-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b60f366
Showing
26 changed files
with
5,066 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
env: | ||
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} | ||
ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }} | ||
run: | | ||
forge test -vvv | ||
id: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/openzeppelin/openzeppelin-contracts | ||
[submodule "lib/openzeppelin-contracts-upgradeable"] | ||
path = lib/openzeppelin-contracts-upgradeable | ||
url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
## CCIP GYD Bridge | ||
|
||
The code is based on the [zkEVM DAI bridge](https://github.com/pyk/zkevm-dai) | ||
|
||
### Introduction | ||
|
||
Bridged GYD implementation consists of two smart contracts: | ||
|
||
1. **GydL1Escrow**: This contract is deployed on Ethereum mainnet. | ||
2. **L2Gyd**: This contract is deployed on L2s. | ||
|
||
The user can do the following: | ||
|
||
1. Bridge GYD from Ethereum mainnet to an L2 via `GydL1Escrow` contract. | ||
2. Bridge GYD from an L2 to Ethereum mainnet via `L2Gyd` contract. | ||
|
||
## Get started | ||
|
||
### Requirements | ||
|
||
This repository uses foundry. You can install foundry via | ||
[foundryup](https://book.getfoundry.sh/getting-started/installation). | ||
|
||
### Setup | ||
|
||
Clone the repository: | ||
|
||
```sh | ||
git clone git@github.com:gyrostable/ccip-gyd.git | ||
cd ccip-gyd/ | ||
``` | ||
|
||
Install the dependencies: | ||
|
||
```sh | ||
forge install | ||
``` | ||
|
||
### Tests | ||
|
||
Create `.env` with the following contents: | ||
|
||
``` | ||
ETH_RPC_URL="" | ||
ARBITRUM_RPC_URL="https://arb1.arbitrum.io/rpc" | ||
ETHERSCAN_API_KEY="" | ||
``` | ||
|
||
Use the following command to run the test: | ||
|
||
```sh | ||
forge test | ||
``` | ||
|
||
> **Note** | ||
> You can set `ETHERSCAN_API_KEY` to helps you debug the call trace. | ||
## Deployment | ||
|
||
Deployment scripts are located in the [`script`](./script/) directory. | ||
|
||
## Contract addresses | ||
|
||
| Smart contract | Network | Address | | ||
| -------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------ | | ||
| GYD | Mainnet | [0xe07F9D810a48ab5c3c914BA3cA53AF14E4491e8A](https://etherscan.io/address/0xe07F9D810a48ab5c3c914BA3cA53AF14E4491e8A) | | ||
| CCIP router | Mainnet | [0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D](https://etherscan.io/address/0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D) | | ||
| | Arbitrum | [0x141fa059441E0ca23ce184B6A78bafD2A517DdE8](https://arbiscan.io/address/0x141fa059441E0ca23ce184B6A78bafD2A517DdE8) | | ||
| GydL1CCIPEscrow | Mainnet | [0xa1886c8d748DeB3774225593a70c79454B1DA8a6](https://etherscan.io/address/0xa1886c8d748DeB3774225593a70c79454B1DA8a6) | | ||
| L2Gyd | Arbitrum | [0xCA5d8F8a8d49439357d3CF46Ca2e720702F132b8](https://arbiscan.io/address/0xCA5d8F8a8d49439357d3CF46Ca2e720702F132b8) | | ||
|
173 changes: 173 additions & 0 deletions
173
broadcast/DeployGydL1CCIPEscrow.s.sol/1/run-1715381332.json
Large diffs are not rendered by default.
Oops, something went wrong.
173 changes: 173 additions & 0 deletions
173
broadcast/DeployGydL1CCIPEscrow.s.sol/1/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
161 changes: 161 additions & 0 deletions
161
broadcast/DeployL2GydArbitrum.s.sol/42161/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[profile.default] | ||
solc = "0.8.24" | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
evm_version = "shanghai" | ||
remappings = [ | ||
"src/=src/", | ||
"oz/=lib/openzeppelin-contracts/contracts/", | ||
"upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", | ||
"ccip/=node_modules/@chainlink/contracts-ccip/src/v0.8/ccip/", | ||
] | ||
|
||
[fmt] | ||
line_length = 79 | ||
tab_width = 2 | ||
number_underscore = "thousands" | ||
wrap_comments = true |
Submodule openzeppelin-contracts
added at
dbb610
Submodule openzeppelin-contracts-upgradeable
added at
723f8c
Oops, something went wrong.