-
Notifications
You must be signed in to change notification settings - Fork 25
Introduce Token module wasm host #602
Copy link
Copy link
Open
Labels
[Type] TaskAn additional feature or improvement.An additional feature or improvement.[group] Smart Contract
Description
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.- 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
- TBD
- Log custom event
- Arguments: event (bytes)
- Spend energy
- Arguments: energy amount
- Aborts transaction if insufficient available, rolling back the state mutations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Type] TaskAn additional feature or improvement.An additional feature or improvement.[group] Smart Contract