gas¶
- class GAS¶
Bases:
object
A class used to represent the GAS native contract
- classmethod decimals() → int¶
Gets the amount of decimals used by GAS.
- Returns
the number 8.
- Return type
- classmethod totalSupply() → int¶
Gets the total token supply deployed in the system.
- Returns
the total token supply deployed in the system.
- Return type
- classmethod balanceOf(account: boa3.builtin.type.UInt160) → int¶
Get the current balance of an address.
- classmethod transfer(from_address: boa3.builtin.type.UInt160, to_address: boa3.builtin.type.UInt160, amount: int, data: Optional[Any] = None) → bool¶
Transfers an amount of GAS from one account to another
If the method succeeds, it will fire the Transfer event and must return true, even if the amount is 0, or from and to are the same address.
- Parameters
- Returns
whether the transfer was successful
- Return type
- Raises
Exception – raised if from_address or to_address length is not 20 or if amount is less than zero.