A Next.js application demonstrating gasless cross-chain token transfers from Arbitrum Sepolia to Base Sepolia using Chainlink CCIP and Alchemy's Account Abstraction.
- 🔗 Cross-Chain Transfers: Send USDC from Arbitrum Sepolia to Base Sepolia
- ⛽ Zero Gas Fees: Users pay no transaction fees thanks to Account Abstraction
- 🔐 Account Abstraction: Powered by Alchemy's AA infrastructure
- 🌐 Chainlink CCIP: Industry-standard cross-chain interoperability protocol
- 🔍 Transaction Tracking: Direct links to CCIP Explorer for monitoring transfers
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Blockchain: Arbitrum Sepolia (source), Base Sepolia (destination)
- Cross-Chain: Chainlink CCIP (Cross-Chain Interoperability Protocol)
- Account Abstraction: Alchemy Account Kit
- Smart Contract Interaction: Viem, Account Kit React hooks
- Node.js 18+
- Git
- An Alchemy API key
- Test tokens on Arbitrum Sepolia
-
Clone the repository
git clone https://github.com/clnan/ccip-gasless-cross-chain-transfers.git cd ccip-gasless-cross-chain-transfers -
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile:NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key_here NEXT_PUBLIC_WC_PROJECT_ID=your_walletconnect_project_id_here
-
Run the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
- Connect Wallet: Users connect their wallet and land on Arbitrum Sepolia
- Select Token: Choose between USDC or CCIP-BnM test tokens
- Enter Details: Specify amount and destination address on Base Sepolia
- Approve Tokens: Smart contract approves tokens for CCIP router (if needed)
- CCIP Transfer: Chainlink CCIP handles the cross-chain message and token transfer
- Track Progress: Monitor the transfer on CCIP Explorer
- CCIP Router:
0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165(Arbitrum Sepolia) - Destination Chain: Base Sepolia (Chain Selector:
10344971235874465080) - Supported Tokens:
- USDC:
0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d - CCIP-BnM:
0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D
- USDC:
- Chainlink CCIP: Official CCIP logo and blue color scheme (#375BD2)
- Alchemy: Account Abstraction branding and blue gradients (#2196F3)
- Modern Interface: Clean cards, gradients, and smooth animations
- Real-time Status: Shows current processing step (checking, approving, transferring)
- Error Handling: Clear error messages and retry functionality
- Success Tracking: Direct links to CCIP Explorer for transaction monitoring
- Responsive Design: Works on desktop and mobile devices
const ccipMessage = {
receiver: destinationAddress, // Padded to 32 bytes
data: '0x', // Empty for token transfers
tokenAmounts: [{
token: tokenAddress, // USDC or CCIP-BnM
amount: weiAmount // Amount in smallest unit
}],
feeToken: '0x000...000', // Pay fees in native ETH
extraArgs: '0x' // Additional CCIP parameters
};- User initiates transfer (no direct wallet interaction)
- Smart account handles token approval
- Smart account executes CCIP transfer
- All gas fees sponsored by the application
| Network | Chain ID | Purpose | Status |
|---|---|---|---|
| Arbitrum Sepolia | 421614 | Source Chain | ✅ Active |
| Base Sepolia | 84532 | Destination Chain | ✅ Active |
- Direct Links: Automatic links to transaction details
- Real-time Status: Track message state across chains
- Transfer Time: Typically 10-20 minutes for completion
- Source Transaction: Token approval and CCIP send on Arbitrum Sepolia
- CCIP Processing: Chainlink network validates and processes message
- Destination Delivery: Tokens arrive on Base Sepolia
- Account Abstraction: No private key exposure
- Chainlink CCIP: Battle-tested cross-chain infrastructure
- Token Approvals: Minimal approval amounts for security
- Error Recovery: Comprehensive error handling and user feedback
- Additional token support (ETH, other ERC-20s)
- More destination chains (Polygon, Optimism, etc.)
- Transaction history and portfolio tracking
- Advanced CCIP features (arbitrary messaging, NFT transfers)
- Gasless transactions on destination chain
- Chainlink CCIP Documentation
- Alchemy Account Kit
- CCIP Explorer
- Arbitrum Sepolia Faucet
- Base Sepolia Faucet
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.