Skip to content

Commit 9fd1a69

Browse files
open source contracts
0 parents  commit 9fd1a69

File tree

173 files changed

+25178
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+25178
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_size = 2
11+
indent_style = space
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
[*.sol]
16+
indent_size = 4
17+
18+
[*.tree]
19+
indent_size = 1

.gas-snapshot

Lines changed: 486 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
env:
4+
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }}
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
ci:
14+
runs-on:
15+
labels: ubuntu-latest-large
16+
strategy:
17+
matrix:
18+
include:
19+
- job_name: lint
20+
command: bun run lint
21+
summary: "## Lint result"
22+
- job_name: build
23+
command: forge build
24+
summary: "## Build result"
25+
- job_name: coverage
26+
command: forge coverage --fuzz-runs 256 --report lcov --report-file ./test-forge-cover.txt
27+
summary: "## Coverage result"
28+
name: ${{ matrix.job_name }}
29+
steps:
30+
- name: Check out the repo
31+
uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
- name: Install Foundry
36+
uses: foundry-rs/foundry-toolchain@v1
37+
38+
- name: Install Bun
39+
uses: oven-sh/setup-bun@v1
40+
41+
- name: Install the Node.js dependencies
42+
run: bun install
43+
44+
- name: Execute Job Command
45+
run: ${{ matrix.command }}
46+
47+
- name: Add Job Summary
48+
run: |
49+
echo ${{ matrix.summary }} >> $GITHUB_STEP_SUMMARY
50+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
51+
52+
- if: ${{ matrix.job_name == 'coverage' }}
53+
name: Upload coverage reports to Codecov
54+
uses: codecov/codecov-action@v2
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
files: ./test-forge-cover.txt
58+
59+
slither:
60+
runs-on:
61+
labels: ubuntu-latest-large
62+
steps:
63+
- name: Check out the repo
64+
uses: actions/checkout@v4
65+
with:
66+
submodules: recursive
67+
68+
- name: Run Slither Analysis
69+
uses: crytic/[email protected]
70+
with:
71+
fail-on: none
72+
73+
- name: Slither Summary
74+
run: |
75+
echo "## Slither result" >> $GITHUB_STEP_SUMMARY
76+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

.github/workflows/tests-merge.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tests-Merge
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on:
11+
labels: ubuntu-latest-large
12+
timeout-minutes: 30
13+
steps:
14+
- name: Check out the repo
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
19+
- name: Install Foundry
20+
uses: foundry-rs/foundry-toolchain@v1
21+
22+
- name: Install Bun
23+
uses: oven-sh/setup-bun@v1
24+
25+
- name: Install the Node.js dependencies
26+
run: bun install
27+
28+
- name: Generate a fuzz seed that changes weekly to avoid burning through RPC allowance
29+
run: echo "FOUNDRY_FUZZ_SEED=$(echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800)))" >> $GITHUB_ENV
30+
31+
- name: Run tests
32+
run: forge test
33+
env:
34+
FOUNDRY_PROFILE: ci

.github/workflows/tests-pr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests-PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
runs-on:
9+
labels: ubuntu-latest-large
10+
timeout-minutes: 30
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
- name: Install Foundry
18+
uses: foundry-rs/foundry-toolchain@v1
19+
20+
- name: Install Bun
21+
uses: oven-sh/setup-bun@v1
22+
23+
- name: Install the Node.js dependencies
24+
run: bun install
25+
26+
- name: Generate a fuzz seed that changes weekly to avoid burning through RPC allowance
27+
run: echo "FOUNDRY_FUZZ_SEED=$(echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800)))" >> $GITHUB_ENV
28+
29+
- name: Run tests
30+
run: forge test
31+

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# directories
2+
.venv
3+
__pycache__
4+
cache
5+
coverage
6+
node_modules
7+
out
8+
9+
# files
10+
*.env*
11+
**/.envrc
12+
*.log
13+
.DS_Store
14+
.pnp.*
15+
lcov.info
16+
package-lock.json
17+
pnpm-lock.yaml
18+
yarn.lock
19+
*-cover.txt
20+
bun.lockb
21+
22+
# broadcasts
23+
!broadcast
24+
broadcast/*
25+
broadcast/*/31337/
26+
27+
# IDE
28+
.idea
29+
.vscode

.gitmodules

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std.git
4+
[submodule "lib/solady"]
5+
path = lib/solady
6+
url = https://github.com/Vectorized/solady
7+
[submodule "lib/transient-goodies"] # using this fork to support multicall with reverts
8+
path = lib/transient-goodies
9+
url = https://github.com/berachain/transient-goodies.git
10+
branch = try-aggregate
11+
[submodule "lib/openzeppelin-foundry-upgrades"]
12+
path = lib/openzeppelin-foundry-upgrades
13+
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades

.gitpod.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
image: "gitpod/workspace-bun"
2+
3+
tasks:
4+
- name: "Install dependencies"
5+
before: |
6+
curl -L https://foundry.paradigm.xyz | bash
7+
source ~/.bashrc
8+
foundryup
9+
init: "bun install"
10+
11+
vscode:
12+
extensions:
13+
- "esbenp.prettier-vscode"
14+
- "NomicFoundation.hardhat-solidity"

.prettierignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# directories
2+
broadcast
3+
cache
4+
coverage
5+
node_modules
6+
out
7+
src/bex/
8+
lib/
9+
audits
10+
11+
# files
12+
*.env
13+
*.log
14+
.DS_Store
15+
.pnp.*
16+
bun.lockb
17+
lcov.info
18+
package-lock.json
19+
pnpm-lock.yaml
20+
yarn.lock
21+
*_proof.json

.prettierrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bracketSpacing: true
2+
printWidth: 120
3+
proseWrap: "always"
4+
singleQuote: false
5+
tabWidth: 2
6+
trailingComma: "all"
7+
useTabs: false

0 commit comments

Comments
 (0)