token::Amount
may not be able to fully represent some wrapped token amounts
#1089
Labels
token::Amount
may not be able to fully represent some wrapped token amounts
#1089
On Namada, we have an
Amount
type which uses units ofmicros
(10^-6).namada/core/src/types/token.rs
Lines 32 to 34 in 76169dc
Since we use
u64
type formicros
, the is maximum limit for how much a singleAmount
can hold is something likeu64::MAX * 10^-6
which is roughly ~18.5bn full units. We useAmount
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 ourAmount
type.Multiple possible solutions including changing our
Amount
type to support a higher supply (e.g. num256::Uint256 instead of u64), or using a differentAmount
type entirely for wrapped tokens.The text was updated successfully, but these errors were encountered: