ERC20 Zone
ERC20 Zone is a zone of the Cosmos for ERC20 token.
This zone has a service which manages erc20 tokens.
Interface
ERC20 Zone has following interfaces.
Mint
Mint(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coins)
Mint erc20 tokens to the address.
Burn
Burn(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coins)
Burn erc20 tokens of the address.
Lock
Lock erc20 tokens of the address. When you transfer erc20 tokens to ehter, this will be used.
Lock(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coins)
Unlock
Unlock erc20 tokens of the address. When you transfer ether to erc20 tokens, this will be used.
Unlock(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coins)
Struct
ERC20 Account State
type Account struct {
Owner sdk.AccAddress `json:"owner"`
Balance sdk.Coins `json:"balance"`
}
Keeper
type Keeper struct {
accStoreKey sdk.StoreKey
lockStoreKey sdk.StoreKey
cdc *codec.Codec
}
Message
type MsgLock struct {
Owner sdk.AccAddress
Balance sdk.Coins
}
type MsgUnlock struct {
Owner sdk.AccAddress
Balance sdk.Coins
}
type MsgMint struct {
Owner sdk.AccAddress
Balance sdk.Coins
}
type MsgBurn struct {
Owner sdk.AccAddress
Balance sdk.Coins
}