Precompiled Contracts

Precompiled contracts provide direct, gas-efficient access to native Cosmos SDK functionality from within the EVM. Build powerful hybrid applications that leverage the best of both worlds. This page provides an overview of the available precompiled contracts, each with detailed documentation on its usage, Solidity interface, and ABI.
Critical: Understanding Token Decimals in PrecompilesAll Cosmos EVM precompile contracts use the native chain’s decimal precision, not Ethereum’s standard 18 decimals (wei).Why this matters:
  • Cosmos chains typically use 6 decimals, while Ethereum uses 18
  • Passing values while assuming conventional Ethereum exponents could cause significant miscalculations
  • Example: On a 6-decimal chain, passing 1000000000000000000 (1 token in wei) will be interpreted as 1 trillion tokens
Before using any precompile:
  1. Check your chain’s native token decimal precision
  2. Convert amounts to match the native token’s format
  3. Never assume 18-decimal precision
// WRONG: Assuming Ethereum's 18 decimals
uint256 amount = 1 ether; // 1000000000000000000
staking.delegate(validator, amount); // Delegates 1 trillion tokens!

// CORRECT: Using chain's native 6 decimals
uint256 amount = 1000000; // 1 token with 6 decimals
staking.delegate(validator, amount); // Delegates 1 token

Available Precompiles

Access native Cosmos SDK features directly from Solidity:

Bank

Interface with native Cosmos SDK tokens for balance and supply queries. Explore Bank →

Bech32

Convert addresses between Ethereum hex and Cosmos bech32 formats. Explore Bech32 →

Callbacks

Handle IBC packet lifecycle callbacks in smart contracts. Explore Callbacks →

Distribution

Withdraw staking rewards and interact with the community pool. Explore Distribution →

ERC20

Utilize standard ERC20 token functionality for native Cosmos tokens. Explore ERC20 →

Governance

Participate in on-chain governance through proposals and voting. Explore Governance →

ICS20

Perform cross-chain token transfers via the IBC protocol. Explore ICS20 →

P256

Execute P-256 elliptic curve cryptographic operations. Explore P256 →

Slashing

Manage validator slashing and jailing for network security. Explore Slashing →

Staking

Perform validator operations, manage delegations, and handle staking. Explore Staking →

WERC20

Wrap native tokens to provide ERC20-compatible functionality. Explore WERC20 →