0g-chain/x/evmutil/spec/05_params.md
Robert Pirtle ff709d73e1
feat(evmutil): add allow list for evm-convertible sdk denoms (#1590)
* add proto for allowed sdk denoms -> evm conversion

* add validation for AllowedNativeCoinERC20Token

* add validation for AllowedNativeCoinERC20Tokens

* add AllowedNativeDenoms into params & genesis

* add evmutil Params.Validate() test

* fix eip712 ante test

* update changelog

* update internal testnet genesis.json

* update state & param specs

updates to the sections describing functionality will be updated once
that functionality actually exists... :)

* update field decimal -> decimals

field now matches erc20 spec

* add validation decimals will cast to uint8

* add v2 store migration for evmutil

* create & register evmutil migrations

* adds migrator to evmutil's keeper
* sets up Migrate1To2 migration
* registers migration in module
* updates GetParams to properly handle historic block queries

* add unit test for GetParams with historic store
2023-05-19 16:01:46 -07:00

2.6 KiB

Parameters

The evmutil module contains the following parameters:

Key Type Example
EnabledConversionPairs array (ConversionPair) [{see below}]
AllowedNativeDenoms array (AllowedNativeCoinERC20Tokens) [{see below}]

Example parameters for ConversionPair:

Key Type Example Description
kava_erc20_Address string "0x43d8814fdfb9b8854422df13f1c66e34e4fa91fd" ERC20 contract address
denom string "erc20/chain/usdc" sdk.Coin denom for the ERC20 token

Example parameters for AllowedNativeCoinERC20Token:

Key Type Example Description
sdk_denom string "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" denom of the sdk.Coin
name string "Kava-wrapped Atom" name field of the erc20 token
symbol string "kATOM" symbol field of the erc20 token
decimal uint32 6 decimal field of the erc20 token, for display only

EnabledConversionPairs

The enabled conversion pairs parameter is an array of ConversionPair entries mapping an erc20 address to a sdk.Coin denom. Only erc20 contract addresses that are in this list can be converted to sdk.Coin and vice versa.

AllowedNativeDenoms

The allowed native denoms parameter is an array of AllowedNativeCoinERC20Token entries. They include the sdk.Coin denom and metadata for the ERC20 representation of the asset in Kava's EVM. Coins may only be transferred to the EVM if they are included in this list. A token in this list will have an ERC20 token contract deployed on first conversion. The token will be deployed with the metadata included in the AllowedNativeCoinERC20Token. Once deployed, changes to the metadata will not affect or change the deployed contract.