{"id":22416282,"url":"https://github.com/bunsdev/ccip-avalanche","last_synced_at":"2025-03-27T04:19:46.207Z","repository":{"id":258475793,"uuid":"869869709","full_name":"BunsDev/ccip-avalanche","owner":"BunsDev","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-21T22:19:13.000Z","size":678,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T09:29:28.258Z","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}},"created_at":"2024-10-09T03:20:44.000Z","updated_at":"2024-11-21T22:19:16.000Z","dependencies_parsed_at":"2024-10-19T07:08:29.107Z","dependency_job_id":"f8859a2b-b020-4d48-817a-41f5f92dc5ea","html_url":"https://github.com/BunsDev/ccip-avalanche","commit_stats":null,"previous_names":["bunsdev/ccip-avalanche"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-avalanche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-avalanche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-avalanche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fccip-avalanche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BunsDev","download_url":"https://codeload.github.com/BunsDev/ccip-avalanche/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779485,"owners_count":20670688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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.787Z","updated_at":"2025-03-27T04:19:46.187Z","avatar_url":"https://github.com/BunsDev.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccip-avalanche\n\nDemonstrating how to use Chainlink Cross-Chain Interoperobility Protocol (CCIP) and Avalanche Interchain Messaging (ICM) to send a message from Ethereum Sepolia to Avalanche Fuji (_via CCIP_), then forwarding that message from Avalanche Fuji to Dispatch L1 (_via ICM_).\n\n# Getting Started\n\nIn the next section you can see how to send data from one chain to another. But before that, you need to set up some environment variables, install dependencies, setup environment variables, and compile contracts.\n\n## 1. Install Dependencies\n\n```bash\nyarn \u0026\u0026 make\n```\n\n## 2. Setup Environment Variables\n\nRun the command below, then update the .env `PRIVATE_KEY` and `ETHERSCAN-API-KEY` variables.\n\n```bash\ncp .env.example .env \u0026\u0026 source .env\n```\n\n## 3. Create Wallet\n\nTo create a new wallet that is stored in a keystore, issue the following command, which will prompt you to secure the private key with a password.\n\n```bash\ncast wallet import --private-key $PRIVATE_KEY -k keystore $ACCOUNT_NAME \n```\n\nFor ease use of the keystore we already configured a environment variable called `KEYSTORE` pointing to the `keystore` file in the working directory.\n\nYou can use the wallet stored in the keystore by adding the `--keystore` flag instead of the `--private-key` flag.\n\n```bash\ncast wallet address --keystore $KEYSTORE\n```\n\n## 4. Prepare Smart Contracts\n\n### Smart Contract Design\n\n![messaging-process](./img/messaging-process.png)\n\n### A. Deploy Contracts\n\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```sh\nyarn deploy:sender\n```\n\n\u003e [`MessageSender.sol`](./src/MessageSender.sol)\n\n```sh\nyarn deploy:broker\n```\n\n\u003e [`MessageBroker.sol`](./src/MessageBroker.sol)\n\n```sh\nyarn deploy:receiver\n```\n\n\u003e [`MessageReceiver.sol`](./src/MessageReceiver.sol)\n\n### B. Fund Sender Contract\n\nAfter acquiring testnet tokens, you will proceed with funding your [Message Sender Contract](./src/MessageSender.sol) with some native tokens (ETH).\n\n```sh\ncast send $MESSAGE_SENDER_ADDRESS --rpc-url ethereumSepolia --value 0.05ether --keystore keystore\n```\n\n# Messaging Cross-Chain\n\n\u003e *Before proceeding, please ensure you have completed the steps outlined in the [Setup Messaging Scenario](#setup-messaging-scenario) section above.*\n\n## 1. Ethereum Sepolia \u0026rarr; Avalanche Fuji\n\n### Sending Message (Sepolia \u0026rarr; Fuji)\n\nRun the following to send a message to Fuji from Sepolia via the `SendMessage` functionality coded in [Send.s.sol](./script/Send.s.sol):\n\n```bash\nforge script ./script/Send.s.sol:SendMessage -vvv --broadcast --rpc-url ethereumSepolia --sig \\\"run(string)\\\" -- \"$CUSTOM_MESSAGE\"\n```\n\n## 2. Avalanche Fuji \u0026rarr; Dispatch Testnet\n\n### Brokering Message (Fuji \u0026rarr; Dispatch)\n\nOnce the message is finalized on the broker chain (*Fuji*), you may see the details about the latest message via the `BrokerMessage` functionality coded in [Broker.s.sol](./script/Broker.s.sol). After you have confirmed the latest message you received looks good, you may proceed with running the following script to broker the message to Dispatch:\n\n```bash\ncast send $MESSAGE_BROKER_ADDRESS --rpc-url avalancheFuji --keystore keystore \"brokerMessage(address)\" $MESSAGE_RECEIVER_ADDRESS\n```\n\n## 3. Dispatch Testnet\n\n### Receiving Message (Dispatch)\n\nAfter running the script above to broker the message from Fuji to Dispatch, you may confirm the message was received by running the following script:\n\n```bash\nforge script ./script/Receive.s.sol:ReceiveMessage -vvv --broadcast --rpc-url dispatchTestnet\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fccip-avalanche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunsdev%2Fccip-avalanche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fccip-avalanche/lists"}