diff options
author | chriseth <chris@ethereum.org> | 2018-10-25 18:42:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 18:42:15 +0800 |
commit | d33553989138ae72abab86be015869d04698d318 (patch) | |
tree | 6f6e15f7fffac98beb74d7b81648c8fa7c0952fd /test/compilationTests/zeppelin/math/SafeMath.sol | |
parent | 01566c2e1af5b7f655fd593e5e1019e103d739a0 (diff) | |
parent | 1424beda791cf75fd807165d58fdaa0d5d4297d4 (diff) | |
download | dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar.gz dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar.bz2 dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar.lz dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar.xz dexon-solidity-d33553989138ae72abab86be015869d04698d318.tar.zst dexon-solidity-d33553989138ae72abab86be015869d04698d318.zip |
Merge pull request #5296 from ethereum/setPragmaToArbitrary
Set pragma to arbitrary
Diffstat (limited to 'test/compilationTests/zeppelin/math/SafeMath.sol')
-rw-r--r-- | test/compilationTests/zeppelin/math/SafeMath.sol | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/test/compilationTests/zeppelin/math/SafeMath.sol b/test/compilationTests/zeppelin/math/SafeMath.sol deleted file mode 100644 index a98635e2..00000000 --- a/test/compilationTests/zeppelin/math/SafeMath.sol +++ /dev/null @@ -1,32 +0,0 @@ -pragma solidity ^0.4.11; - - -/** - * @title SafeMath - * @dev Math operations with safety checks that throw on error - */ -library SafeMath { - function mul(uint256 a, uint256 b) internal pure returns (uint256) { - uint256 c = a * b; - assert(a == 0 || c / a == b); - return c; - } - - function div(uint256 a, uint256 b) internal pure returns (uint256) { - // assert(b > 0); // Solidity automatically throws when dividing by 0 - uint256 c = a / b; - // assert(a == b * c + a % b); // There is no case in which this doesn't hold - return c; - } - - function sub(uint256 a, uint256 b) internal pure returns (uint256) { - assert(b <= a); - return a - b; - } - - function add(uint256 a, uint256 b) internal pure returns (uint256) { - uint256 c = a + b; - assert(c >= a); - return c; - } -} |