Skip to content

Latest commit

 

History

History
135 lines (63 loc) · 3.4 KB

gas_coin.md

File metadata and controls

135 lines (63 loc) · 3.4 KB

Module 0x3::gas_coin

This module defines Rooch Gas Coin.

Resource RGas

RGas is the symbol of Rooch Gas Coin

struct RGas has store, key

Constants

const DECIMALS: u8 = 8;

Function decimals

public fun decimals(): u8

Function balance

public fun balance(addr: address): u256

Function burn

Function deduct_gas

deduct gas coin from the given account.

public(friend) fun deduct_gas(addr: address, amount: u256): coin::Coin<gas_coin::RGas>

Function faucet

Mint gas coin to the given account.

public(friend) fun faucet(addr: address, amount: u256)

Function faucet_entry

Entry point for the faucet, anyone can get Gas via this function on local/dev net, otherwise only admin account can call this function.

public entry fun faucet_entry(account: &signer, amount: u256)

Function genesis_init

Can only be called during genesis to initialize the Rooch coin.

public(friend) fun genesis_init(_genesis_account: &signer)