remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-tests/tests/examples_4/SafeMathProxy.sol

32 lines
863 B

3 months ago
pragma solidity >=0.4.22 <0.9.0;
import "./SafeMath.sol";
/*
Using a proxy contract here allows revert-causing functions that contain
require() to return false rather than halt execution
https://truffleframework.com/tutorials/testing-for-throws-in-solidity-tests
*/
contract SafeMathProxy {
using SafeMath for uint;
function divProxy(uint256 a, uint256 b) public pure returns (uint256) {
return a.div(b);
}
function mulProxy(uint256 a, uint256 b) public pure returns (uint256) {
return a.mul(b);
}
function subProxy(uint256 a, uint256 b) public pure returns (uint256) {
return a.sub(b);
}
function addProxy(uint256 a, uint256 b) public pure returns (uint256) {
return a.add(b);
}
function modProxy(uint256 a, uint256 b) public pure returns (uint256) {
return a.mod(b);
}
}