Skip to content

Commit

Permalink
Merge and update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhuiluo committed May 11, 2024
2 parents 91d5ded + 616e988 commit 07faa5c
Show file tree
Hide file tree
Showing 83 changed files with 2,048 additions and 913 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
151062
1 change: 1 addition & 0 deletions .forge-snapshots/addLiquidity CA fee.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
329402
2 changes: 1 addition & 1 deletion .forge-snapshots/addLiquidity with empty hook.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
278738
284043
2 changes: 1 addition & 1 deletion .forge-snapshots/addLiquidity with native token.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
136106
141238
2 changes: 1 addition & 1 deletion .forge-snapshots/addLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
145897
151038
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
299590
2 changes: 1 addition & 1 deletion .forge-snapshots/donate gas with 1 token.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
108830
108878
2 changes: 1 addition & 1 deletion .forge-snapshots/donate gas with 2 tokens.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
149312
149370
2 changes: 1 addition & 1 deletion .forge-snapshots/erc20 collect protocol fees.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57332
57354
2 changes: 1 addition & 1 deletion .forge-snapshots/initialize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
61933
62245
2 changes: 1 addition & 1 deletion .forge-snapshots/native collect protocol fees.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
59565
59587
2 changes: 1 addition & 1 deletion .forge-snapshots/poolManager bytecode size.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22469
23450
1 change: 1 addition & 0 deletions .forge-snapshots/removeLiquidity CA fee.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
184975
2 changes: 1 addition & 1 deletion .forge-snapshots/removeLiquidity with empty hook.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
115818
121019
2 changes: 1 addition & 1 deletion .forge-snapshots/removeLiquidity with native token.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
113115
117794
2 changes: 1 addition & 1 deletion .forge-snapshots/removeLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
115806
121007
2 changes: 1 addition & 1 deletion .forge-snapshots/simple swap with native.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
130496
130998
2 changes: 1 addition & 1 deletion .forge-snapshots/simple swap.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
148847
149357
1 change: 1 addition & 0 deletions .forge-snapshots/swap CA custom curve + swap noop.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
139347
1 change: 1 addition & 0 deletions .forge-snapshots/swap CA fee on unspecified.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
184801
Original file line number Diff line number Diff line change
@@ -1 +1 @@
113399
113901
2 changes: 1 addition & 1 deletion .forge-snapshots/swap against liquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
124769
125279
2 changes: 1 addition & 1 deletion .forge-snapshots/swap burn 6909 for input.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
136757
137268
2 changes: 1 addition & 1 deletion .forge-snapshots/swap burn native 6909 for input.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
125888
126384
2 changes: 1 addition & 1 deletion .forge-snapshots/swap mint native output as 6909.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
147951
148403
2 changes: 1 addition & 1 deletion .forge-snapshots/swap mint output as 6909.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
164862
165306
Original file line number Diff line number Diff line change
@@ -1 +1 @@
224048
224956
2 changes: 1 addition & 1 deletion .forge-snapshots/swap with dynamic fee.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
149063
149573
2 changes: 1 addition & 1 deletion .forge-snapshots/swap with hooks.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
124781
125291
2 changes: 1 addition & 1 deletion .forge-snapshots/swap with lp fee and protocol fee.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
181352
181915
2 changes: 1 addition & 1 deletion .forge-snapshots/update dynamic fee in before swap.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
159599
160206
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:

jobs:
forge-tests:
Expand Down Expand Up @@ -40,4 +39,4 @@ jobs:
env:
FOUNDRY_PROFILE: ci
FORGE_SNAPSHOT_CHECK: true

40 changes: 40 additions & 0 deletions .github/workflows/tests-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
pull_request:

jobs:
forge-tests:
name: Forge Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: './test/js-scripts'
cache: 'yarn'

- run: yarn
working-directory: ./test/js-scripts

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Build
run: forge build
env:
FOUNDRY_PROFILE: pr

- name: Run tests
run: forge test --isolate -vvv
env:
FOUNDRY_PROFILE: pr
FORGE_SNAPSHOT_CHECK: true

12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ The fee values, or callback logic, may be updated by the hooks dependent on thei

## Repository Structure

All contracts are held within the `v4-core/contracts` folder.
All contracts are held within the `v4-core/src` folder.

Note that helper contracts used by tests are held in the `v4-core/contracts/test` subfolder within the contracts folder. Any new test helper contracts should be added here, but all foundry tests are in the `v4-core/test/foundry-tests` folder.
Note that helper contracts used by tests are held in the `v4-core/src/test` subfolder within the `src` folder. Any new test helper contracts should be added here, but all foundry tests are in the `v4-core/test` folder.

```markdown
contracts/
src/
----interfaces/
| IPoolManager.sol
| ...
Expand All @@ -56,10 +56,12 @@ contracts/
| Pool.sol
| ...
----test
----PoolManager.sol
...
PoolManager.sol
test/
----foundry-tests/
----libraries/
| Position.t.sol
| Pool.t.sol
```

## Local deployment and Usage
Expand Down
3 changes: 3 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ evm_version = "cancun"
runs = 1000
seed = "0x4444"

[profile.pr.fuzz]
runs = 10000

[profile.ci.fuzz]
runs = 100000

Expand Down
Loading

0 comments on commit 07faa5c

Please sign in to comment.