Documentation
¶
Overview ¶
A simple token contract example based on WASM wrapper
Index ¶
- Constants
- func BalanceOf(ctx core.Context, owner core.Address) uint64
- func Burn(ctx core.Context, id core.ObjectID, amount uint64) bool
- func Collect(ctx core.Context, ids []core.ObjectID) bool
- func GetOwner(ctx core.Context) core.Address
- func GetTokenInfo(ctx core.Context) (string, string, uint8, uint64)
- func InitializeToken(ctx core.Context, name string, symbol string, decimals uint8, ...) core.ObjectID
- func Mint(ctx core.Context, to core.Address, amount uint64) bool
- func Transfer(ctx core.Context, to core.Address, amount uint64) bool
Constants ¶
View Source
const ( // Fields in default Object TokenNameKey = "name" // Token name TokenSymbolKey = "symbol" // Token symbol TokenDecimalsKey = "decimals" // Token decimals TokenTotalSupplyKey = "total_supply" // Total supply TokenAmountKey = "amount" // Balance amount )
Constants - Field names in objects
Variables ¶
This section is empty.
Functions ¶
func GetTokenInfo ¶
Get token information
func InitializeToken ¶
func InitializeToken(ctx core.Context, name string, symbol string, decimals uint8, totalSupply uint64) core.ObjectID
Initialize token contract
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.