Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using this sdk on polygon #29

Open
jdavidteki opened this issue Dec 20, 2021 · 0 comments
Open

using this sdk on polygon #29

jdavidteki opened this issue Dec 20, 2021 · 0 comments

Comments

@jdavidteki
Copy link

hello,

is there a special chain id when im on the polygon network? i keep getting SushiswapError: invalid from or to contract tokens

when i do -

////sushiswap
const sushiswapPair = new SushiswapPair({
// the contract address of the token you want to convert FROM
fromTokenContractAddress: '0x111111111117dC0aa78b770fA6A738034120C302',
// the contract address of the token you want to convert TO
toTokenContractAddress: '0x1985365e9f78359a9B6AD760e32412f4a445E862',
// the ethereum address of the user using this part of the dApp
ethereumAddress: '0xB1E6079212888f0bE0cf55874B2EB9d7a5e02cD9',
// you can pass in the provider url as well if you want
providerUrl: url,
chainId: ChainId.MAINNET,
});

// now to create the factory you just do
const sushiswapPairFactory = await sushiswapPair.createFactory();

const toToken = sushiswapPairFactory.toToken;
console.log("toToken", sushiswapPairFactory);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant