evmos/erc20
Table of Contents
evmos/erc20/v1/erc20.proto
TopCopyright Tharsis Labs Ltd.(Evmos)
SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
ProposalMetadata
Deprecated: ProposalMetadata is used to parse a slice of denom metadata and generate
the RegisterCoinProposal content. We're keeping it to remove the existing proposals from
store. After that, remove this message.
| Field | Type | Label | Description |
| metadata | cosmos.bank.v1beta1.Metadata | repeated | metadata slice of the native Cosmos coins |
RegisterCoinProposal
Deprecated: RegisterCoinProposal is a gov Content type to register a token pair for a
native Cosmos coin. We're keeping it to remove the existing proposals from
store. After that, remove this message.
NOTE: Keep this message for backwards compatibility on proposals query
| Field | Type | Label | Description |
| title | string | title of the proposal |
|
| description | string | description of the proposal |
|
| metadata | cosmos.bank.v1beta1.Metadata | repeated | metadata slice of the native Cosmos coins |
RegisterERC20Proposal
Deprecated: RegisterERC20Proposal is a gov Content type to register a token pair for an
ERC20 token.
NOTE: Keep this message for backwards compatibility on proposals query
| Field | Type | Label | Description |
| title | string | title of the proposal |
|
| description | string | description of the proposal |
|
| erc20addresses | string | repeated | erc20addresses is a slice of ERC20 token contract addresses |
ToggleTokenConversionProposal
Deprecated: ToggleTokenConversionProposal is a gov Content type to toggle the conversion
of a token pair.
NOTE: Keep this message for backwards compatibility on proposals query
| Field | Type | Label | Description |
| title | string | title of the proposal |
|
| description | string | description of the proposal |
|
| token | string | token identifier can be either the hex contract address of the ERC20 or the Cosmos base denomination |
TokenPair
TokenPair defines an instance that records a pairing consisting of a native
Cosmos Coin and an ERC20 token address.
| Field | Type | Label | Description |
| erc20_address | string | erc20_address is the hex address of ERC20 contract token |
|
| denom | string | denom defines the cosmos base denomination to be mapped to |
|
| enabled | bool | enabled defines the token mapping enable status |
|
| contract_owner | Owner | contract_owner is the an ENUM specifying the type of ERC20 owner (0 invalid, 1 ModuleAccount, 2 external address) |
Owner
Owner enumerates the ownership of a ERC20 contract.
| Name | Number | Description |
| OWNER_UNSPECIFIED | 0 | OWNER_UNSPECIFIED defines an invalid/undefined owner. |
| OWNER_MODULE | 1 | OWNER_MODULE - erc20 is owned by the erc20 module account. |
| OWNER_EXTERNAL | 2 | OWNER_EXTERNAL - erc20 is owned by an external account. |
evmos/erc20/v1/events.proto
TopCopyright Tharsis Labs Ltd.(Evmos)
SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
EventConvertCoin
EventConvertCoin is an event emitted when a coin is converted.
| Field | Type | Label | Description |
| sender | string | sender is the sender's address. |
|
| receiver | string | receiver is the receiver's address. |
|
| amount | string | amount is the amount of coins to be converted. |
|
| denom | string | denom is the coin's denomination. |
|
| erc20_address | string | erc20_address is the ERC20 contract address. |
EventConvertERC20
EventConvertERC20 is an event emitted when an ERC20 is converted.
| Field | Type | Label | Description |
| sender | string | sender is the sender's address. |
|
| receiver | string | receiver is the receiver's address. |
|
| amount | string | amount is the amount of coins to be converted. |
|
| denom | string | denom is the coin's denomination. |
|
| contract_address | string | contract_address of an ERC20 token contract, that is registered in a token pair |
EventRegisterPair
EventRegisterPair is an event emitted when a coin is registered.
| Field | Type | Label | Description |
| denom | string | denom is the coin's denomination. |
|
| erc20_address | string | erc20_address is the ERC20 contract address. |
EventToggleTokenConversion
EventToggleTokenConversion is an event emitted when a coin's token conversion is toggled.
| Field | Type | Label | Description |
| denom | string | denom is the coin's denomination. |
|
| erc20_address | string | erc20_address is the ERC20 contract address. |
evmos/erc20/v1/genesis.proto
TopCopyright Tharsis Labs Ltd.(Evmos)
SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
GenesisState
GenesisState defines the module's genesis state.
| Field | Type | Label | Description |
| params | Params | params are the erc20 module parameters at genesis |
|
| token_pairs | TokenPair | repeated | token_pairs is a slice of the registered token pairs at genesis |
Params
Params defines the erc20 module params
| Field | Type | Label | Description |
| enable_erc20 | bool | enable_erc20 is the parameter to enable the conversion of Cosmos coins <--> ERC20 tokens. |
|
| native_precompiles | string | repeated | native_precompiles defines the slice of hex addresses of the active precompiles that are used to interact with native staking coins as ERC20s |
| dynamic_precompiles | string | repeated | dynamic_precompiles defines the slice of hex addresses of the active precompiles that are used to interact with Bank coins as ERC20s |
evmos/erc20/v1/query.proto
TopCopyright Tharsis Labs Ltd.(Evmos)
SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
QueryParamsRequest
QueryParamsRequest is the request type for the Query/Params RPC method.
QueryParamsResponse
QueryParamsResponse is the response type for the Query/Params RPC
method.
| Field | Type | Label | Description |
| params | Params | params are the erc20 module parameters |
QueryTokenPairRequest
QueryTokenPairRequest is the request type for the Query/TokenPair RPC method.
| Field | Type | Label | Description |
| token | string | token identifier can be either the hex contract address of the ERC20 or the Cosmos base denomination |
QueryTokenPairResponse
QueryTokenPairResponse is the response type for the Query/TokenPair RPC
method.
| Field | Type | Label | Description |
| token_pair | TokenPair | token_pairs returns the info about a registered token pair for the erc20 module |
QueryTokenPairsRequest
QueryTokenPairsRequest is the request type for the Query/TokenPairs RPC
method.
| Field | Type | Label | Description |
| pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. |
QueryTokenPairsResponse
QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC
method.
| Field | Type | Label | Description |
| token_pairs | TokenPair | repeated | token_pairs is a slice of registered token pairs for the erc20 module |
| pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. |
Query
Query defines the gRPC querier service.
| Method Name | Request Type | Response Type | Description |
| TokenPairs | QueryTokenPairsRequest | QueryTokenPairsResponse | TokenPairs retrieves registered token pairs |
| TokenPair | QueryTokenPairRequest | QueryTokenPairResponse | TokenPair retrieves a registered token pair |
| Params | QueryParamsRequest | QueryParamsResponse | Params retrieves the erc20 module params |
Methods with HTTP bindings
| Method Name | Method | Pattern | Body |
| TokenPairs | GET | /evmos/erc20/v1/token_pairs | |
| TokenPair | GET | /evmos/erc20/v1/token_pairs/{token} | |
| Params | GET | /evmos/erc20/v1/params |
evmos/erc20/v1/tx.proto
TopCopyright Tharsis Labs Ltd.(Evmos)
SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
MsgConvertCoin
MsgConvertCoin defines a Msg to convert a native Cosmos coin to a ERC20 token
| Field | Type | Label | Description |
| coin | cosmos.base.v1beta1.Coin | coin is a Cosmos coin whose denomination is registered in a token pair. The coin amount defines the amount of coins to convert. |
|
| receiver | string | receiver is the hex address to receive ERC20 token |
|
| sender | string | sender is the cosmos bech32 address from the owner of the given Cosmos coins |
MsgConvertCoinResponse
MsgConvertCoinResponse returns no fields
MsgConvertERC20
MsgConvertERC20 defines a Msg to convert a ERC20 token to a native Cosmos
coin.
| Field | Type | Label | Description |
| contract_address | string | contract_address of an ERC20 token contract, that is registered in a token pair |
|
| amount | string | amount of ERC20 tokens to convert |
|
| receiver | string | receiver is the bech32 address to receive native Cosmos coins |
|
| sender | string | sender is the hex address from the owner of the given ERC20 tokens |
MsgConvertERC20Response
MsgConvertERC20Response returns no fields
MsgRegisterERC20
MsgRegisterERC20 is the Msg/RegisterERC20 request type for registering
an Erc20 contract token pair.
| Field | Type | Label | Description |
| authority | string | authority is the address of the governance account. |
|
| erc20addresses | string | repeated | erc20addresses is a slice of ERC20 token contract hex addresses |
MsgRegisterERC20Response
MsgRegisterERC20Response defines the response structure for executing a
MsgRegisterERC20 message.
MsgToggleConversion
MsgToggleConversion is the Msg/MsgToggleConversion request type for toggling
an Erc20 contract conversion capability.
| Field | Type | Label | Description |
| authority | string | authority is the address of the governance account. |
|
| token | string | token identifier can be either the hex contract address of the ERC20 or the Cosmos base denomination |
MsgToggleConversionResponse
MsgToggleConversionResponse defines the response structure for executing a
ToggleConversion message.
MsgUpdateParams
MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| authority | string | authority is the address of the governance account. |
|
| params | Params | params defines the x/evm parameters to update. NOTE: All parameters must be supplied. |
MsgUpdateParamsResponse
MsgUpdateParamsResponse defines the response structure for executing a
MsgUpdateParams message.
Since: cosmos-sdk 0.47
Msg
Msg defines the erc20 Msg service.
| Method Name | Request Type | Response Type | Description |
| ConvertERC20 | MsgConvertERC20 | MsgConvertERC20Response | ConvertERC20 mints a native Cosmos coin representation of the ERC20 token contract that is registered on the token mapping. |
| UpdateParams | MsgUpdateParams | MsgUpdateParamsResponse | UpdateParams defines a governance operation for updating the x/erc20 module parameters. The authority is hard-coded to the Cosmos SDK x/gov module account |
| RegisterERC20 | MsgRegisterERC20 | MsgRegisterERC20Response | RegisterERC20 defines a governance operation for registering a token pair for the specified erc20 contract. The authority is hard-coded to the Cosmos SDK x/gov module account |
| ToggleConversion | MsgToggleConversion | MsgToggleConversionResponse | ToggleConversion defines a governance operation for enabling/disablen a token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov module account |
Methods with HTTP bindings
| Method Name | Method | Pattern | Body |
| ConvertERC20 | GET | /evmos/erc20/v1/tx/convert_erc20 |
Scalar Value Types
| .proto Type | Notes | Python Type |
| double | float | |
| float | float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long |
| uint32 | Uses variable-length encoding. | int/long |
| uint64 | Uses variable-length encoding. | int/long |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long |
| sfixed32 | Always four bytes. | int |
| sfixed64 | Always eight bytes. | int/long |
| bool | boolean | |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode |
| bytes | May contain any arbitrary sequence of bytes. | str |