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

Code in readme.md #1

Open
riemann1120 opened this issue Sep 19, 2023 · 0 comments
Open

Code in readme.md #1

riemann1120 opened this issue Sep 19, 2023 · 0 comments

Comments

@riemann1120
Copy link

In readme.md, the code:
await routerContract.swapExactETHForTokensSupportingFeeOnTransferTokens( trade.minAmountConvertQuote, trade.routePath, to, deadline, trade.stable, { value: amountIn } )

should be
await routerContract.swapExactETHForTokensSupportingFeeOnTransferTokens( ethers.utils.parseUnits(trade.minAmountConvertQuote, decimal), trade.routePath, to, deadline, trade.stable, { value: ethers.utils.parseUnits(amountIn, decimal) } )
Here decimal is the token's decimal value, eg: ether is 18, usdc is 6

If I was wrong, pls let me know

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