Skip to content

Commit 5d67bce

Browse files
authored
CCIP CLA Rate Limits example (#66)
* chore: forge init * forge install: forge-std v1.8.2 * feat: Add ccip-cla-rate-limits example via single commit
1 parent 7fbe440 commit 5d67bce

18 files changed

+6278
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@
3737
[submodule "ccip/token-transfer-using-arbitrary-messaging/lib/openzeppelin-contracts"]
3838
path = ccip/token-transfer-using-arbitrary-messaging/lib/openzeppelin-contracts
3939
url = https://github.com/OpenZeppelin/openzeppelin-contracts
40+
[submodule "ccip/ccip-cla-rate-limits/lib/forge-std"]
41+
path = ccip/ccip-cla-rate-limits/lib/forge-std
42+
url = https://github.com/foundry-rs/forge-std
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: test
2+
3+
on: workflow_dispatch
4+
5+
env:
6+
FOUNDRY_PROFILE: ci
7+
8+
jobs:
9+
check:
10+
strategy:
11+
fail-fast: true
12+
13+
name: Foundry project
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install Foundry
21+
uses: foundry-rs/foundry-toolchain@v1
22+
with:
23+
version: nightly
24+
25+
- name: Run Forge build
26+
run: |
27+
forge --version
28+
forge build --sizes
29+
id: build
30+
31+
- name: Run Forge tests
32+
run: |
33+
forge test -vvv
34+
id: test

ccip/ccip-cla-rate-limits/.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Compiler files
2+
cache/
3+
out/
4+
5+
# Ignores development broadcast logs
6+
!/broadcast
7+
/broadcast/*/31337/
8+
/broadcast/**/dry-run/
9+
10+
# Docs
11+
docs/
12+
13+
# Dotenv file
14+
.env
15+
16+
# Node modules
17+
node_modules/

ccip/ccip-cla-rate-limits/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SmartContract
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

ccip/ccip-cla-rate-limits/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## CCIP + CLA Rate Limits
2+
3+
Showcase example that combines Chainlink CCIP and Chainlink Automation to deliver exchange rates of StaFi Staked ETH (rETH).
4+
5+
## Usage
6+
7+
Create an `.env` file and provide the following variables:
8+
9+
```
10+
ETHEREUM_MAINNET_RPC_URL = https://eth-mainnet.g.alchemy.com/v2/<KEY>
11+
POLYGON_MAINNET_RPC_URL = https://polygon-mainnet.g.alchemy.com/v2/<KEY>
12+
```
13+
14+
### Build
15+
16+
```shell
17+
$ forge build
18+
```
19+
20+
### Test
21+
22+
```shell
23+
$ forge test
24+
```
25+
26+
### Format
27+
28+
```shell
29+
$ forge fmt
30+
```
31+
32+
<br />
33+
34+
> _This tutorial represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink’s systems, products, and services to integrate them into your own. This template is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the code in this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code._
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[profile.default]
2+
src = "src"
3+
out = "out"
4+
libs = ["lib"]
5+
solc = '0.8.24'
6+
evm_version = 'paris'
7+
remappings = [
8+
'@chainlink/contracts=node_modules/@chainlink/contracts',
9+
'@chainlink/contracts-ccip=node_modules/@chainlink/contracts-ccip',
10+
'@chainlink/local=node_modules/@chainlink/local',
11+
'@openzeppelin/contracts=node_modules/@openzeppelin/contracts',
12+
]
13+
14+
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
Submodule forge-std added at 978ac6f

0 commit comments

Comments
 (0)