Expand description
The traits for dealing with a single fungible token class and any associated types.
User-implememted traits
Inspect: Regular balance inspector functions.Unbalanced: Low-level balance mutating functions. Does not guarantee proper book-keeping and so should not be called into directly from application code. Other traits depend on this and provide default implementations based on it.UnbalancedHold: Low-level balance mutating functions for balances placed on hold. Does not guarantee proper book-keeping and so should not be called into directly from application code. Other traits depend on this and provide default implementations based on it.Mutate: Regular balance mutator functions. Pre-implemented usingUnbalanced, though thedone_*functions should likely be reimplemented in case you want to do something following the operation such as emit events.InspectHold: Inspector functions for balances on hold.MutateHold: Mutator functions for balances on hold. Mostly pre-implemented usingUnbalancedHold.InspectFreeze: Inspector functions for frozen balance.MutateFreeze: Mutator functions for frozen balance.Balanced: One-sided mutator functions for regular balances, which return imbalance objects which guarantee eventual book-keeping. May be useful for some sophisticated operations where funds must be removed from an account before it is known precisely what should be done with them.
Modules
- The traits for putting freezes within a single fungible token class.
- The traits for putting holds within a single fungible token class.
Structs
- Simple handler for an imbalance drop which decreases the total issuance of the system by the imbalance amount. Used for leftover credit.
- Special dust type which can be type-safely converted into a
Credit. - Consideration method using a
fungiblebalance frozen as the cost exacted for the footprint. - Consideration method using a
fungiblebalance frozen as the cost exacted for the footprint. - An imbalance in the system, representing a divergence of recorded token supply from the sum of the balances of all accounts. This is
must_usein order to ensure it gets handled (placing into an account, settling from an account or altering the supply). - Simple handler for an imbalance drop which increases the total issuance of the system by the imbalance amount. Used for leftover debt.
- Convert a
fungiblestrait implementation into afungibletrait implementation by identifying a single item. - Basic consideration method using a
fungiblebalance frozen as the cost exacted for the footprint. - Basic consideration method using a
fungiblebalance placed on hold as the cost exacted for the footprint.
Traits
- A fungible token class where any creation and deletion of tokens is semi-explicit and where the total supply is maintained automatically.
- Trait for slashing a fungible asset which can be place on hold.
- Handler for when an imbalance gets dropped. This could handle either a credit (negative) or debt (positive) imbalance.
- Trait for providing balance-inspection access to a fungible asset.
- Trait for inspecting a fungible asset which can be frozen. Freezing is essentially setting a minimum balance bellow which the total balance (inclusive of any funds placed on hold) may not be normally allowed to drop. Generally, freezers will provide an “update” function such that if the total balance does drop below the limit, then the freezer can update their housekeeping accordingly.
- Trait for inspecting a fungible asset whose accounts support partitioning and slashing.
- Trait for providing a basic fungible asset.
- Trait for introducing, altering and removing locks to freeze an account’s funds so they never go below a set minimum.
- Trait for mutating a fungible asset which can be placed on hold.
- A fungible token class where the balance can be set arbitrarily.
- A fungible, holdable token class where the balance on hold can be set arbitrarily.
Type Definitions
- Imbalance implying that the total_issuance value is greater than the sum of all account balances.
- Imbalance implying that the total_issuance value is less than the sum of all account balances.