-
Notifications
You must be signed in to change notification settings - Fork 1
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 17df2c9
Showing
610 changed files
with
213,001 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,23 @@ | ||
# Localhost RPC URL | ||
export LOCALHOST_RPC_URL=http://127.0.0.1:8545 | ||
|
||
# Mainnet RPC URLs | ||
export MAINNET_RPC_URL= | ||
export BASE_RPC_URL= | ||
export OPTIMISM_RPC_URL= | ||
|
||
# Testnet RPC URLs | ||
export SEPOLIA_RPC_URL= | ||
export BASE_SEPOLIA_RPC_URL= | ||
export OPTIMISM_SEPOLIA_RPC_URL= | ||
|
||
# Used for verifying contracts on Etherscan | ||
export ETHERSCAN_API_KEY= | ||
export BASE_ETHERSCAN_API_KEY= | ||
export OPTIMISM_ETHERSCAN_API_KEY= | ||
|
||
# Used for deploying contracts on Mainnet | ||
export PRIVATE_KEY= | ||
|
||
# Used for deploying contracts on Testnet Dev environment | ||
export DEV_PRIVATE_KEY= |
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 @@ | ||
name: Forge Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
check: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install NPM dependencies | ||
run: npm install | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
make sizes | ||
id: build | ||
|
||
- name: Install lcov | ||
uses: hrishikesh-kadam/setup-lcov@v1 | ||
|
||
- name: Run coverage | ||
env: | ||
MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} | ||
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | ||
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | ||
run: make coverage profile=ci | ||
id: coverage | ||
|
||
- name: Report code coverage | ||
uses: zgosalvez/github-actions-report-lcov@v3 | ||
with: | ||
coverage-files: lcov.info | ||
artifact-name: code-coverage-report | ||
minimum-coverage: 0 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
update-comment: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# name: Forge Fork Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# | ||
# permissions: write-all | ||
# | ||
# jobs: | ||
# check: | ||
# name: Fork Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: recursive | ||
# | ||
# - name: Setup Node | ||
# uses: actions/setup-node@v4 | ||
# | ||
# - name: Install NPM dependencies | ||
# run: npm install | ||
# | ||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
# | ||
# - name: Run Forge build | ||
# run: | | ||
# forge --version | ||
# make sizes | ||
# id: build | ||
# | ||
# - name: Run Forge fork tests | ||
# run: make fork profile=ci | ||
# env: | ||
# MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} | ||
# MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
# BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | ||
# OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} |
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,35 @@ | ||
# name: Forge Fuzz Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# | ||
# permissions: write-all | ||
# | ||
# jobs: | ||
# check: | ||
# name: Fuzz Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: recursive | ||
# | ||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
# | ||
# - name: Run Forge build | ||
# run: | | ||
# forge --version | ||
# make sizes | ||
# id: build | ||
# | ||
# - name: Run Forge fuzz tests | ||
# run: make fuzz profile=ci | ||
# env: | ||
# # make fuzzing semi-deterministic to avoid noisy gas cost estimation | ||
# # due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds) | ||
# FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} | ||
# MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} |
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,56 @@ | ||
name: Forge Tests Gas Report | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
check: | ||
name: Gas report | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install NPM dependencies | ||
run: npm install | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
make sizes | ||
id: build | ||
|
||
- name: Run Forge tests with gas report | ||
run: make gas-report profile=ci | ||
env: | ||
# make fuzzing semi-deterministic to avoid noisy gas cost estimation | ||
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds) | ||
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} | ||
MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} | ||
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | ||
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | ||
|
||
- name: Compare gas reports | ||
uses: Rubilmax/[email protected] | ||
id: gas_diff | ||
|
||
- name: Add gas diff to sticky comment | ||
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
# delete the comment in case changes no longer impact gas costs | ||
delete: ${{ !steps.gas_diff.outputs.markdown }} | ||
message: ${{ steps.gas_diff.outputs.markdown }} |
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,30 @@ | ||
# name: Forge Integration Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# | ||
# permissions: write-all | ||
# | ||
# jobs: | ||
# check: | ||
# name: Integration Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: recursive | ||
# | ||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
# | ||
# - name: Run Forge build | ||
# run: | | ||
# forge --version | ||
# make sizes | ||
# id: build | ||
# | ||
# - name: Run Forge integration tests | ||
# run: make integration profile=ci |
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,35 @@ | ||
# name: Forge Invariant Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# | ||
# permissions: write-all | ||
# | ||
# jobs: | ||
# check: | ||
# name: Invariant Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: recursive | ||
# | ||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
# | ||
# - name: Run Forge build | ||
# run: | | ||
# forge --version | ||
# make sizes | ||
# id: build | ||
# | ||
# - name: Run Forge invariant tests | ||
# run: make invariant profile=ci | ||
# env: | ||
# # make fuzzing semi-deterministic to avoid noisy gas cost estimation | ||
# # due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds) | ||
# FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} | ||
# MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} |
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,22 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
broadcast/**/*run* | ||
|
||
# Coverage files | ||
coverage/ | ||
lcov.info | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env | ||
|
||
# Mac OS files | ||
.DS_Store | ||
|
||
# NPM modules | ||
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,15 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = [email protected]:foundry-rs/forge-std.git | ||
branch = v1 | ||
[submodule "lib/common"] | ||
path = lib/common | ||
url = [email protected]:m0-foundation/common.git | ||
[submodule "lib/protocol"] | ||
path = lib/protocol | ||
url = [email protected]:m0-foundation/protocol.git | ||
branch = spoke | ||
[submodule "lib/ttg"] | ||
path = lib/ttg | ||
url = [email protected]:m0-foundation/ttg.git | ||
branch = spoke |
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 @@ | ||
npm run lint-staged && 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"!(lib/**/*)*.{json,md,sol,yml}": [ | ||
"npm run prettier" | ||
], | ||
"!(lib/**/*)*.sol": [ | ||
"npm run solhint" | ||
] | ||
} |
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 @@ | ||
{ | ||
"plugins": [ | ||
"prettier-plugin-solidity" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"bracketSpacing": true, | ||
"compiler": "0.8.26", | ||
"parser": "solidity-parse", | ||
"printWidth": 120, | ||
"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,34 @@ | ||
{ | ||
"extends": ["solhint:recommended"], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"code-complexity": ["warn", 10], | ||
"compiler-version": ["error", "0.8.26"], | ||
"comprehensive-interface": "off", | ||
"const-name-snakecase": "off", | ||
"func-name-mixedcase": "off", | ||
"func-visibility": [ | ||
"warn", | ||
{ | ||
"ignoreConstructors": true | ||
} | ||
], | ||
"function-max-lines": ["warn", 100], | ||
"immutable-vars-naming": "off", | ||
"imports-on-top": "error", | ||
"imports-order": "warn", | ||
"max-line-length": ["warn", 120], | ||
"no-console": "warn", | ||
"no-empty-blocks": "off", | ||
"no-inline-assembly": "off", | ||
"not-rely-on-time": "off", | ||
"private-vars-leading-underscore": [ | ||
"warn", | ||
{ | ||
"strict": true | ||
} | ||
], | ||
"visibility-modifier-order": "error" | ||
} | ||
} |
Oops, something went wrong.