Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fuzz tests #12

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ node_modules
cache
artifacts

#Foundry files
out
cache_foundry

yarn.lock
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,14 @@ Next, the vm calls the target contract with the encoded input data. A `delegatec
### Output decoding

Finally, the return data is decoded by following the output argument specifier, in the same fashion as the 'input encoding' stage. Only one return value is supported.

## Foundry Testing - Fuzz Tests

In order to run tests using [Foundry](https://getfoundry.sh/), first setup the dependencies:
```bash
forge install
```
then run:
```bash
forge test --match-path "./test/**/*.t.sol"
```
16 changes: 16 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

[profile.default]
src = 'contracts'
out = 'out'
cache_path = 'cache_foundry'
libs = ['lib']

solc = '0.8.16'
via_ir = true
optimizer = true
optimizer_runs = 100000

[rpc_endpoints]
mainnet = "https://eth-rpc.gateway.pokt.network"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at 038555
119 changes: 115 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@openzeppelin/contracts": "^4.1.0",
"@uniswap/v3-core": "^1.0.1",
"@uniswap/v3-periphery": "^1.4.3",
"chai": "^4.3.4",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.3.1",
Expand Down
5 changes: 5 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
@openzeppelin/contracts=node_modules/@openzeppelin/contracts
@uniswap/v3-core/contracts/=node_modules/@uniswap/v3-core/contracts/
@uniswap/v3-periphery/contracts/=node_modules/@uniswap/v3-periphery/contracts/
Loading