Merge 3.4 master into solc-0.8 (#2499)
* 3.4.0-rc.0 * Allow manual dispatch of Test CI job * Update lockfile (#2481) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Add "available since" comments in documentation * Add "available since" comments in documentation (cherry picked from commit63a0343dda) * Remove SafeMathMock compilation warnings (#2497) * Remove SafeMathMock compilation warnings (#2497) (cherry picked from commitf4e57fd529) * 3.4.0 * fix safemath test to use renamed function from the mock Co-authored-by: Francisco Giordano <frangio.1@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
@ -8,6 +8,8 @@ pragma solidity ^0.8.0;
|
||||
library SafeMath {
|
||||
/**
|
||||
* @dev Returns the addition of two unsigned integers, with an overflow flag.
|
||||
*
|
||||
* _Available since v3.4._
|
||||
*/
|
||||
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
|
||||
unchecked {
|
||||
@ -19,6 +21,8 @@ library SafeMath {
|
||||
|
||||
/**
|
||||
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
|
||||
*
|
||||
* _Available since v3.4._
|
||||
*/
|
||||
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
|
||||
unchecked {
|
||||
@ -29,6 +33,8 @@ library SafeMath {
|
||||
|
||||
/**
|
||||
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
|
||||
*
|
||||
* _Available since v3.4._
|
||||
*/
|
||||
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
|
||||
unchecked {
|
||||
@ -44,6 +50,8 @@ library SafeMath {
|
||||
|
||||
/**
|
||||
* @dev Returns the division of two unsigned integers, with a division by zero flag.
|
||||
*
|
||||
* _Available since v3.4._
|
||||
*/
|
||||
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
|
||||
unchecked {
|
||||
@ -54,6 +62,8 @@ library SafeMath {
|
||||
|
||||
/**
|
||||
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
|
||||
*
|
||||
* _Available since v3.4._
|
||||
*/
|
||||
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
|
||||
unchecked {
|
||||
|
||||
Reference in New Issue
Block a user