From f618384f2280a077caf06cfe1050e8a98ac05790 Mon Sep 17 00:00:00 2001 From: Mathacc Date: Fri, 14 Feb 2025 16:47:14 +0100 Subject: [PATCH] allow compiler >=0.8.0 --- contracts/libraries/FullMath.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)