CrossChain-Hub
A relay for calling a function on another chain over Chainlink CCIP: an API builds the payload, a sender contract pays the fee, a receiver contract makes the call.
- Period: 2023 to 2024
- Languages: Solidity, TypeScript
- Built with: Chainlink CCIP, Foundry, Express
- Repository: yogesh0509/CrossChain-Hub
What it does
A small relay for calling a function on a contract on another chain, built on Chainlink CCIP (Cross-Chain Interoperability Protocol). CCIP carries the message; this project adds the pieces around it.
- A client posts the target function's ABI, its arguments and the target contract to the Node API.
- The API returns the sender contract for the current chain, the CCIP chain selector and receiver for the target chain, and the payload: the target address and the encoded function call.
- The user's wallet calls
crossChainCallon the sender contract. It builds a CCIP message, asks the router for the fee, pays it in the native token or LINK, and sends the message. - On the destination chain, the CCIP router calls the receiver, which decodes the payload and calls the target contract.
A small demo app casts a vote on a Voter contract on another chain.
What is mine, and what is not
The sender contract is adapted from Chainlink's CCIP starter kit (its BasicMessageSender). My changes are sending a raw byte payload, checking the balance before sending, and approving the exact fee for each call. The receiver also reuses the starter kit's structure.
The parts I wrote are the payload relay design, the receiver's dispatching of the decoded call, the payload-building API, and the demo.
Testnets
It targets the CCIP testnets Ethereum Sepolia and Avalanche Fuji. An earlier configuration used Polygon Mumbai, which no longer exists.
Deployed contracts
Testnets only. Each address opens on its block explorer.
| Network | Contract | Address | Read-only calls |
|---|---|---|---|
| Ethereum Sepolia | CrossHubSender | 0x90F2…133e | owner() |
| Ethereum Sepolia | CrossHubReceiver | 0xdBe8…A292 | getRouter() |
| Avalanche Fuji | CrossHubSender | 0x1F09…852D | owner() |
| Avalanche Fuji | CrossHubReceiver | 0x7FD6…a20C | getRouter(), s_feeToken() |
| Avalanche Fuji | Voter (demo) | 0x7AD8…49AD | none listed |
- CrossHubReceiver (Ethereum Sepolia): An earlier version than the code in the repository.
- Voter (demo) (Avalanche Fuji): The contract the demo app calls across chains.
In the terminal, cast call --list lists every function that can be called live against these contracts.