Skip to content

Commit 6a7a0f2

Browse files
authored
Merge pull request #1 from robertleifke/robert/numo2
Adds robust testing and handling of the Numo invariant
2 parents 7f47080 + bdcb794 commit 6a7a0f2

Some content is hidden

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

60 files changed

+2336
-1618
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm
2+
3+
USER node
4+
5+
# Install Bun
6+
RUN curl -fsSL https://bun.sh/install | bash
7+
8+
# Install Foundry
9+
RUN curl -L https://foundry.paradigm.xyz | bash \
10+
&& /bin/bash -c "source ~/.bashrc && ~/.foundry/bin/foundryup"

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Foundry Template",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"NomicFoundation.hardhat-solidity",
10+
"esbenp.prettier-vscode",
11+
"PraneshASP.vscode-solidity-inspector",
12+
"tamasfe.even-better-toml"
13+
]
14+
}
15+
},
16+
"postCreateCommand": "bun install"
17+
}

.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

.env.example

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
PRIVATE_KEY=
2-
ETHERSCAN_API_KEY=
3-
BASE_SEPOLIA_RPC=
1+
export API_KEY_ALCHEMY="YOUR_API_KEY_ALCHEMY"
2+
export API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN"
3+
export API_KEY_INFURA="YOUR_API_KEY_INFURA"
4+
export MNEMONIC="YOUR_MNEMONIC"
5+
export FOUNDRY_PROFILE="default"

.gas-snapshot

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/scripts/rename.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Get input parameters
5+
GITHUB_REPOSITORY="$1"
6+
GITHUB_REPOSITORY_OWNER="$2"
7+
GITHUB_REPOSITORY_DESCRIPTION="$3"
8+
9+
# Extract repository name from full repository path
10+
REPOSITORY_NAME=$(basename "$GITHUB_REPOSITORY")
11+
12+
# Update package.json with new repository information
13+
if [ -f "package.json" ]; then
14+
# Use sed to update package.json fields
15+
sed -i.bak "s|\"name\": \".*\"|\"name\": \"$REPOSITORY_NAME\"|g" package.json
16+
sed -i.bak "s|\"description\": \".*\"|\"description\": \"$GITHUB_REPOSITORY_DESCRIPTION\"|g" package.json
17+
sed -i.bak "s|\"url\": \"git+https://github.com/.*/.*\\.git\"|\"url\": \"git+https://github.com/$GITHUB_REPOSITORY.git\"|g" package.json
18+
sed -i.bak "s|\"homepage\": \"https://github.com/.*/.*#readme\"|\"homepage\": \"https://github.com/$GITHUB_REPOSITORY#readme\"|g" package.json
19+
sed -i.bak "s|\"url\": \"https://github.com/.*/.*\\/issues\"|\"url\": \"https://github.com/$GITHUB_REPOSITORY/issues\"|g" package.json
20+
21+
# Remove backup file
22+
rm -f package.json.bak
23+
fi
24+
25+
# Update README.md if it exists
26+
if [ -f "README.md" ]; then
27+
sed -i.bak "1s/^# .*/# $REPOSITORY_NAME/" README.md
28+
rm -f README.md.bak
29+
fi
30+
31+
echo "Repository renamed to: $REPOSITORY_NAME"
32+
echo "Description: $GITHUB_REPOSITORY_DESCRIPTION"
33+
echo "Owner: $GITHUB_REPOSITORY_OWNER"

.github/workflows/ci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: "CI"
2+
3+
env:
4+
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }}
5+
FOUNDRY_PROFILE: "ci"
6+
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
push:
11+
branches:
12+
- "main"
13+
14+
jobs:
15+
lint:
16+
runs-on: "ubuntu-latest"
17+
steps:
18+
- name: "Check out the repo"
19+
uses: "actions/checkout@v4"
20+
21+
- name: "Install Foundry"
22+
uses: "foundry-rs/foundry-toolchain@v1"
23+
24+
- name: "Install Bun"
25+
uses: "oven-sh/setup-bun@v1"
26+
27+
- name: "Install the Node.js dependencies"
28+
run: "bun install"
29+
30+
- name: "Lint the code"
31+
run: "bun run lint"
32+
33+
- name: "Add lint summary"
34+
run: |
35+
echo "## Lint result" >> $GITHUB_STEP_SUMMARY
36+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
37+
38+
build:
39+
runs-on: "ubuntu-latest"
40+
steps:
41+
- name: "Check out the repo"
42+
uses: "actions/checkout@v4"
43+
44+
- name: "Install Foundry"
45+
uses: "foundry-rs/foundry-toolchain@v1"
46+
47+
- name: "Install Bun"
48+
uses: "oven-sh/setup-bun@v1"
49+
50+
- name: "Install the Node.js dependencies"
51+
run: "bun install"
52+
53+
- name: "Build the contracts and print their size"
54+
run: "forge build --sizes"
55+
56+
- name: "Add build summary"
57+
run: |
58+
echo "## Build result" >> $GITHUB_STEP_SUMMARY
59+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
60+
61+
test:
62+
needs: ["lint", "build"]
63+
runs-on: "ubuntu-latest"
64+
steps:
65+
- name: "Check out the repo"
66+
uses: "actions/checkout@v4"
67+
68+
- name: "Install Foundry"
69+
uses: "foundry-rs/foundry-toolchain@v1"
70+
71+
- name: "Install Bun"
72+
uses: "oven-sh/setup-bun@v1"
73+
74+
- name: "Install the Node.js dependencies"
75+
run: "bun install"
76+
77+
- name: "Show the Foundry config"
78+
run: "forge config"
79+
80+
- name: "Generate a fuzz seed that changes weekly to avoid burning through RPC allowance"
81+
run: >
82+
echo "FOUNDRY_FUZZ_SEED=$(
83+
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
84+
)" >> $GITHUB_ENV
85+
86+
- name: "Run the tests"
87+
run: "forge test"
88+
89+
- name: "Add test summary"
90+
run: |
91+
echo "## Tests result" >> $GITHUB_STEP_SUMMARY
92+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

.github/workflows/contracts.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/gas.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)