Files
uniswap-v2/contracts/libraries/SafeMath.sol
Noah Zinsmeister c5e9261036 bump to solc@0.5.15
2019-12-20 13:28:21 -05:00

16 lines
456 B
Solidity

pragma solidity 0.5.15;
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
}