Exercise - Create and deploy a contract with simple math functions.
BasicMath
. It should not inherit from any other contracts and does not need a constructor. It should have the following two functions:
adder
. It must:
uint
arguments, called _a
and _b
uint
sum
and a bool
error
_a
+ _b
does not overflow, it should return the sum
and an error
of false
_a
+ _b
overflows, it should return 0
as the sum
, and an error
of true
subtractor
. It must:
uint
arguments, called _a
and _b
uint
difference
and a bool
error
_a
- _b
does not underflow, it should return the difference
and an error
of false
_a
- _b
underflows, it should return 0
as the difference
, and an error
of true