This module defines Rooch Gas Coin.
- Resource
RGas - Constants
- Function
decimals - Function
balance - Function
burn - Function
deduct_gas - Function
refund_gas - Function
faucet - Function
faucet_entry - Function
genesis_init
use 0x1::option;
use 0x1::string;
use 0x2::object;
use 0x2::signer;
use 0x3::account_coin_store;
use 0x3::chain_id;
use 0x3::coin;
use 0x3::onchain_config;
RGas is the symbol of Rooch Gas Coin
struct RGas has store, key
const DECIMALS: u8 = 8;
public fun decimals(): u8
public fun burn(coin: coin::Coin<gas_coin::RGas>)
deduct gas coin from the given account.
public(friend) fun deduct_gas(addr: address, amount: u256): coin::Coin<gas_coin::RGas>
Refund gas to account store
public(friend) fun refund_gas(addr: address, gas_coin: coin::Coin<gas_coin::RGas>)
Mint gas coin to the given account.
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)
Can only be called during genesis to initialize the Rooch coin.
public(friend) fun genesis_init(_genesis_account: &signer)