v3-periphery icon indicating copy to clipboard operation
v3-periphery copied to clipboard

Hardcoded `POOL_INIT_CODE_HASH` is unexpected value

Open funderbrker opened this issue 2 years ago • 4 comments

Hardcoded value seen in v3-periphery/contracts/libraries/PoolAddress.solis 0xa598dd2fba360510c5a8f02f44423a4468e902df5857dbce3ca162a43a3a31ff, which results in incorrect pool address computation.

When the value is updated to 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54 (as seen in the Uniswap v3 SDK and this issue https://github.com/Uniswap/v3-sdk/issues/113) the pool address computations align with pools currently deployed on mainnet.

Not sure why this value is in the file. From a external user pov, it was unexpected.

funderbrker avatar May 31 '23 10:05 funderbrker

Great

Toluphene avatar Jun 05 '23 14:06 Toluphene

this issue exists on the 0.8 branch. introduced by b325bb0905d922ae61fcc7df85ee802e8df5e96c, which changes to pool init code hash even though the hash used to deploy pools is immutable and not affected by the changes in this commit.

@marktoda

funderbrker avatar Aug 14 '23 20:08 funderbrker

fix in fork here for public reference https://github.com/Uniswap/v3-periphery/compare/0.8...funderbrker:v3-periphery:0.8

funderbrker avatar Aug 14 '23 20:08 funderbrker

thanks for this, after patching out the PoolAddress.sol library and using it with this code the computed pool was correct

polus-arcticus avatar Nov 06 '23 22:11 polus-arcticus