x/vm module from cosmos/evm provides a fully compatible Ethereum Virtual Machine execution environment as a Cosmos SDK module.
For conceptual understanding of EVM architecture and design, see EVM Architecture.
Parameters
The module parameters control EVM behavior and access policies (source):Parameter Details
Configuration Profiles
- Ethereum Compatible
- Permissioned
- High Security
Chain Configuration
Hard fork activation schedule (source):Static Precompiles
Precompiled contracts at fixed addresses (source):Activation
Messages
MsgEthereumTx
Primary message for EVM transactions (source):- Valid signature matching
fromaddress - Sufficient balance for gas + value
- Correct nonce (account sequence)
- Gas limit ≥ intrinsic gas
MsgUpdateParams
Governance message for parameter updates:State
Persistent State
Transient State
Events
Transaction Events
Block Events
Queries
gRPC
CLI
JSON-RPC
Supported Methods
- eth namespace
- web3 namespace
- net namespace
- debug namespace
Hooks
Post-transaction processing interface (source):Registration
Use Cases
- Process EVM events in Cosmos modules
- Bridge EVM logs to Cosmos events
- Trigger native module actions from contracts
- Custom indexing and monitoring
Gas Configuration
Gas Consumption Mapping
Gas Refunds
Maximum refund: 50% of gas used (after London)Best Practices
Chain Integration
-
Precompile Selection
- Only enable necessary precompiles
- Test gas costs in development
- Monitor usage patterns
-
Access Control
- Start restrictive, open gradually
- Use governance for changes
- Monitor blacklist/whitelist events
-
Fork Planning
Contract Development
-
Gas Optimization
-
Precompile Usage
dApp Integration
-
Provider Setup
-
Error Handling
Troubleshooting
Common Issues
Debug Commands
References
Source Code
Related Documentation
- EVM Architecture - Conceptual overview
- Fee Market Module - EIP-1559 implementation
- ERC20 Module - Token conversions