Skip to content

Commit

Permalink
chore: cleanup script for generating bindings
Browse files Browse the repository at this point in the history
update readme

Add setup step to readme
  • Loading branch information
seanmcgary committed May 3, 2024
1 parent dbfa121 commit 2da987a
Show file tree
Hide file tree
Showing 124 changed files with 61,165 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/check-compilation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on: [push]

jobs:
check-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and validate
if: github.event_name == 'push'
run: |
sudo apt-get update
sudo apt-get install -y make curl git software-properties-common jq
sudo add-apt-repository -y ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install -y golang-1.22
sudo update-alternatives --install /usr/local/bin/go go /usr/lib/go-1.22/bin/go 1
mkdir ~/.go
export GOPATH=~/.go
export PATH=$PATH:~/.go/bin
go install github.com/ethereum/go-ethereum/cmd/[email protected]
curl -L https://foundry.paradigm.xyz | bash
export PATH=$PATH:/home/runner/.config/.foundry/bin
source ~/.bashrc
foundryup
make bindings
if [ ! -z "$(git status --porcelain)" ]; then git diff; git status; exit 1; fi
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ test.sh

# Surya outputs
InheritanceGraph.png
surya_report.md
surya_report.md

.idea
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

.PHONY: install-hooks
install-hooks:
cp scripts/pre-commit.sh .git/hooks/pre-commit

.PHONY: deps
deps: install-hooks
brew install libusb
go install github.com/ethereum/go-ethereum/cmd/abigen@latest
curl -L https://foundry.paradigm.xyz | bash
foundryup

.PHONY: compile
compile:
forge b

.PHONY: bindings
bindings: compile
./scripts/compile-bindings.sh
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ The main branches we use are:

## Documentation

### Setup

To set up this repo for the first time, run:

```bash
make deps
```

This will:
* Install the pre-commit hook
* Install foundry and its tools
* Install abigen

### Basics

To get a basic understanding of EigenLayer, check out [You Could've Invented EigenLayer](https://www.blog.eigenlayer.xyz/ycie/). Note that some of the document's content describes features that do not exist yet (like the Slasher). To understand more about how restakers and operators interact with EigenLayer, check out these guides:
Expand All @@ -41,6 +54,8 @@ foundryup
forge build
forge test
make bindings
```

### Running Fork Tests
Expand Down Expand Up @@ -83,6 +98,12 @@ surya inheritance ./src/contracts/**/*.sol | dot -Tpng > InheritanceGraph.png
surya mdreport surya_report.md ./src/contracts/**/*.sol
```

### Generate Go bindings

```bash
make bindings
```

## Deployments

### Current Mainnet Deployment
Expand Down
34 changes: 34 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module github.com/Layr-Labs/eigenlayer-contracts

go 1.22.2

require github.com/ethereum/go-ethereum v1.14.0

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/tools v0.20.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
192 changes: 192 additions & 0 deletions go.sum

Large diffs are not rendered by default.

1,793 changes: 1,793 additions & 0 deletions pkg/bindings/AVSDirectory/binding.go

Large diffs are not rendered by default.

Loading

0 comments on commit 2da987a

Please sign in to comment.