Signed SafeMath (#1559)

* signed safe math

* fix lint errors

* refactor overflow checks and add descriptions

* remove incorrect description

* add test for reversed arguments in multiplication test

* fix power operator

* improve multiplication test descriptions

* Update SafeMath.test.js

* add feature to changelog
This commit is contained in:
Francisco Giordano
2018-12-18 15:54:44 -03:00
committed by GitHub
parent fad30c3d2c
commit d17ae0b806
5 changed files with 325 additions and 121 deletions

View File

@ -3,4 +3,6 @@ const BigNumber = web3.BigNumber;
module.exports = {
ZERO_ADDRESS: '0x0000000000000000000000000000000000000000',
MAX_UINT256: new BigNumber(2).pow(256).minus(1),
MAX_INT256: new BigNumber(2).pow(255).minus(1),
MIN_INT256: new BigNumber(2).pow(255).times(-1),
};