pragma solidity ^0.4.24; contract Sub { function sub1(uint256 a, uint256 b) public pure returns (uint256) { assert(b <= a); return a - b; } function sub2(uint256 a, uint256 b) public pure returns (uint256) { require(b <= a); return a - b; } function sub3(uint256 a, uint256 b) public pure returns (uint256) { assert((a-b) < a); return a-b; } function sub4(uint256 a, uint256 b) public pure returns (uint256) { require(b <= a, "subtractor too large"); return a-b; } }
0.4.24