stp258-currencies

Crates.iostp258-currencies
lib.rsstp258-currencies
version0.5.3
sourcesrc
created_at2021-03-28 10:34:15.928177
updated_at2021-03-28 10:34:15.928177
descriptionProvide `Stp258Standard` implementation using `pallet-balances` and `stp258-serp
homepagehttps://setheum.xyz
repositoryhttps://github.com/Setheum-Labs/stp258
max_upload_size
id374621
size54,664
Muhammad-Jibril (JBA-Khalifa)

documentation

https://wiki.setheum.xyz

README

STP-258 Currencies

Setheum Tokenization Protocol 258 Standard

Multi-Currency Stablecoin SERP Module based on Stp258Standard built on top of Stp258Serp and SerpTraits.

Overview

The STP258 Currencies module provides a mixed stablecoin system, by configuring a native currency which implements Stp258AssetExtended, and a multi-currency which implements Stp258Currency.

This module is based on the STP-258 Standard built on the STP-258 Serp implementing the STP-258 Traits.

Implementations

The stp258 module provides implementations for following traits.

  • Stp258Currency - Abstraction over a fungible multi-currency stablecoin system.
  • Stp258CurrencyExtended - Extended Stp258Currency 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, in a given currency.
  • transfer_native_currency - Transfer some balance to another account, in native currency set in Config::Stp258Native.
  • update_balance - Update balance by signed integer amount, in a given currency, root origin required.

Acknowledgement & Reference

This Pallet is built on STP258 Serp pallet.

This Pallet is inspired by the ORML Currencies Pallet developed by Open Web3 Stack, for reference check The ORML Repo.

Test & Build

Run cargo build to build. Run cargo test to test.

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install toolchain
  uses: actions-rs/toolchain@v1
  with:
    profile: minimal
    toolchain: nightly-2021-03-05
    target: wasm32-unknown-unknown
    default: true
- name: Install Wasm toolchain
  run: rustup target add wasm32-unknown-unknown
- name: Install clippy
  run: rustup component add clippy
- name: Build
  run: cargo build --verbose
- name: Run tests
  run: cargo test --verbose
Commit count: 190

cargo fmt