Introduce a new wasm host type for running the upcoming Token modules, with some similarities to smart contracts.
A token module will export several functions:
holder_operation return status code.
governance_operation return status code.
- Arbitrary read-only functions for reading the state.
The host functions should be:
- Mint
- Mint some amount of tokens to the provided account, and log an event.
- Arguments: account, amount, memo
- Burn
- Burn some amount of tokens from the given account, and log an event.
- Arguments: account, amount, memo
- Return: success or failure
- Transfer
- This will immediately transfer funds from one account to another account and log event.
- Arguments: sender, receiver, amount, memo
- Callable from both holder_operation and token_governance
- Query account balance
- Get the balance of a specific account.
- State functions
- Log custom event
- Spend energy
- Arguments: energy amount
- Aborts transaction if insufficient available, rolling back the state mutations
Introduce a new wasm host type for running the upcoming Token modules, with some similarities to smart contracts.
A token module will export several functions:
holder_operationreturn status code.governance_operationreturn status code.The host functions should be: