Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skeletordapps/chainlink-ccip-poc
Chainlink CCIP using dual side send/income messages in forked test networks (OP/Base)
https://github.com/skeletordapps/chainlink-ccip-poc
chainlink-ccip crosschain foundry solidity test
Last synced: about 2 months ago
JSON representation
Chainlink CCIP using dual side send/income messages in forked test networks (OP/Base)
- Host: GitHub
- URL: https://github.com/skeletordapps/chainlink-ccip-poc
- Owner: skeletordapps
- Created: 2024-09-10T01:17:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T16:37:33.000Z (4 months ago)
- Last Synced: 2024-10-15T20:41:05.847Z (3 months ago)
- Topics: chainlink-ccip, crosschain, foundry, solidity, test
- Language: Solidity
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Chainlink CCIP - Proof of Concept
### Description:
This project demonstrates cross-chain message passing using Chainlink CCIP between the Base Chain (Sepolia testnet) and Optimism (Sepolia testnet). It allows sending a wallet address from Optimism to Base and retrieving the associated tier information.### Prerequisites:
- Node.js (https://nodejs.org/)
- Foundry (https://github.com/foundry-rs/foundry)### Clone the repository:
```shell
$ git clone [email protected]:skeletordapps/chainlink-ccip-poc.git
```### Install Foundry dependencies:
```shell
$ foundryup && forge install
```
### Configuration:
Create a ```.env``` file in the project root directory with the following environment variables:
```shell
BASE_SEPOLIA_RPC_URL="https://sepolia.base.org"
OPTIMISM_SEPOLIA_RPC_URL="https://sepolia.optimism.io"BASE_SEPOLIA_CHAIN_SELECTOR=10344971235874465080
OPTIMISM_SEPOLIA_CHAIN_SELECTOR=5224473277236331295BASE_SEPOLIA_ROUTER_ADDRESS=0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93
OPTIMISM_SEPOLIA_ROUTER_ADDRESS=0x114A20A10b43D4115e5aeef7345a1A71d2a60C57BASE_SEPOLIA_LINK_ADDRESS=0xE4aB69C077896252FAFBD49EFD26B5D171A32410
OPTIMISM_SEPOLIA_LINK_ADDRESS=0xE4aB69C077896252FAFBD49EFD26B5D171A32410WALLET_A=0x
WALLET_B=0x
WALLET_C=0x
```**Important:** Replace the placeholder wallet addresses ```(WALLET_A, WALLET_B, WALLET_C)``` with your actual testnet wallet addresses if you intend to use them in the tests.
### Test
```shell
$ forge test && forge coverage
```### Coverage
Ran 1 test suite in 21.46s (21.46s CPU time): 3 tests passed, 0 failed, 0 skipped (3 total tests)
| File | % Lines | % Statements | % Branches | % Funcs |
|----------------|-----------------|-----------------|---------------|----------------|
| src/Answer.sol | 100.00% (22/22) | 100.00% (28/28) | 50.00% (1/2) | 83.33% (5/6) |
| src/Ask.sol | 100.00% (15/15) | 100.00% (20/20) | 50.00% (1/2) | 100.00% (5/5) |
| src/Points.sol | 100.00% (1/1) | 100.00% (1/1) | 100.00% (0/0) | 100.00% (1/1) |
| src/Tiers.sol | 60.00% (9/15) | 54.55% (12/22) | 100.00% (1/1) | 75.00% (3/4) |
| Total | 88.68% (47/53) | 85.92% (61/71) | 60.00% (3/5) | 87.50% (14/16) |### Contracts
```Tier.sol```
Defines tiers on the Base Chain, each with a name, minimum points, and maximum points.```Points.sol```
Manages a list of wallets and their corresponding points on the Base Chain. This contract is used to determine the tier associated with a wallet's points.```Ask.sol```
Deployed on Optimism, this contract facilitates sending a wallet address to the Base Chain to retrieve tier information.```Answer.sol```
Receives requests from other chains (in this case, Optimism) to check the tier of a specified wallet address on the Base Chain.### Additional Notes:
- Remember to replace the placeholder wallet addresses in the ```.env``` file with your own ```testnet addresses``` if you plan to use them in the tests.
- Ensure that you have sufficient testnet ```funds``` in your wallets to cover gas costs during testing.
- This poc only aims to test crosschain messages sending a question and obtaining an answer, that's why we don't have a full coverage for all aspects.