2/5
## Mastering Cross-Chain Token Transfers: A CCIP Case Study with Rebase Tokens (RBT) This lesson details the successful execution and verification of an optional cross-chain message, specifically the transfer of a Rebase Token (RBT) from the Ethereum Sepolia testnet to the ZKsync Sepolia testnet. We will utilize Chainlink's Cross-Chain Interoperability Protocol (CCIP) and its associated tools to track and confirm this operation. ## Verifying Transaction Success with CCIP Explorer Our first step is to confirm the successful processing of our cross-chain message using the CCIP Explorer, accessible at `ccip.chain.link`. Upon navigating to the specific "Transaction Details" page for our message, we observe the following critical information: * **Status:** The transaction is clearly marked as "Success," indicating the message was successfully relayed and processed. * **Message ID:** `0x9ec597e4883c3f3f890b789fb73e8c1034f93f8ab52f3c0cc479281a78ab87e`. This unique identifier is crucial for tracking the specific CCIP message. * **Source Transaction Hash:** `0xdff195ef43b1998b60401bfffd92eb33abaa06847962a3f2be5841c8d6c8`. This hash corresponds to the transaction initiated on the Ethereum Sepolia network. * **Destination Transaction Hash:** `0x0230798fdd13bd37ed4017c3a99815a38f7c3091c48584aae4ebe1`. This hash represents the transaction executed on the ZKsync Sepolia network, completing the cross-chain operation. * **Source Chain:** Ethereum Sepolia. * **Destination Chain:** ZKsync Sepolia. * **Transaction Timestamp:** December 20, 2024, at 15:09:12 UTC. (At the time of review, this transaction occurred 26 minutes prior). * **Origin/From/To Addresses:** All three fields display the same address: `0x52c64aed1fa87797e2030c914255e052f2bd67`. This configuration signifies that the sender transferred tokens to themselves on the destination chain, a common pattern for testing or personal asset management. * **Tokens and Amounts:** The transaction involved the transfer of `0.000000001000000000 RBT` (Rebase Token). * **Fees:** The CCIP transaction incurred a fee of `0.0116983510391186 LINK`. * **Sender Nonce:** `7`. This indicates that this was the seventh CCIP message sent by this specific account from the Ethereum Sepolia source chain. The nonce is crucial for ordering messages from a particular sender. * **Gas Limit:** `0`. This value is significant. A gas limit of zero typically means that no custom logic via a `ccipReceive` function was intended to be executed on the destination chain upon message arrival. For a simple token transfer like this, where the tokens are directly moved to the recipient's address without further smart contract interaction initiated by CCIP, this is expected. * **Sequence Number:** `90`. This is another internal CCIP identifier for message ordering and processing. The CCIP Explorer provides a comprehensive overview, confirming that our rebase tokens have successfully traversed from Ethereum Sepolia to ZKsync Sepolia. ## Confirming Token Arrival: Importing RBT into Metamask on ZKsync Sepolia With the cross-chain transfer confirmed by CCIP Explorer, the next logical step is to verify the arrival of the Rebase Tokens (RBT) in our wallet on the ZKsync Sepolia network. We will use Metamask for this purpose. 1. **Locating the Token Contract Address:** To import the token, we first need its contract address on the ZKsync Sepolia network. This address would have been generated during the deployment of the RBT contract to ZKsync. We retrieve this from our terminal output from a previous contract deployment step. A useful tip for searching extensive terminal logs is to use "Command+F" (on macOS) or "Ctrl+F" (on Windows/Linux). The ZKsync Rebase Token Address for this example is: `0x249cA469545e9A4020dBfE2DA4a3884894dC532d`. This address is copied for use in Metamask. 2. **Importing Token into Metamask:** * Open your Metamask browser extension. * Ensure your Metamask is connected to the "ZKsync Sepolia Testnet". If not, switch to this network. * Navigate to the "Tokens" tab within your selected account. * Click on the "Import tokens" link. * In the "Token contract address" field, paste the copied ZKsync rebase token address (`0x249cA469545e9A4020dBfE2DA4a3884894dC532d`). * Metamask should automatically detect and populate the "Token symbol" as `RBT` and the "Token decimal" as `18`. * The import confirmation screen will display the balance of the token. In this instance, it correctly shows `0.000000001000000000 RBT`. * *Note on Display Precision:* A very small amount was transferred intentionally to conserve testnet tokens. While Metamask's main token list might sometimes round such a small fractional balance down to "0 RBT" due to display limitations, the import step accurately reflects the precise fractional balance. * Click the "Import" button. The RBT token, along with its minuscule but correct balance, is now successfully added and visible in your Metamask wallet on the ZKsync Sepolia testnet, confirming the end-to-end transfer. ## Key Concepts in CCIP-Enabled Token Transfers This successful cross-chain transfer highlights several important concepts and functionalities within the Chainlink CCIP ecosystem: * **Successful Cross-Chain Transfer:** The primary achievement is the seamless movement of tokens (RBT) between two distinct blockchain networks, Ethereum Sepolia and ZKsync Sepolia, orchestrated by CCIP. This demonstrates CCIP's capability to bridge assets across disparate ledgers. The underlying mechanism for this token transfer would have involved a `ccipSend` (or an equivalent function within CCIP's token pool contracts like `LockReleaseTokenPool` or `BurnMintTokenPool`) call on Ethereum Sepolia. * **CCIP Explorer Utility:** The CCIP Explorer (`ccip.chain.link`) is an indispensable tool. It provides transparency and verifiability for CCIP messages, allowing users and developers to monitor transaction statuses, fees, sender/receiver details, message IDs, and other crucial parameters. * **Sender Nonce:** The "Sender Nonce" plays a vital role in CCIP. It's a sequential counter maintained per account on the source chain, ensuring that messages sent from that account are processed in the correct order. * **Gas Limit for `ccipReceive`:** The observed "Gas Limit" of `0` for this CCIP message is instructive. CCIP allows messages to not only transfer tokens but also to trigger arbitrary smart contract function calls on the destination chain via a `ccipReceive` function in a receiver contract. If such a function were implemented to execute custom logic upon message arrival (e.g., stake the tokens, record the transfer in another contract), a non-zero gas limit would have been specified and paid for by the sender on the source chain to cover the execution costs of `ccipReceive` on the destination chain. In this straightforward token transfer, no such custom logic was required, hence the zero gas limit. * **Enabling Tokens for CCIP:** A foundational step, performed prior to this transfer, was making the Rebase Token (RBT) CCIP-enabled. This involves configuring the token contract and registering it with CCIP's token pool contracts, allowing it to be recognized and managed by the CCIP bridging mechanism. * **Rebase Tokens:** While the specific mechanics of the "rebase" functionality (where token supply adjusts algorithmically) were not the focus of this transfer demonstration, the project successfully made such a dynamic-supply token interoperable across chains using CCIP. ## Expanding Cross-Chain Capabilities: The CCIP Directory The process demonstrated for transferring RBT from Ethereum Sepolia to ZKsync Sepolia is not limited to these two chains. The same principles and CCIP functionalities can be employed to enable token bridging and message passing to other CCIP-supported blockchains, such as Arbitrum, Optimism, Scroll, and more. A key resource for exploring CCIP's reach is the **CCIP Directory**, available at `docs.chain.link/ccip/directory/`. This directory is an essential reference, providing a comprehensive list of: * All networks (both mainnets and testnets) that have integrated CCIP. * The available "lanes" (supported routes) between these networks for sending and receiving messages/tokens. * A curated list of CCIP-enabled tokens on various chains. By selecting a specific network within the directory (e.g., ZKsync Sepolia), you can access detailed information pertinent to that chain's CCIP integration, including: * **Router Address:** The main CCIP contract address for interacting with the protocol on that chain. * **Chain Selector:** A unique identifier for the chain within the CCIP ecosystem. * **RMN (Risk Management Network) Address:** The address of the Risk Management Network contract for that chain. * **Token Admin Registry & Registry Module Owner Addresses:** Contracts related to token management and governance within CCIP on that chain. * **Fee Tokens:** A list of tokens accepted for paying CCIP transaction fees on that network (e.g., LINK, WETH, the chain's native gas token). * **Outbound Lanes:** Details on which destination networks tokens and messages can be sent *to* from the selected chain (e.g., from ZKsync to Arbitrum One or Ethereum). This includes OnRamp contract addresses for each lane and their operational status. * **Inbound Lanes:** Information on which source networks the selected chain can receive tokens and messages *from* (e.g., ZKsync receiving from Arbitrum One or Ethereum). This includes OffRamp contract addresses for each lane and their operational status. The CCIP Directory is invaluable for developers planning and implementing cross-chain applications, as it provides the necessary contract addresses, supported routes, and fee information. ## Project Recap: CCIP-Enabled Rebase Token Transfer The successful transfer of the CCIP-enabled Rebase Token (RBT) from Ethereum Sepolia to ZKsync Sepolia, and its subsequent verification, marks the completion of this project phase. We have demonstrated a practical application of Chainlink CCIP, covering transaction initiation (implied through previous steps), monitoring via CCIP Explorer, and final confirmation in a user wallet. This exercise underscores the power of CCIP in creating interoperable token solutions and lays the groundwork for more complex cross-chain interactions. The upcoming final lesson will consolidate all the learnings from the entire project of building and bridging this CCIP-enabled rebase token.
A detailed breakdown to Mastering Cross-Chain Token Transfers: A CCIP Case Study with Rebase Tokens (RBT) - Get a detailed breakdown of verifying a Rebase Token (RBT) cross-chain transfer via Chainlink CCIP from Ethereum Sepolia to ZKsync Sepolia. Master using the CCIP Explorer to interpret transaction details and confirm token receipt in Metamask on the ZKsync Sepolia network.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.
Guest lecturers:
Last updated on May 20, 2025
Duration: 36min
Duration: 3h 06min
Duration: 5h 02min
Duration: 6h 02min
Duration: 2h 47min
Duration: 1h 23min
Duration: 4h 28min
Duration: 1h 19min
Duration: 1h 10min
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.
Guest lecturers:
Last updated on May 20, 2025