v3-core
v3-core copied to clipboard
Unary operator misused, fails to compile with solidity v8.18
https://github.com/Uniswap/v3-core/blob/d8b1c635c275d2a9450bd6a78f3fa2484fef73eb/contracts/libraries/FullMath.sol#L64
TypeError: Unary operator - cannot be applied to type uint256
--> @uniswap/v3-core/contracts/libraries/FullMath.sol:64:24:
|
64 | uint256 twos = -denominator & denominator;
This line can be safely replaced by the following which is compatible with the newer solidity compilers:
uint256 twos = denominator & (~denominator + 1);
I would like to work on this @stevieraykatz @NoahZinsmeister @danrobinson
@stevieraykatz @NoahZinsmeister @danrobinson I have submitted a PR on this issue.