Skip to content

Commit

Permalink
added contracts (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant authored Jun 20, 2023
1 parent 7f1da84 commit 7e99f8e
Show file tree
Hide file tree
Showing 20 changed files with 790 additions and 114 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test-contracts

on:
push:
pull_request:
types: [opened, reopened]

env:
FOUNDRY_PROFILE: ci

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
check:
name: Foundry Project
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install forge dependencies
run: forge install
working-directory: ./contracts

- name: Run tests
run: forge test -vvv
working-directory: ./contracts

- name: Run snapshot
run: forge snapshot
working-directory: ./contracts
12 changes: 1 addition & 11 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,9 @@ jobs:
- name: Checkout EigenDA
uses: actions/checkout@v3

- name: Clone EL contracts
uses: actions/checkout@v2
with:
repository: Layr-Labs/eigenlayer-contracts
branch: master
path: contracts/eigenlayer-contracts
ssh-key: ${{ secrets.EIGENLAYR_DEPLOY_KEY }}
submodules: recursive
persist-credentials: true

- name: Update Submodule Commits
run: |
git submodule update --init --recursive contracts/eigenlayer-contracts
git submodule update --init --recursive
- name: Install geth
run: |
Expand Down
24 changes: 12 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "contracts/eigenlayer-contracts"]
path = contracts/eigenlayer-contracts
url = https://github.com/Layr-Labs/eigenlayer-contracts.git
[submodule "contracts/eigenda-contracts/lib/forge-std"]
path = contracts/eigenda-contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std.git
[submodule "contracts/eigenda-contracts/lib/openzeppelin-contracts"]
path = contracts/eigenda-contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts.git
[submodule "contracts/eigenda-contracts/lib/openzeppelin-contracts-upgradeable"]
path = contracts/eigenda-contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/eigenlayer-contracts"]
path = contracts/lib/eigenlayer-contracts
url = https://github.com/Layr-Labs/eigenlayer-contracts
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/lib/openzeppelin-contracts-upgradeable"]
path = contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
14 changes: 14 additions & 0 deletions contracts/.gitignore
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
Empty file removed contracts/.keep
Empty file.
87 changes: 0 additions & 87 deletions contracts/compile.sh

This file was deleted.

1 change: 0 additions & 1 deletion contracts/eigenda-contracts/lib/forge-std
Submodule forge-std deleted from b00f50
1 change: 0 additions & 1 deletion contracts/eigenda-contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts deleted from 253bfa
Submodule openzeppelin-contracts-upgradeable deleted from 2f3e78
1 change: 0 additions & 1 deletion contracts/eigenlayer-contracts
Submodule eigenlayer-contracts deleted from fa80db
25 changes: 25 additions & 0 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[profile.default]
src = 'src'
out = 'out'
libs = ['lib']
fs_permissions = [{ access = "read-write", path = "./"}]

remappings = [
"@eigenlayer/=lib/eigenlayer-contracts/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@openzeppelin-upgrades/=lib/openzeppelin-contracts-upgradeable/",
"forge-std/=lib/forge-std/src/"
]

gas_reports = ["*"]

# A list of ignored solc error codes

# Enables or disables the optimizer
optimizer = true
# The number of optimizer runs
optimizer_runs = 200
# Whether or not to use the Yul intermediate representation compilation pipeline
via_ir = false
# Override the Solidity version (this overrides `auto_detect_solc`)
solc_version = '0.8.12'
1 change: 1 addition & 0 deletions contracts/lib/eigenlayer-contracts
Submodule eigenlayer-contracts added at fbbe6e
1 change: 1 addition & 0 deletions contracts/lib/forge-std
Submodule forge-std added at e8a047
1 change: 1 addition & 0 deletions contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at e50c24
1 change: 1 addition & 0 deletions contracts/lib/openzeppelin-contracts-upgradeable
Loading

0 comments on commit 7e99f8e

Please sign in to comment.