This module defines Rooch Gas Coin.
- Resource
GasCoin
- Function
balance
- Function
burn
- Function
deduct_gas
- Function
faucet
- Function
faucet_entry
- Function
genesis_init
use 0x1::string;
use 0x2::context;
use 0x2::object;
use 0x2::signer;
use 0x3::account_coin_store;
use 0x3::coin;
struct GasCoin has store, key
public fun balance(ctx: &context::Context, addr: address): u256
public fun burn(ctx: &mut context::Context, coin: coin::Coin<gas_coin::GasCoin>)
deduct gas coin from the given account.
public(friend) fun deduct_gas(ctx: &mut context::Context, addr: address, amount: u256): coin::Coin<gas_coin::GasCoin>
Mint gas coin to the given account.
public(friend) fun faucet(ctx: &mut context::Context, addr: address, amount: u256)
TODO find a way to protect this function from DOS attack.
public entry fun faucet_entry(ctx: &mut context::Context, account: &signer)
Can only be called during genesis to initialize the Rooch coin.
public(friend) fun genesis_init(ctx: &mut context::Context, _genesis_account: &signer)