Skip to content

Latest commit

 

History

History
105 lines (49 loc) · 3.01 KB

gas_coin.md

File metadata and controls

105 lines (49 loc) · 3.01 KB

Module 0x3::gas_coin

This module defines Rooch Gas Coin.

Resource GasCoin

struct GasCoin has store, key

Function balance

public fun balance(ctx: &context::Context, addr: address): u256

Function burn

Function deduct_gas

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>

Function faucet

Mint gas coin to the given account.

public(friend) fun faucet(ctx: &mut context::Context, addr: address, amount: u256)

Function faucet_entry

TODO find a way to protect this function from DOS attack.

public entry fun faucet_entry(ctx: &mut context::Context, account: &signer)

Function genesis_init

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

public(friend) fun genesis_init(ctx: &mut context::Context, _genesis_account: &signer)