-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from the-standard/cyfrin-audit/foundry
Foundry test suite
- Loading branch information
Showing
93 changed files
with
10,090 additions
and
4,630 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,50 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Show Forge version | ||
run: | | ||
forge --version | ||
- name: Run Forge fmt | ||
run: | | ||
forge fmt --check | ||
id: fmt | ||
|
||
- name: Install npm dependencies | ||
run: | | ||
npm install | ||
id: npmi | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: 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 |
---|---|---|
|
@@ -22,4 +22,12 @@ cache | |
artifacts | ||
|
||
.DS_Store | ||
.idea/ | ||
.idea/ | ||
|
||
# crytic | ||
crytic-export/ | ||
echidna/ | ||
medusa/ | ||
|
||
# python | ||
venv/ |
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/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/chimera"] | ||
path = lib/chimera | ||
url = https://github.com/recon-fuzz/chimera | ||
[submodule "lib/properties"] | ||
path = lib/properties | ||
url = https://github.com/crytic/properties |
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 |
---|---|---|
@@ -1,29 +1,73 @@ | ||
# The Standard: Smart Vaults | ||
|
||
## Installation | ||
### Hardhat | ||
If you have npm installed, you can install the required project dependencies | ||
``` | ||
npm install | ||
``` | ||
|
||
### Foundry | ||
If you have Foundry installed, you can install the required project dependencies | ||
``` | ||
forge install | ||
``` | ||
|
||
## Testing | ||
### Hardhat | ||
If you are in root, you can run the project's full test suite | ||
``` | ||
npx hardhat test | ||
``` | ||
Since this project uses Hardhat, you can use its default ways to run tests, should you prefer it. | ||
|
||
### Foundry | ||
``` | ||
forge test | ||
``` | ||
|
||
## Coverage | ||
### Hardhat | ||
Run the code coverage suite with | ||
``` | ||
npx hardhat coverage | ||
``` | ||
|
||
### Foundry | ||
``` | ||
forge coverage | ||
``` | ||
|
||
## Contract size benchmark | ||
Run the contract sizer with | ||
``` | ||
npx hardhat size-contracts | ||
``` | ||
|
||
## Format | ||
Format using the forge formatter with | ||
``` | ||
forge fmt | ||
``` | ||
|
||
## Gas Snapshots | ||
Output gas usage snapshots with | ||
``` | ||
forge snapshot | ||
``` | ||
|
||
## Anvil | ||
Run a local chain with | ||
``` | ||
anvil | ||
``` | ||
|
||
## Chisel | ||
Open a Solidity REPL with | ||
``` | ||
chisel | ||
``` | ||
|
||
## Documentation | ||
- [Testnet guide](docs/TESTNET) | ||
- [Deployed addresses](docs/addresses.json) |
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
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
Oops, something went wrong.