Step-by-step guide for upgrading Cosmos EVM from v0.3.x to v0.4.0
Preparation
Dependencies
cosmos/evm
to v0.4.0Code Changes
RegisterServices
)Configuration
go.sum
, particularly:google.golang.org/protobuf
github.com/gofrs/flock
github.com/consensys/gnark-crypto
newApp
function must now return evmserver.Application
instead of servertypes.Application
.
ICS-20 Precompile
bankKeeper
as the first parameter:Governance Precompile
AddressCodec
:Start Node
Deploy Contract
Test EIP-1559
Test Listeners
replace
directives in go.mod
app.toml
diff if defaults changedpruning
or snapshot
commands panic with wrong type error.
Solution: Ensure you’re passing sdkAppCreatorWrapper
(not ac.newApp
) to these commands.
bankKeeper
is passed as the first parameter to NewPrecompile
.
AddressCodec
via defaults or WithAddressCodec(...)
.
RegisterPendingTxListener
is called during app construction or module initialization.