> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmos.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Precompiled Contracts

> A hub for precompiled contracts that bridge EVM and Cosmos SDK modules.

# 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.

<Warning>
  **Critical: Understanding Token Decimals in Precompiles**

  All 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

  ```solidity theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
  // 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
  ```
</Warning>

## Available Precompiles

Access native Cosmos SDK features directly from Solidity:

<CardGroup cols={3}>
  <Card title="Bank" icon="building-columns">
    Interface with native Cosmos SDK tokens for balance and supply queries.
    <a href="./bank">Explore Bank →</a>
  </Card>

  <Card title="Bech32" icon="arrows-rotate">
    Convert addresses between Ethereum hex and Cosmos bech32 formats.
    <a href="./bech32">Explore Bech32 →</a>
  </Card>

  <Card title="Callbacks" icon="arrows-turn-right">
    Handle IBC packet lifecycle callbacks in smart contracts.
    <a href="./callbacks">Explore Callbacks →</a>
  </Card>

  <Card title="Distribution" icon="coins">
    Withdraw staking rewards and interact with the community pool.
    <a href="./distribution">Explore Distribution →</a>
  </Card>

  <Card title="ERC20" icon="coins">
    Utilize standard ERC20 token functionality for native Cosmos tokens.
    <a href="./erc20">Explore ERC20 →</a>
  </Card>

  <Card title="Governance" icon="note">
    Participate in on-chain governance through proposals and voting.
    <a href="./governance">Explore Governance →</a>
  </Card>

  <Card title="ICS20" icon="arrow-right-arrow-left">
    Perform cross-chain token transfers via the IBC protocol.
    <a href="./ics20">Explore ICS20 →</a>
  </Card>

  <Card title="P256" icon="key">
    Execute P-256 elliptic curve cryptographic operations.
    <a href="./p256">Explore P256 →</a>
  </Card>

  <Card title="Slashing" icon="gavel">
    Manage validator slashing and jailing for network security.
    <a href="./slashing">Explore Slashing →</a>
  </Card>

  <Card title="Staking" icon="coins">
    Perform validator operations, manage delegations, and handle staking.
    <a href="./staking">Explore Staking →</a>
  </Card>

  <Card title="WERC20" icon="repeat">
    Wrap native tokens to provide ERC20-compatible functionality.
    <a href="./werc20">Explore WERC20 →</a>
  </Card>
</CardGroup>
