Uniswap / v3-periphery

🦄 🦄 🦄 Peripheral smart contracts for interacting with Uniswap v3
https://uniswap.org
GNU General Public License v2.0
1.18k stars 1.1k forks source link

Hardcoded `POOL_INIT_CODE_HASH` is unexpected value #348

Open funderbrker opened 1 year ago

funderbrker commented 1 year ago

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.

Toluphene commented 1 year ago

Great

funderbrker commented 1 year ago

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 commented 1 year ago

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

polus-arcticus commented 11 months ago

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