|
@@ -23,6 +23,7 @@ library SafeMath {
|
|
|
* Counterpart to Solidity's `+` operator.
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - Addition cannot overflow.
|
|
|
*/
|
|
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
|
|
@@ -39,6 +40,7 @@ library SafeMath {
|
|
|
* Counterpart to Solidity's `-` operator.
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - Subtraction cannot overflow.
|
|
|
*/
|
|
|
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
|
|
@@ -52,6 +54,7 @@ library SafeMath {
|
|
|
* Counterpart to Solidity's `-` operator.
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - Subtraction cannot overflow.
|
|
|
*/
|
|
|
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
|
|
@@ -68,6 +71,7 @@ library SafeMath {
|
|
|
* Counterpart to Solidity's `*` operator.
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - Multiplication cannot overflow.
|
|
|
*/
|
|
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
|
|
@@ -93,6 +97,7 @@ library SafeMath {
|
|
|
* uses an invalid opcode to revert (consuming all remaining gas).
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - The divisor cannot be zero.
|
|
|
*/
|
|
|
function div(uint256 a, uint256 b) internal pure returns (uint256) {
|
|
@@ -108,6 +113,7 @@ library SafeMath {
|
|
|
* uses an invalid opcode to revert (consuming all remaining gas).
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - The divisor cannot be zero.
|
|
|
*/
|
|
|
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
|
|
@@ -127,6 +133,7 @@ library SafeMath {
|
|
|
* invalid opcode to revert (consuming all remaining gas).
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - The divisor cannot be zero.
|
|
|
*/
|
|
|
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
|
|
@@ -142,6 +149,7 @@ library SafeMath {
|
|
|
* invalid opcode to revert (consuming all remaining gas).
|
|
|
*
|
|
|
* Requirements:
|
|
|
+ *
|
|
|
* - The divisor cannot be zero.
|
|
|
*/
|
|
|
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
|