ava-labs / ava-labs/avalanche-cli
Consider the decimals of the ERC20 token that you're transferring when using the **avalanche key transfer** command
- Dominant language
- Go
- Stars
- 132
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
## Goal
When transfering tokens (not natives so ERC20/ERC1155...) through the avalanche cli command **avalanche key transfer** could be useful to have an indication of the number of decimals of that token or the equivalent amount of the specific token that you're transferring
### Assumptions and Scope
## Example Usage
Consider the USDC ERC20 which has 6 decimals, when transferring it through ictt (but the same argument can be made for transfers on the same chain so without the usage of ictt) the cli asks for the amount and writing 5 would cause a transfer of 5.000.000 tokens (or in case of insufficient balance raise an error) without the user being aware of it.
### Requirements:
Could be useful to write near the amount inserted by the user the equivalent _real_ amount that you would transfer for that specific token or at least the number of decimals so that the user knows how many decimals it should use.
### Current Limitations
### Nice to Have, but Not Required
## Open Questions
Are there any calculations done by the cli which relates to the number of decimals of the native token of the network? In the end i transferred 5 * 10^-13 tokens which translated to 0.05 USDC, but this seems strange since USDC (from Circle's documentation) has 6 decimals. If this is true it would make even tougher to really understand how many tokens you'll transfer.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the avalanche key transfer command and trace how ERC20/ERC1155 amounts are parsed and token decimals are obtained. The work is done when the command clearly shows the token's decimals or equivalent real-token amount and its handling of the reported native-token calculation is understood and reflected in the user-facing transfer flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100