-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from bob-collective/feat/relayer
Add relayer binary
- Loading branch information
Showing
101 changed files
with
91,694 additions
and
58 deletions.
There are no files selected for viewing
74 changes: 36 additions & 38 deletions
74
.github/workflows/test.yml → .github/workflows/contracts.yml
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 |
---|---|---|
@@ -1,64 +1,62 @@ | ||
name: test | ||
name: Contracts | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
contracts: | ||
name: Contracts | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
defaults: | ||
run: | ||
working-directory: contracts | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install foundry | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: v0.3.0 | ||
- name: Run forge fmt | ||
run: | | ||
forge --version | ||
forge fmt --check | ||
id: fmt | ||
- name: Run forge build | ||
run: | | ||
forge build --sizes --deny-warnings | ||
id: build | ||
- name: Install deps | ||
run: forge install | ||
- name: Run forge tests | ||
# Currently forked tests are disabled to increase reliability of CI builds | ||
run: | | ||
forge test --no-match-contract Forked -vvv --deny-warnings | ||
id: test | ||
- name: Run forge docs | ||
run: | | ||
forge doc --out docs/docs/contracts | ||
python3 docs/scripts/forge_doc_reformat.py | ||
- name: Commit forge docs | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "chore: Generate Foundry docs" | ||
file_pattern: "./docs/" | ||
sdk: | ||
name: SDK | ||
bindings: | ||
name: Bindings | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
defaults: | ||
run: | ||
working-directory: ./sdk | ||
working-directory: contracts | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
registry-url: "https://registry.npmjs.org" | ||
always-auth: true | ||
- run: npm ci | ||
- run: npx prettier --check {examples,src,test} | ||
- run: npm run lint | ||
- name: Run tests | ||
run: npm test | ||
submodules: recursive | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
- name: Pull library deps | ||
run: forge install | ||
- name: Check fmt | ||
run: forge fmt --check | ||
- name: Build contracts before checking bindings are correct | ||
run: forge build --sizes | ||
- name: Versions | ||
run: | | ||
forge --version | ||
git submodule status | ||
- name: Run forge docs | ||
run: | | ||
forge doc --out ../docs/docs/contracts | ||
python3 ../docs/scripts/forge_doc_reformat.py | ||
- name: Commit forge docs | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "chore: Generate Foundry docs" | ||
file_pattern: "./docs/" |
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,27 @@ | ||
name: SDK | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./sdk | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
registry-url: "https://registry.npmjs.org" | ||
always-auth: true | ||
- run: npm ci | ||
- run: npx prettier --check {examples,src,test} | ||
- run: npm run lint | ||
- name: Run tests | ||
run: npm 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 |
---|---|---|
|
@@ -41,3 +41,9 @@ node_modules/* | |
|
||
# generated docs | ||
/docs/docs/api/* | ||
|
||
# Rust stuff | ||
/target | ||
out/ | ||
cache/ | ||
Cargo.lock |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
path = contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
path = contracts/lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/bitcoin-spv"] | ||
path = lib/bitcoin-spv | ||
path = contracts/lib/bitcoin-spv | ||
url = https://github.com/bob-collective/bitcoin-spv | ||
[submodule "lib/account-abstraction"] | ||
path = lib/account-abstraction | ||
path = contracts/lib/account-abstraction | ||
url = https://github.com/eth-infinitism/account-abstraction | ||
[submodule "lib/gsn"] | ||
path = lib/gsn | ||
path = contracts/lib/gsn | ||
url = https://github.com/opengsn/gsn |
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,5 @@ | ||
[workspace] | ||
members = ["relayer", "crates/bindings"] | ||
|
||
[workspace.dependencies] | ||
bindings = { path = "crates/bindings" } |
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,54 @@ | ||
#!/usr/bin/make -f | ||
|
||
# Default target is build | ||
default: build | ||
|
||
# Define variables | ||
CARGO=cargo | ||
CRATES_FOLDER=crates | ||
CONTRACTS_PATH=./contracts | ||
BINDINGS_FOLDER=bindings | ||
BINDINGS_CRATES_FOLDER=$(CRATES_FOLDER)/$(BINDINGS_FOLDER) | ||
BINDINGS_OUT_PATH=$(CONTRACTS_PATH)/out/$(BINDINGS_FOLDER) | ||
|
||
# Target for generating bindings | ||
bindings: | ||
rm -rf $(BINDINGS_CRATES_FOLDER) | ||
rm -rf $(BINDINGS_OUT_PATH) | ||
|
||
# Generate new bindings | ||
@forge bind --root $(CONTRACTS_PATH) --crate-name $(BINDINGS_FOLDER) --select FullRelay | ||
|
||
# Move bindings to the correct location | ||
@mv -f $(BINDINGS_OUT_PATH) $(CRATES_FOLDER) | ||
|
||
# Target for building the project | ||
build: bindings | ||
@$(CARGO) build | ||
|
||
# Target for building the project in release mode | ||
build-release: bindings | ||
@$(CARGO) build --release | ||
|
||
# Target for cleaning the project | ||
clean: | ||
@forge clean --root $(CONTRACTS_PATH) | ||
@$(CARGO) clean | ||
|
||
# Target for formatting the code | ||
fmt: | ||
@forge fmt --check --root $(CONTRACTS_PATH) | ||
@$(CARGO) fmt | ||
|
||
# Target for running tests | ||
test: | ||
@forge test --root $(CONTRACTS_PATH) | ||
@$(CARGO) test | ||
|
||
# Target for installing forge dependencies | ||
setup: | ||
@forge install --root $(CONTRACTS_PATH) | ||
|
||
|
||
# Declare phony targets | ||
.PHONY: build build-release clean fmt bindings |
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
Submodule bitcoin-spv
updated
from 000000 to 98264c
Submodule forge-std
updated
from 000000 to f73c73
Submodule gsn
updated
from 000000 to da4222
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
[package] | ||
name = "bindings" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
alloy = { git = "https://github.com/alloy-rs/alloy", features = ["sol-types", "contract"] } |
Oops, something went wrong.