18 releases (9 breaking)

new 0.10.0 Apr 17, 2024
0.8.1 Apr 7, 2024
0.8.0 Mar 18, 2024
0.6.7 Nov 21, 2023
0.1.1 Jun 5, 2020

#242 in Magic Beans

Download history 4/week @ 2024-01-07 2/week @ 2024-01-14 7/week @ 2024-01-28 13/week @ 2024-02-04 9/week @ 2024-02-11 38/week @ 2024-02-18 72/week @ 2024-02-25 39/week @ 2024-03-03 59/week @ 2024-03-10 168/week @ 2024-03-17 6/week @ 2024-03-24 86/week @ 2024-03-31 287/week @ 2024-04-07 159/week @ 2024-04-14

552 downloads per month
Used in pallet-mixer

Apache-2.0 and GPL-3.0-only

315KB
8K SLoC

Tokens Module

Overview

The tokens module provides fungible multi-currencies functionality that implements MultiCurrency trait.

The tokens module provides functions for:

  • Querying and setting the balance of a given account.
  • Getting and managing total issuance.
  • Balance transfer between accounts.
  • Depositing and withdrawing balance.
  • Slashing an account balance.

lib.rs:

Tokens Module

Overview

The tokens module provides fungible multi-currency functionality that implements MultiCurrency trait.

The tokens module provides functions for:

  • Querying and setting the balance of a given account.
  • Getting and managing total issuance.
  • Balance transfer between accounts.
  • Depositing and withdrawing balance.
  • Slashing an account balance.

Implementations

The tokens module provides implementations for following traits.

  • MultiCurrency - Abstraction over a fungible multi-currency system.
  • MultiCurrencyExtended - Extended MultiCurrency with additional helper types and methods, like updating balance by a given signed integer amount.

Interface

Dispatchable Functions

  • transfer - Transfer some balance to another account.
  • transfer_all - Transfer all balance to another account.

Genesis Config

The tokens module depends on the GenesisConfig. Endowed accounts could be configured in genesis configs.

Dependencies

~20–34MB
~556K SLoC