diff --git a/contracts/libraries/FullMath.sol b/contracts/libraries/FullMath.sol index 9985059e2..3d83348e8 100644 --- a/contracts/libraries/FullMath.sol +++ b/contracts/libraries/FullMath.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.4.0 <0.8.0; +pragma solidity >=0.4.0; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision @@ -61,7 +61,7 @@ library FullMath { // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. - uint256 twos = -denominator & denominator; + uint256 twos = denominator & (~denominator + 1); // Divide denominator by power of two assembly { denominator := div(denominator, twos)