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/remix-tests/tests/examples_4/SafeMathProxy.sol

32 lines
795 B

pragma solidity ^0.4.24;
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) returns (uint256) {
return a.div(b);
}
function mulProxy(uint256 a, uint256 b) returns (uint256) {
return a.mul(b);
}
function subProxy(uint256 a, uint256 b) returns (uint256) {
return a.sub(b);
}
function addProxy(uint256 a, uint256 b) returns (uint256) {
return a.add(b);
}
function modProxy(uint256 a, uint256 b) returns (uint256) {
return a.mod(b);
}
}