You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
I create two ERC20 tokens, deploy them with hardhat on hardhat network, then create Uniswap pair, then retrieve its address with SDK's Fetcher and with my contract. Fetcher returns different address than the one I get in my contract. If I manually substitute the address in sdk.cjs.development.js with the address from the contract, all works, otherwise Fetcher reverts.
Hi @weixin3046@freebyte ,
The result of the create2 function depends on the deploy address of the factory, the token addresses and the init_code_hash.
The deploy address of the factory depends on the wallet address that deploys it, the nonce, and the bytecode of the contract. In your case you are getting the factory address from the Factory contract you deployed, the SDK has the correct Factory address for mainnet hardcoded in constants.
You can read more about that here.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I create two ERC20 tokens, deploy them with hardhat on hardhat network, then create Uniswap pair, then retrieve its address with SDK's
Fetcher
and with my contract. Fetcher returns different address than the one I get in my contract. If I manually substitute the address insdk.cjs.development.js
with the address from the contract, all works, otherwiseFetcher
reverts.So, here is the hardhat script:
We deployed two ERC20 tokens,
Skill
andFakeDAE
:and
FakeDAE
is analogeous.LiqCal
is a contract which reports the valid pair address:which is
0x21e7b0ced250469051a249252a33c7c5eb13a1f6
However,
Fetcher
returns invalid pair:from console.log:
When I don't not substitute inside
Fetcher
my pair,getReserves()
reverts obviously, because no such pair exists.The entire log from the run with substituted pair address (all works):
What am I doing incorrect?
The text was updated successfully, but these errors were encountered: