-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
7,635 additions
and
4 deletions.
There are no files selected for viewing
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,25 @@ | ||
<!-- | ||
Borrowed from foundry. | ||
Thank you for your Pull Request. Please provide a description above and review | ||
the requirements below. | ||
Bug fixes and new features should include tests. | ||
--> | ||
|
||
## Motivation | ||
|
||
<!-- | ||
Explain the context and why you're making that change. What is the problem | ||
you're trying to solve? In some cases there is not a problem and this can be | ||
thought of as being the motivation for your change. | ||
If your PR solves a particular issue, tag that issue. | ||
--> | ||
|
||
## Solution | ||
|
||
<!-- | ||
Summarize the solution and provide any necessary context needed to understand | ||
the code change. | ||
--> |
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,91 @@ | ||
name: ERC6900 RI Test CI | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
# Runs linter, tests, and inspection checker in parallel | ||
jobs: | ||
lint: | ||
name: Run Linters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- run: forge install | ||
|
||
- run: forge fmt --check | ||
|
||
- name: "Check out the repo" | ||
uses: "actions/checkout@v3" | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install Pnpm" | ||
uses: "pnpm/action-setup@v2" | ||
with: | ||
version: "8" | ||
|
||
- name: "Install Node.js" | ||
uses: "actions/setup-node@v3" | ||
with: | ||
cache: "pnpm" | ||
node-version: "lts/*" | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "pnpm install" | ||
|
||
- name: "Lint the contracts" | ||
run: "pnpm lint" | ||
|
||
test: | ||
name: Run Forge Tests | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
- name: Build project | ||
run: forge build | ||
|
||
- name: Run tests | ||
run: FOUNDRY_PROFILE=deep forge test -vvv | ||
|
||
test-lite: | ||
name: Run Forge Tests [lite build] | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
- name: Build project | ||
run: FOUNDRY_PROFILE=lite forge build | ||
|
||
- name: Run tests | ||
run: FOUNDRY_PROFILE=lite forge test -vvv |
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,4 @@ | ||
# Foundry build and cache directories | ||
out/ | ||
cache/ | ||
node_modules/ |
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,9 @@ | ||
[submodule "lib/account-abstraction"] | ||
path = lib/account-abstraction | ||
url = https://github.com/eth-infinitism/account-abstraction | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
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,17 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"immutable-vars-naming": ["error"], | ||
"no-unused-import": ["error"], | ||
"compiler-version": ["error", ">=0.8.19"], | ||
"func-visibility": ["error", { "ignoreConstructors": true }], | ||
"max-line-length": ["error", 120], | ||
"func-param-name-mixedcase": ["error"], | ||
"modifier-name-mixedcase": ["error"], | ||
"private-vars-leading-underscore": ["error"], | ||
"ordering": ["warn"], | ||
"no-inline-assembly": "off", | ||
"avoid-low-level-calls": "off", | ||
"no-complex-fallback": "off" | ||
} | ||
} |
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,17 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"func-name-mixedcase": "off", | ||
"immutable-vars-naming": ["error"], | ||
"no-unused-import": ["error"], | ||
"compiler-version": ["error", ">=0.8.19"], | ||
"func-visibility": ["error", { "ignoreConstructors": true }], | ||
"max-line-length": ["error", 120], | ||
"max-states-count": ["warn", 30], | ||
"modifier-name-mixedcase": ["error"], | ||
"private-vars-leading-underscore": ["error"], | ||
"no-inline-assembly": "off", | ||
"avoid-low-level-calls": "off" | ||
} | ||
} | ||
|
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,11 @@ | ||
{ | ||
"solidity.packageDefaultDependenciesContractsDirectory": "src", | ||
"solidity.packageDefaultDependenciesDirectory": "lib", | ||
"solidity.compileUsingRemoteVersion": "v0.8.19", | ||
"editor.formatOnSave": true, | ||
"[solidity]": { | ||
"editor.defaultFormatter": "JuanBlanco.solidity" | ||
}, | ||
"solidity.formatter": "forge", | ||
"search.exclude": { "lib": true } | ||
} |
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
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,46 @@ | ||
[profile.default] | ||
solc = '0.8.19' | ||
via_ir = true | ||
src = 'src' | ||
out = 'out' | ||
test = 'test' | ||
libs = ['lib'] | ||
optimizer = true | ||
optimizer_runs = 10_000 | ||
ignored_error_codes = [3628] | ||
|
||
[fuzz] | ||
runs = 500 | ||
|
||
[invariant] | ||
runs=500 | ||
fail_on_revert = true | ||
depth = 10 | ||
|
||
[profile.lite] | ||
solc = '0.8.19' | ||
via_ir = false | ||
optimizer = true | ||
optimizer_runs = 10_000 | ||
ignored_error_codes = [3628] | ||
|
||
[profile.deep.fuzz] | ||
runs = 10000 | ||
|
||
[profile.deep.invariant] | ||
runs = 5000 | ||
depth = 32 | ||
|
||
[fmt] | ||
line_length = 115 | ||
wrap_comments = true | ||
|
||
[rpc_endpoints] | ||
mainnet = "${RPC_URL_MAINNET}" | ||
goerli = "${RPC_URL_GOERLI}" | ||
|
||
[etherscan] | ||
mainnet = { key = "${ETHERSCAN_API_KEY}" } | ||
goerli = { key = "${ETHERSCAN_API_KEY}" } | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
Submodule account-abstraction
added at
187613
Submodule openzeppelin-contracts
added at
e1b3d8
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,11 @@ | ||
{ | ||
"devDependencies": { | ||
"pnpm": "^8.7.5", | ||
"solhint": "^3.6.2" | ||
}, | ||
"scripts": { | ||
"lint": "pnpm lint:src && pnpm lint:test", | ||
"lint:src": "solhint -c .solhint-src.json ./src/**/*.sol", | ||
"lint:test": "solhint -c .solhint-test.json ./test/**/*.sol" | ||
} | ||
} |
Oops, something went wrong.