v3-periphery
v3-periphery copied to clipboard
fix: uint256 to address explicit type conversion error
Any version of solidity greater than 0.8.0 won't allow you to convert from/to uint256<->address, so the following contracts will encounter error when compiling with newer version of solidity.
TypeError: Explicit type conversion not allowed from "uint256" to "address".
--> @uniswap/v3-periphery/contracts/libraries/PoolAddress.sol:35:16:
|
35 | pool = address(
| ^ (Relevant source part starts here and spans across multiple lines).
So, we need to first convert uint256 to uint160 and then to address.