Help me~! Decimals Change #1837
Unanswered
polygongogogo
asked this question in
Q&A
Replies: 2 comments 2 replies
-
If you want to set 1000 USDC, you need to use: amountIn = ethers.utils.parseUnits('1000', 6); // note that second argument here is the decimals of USDC (moving to discussions) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have the same issue.
I have no idea about how to figure out this issue. Here's my code : |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
While studying the code, a curiosity arose.
Common tokens use decimal 18.
In the case of usdc, decimal 6 is used.
'wmatic -> usdc' is easy, but
I can't convert 'usdc -> wmatic'.
Quick Swap change - normal
0 amountIn uint256 100000
1 amountOutMin uint256 96914488002955915
2 path address[] 2791bca1f2de4661ed88a30c99a7a9449aa84174
0d500b1d8e8ef31e21c99d1db9a6444d3adf1270
3 to address ad7fed7efb657b33eddda41825d44c235eeedd81
4 deadline uint256 3256334716
Ethers code change - code
0 amountIn uint256 10000000000000000
1 amountOutMin uint256 0
2 path address[] 2791bca1f2de4661ed88a30c99a7a9449aa84174
0d500b1d8e8ef31e21c99d1db9a6444d3adf1270
3 to address ad7fed7efb657b33eddda41825d44c235eeedd81
4 deadline uint256 1628169153009
i used ethers. code (your code)
Beta Was this translation helpful? Give feedback.
All reactions