Contract Calls Overview
Execute arbitrary smart contract calls across multiple chains with aggregated asset management
Contract calls enable you to execute any smart contract operation using your aggregated balance. This powerful feature allows for complex DeFi operations, NFT interactions, gaming actions, and custom business logic - all while benefiting from unified asset management.
What Are Contract Calls?
Contract calls let you interact with smart contracts on any supported chain while OneBalance handles:
- Cross-chain token routing - Use tokens from any chain to pay for operations
- Automatic gas abstraction - No need to hold native tokens on target chains
- Token approvals - Automatic ERC20 approvals when needed
- Transaction bundling - Multiple operations in a single user experience
Account Configuration Required: Contract calls require proper account setup. Choose your account model based on your security and operational needs. See Account Models for setup instructions.
Quick Example
Here’s how to transfer USDC on Arbitrum using funds from your aggregated balance:
How It Works
OneBalance contract calls are executed through a three-phase process that handles all the complexity behind the scenes.
Phase Breakdown
- Prepare Quote - Submit your contract calls and requirements to get executable operations. OneBalance analyzes your requirements, generates user operations, and calculates optimal routing across chains.
- Sign Operations - Sign the generated user operations with your wallet. This happens client-side using standard EIP-712 typed data signatures.
- Execute - OneBalance coordinates cross-chain execution and settlement, handling token transfers, bridging, and smart contract calls automatically.
Detailed Flow
For those interested in the technical details, here’s the complete execution flow:
Each phase uses specific API endpoints:
- Phase 1: Prepare - POST /quotes/prepare-call-quote & POST /quotes/call-quote - Analyzes your calls and generates user operations
- Phase 2: Sign - Client-side signing with your wallet or library
- Phase 3: Execute - POST /quotes/execute-quote - Submits signed operations for execution
Common Use Cases
Token Operations
Cross-chain transfers, swaps, and token management
DeFi Protocols
Lending, borrowing, staking, and yield farming
NFT Interactions
Minting, trading, and marketplace operations
DAO Governance
Proposal voting and treasury management
Real-World Examples
- Cross-chain DEX Trading - Use USDC from Polygon to trade on Uniswap on Base
- Multi-chain Staking - Stake ETH on Ethereum using tokens from your Arbitrum balance
- NFT Minting - Mint NFTs on any chain using your unified token balance
- DAO Participation - Vote on proposals using tokens from multiple chains
Benefits
Unified Experience
One API for all chains and protocols
Gas Efficiency
Optimized routing and batched operations
Enhanced UX
No chain switching or token bridging required
Developer Friendly
Simple integration with existing smart contracts
Getting Started: All examples in this section use Role-Based accounts. For complete setup instructions and to choose the right account model for your needs, see Account Models.
Next Steps
Quickstart Guide
Build your first contract call integration step-by-step
Working Examples
Copy-paste examples for common use cases and protocols
Advanced Patterns
Complex scenarios, batch operations, and optimization techniques
Approvals & Allowances
Handle token approvals and permission management
Troubleshooting
Debug common issues and error handling strategies