Chains
Supported Networks
| Network | Chain ID | Type | Cross Chain Support |
|---|---|---|---|
| Ethereum Mainnet | 1 | Mainnet | ✅ |
| Ethereum Sepolia | 11155111 | Testnet | ✅ |
| Avalanche C-Chain | 43114 | Mainnet | ✅ |
| Avalanche Fuji | 43113 | Testnet | ✅ |
| Celo Mainnet | 42220 | Mainnet | ✅ |
| Celo Alfajores | 44787 | Testnet | ✅ |
| Base Mainnet | 8453 | Mainnet | ✅ |
| Base Sepolia | 84532 | Testnet | ✅ |
| Soshi L1 Testnet | 3278 | Testnet | ❌ |
| Somnia Testnet | 50312 | Testnet | ❌ |
Multi-Chain Support
The Sherry SDK is built from the ground up to support multiple blockchain networks. Whether you're building for a single chain or creating cross-chain experiences, the SDK provides seamless integration across all supported networks.
Chain Configuration
Every action in the Sherry SDK must specify which blockchain(s) it operates on using the chains property. This ensures transactions are sent to the correct network and enables cross-chain functionality.
Flexible Chain Specification
You must specify chains using numeric chain IDs:
// Using chain IDs
chains: {
source: 43114; // Avalanche C-Chain Mainnet
}
// For cross-chain operations
chains: {
source: 43114, // Avalanche
destination: 42220 // Celo
}
Implementation Examples
Single-Chain Operations
Most mini-apps operate on a single blockchain. Here are examples for each supported network:
Avalanche NFT Mint
const nftMintAction = {
type: 'blockchain',
label: 'Mint NFT on Avalanche',
address: '0x742d35Cc6734C0532925a3b8D4ccd306f6F4B26C',
abi: nftAbi,
functionName: 'mint',
chains: { source: 43114 }, // Avalanche C-Chain
amount: 0.1, // 0.1 AVAX mint fee
params: [
{
name: 'to',
label: 'Recipient Address',
type: 'address',
required: true,
},
],
};
Celo Mobile Payment
const paymentAction = {
type: 'transfer',
label: 'Send CELO Payment',
chains: { source: 42220 }, // Celo Mainnet
amountConfig: {
type: 'select',
options: [
{ label: '$1 USD', value: 0.5 }, // Approximate CELO amount
{ label: '$5 USD', value: 2.5 },
{ label: '$10 USD', value: 5.0 },
],
},
recipient: {
type: 'select',
options: [
{ label: 'Coffee Shop', value: '0x...' },
{ label: 'Local Store', value: '0x...' },
],
},
};
Ethereum DeFi Interaction
const defiAction = {
type: 'blockchain',
label: 'Stake ETH',
address: '0xStakingContractAddress',
abi: stakingAbi,
functionName: 'stake',
chains: { source: 1 }, // Ethereum Mainnet
params: [
{
name: 'amount',
label: 'Amount to Stake (ETH)',
type: 'number',
required: true,
min: 0.01,
max: 100,
},
],
};
Cross-Chain Operations
Cross-chain actions enable powerful interoperability between different networks:
Asset Bridge
const bridgeAction = {
type: 'blockchain',
label: 'Bridge AVAX to Celo',
address: '0xBridgeContractAvalanche',
abi: bridgeAbi,
functionName: 'initiateTransfer',
chains: {
source: 43114, // Transaction happens on Avalanche
destination: 42220, // Assets arrive on Celo
},
params: [
{
name: 'amount',
label: 'Amount to Bridge',
type: 'number',
required: true,
min: 0.1,
},
{
name: 'recipientAddress',
label: 'Celo Recipient Address',
type: 'address',
required: true,
},
],
};
Cross-Chain Governance
const crossChainVote = {
type: 'blockchain',
label: 'Vote Across Chains',
address: '0xGovernanceHub',
abi: governanceAbi,
functionName: 'submitCrossChainVote',
chains: {
source: 1, // Vote initiated on Ethereum
destination: 43114, // Vote counted on Avalanche
},
params: [
{
name: 'proposalId',
label: 'Proposal ID',
type: 'number',
required: true,
},
{
name: 'support',
label: 'Vote',
type: 'radio',
required: true,
options: [
{ label: 'Yes', value: 1 },
{ label: 'No', value: 0 },
{ label: 'Abstain', value: 2 },
],
},
],
};
Development Best Practices
Chain Selection Guidelines
Use Testnets for Development
// Development
chains: {
source: 43113;
} // Test on Fuji first
chains: {
source: 44787;
} // Test Celo features
chains: {
source: 11155111;
} // Test Ethereum integration
// Production
chains: {
source: 43114;
} // Deploy to Avalanche mainnet
Choose Chains Based on Use Case
- High-frequency trading, gaming: Avalanche (fast, cheap)
- Mobile payments, social impact: Celo (mobile-optimized)
- DeFi, established protocols: Ethereum (largest ecosystem)
Error Handling
// Robust chain configuration with fallbacks
const robustAction = {
type: 'blockchain',
label: 'Multi-Chain Compatible Action',
// Primary chain
chains: { source: 43114 }, // Avalanche
// Include chain-specific error handling in your backend
address: getContractAddress(43114), // Dynamic address selection
abi: contractAbi,
functionName: 'execute',
};
function getContractAddress(chainId: number): string {
const addresses = {
43114: '0xMainnetContract', // Avalanche
43113: '0xTestnetContract', // Fuji
42220: '0xCeloContract', // Celo
44787: '0xCeloTestContract', // Alfajores
};
return addresses[chainId] || addresses[43114];
}
Testing Across Chains
- Start with testnets: Always test on Fuji, Alfajores, or Sepolia first
- Use small amounts: Test with minimal token amounts initially
- Verify addresses: Ensure contract addresses are correct for each chain
- Test edge cases: Handle network congestion and failed transactions
- Monitor gas costs: Different chains have different fee structures
Migration from Chain Names to Chain IDs
The Sherry SDK has transitioned from using string-based chain names to numeric chain IDs for better standardization and compatibility. This change provides several benefits:
Benefits of Chain IDs
- Standardization: Chain IDs are industry-standard identifiers used across all blockchain tools
- Compatibility: Seamless integration with wallets, explorers, and other Web3 tools
- Precision: No ambiguity about which network is being referenced
- Future-proofing: Easier to add new networks without naming conflicts
Chain ID Reference Table
| Network | Chain ID | Description |
|---|---|---|
| Ethereum Mainnet | 1 | The original Ethereum network |
| Ethereum Sepolia | 11155111 | Ethereum's recommended testnet |
| Avalanche C-Chain | 43114 | Avalanche mainnet |
| Avalanche Fuji | 43113 | Avalanche's testnet |
| Celo Mainnet | 42220 | Celo's main network |
| Celo Alfajores | 44787 | Celo's testnet |
| Base Mainnet | 8453 | Base's main network |
| Base Sepolia Testnet | 84532 | Base's testnet |
| Soshi L1 Testnet | 3278 | Soshi's custom testnet |
Quick Migration Guide
If you're updating existing code, here are the key changes:
// Before (deprecated)
chains: {
source: 'avalanche';
}
// After (current)
chains: {
source: 43114;
}
// Before (deprecated)
chains: {
source: 'ethereum',
destination: 'celo'
}
// After (current)
chains: {
source: 1,
destination: 42220
}