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

token::Amount may not be able to fully represent some wrapped token amounts #1089

Closed
james-chf opened this issue Jan 26, 2023 · 2 comments
Closed

Comments

@james-chf
Copy link
Contributor

On Namada, we have an Amount type which uses units of micros (10^-6).

pub struct Amount {
micro: u64,
}

Since we use u64 type for micros, the is maximum limit for how much a single Amount can hold is something like u64::MAX * 10^-6 which is roughly ~18.5bn full units. We use Amount type to represent amounts of native tokens on Namada as well as wrapped tokens from other chains. On Ethereum, ERC20 tokens can have supplies much larger than ~18.5bn e.g. SHIB. We want to be able to represent any wrapped token amounts in our Amount type.

Multiple possible solutions including changing our Amount type to support a higher supply (e.g. num256::Uint256 instead of u64), or using a different Amount type entirely for wrapped tokens.

@james-chf
Copy link
Contributor Author

Have tagged this issue IBC as well as ethereum-bridge as I presume there are types of tokens that could come over IBC, that could be affected by this issue as well

@sug0
Copy link
Contributor

sug0 commented Jul 11, 2023

Closed by #1282

@sug0 sug0 closed this as completed Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Tested in Devnet
Development

No branches or pull requests

3 participants