-
Notifications
You must be signed in to change notification settings - Fork 8
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
0 parents
commit d26b274
Showing
228 changed files
with
111,971 additions
and
0 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,11 @@ | ||
#!/bin/sh | ||
ANVIL_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
ANVIL_MULTISIG=<test multisig address> | ||
INFURA_ID=<your Infura Id> | ||
MAINNET_RPC_URL="https://mainnet.infura.io/v3/${INFURA_ID}" | ||
GOERLI_RPC_URL="https://goerli.infura.io/v3/${INFURA_ID}" | ||
SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/${INFURA_ID}" | ||
|
||
KEYSTORE_PATH= | ||
KEY_PASSWD= | ||
SENDER_ADDRESS= |
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,138 @@ | ||
name: Foundry | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Foundry Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Check forge version | ||
run: forge --version | ||
|
||
- name: Check forge tree | ||
run: forge tree | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install solc-select and solc | ||
run: | | ||
pip3 install solc-select | ||
solc-select use 0.8.19 --always-install | ||
- name: Run Foundry tests | ||
run: | | ||
export MAINNET_RPC_URL=${{ vars.MAINNET_RPC_URL }} | ||
export GOERLI_RPC_URL=${{ vars.GOERLI_RPC_URL }} | ||
export SEPOLIA_RPC_URL=${{ vars.SEPOLIA_RPC_URL }} | ||
RUST_BACKTRACE=1 forge test -vvv --gas-report | ||
coverage: | ||
name: Test Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install solc-select and solc | ||
run: | | ||
pip3 install solc-select | ||
solc-select use 0.8.19 --always-install | ||
- name: Run coverage | ||
run: forge coverage --report summary --report lcov | ||
|
||
# To ignore coverage for certain directories modify the paths in this step as needed. The | ||
# below default ignores coverage results for the test and script directories. Alternatively, | ||
# to include coverage in all directories, comment out this step. Note that because this | ||
# filtering applies to the lcov file, the summary table generated in the previous step will | ||
# still include all files and directories. | ||
# The `--rc lcov_branch_coverage=1` part keeps branch info in the filtered report, since lcov | ||
# defaults to removing branch info. | ||
|
||
- name: Filter directories | ||
run: | | ||
sudo apt update && sudo apt install -y lcov | ||
lcov --remove lcov.info 'contracts/mock/*' 'test/*' 'script/*' --output-file lcov.info --rc lcov_branch_coverage=1 | ||
# This step posts a detailed coverage report as a comment and deletes previous comments on | ||
# each push. The below step is used to fail coverage if the specified coverage threshold is | ||
# not met. The below step can post a comment (when it's `github-token` is specified) but it's | ||
# not as useful, and this action cannot fail CI based on a minimum coverage threshold, which | ||
# is why we use both in this way. | ||
- name: Post coverage report | ||
if: github.event_name == 'pull_request' # This action fails when ran outside of a pull request. | ||
uses: romeovs/[email protected] | ||
with: | ||
delete-old-comments: true | ||
lcov-file: ./lcov.info | ||
github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR. | ||
|
||
# - name: Verify minimum coverage | ||
# uses: zgosalvez/github-actions-report-lcov@v2 | ||
# with: | ||
# coverage-files: ./lcov.info | ||
# minimum-coverage: 100 # Set coverage threshold. | ||
|
||
lint: | ||
name: Code Formatting Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Check formatting | ||
run: forge fmt --check | ||
# slither-analyze: | ||
# name: Slither Static Analysis | ||
# runs-on: ubuntu-latest | ||
# permissions: | ||
# actions: read | ||
# contents: read | ||
# security-events: write | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
|
||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
# - name: Build foundry | ||
# run: forge build --build-info | ||
|
||
# - name: Run Slither | ||
# uses: crytic/[email protected] | ||
# id: slither # Required to reference this step in the next step. | ||
# with: | ||
# ignore-compile: true | ||
# node-version: 18 | ||
# fail-on: none # Required to avoid failing the CI run regardless of findings. | ||
# sarif: results.sarif | ||
|
||
# - name: Upload SARIF file | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: ${{ steps.slither.outputs.sarif }} |
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,31 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Dotenv file | ||
.env | ||
|
||
# IDE | ||
.idea/ | ||
|
||
build/ | ||
node_modules/ | ||
INFURA_ID | ||
GOERLI_PRIVATE_KEY | ||
CONTRACT_ADDRESS | ||
|
||
lcov.info | ||
coverage | ||
|
||
*.swp | ||
*~ | ||
*.sym | ||
|
||
*.pk | ||
*.pkey | ||
*.srs |
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,15 @@ | ||
[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 | ||
[submodule "lib/openzeppelin-contracts-upgradeable"] | ||
path = lib/openzeppelin-contracts-upgradeable | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable | ||
[submodule "lib/solmate"] | ||
path = lib/solmate | ||
url = https://github.com/transmissions11/solmate | ||
[submodule "lib/create3-factory"] | ||
path = lib/create3-factory | ||
url = https://github.com/zeframlou/create3-factory |
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,8 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"[solidity]": { | ||
"editor.defaultFormatter": "JuanBlanco.solidity" | ||
}, | ||
"solidity.formatter": "forge", | ||
"prettier.tabWidth": 4 | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Axiom | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.