Migration for ERC20 precompiles when upgrading to v0.4.0
**This is a mandatory breaking change for chains with existing ERC20 token pairs.**
Without this migration, your ERC20 tokens will become inaccessible via EVM, showing zero balances and failing all operations.
Impact Assessment
Affected Chains
Your chain needs this migration if you have:
IBC tokens converted to ERC20
Token factory tokens with ERC20 representations
Any existing DynamicPrecompiles or NativePrecompiles in storage
Symptoms if Not Migrated
ERC20 balances will show as 0 when queried via EVM
totalSupply() calls return 0
Token transfers via ERC20 interface fail
Native Ontomir balances remain intact but inaccessible via EVM
Storage Changes
* Precompiles stored as concatenated hex strings in parameter storage * Keys: `"DynamicPrecompiles"` and `"NativePrecompiles"` * Format: Multiple addresses concatenated as 42-character hex strings * Dedicated prefix stores for each precompile type * Keys: `types.KeyPrefixDynamicPrecompiles` and `types.KeyPrefixNativePrecompiles` * Individual storage entries per address
Implementation
Quick Start
Add this essential migration logic to your existing upgrade handler: