pancake-swap-periphery icon indicating copy to clipboard operation
pancake-swap-periphery copied to clipboard

CREATE2 init code hash is not correct

Open preston4896 opened this issue 4 years ago • 2 comments

Hi there, as I was trying to call the pairFor() method from the PancakeLibrary to compute the CREATE2 address of a token pair, I noticed that the address did not match the ones returned from the router.

After a closer look, I realized the hardcoded value, see line 24 of Pancake Library does not match the INIT_CODE_PAIR_HASH that was computed by the Factory. You can find the actual value here.

Using the value obtained from BSCscan, it resolves the issue that I had and I was able to get the correct pair address. I thought I would raise this issue for anyone who's also having a hard time with this.

preston4896 avatar Jun 29 '21 05:06 preston4896

Hello Preston, you have to change the init hash with a new one.

Sam-Devs avatar Jul 04 '21 18:07 Sam-Devs

Thanks for your reminding, encounter the same issue and solved😄

LaceLetho avatar Aug 11 '21 10:08 LaceLetho