Crate namada_trans_token

Crate namada_trans_token 

Source
Expand description

Transparent token types, storage functions, and validation.

Modules§

event
Token transaction events.
storage_key
Transparent token storage keys
tx
Token transfers
vp
Native VP for multitokens

Structs§

Amount
Amount in micro units. For different granularity another representation might be more appropriate.
DenominatedAmount
An amount with its denomination.
Denomination
Given a number represented as M*B^D, then M is the matissa, B is the base and D is the denomination, represented by this struct.
Key
A storage key is made of storage key segments DbKeySeg, separated by KEY_SEGMENT_SEPARATOR.
Store
Transparent token storage Keys/Read/Write implementation

Enums§

AmountError
AmountParseError
Error
EventLevel
Indicates if an event is emitted do to an individual Tx or the nature of a finalized block
MaspDigitPos
The four possible u64 words in a Uint. Used for converting to MASP amounts.
UserAccount
A user account.

Constants§

NATIVE_MAX_DECIMAL_PLACES
Maximum decimal places in a native token Amount and Change. For non-native (e.g. ERC20 tokens) one must read the denom_key storage key.
NATIVE_SCALE
Decimal scale of a native token Amount and Change. For non-native (e.g. ERC20 tokens) one must read the denom_key storage key.

Traits§

Events
Abstract token events interface
Keys
Abstract token keys interface
Read
Abstract token storage read interface
ResultExt
Result extension to easily wrap custom errors into Error.
StorageRead
Common storage read interface
StorageWrite
Common storage write interface
Write
Abstract token storage write interface

Functions§

burn_tokens
Burn a specified amount of tokens from some address.
credit_tokens
Credit tokens to an account, to be used only by protocol. In transactions, this would get rejected by the default vp_token.
decrement_balance
Decrement the balance of a given token and owner.
decrement_total_supply
Decrement the total network supply of a given token.
denom_to_amount
Convert this denominated amount into a plain amount by increasing its precision to the given token’s denomination and then taking the significand.
denominated
Add denomination info if it exists in storage.
get_effective_total_native_supply
Get the effective circulating total supply of native tokens.
increment_balance
Increment the balance of a given token and owner.
increment_total_supply
Increment the total network supply of a given token.
mint_tokens
Mint amount of token as minter to dest.
read_balance
Read the balance of a given token and owner.
read_denom
Read the denomination of a given token, if any. Note that native transparent tokens do not have this set and instead use the constant token::NATIVE_MAX_DECIMAL_PLACES.
read_total_supply
Read the total network supply of a given token.
transfer
Apply transfer of a token from src to dest in storage.
update_balance
Update the balance of a given token and owner.
update_total_supply
Update the total network supply of a given token.
write_denom
Write the denomination of a given token.
write_params
Initialize parameters for the token in storage during the genesis block.

Type Aliases§

Change
A change in tokens amount
Result
Result of a storage API call.