Contract
Abstract
This module is responsible for transactions and queries related to evm
Contents
chat/
βββ client
β βββ rest
β βββ error.go # interface error collection
β βββ grpc.go # grpc query method
β βββ handle_comm.go # comm module message pre-processing
β βββ query.go # interface query function
β βββ rest.go # Registration of message and query routing
β βββ tx.go # tx related methods, including broadcasting, etc.
βββkeeper
β βββ genesis.go # Status and export of modules
β βββ keeper.go # storage manager, handles the business logic of the module, and has permission to access specific subtrees of the state tree
β βββ msg_server.go # Provide service processing logic for uplink messages
β βββ params.go # Setting and obtaining module parameters
β βββ query.go # Status query function
β βββ medal.go # Hash coin pledge calculation related logic algorithm
β βββ mingkeeper.go # Foundry related logic algorithm
βββ types
β βββ codec.go # code registration type
β βββ errors.go # module-specific errors
β βββ events.go # Events exposed to Tendermint PubSub/Websocket
β βββ genesis.go # Genesis state of the module
β βββ interface.go # interface collection of modules
β βββ keys.go # module stores key and some other constants
β βββ msg.go # Chat module transaction message
β βββ params.go # The custom parameters that the module can modify through the governance module
β βββ interface.go # The method implemented by the imported external module
β βββ types.go # module type collection
βββ genesis.go # ABCI's genesis state initialization and export function
βββ handler.go # message routing
βββ module.go # Module settings of the module manager
Overview
Contract
Contract is responsible for the content related to the evm contract
One-click coin issuance
Users can directly publish their own tokens on evm through messages, only need to upload some basic information of tokens, no need to deploy token contracts
Everything is done automatically inside the contract
Cross-chain transfer
This module can be used to realize the token mapping transfer (such as ETH) from DaoDst to the external chain, and the cross-chain supports two-way
When DaoDst transfers funds to the external chain, the balance inside DaoDst will be frozen, and at the same time, the external chain contract will issue corresponding tokens
Correspondingly, when the opposite operation is performed, the external chain is destroyed and Daodst is unfrozen
Keeper
The contract module 'Keeper' grants access to the state of the chat module And implement 'statedb. Interface to support 'StateDB' implementation. Keeper contains a storage key that allows the repository Write to the concrete subtree of the multibase that can only be accessed by the Chat module. Instead of using trees and databases for querying and persistence (the 'StateDB' implementation), DaoDst uses Cosmos' "KVStore" (key-value store) and Cosmos SDK's "Keeper" to facilitate state transitions.
In order to support the interface function, it imports 7 module Keepers:
auth
: addition, deletion, modification and query of accountsbank
: addition, deletion, modification and query of supply and balancestaking
: management of gateway related datapledge
: management of chat related dataevm
: management of evm related datachat
: management of chat related datagateway
: gateway data management
type Keeper struct {
storeKey sdk.StoreKey
cdc codec.BinaryCodec
paramstore paramtypes.Subspace
stakingKeeper *stakingKeeper.Keeper
accountKeeper types.AccountKeeper
BankKeeper types.BankKeeper
pledgeKeeper types.PledgeKeeper
evmKeeper types.EVMKeeper
chatKeeper types.ChatKeeper
gatewayKeeper types.GatewayKeeper
erc20Keeper erc20keeper.Keeper
}
Messages
MsgAppTokenIssue
Through this message, initiate one-click coin issuance
type MsgAppTokenIssue struct {
FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"`
Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty" yaml:"symbol"`
PreMintAmount string `protobuf:"bytes,4,opt,name=pre_mint_amount,json=preMintAmount,proto3" json:"pre_mint_amount,omitempty" yaml:"pre_mint_amount"`
Decimals string `protobuf:"bytes,5,opt,name=decimals,proto3" json:"decimals,omitempty" yaml:"decimals"`
LogoUrl string `protobuf:"bytes,6,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty" yaml:"logo_url"`
}
MsgCrossChainOut
Through this message, initiate a cross-chain transfer from DaoDst
type MsgCrossChainOut struct {
SendAddress string `protobuf:"bytes,1,opt,name=send_address,json=sendAddress,proto3" json:"send_address,omitempty" yaml:"send_address"`
ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"`
Coins string `protobuf:"bytes,3,opt,name=coins,proto3" json:"coins,omitempty" yaml:"coins"`
ChainType string `protobuf:"bytes,4,opt,name=chain_type,json=chainType,proto3" json:"chain_type,omitempty" yaml:"chain_type"`
Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty" yaml:"remark"`
}
MsgCrossChainIn
Through this message, a cross-chain transfer to DaoDst is initiated from the external chain
type MsgCrossChainIn struct {
SendAddress string `protobuf:"bytes,1,opt,name=send_address,json=sendAddress,proto3" json:"send_address,omitempty" yaml:"send_address"`
Coins string `protobuf:"bytes,2,opt,name=coins,proto3" json:"coins,omitempty" yaml:"coins"`
ChainType string `protobuf:"bytes,3,opt,name=chain_type,json=chainType,proto3" json:"chain_type,omitempty" yaml:"chain_type"`
Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty" yaml:"remark"`
TxHash string `protobuf:"bytes,5,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty" yaml:"tx_hash"`
}