Overview
The IBC precompile enables cross-chain token transfers using the Inter-Blockchain Communication (IBC) protocol directly from EVM contracts. This allows seamless integration between Sei and other Cosmos SDK chains, enabling multi-chain DeFi applications and cross-chain asset management. Contract Address:0x0000000000000000000000000000000000001009
Key Features
- Cross-Chain Transfers: Send tokens to any IBC-enabled Cosmos chain
- Flexible Timeouts: Set custom timeout parameters or use defaults
- Memo Support: Include arbitrary data with transfers
- Multi-Asset Support: Transfer any IBC-compatible token denomination
Available Functions
State-Changing Functions
transfer(string, string, string, string, uint256, uint64, uint64, uint64, string) → bool
transfer(string, string, string, string, uint256, uint64, uint64, uint64, string) → bool
Transfer tokens to another chain via IBC with custom timeout parameters.Parameters:
toAddress(string): Recipient address on destination chainport(string): IBC port identifier (usually “transfer”)channel(string): IBC channel identifier (e.g., “channel-0”)denom(string): Token denomination to transferamount(uint256): Amount to transfer (in base units)revisionNumber(uint64): Timeout height revision numberrevisionHeight(uint64): Timeout height revision heighttimeoutTimestamp(uint64): Timeout timestamp (nanoseconds)memo(string): Optional memo data
transferWithDefaultTimeout(string, string, string, string, uint256, string) → bool
transferWithDefaultTimeout(string, string, string, string, uint256, string) → bool
Transfer tokens to another chain via IBC using default timeout parameters.Parameters:
toAddress(string): Recipient address on destination chainport(string): IBC port identifier (usually “transfer”)channel(string): IBC channel identifierdenom(string): Token denomination to transferamount(uint256): Amount to transfer (in base units)memo(string): Optional memo data
Usage Examples
- Viem
- Ethers.js
- Manual
IBC Channel Configuration
Common Sei IBC Channels
| Chain | Channel ID | Destination Prefix | Transfer Time |
|---|---|---|---|
| Osmosis | channel-0 | osmo | 1-2 minutes |
| Cosmos Hub | channel-1 | cosmos | 1-2 minutes |
| Juno | channel-2 | juno | 1-2 minutes |
| Stargaze | channel-3 | stars | 1-2 minutes |
Channel Discovery
Common Use Cases
Cross-Chain DeFi
- Yield Farming: Transfer tokens to other chains for higher yields
- Arbitrage: Move assets between chains to exploit price differences
- Liquidity Provision: Provide liquidity on multiple DEXs across chains
Portfolio Management
- Diversification: Spread assets across multiple chains
- Risk Management: Move assets to safer chains during market volatility
- Rebalancing: Maintain target allocations across chains
Multi-Chain Applications
- Cross-Chain Swaps: Enable swaps between assets on different chains
- Unified Wallets: Manage assets across multiple chains from one interface
- Cross-Chain Governance: Participate in governance across multiple chains
Transfer Strategies
Timeout Management
Memo Optimization
Batch Transfer Optimization
Error Handling
Common errors when using the IBC precompile:- Invalid channel: Channel doesn’t exist or is closed
- Timeout expired: Transfer took too long to complete
- Insufficient balance: Not enough tokens to transfer
- Invalid destination: Malformed destination address
Security Considerations
Address Validation
- Always validate destination addresses match the expected chain prefix
- Verify channel IDs are correct for the intended destination chain
- Double-check amounts and denominations before transfer
Timeout Management
- Use appropriate timeouts based on network conditions
- Consider using default timeouts for most transfers
- Monitor for failed transfers due to timeouts
Memo Security
- Avoid including sensitive information in memos
- Be cautious with automated memo generation
- Validate memo content for cross-chain applications