pancake-swap-periphery
pancake-swap-periphery copied to clipboard
CREATE2 init code hash is not correct
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.
Hello Preston, you have to change the init hash with a new one.
Thanks for your reminding, encounter the same issue and solved😄