Closed deAngelisAlex closed 2 years ago
I got the same problem: Solidity v0.8.0 Breaking Changes==>New Restrictions address(uint) and uint(address): converting both type-category and width. Replace this by address(uint160(uint)) and uint(uint160(address)) respectively.
Hi, I am facing the same issue. Any news about this? I modified PoolAddress.sol as deAngelisAlex, but it is not a long-term solution. Regards, Jaybanez
Duplicate of #177
Dear Uniswap team,
I've been using the PoolAddress library in smart contracts, to get the address of a pool with the tokens and fee, and it seems like a recent update in solidity (0.8) has broken the way that the address is computed.
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).
As you can see, a uint256 cannot be casted to address directly. As a workaround I have casted the uint256 to uint160 first, which works. Obviously, modifying the underlying source code in node_modules is not a practical solution. Should I do a PR with the right fixes on the file?
Kind regards, deAngelisAlex