{"id":22416283,"url":"https://github.com/bunsdev/ccip-mode","last_synced_at":"2026-02-18T02:02:35.543Z","repository":{"id":253178196,"uuid":"841535209","full_name":"BunsDev/ccip-mode","owner":"BunsDev","description":"Example demonstrating how to use CCIP on Mode blockchain.","archived":false,"fork":false,"pushed_at":"2024-11-18T19:42:13.000Z","size":1609,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T14:37:27.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BunsDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-12T15:44:57.000Z","updated_at":"2025-08-26T22:53:36.000Z","dependencies_parsed_at":"2024-08-19T03:25:00.435Z","dependency_job_id":null,"html_url":"https://github.com/BunsDev/ccip-mode","commit_stats":null,"previous_names":["bunsdev/ccip-mode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BunsDev/ccip-mode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BunsDev","download_url":"https://codeload.github.com/BunsDev/ccip-mode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-mode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29566366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T15:15:36.795Z","updated_at":"2026-02-18T02:02:35.526Z","avatar_url":"https://github.com/BunsDev.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccip-mode\nExample demonstrating how to use CCIP on Mode blockchain.\n\n## Chainlink CCIP Starter Kit\n\n\u003e _This repository represents an example of using a Chainlink product or service. It is provided to help you understand how to interact with Chainlink’s systems so that you can integrate them into your own. This template is provided \"AS IS\" without warranties of any kind, has not been audited, and may be missing key checks or error handling to make the usage of the product more clear. Take everything in this repository as an example and not something to be copy pasted into a production ready service._\n\nThis project demonstrates a couple of basic Chainlink CCIP use cases.\n\n## What is Chainlink CCIP?\n\n**Chainlink Cross-Chain Interoperability Protocol (CCIP)** provides a single, simple, and elegant interface through which dApps and web3 entrepreneurs can securely meet all their cross-chain needs, including token transfers and arbitrary messaging.\n\n![basic-architecture](./img/basic-architecture.png)\n\n**Chainlink CCIP Main Functionality**:\n\n1. Transfer Tokens\n2. Send Arbitrary Data\n3. Send Programmable Tokens\n\nReceiver can be either a smart contract that implements `CCIPReceiver.sol` or an EOA, **but if you send a message and token(s) to EOA, only tokens will arrive**.\n\n## Getting Started\n\nIn the next section you can see a couple of basic Chainlink CCIP use case examples. But before that, you need to set up some environment variables, install dependencies, setup environment variables, and compile contracts.\n\n### A. Install Dependencies\n```\nyarn \u0026\u0026 make\n```\n\n### B. Setup Environment Variables\nCopy \u0026 paste `.env.example` and name it `.env` and fill in the variables.\n\n```shell\ncp .env.example .env\n```\n\nAfter filling out your `.env`, run the following:\n```shell\nsource .env\n```\n\n# Setup Scenario\n\n## Deploy Contracts\nIn order to interact with our contracts, we first need to deploy them, which is simplified in the [`script/Deploy.s.sol`](./script/Deploy.s.sol) smart contract. \n\nWe have package scripts that enable you to deploy contracts, as follows:\n\n```shell\nyarn deploy\n```\n- [`BasicTokenSender.sol`](./src/BasicTokenSender.sol)\n- [`BasicMessageSender.sol`](./src/BasicMessageSender.sol)\n- [`BasicMessageReceiver.sol`](./src/BasicMessageReceiver.sol)\n- [`ProgrammableTokenTransfers.sol`](./src/ProgrammableTokenTransfers.sol)\n\n## Acquire Test Tokens from Faucet\nIn order to proceed with transferring tokens, you must first acquire test tokens from your source chain.  The command below, calls a faucet drip function to acquire `ccipBnm` -- also `ccipLnm`, when [transacting on an Ethereum network](https://docs.chain.link/ccip/supported-networks/v1_2_0/testnet#ethereum-sepolia-mode-sepolia):\n\n```shell\nforge script ./script/utils/Faucet.s.sol -vvv --broadcast --rpc-url modeSepolia --sig \"run(bool)\" -- false\n```\n\n## Load Contracts with Test Tokens\n\nAfter acquiring testnet tokens, you will proceed with funding your [Message Sender Contract](./src/BasicMessageSender.sol) and [Programmable Tokens Contract](./src/ProgrammableTokenTransfers.sol). \n\n- **Native Funding**: the following commands will send **0.1 native tokens** (ETH) to the contracts deployed on your source (Mode Sepolia) and destination (Ethereum Sepolia).\n\n- **LINK Funding**: the following commands will send **1 LINK** to the contracts deployed on your source (Mode Sepolia) and destination (Ethereum Sepolia).\n\n#### Fund Message Sender Contract\n**with 0.1 Native (ETH)**\n```shell\ncast send 0x0cd2E31eb378110DDD62778E136ba664A624b1CA --rpc-url modeSepolia --value 0.1ether --interactive\n```\n\n**with 1 LINK**\n```shell\ncast send 0x925a4bfE64AE2bFAC8a02b35F78e60C29743755d \"transfer(address,uint256)\"  0x0cd2E31eb378110DDD62778E136ba664A624b1CA 1000000000000000000 --rpc-url modeSepolia --interactive\n``` \n\n#### Fund Programmable Tokens Contracts\n**with 0.1 Native (ETH)**\n```shell\ncast send 0xF8b6eB96f2af79515fCce984c3e4fc8392e59645 --rpc-url modeSepolia --value 0.1ether --interactive \u0026\u0026 cast send 0x3fcCfFD821cd4Eab20FBb86EEc6cD22D5D237C87 --rpc-url ethereumSepolia --value 0.1ether --interactive\n```\n\n**with 1 LINK**\n```shell\ncast send 0x925a4bfE64AE2bFAC8a02b35F78e60C29743755d \"transfer(address,uint256)\" 0xF8b6eB96f2af79515fCce984c3e4fc8392e59645 1000000000000000000 --rpc-url modeSepolia --interactive \u0026\u0026 cast send 0x779877A7B0D9E8603169DdbD7836e478b4624789 \"transfer(address,uint256)\" 0x3fcCfFD821cd4Eab20FBb86EEc6cD22D5D237C87 1000000000000000000 --rpc-url ethereumSepolia --interactive\n```\n\n**with BnM (source)**\n```shell\ncast send 0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5 \"transfer(address,uint256)\" 0xF8b6eB96f2af79515fCce984c3e4fc8392e59645 100 --rpc-url modeSepolia --interactive\n```\n\n## Scenarios\n\u003e *Before proceeding with this section, please ensure you have completed the steps outlined in the [Setup for Scenario](#setup-for-scenario) section above.*\n\n### Scenario 1: Transfer Tokens\n- **1A | Transfer Tokens**: transfer tokens from one EOA on one blockchain to another EOA on another blockchain you can use the `script/Transfer.s.sol` smart contract. \n\n    - Run the following to send 1 CCIP-BnM from Mode Sepolia to Ethereum Sepolia and to pay for CCIP fees in LINK:\n        ```shell\n        forge script ./script/Transfer.s.sol -vvv --broadcast --rpc-url modeSepolia --sig \"run(uint256,uint8)\" -- 1000000000000000000 1\n        ```\n\n### Scenario 2: Send Message\n\n- **2A | Transfer Tokens**: run the following to send `1 CCIP-BnM` from Mode Sepolia \u0026rarr; Ethereum Sepolia (fee in LINK):\n\n    ```shell\n    forge script ./script/Message.s.sol:CCIPTokenTransfer -vvv --broadcast --rpc-url modeSepolia --sig \"run(uint256,uint8)\" -- 1000000000000000000 1\n    ```\n\n- **2B | Send Cross-Chain Message**: run the following to send \"Hello World\" as a message:\n\n    ```shell\n    forge script ./script/Message.s.sol:SendMessage -vvv --broadcast --rpc-url modeSepolia --sig \"run(string,uint8)\" -- \"Hello World\" 0\n    ```\n\n- **2C | Get Details**: once the CCIP message is finalized on the destination blockchain, you can see the details about the latest message using the `script/Message.s.sol:GetLatestMessageDetails` smart contract.\n\n    ```shell\n    forge script ./script/Message.s.sol:GetLatestMessageDetails -vvv --broadcast --rpc-url ethereumSepolia --sig \"run()\"\n    ```\n\n- **2D | Withdraw Tokens**: finally, you can always withdraw received tokens from the [`BasicMessageSender.sol`](./src/BasicMessageSender.sol) and  [`BasicMessageReceiver.sol`](./src/BasicMessageReceiver.sol) via `cast send` command. \n\n    - **Message Sender**: you can always withdraw tokens for Chainlink CCIP fees, as follows.\n\n        ```shell\n        cast send 0x0cd2E31eb378110DDD62778E136ba664A624b1CA --rpc-url modeSepolia \"withdraw(address)\" 0x7D5498EE4d080396408Bd727A03Cff8C12d9d713\n        ```\n\n    - **Message Receiver**: withdraw 100 units of CCIP-BnM previously sent, run:\n\n        ```shell\n        cast send 0x3161Ba019494a04b73B28193E43dC9d5733465f4 --rpc-url ethereumSepolia \"withdrawToken(address,address)\" 0x7D5498EE4d080396408Bd727A03Cff8C12d9d713 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05\n        ```\n\n### Scenario 3: Program Tokens\nOur final scenario involves programmable tokens. These enable you to send \u0026 receive tokens that contain code that instructs them with code to execute once they are received.\n\nAt this point, you have one **sender** contract on the source blockchain, and one **receiver** contract on the destination blockchain. Please note that [`ProgrammableTokenTransfers.sol`](./src/ProgrammableTokenTransfers.sol) can both send \u0026 receive tokens and data, hence we have two identical instances on both source and destination blockchains.\n\n**3A | Send Message**: send a message, using the `script/Program.s.sol:SendTokensAndData` smart contract:\n\nUse the following to send a \"Hello World\" `message` alongside 100 (`amount`) units of the CCIP-BnM (`token`) from Mode Sepolia to Ethereum Sepolia:\n\n```shell\nforge script ./script/Program.s.sol:SendTokensAndData -vvv --broadcast --rpc-url modeSepolia --sig \"run(string,address,uint256)\" -- \"Hello World\" 0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5 100\n```\n\n**3B | Get Details**: once the CCIP message is finalized on the destination blockchain, you can see the details of the latest CCIP message received, by running the following command:\n\n```shell\ncast call 0x3fcCfFD821cd4Eab20FBb86EEc6cD22D5D237C87 \"getLastReceivedMessageDetails()\" --rpc-url ethereumSepolia\n```\n\n---\n# Key Addresses\n\n**`BasicTokenSender.sol`**\n[0x0d0debEFCaC433885a51B32c359Cc971522F29cD](https://sepolia.explorer.mode.network/address/0x0d0debEFCaC433885a51B32c359Cc971522F29cD)\n\n**`BasicMessageSender.sol`**\n[0x0cd2E31eb378110DDD62778E136ba664A624b1CA](https://sepolia.explorer.mode.network/address/0x0cd2E31eb378110DDD62778E136ba664A624b1CA)\n\n**`BasicMessageReceiver.sol`**\n[0x3161Ba019494a04b73B28193E43dC9d5733465f4](https://sepolia.etherscan.io/address/0x3161Ba019494a04b73B28193E43dC9d5733465f4)\n\n**`ProgrammableTokenTransfers.sol`**\n- **Source [919]**: [0xF8b6eB96f2af79515fCce984c3e4fc8392e59645](https://sepolia.explorer.mode.network/address/0xF8b6eB96f2af79515fCce984c3e4fc8392e59645)\n\n- **Destination [1]**: [0x3fcCfFD821cd4Eab20FBb86EEc6cD22D5D237C87](https://sepolia.etherscan.io/address/0x3fcCfFD821cd4Eab20FBb86EEc6cD22D5D237C87)\n\n**DESTINATION_LINK_ADDRESS**: 0x779877A7B0D9E8603169DdbD7836e478b4624789\n\n**SOURCE_LINK_ADDRESS**: \n0x925a4bfE64AE2bFAC8a02b35F78e60C29743755d\n\n**BENEFICIARY_ADDRESS**:\n0x7D5498EE4d080396408Bd727A03Cff8C12d9d713\n\n**SOURCE_BNM_ADDRESS**:\n0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5\n\n**DESTINATION_BNM_ADDRESS**:\n0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05\n\n---\n# Resources\n\n- Check the [Official Chainlink Documentation](https://docs.chain.link/ccip).\n- [Comprehensive CCIP Flowchart](https://docs.chain.link/images/ccip/manual-execution.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fccip-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunsdev%2Fccip-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fccip-mode/lists"}