Skip to main content

Module 0x2::smr

Coin<SMR> is the token used for migrated Shimmer users. It has 6 decimals, and the smallest unit (10^-6) is called "glow".

use 0x1::option; use 0x2::balance; use 0x2::coin; use 0x2::transfer; use 0x2::tx_context; use 0x2::url;

Struct SMR

Name of the coin

struct SMR has drop

Fields
dummy_field: bool

Constants

Sender is not @0x0 the system address.

const ENotSystemAddress: u64 = 1;

const EAlreadyMinted: u64 = 0;

The amount of Glows per Shimmer token based on the fact that micros is 10^-6 of a Shimmer token

const GLOW_PER_SMR: u64 = 1000000;

The total supply of Shimmer denominated in Glows

const TOTAL_SUPPLY_GLOWS: u64 = 1813620509061365;

Function init

Register the SHIMMER coin.

fun init(witness: smr::SMR, ctx: &mut tx_context::TxContext)

Implementation

fun init(witness: SMR, ctx: &mut TxContext) { assert!(ctx.sender() == @0x0, ENotSystemAddress); assert!(ctx.epoch() == 0, EAlreadyMinted);

let (treasury, metadata) = coin::create_currency( witness, 6, b"Shimmer", b"SMR", b"The original Shimmer (SMR) token as inherited from the Shimmer Network.", option::some(url::new_unsafe_from_bytes(b"https://iota.org/smr-logo.png")), ctx ); transfer::public_freeze_object(metadata); let supply = treasury.treasury_into_supply(); supply.destroy_supply(); }

Function transfer

public entry fun transfer(c: coin::Coin<smr::SMR>, recipient: address)

Implementation

public entry fun transfer(c: coin::Coin<SMR>, recipient: address) { transfer::public_transfer(c, recipient) }