Skip to content

Commit

Permalink
Feat/support btach modifyliquidities for CL (#71)
Browse files Browse the repository at this point in the history
* feat: Add settleOrTake for optimization

NonfungiblePositionManager contract size optimization
Before
| NonfungiblePositionManager                 |   21,512 |      3,064 |
After
| NonfungiblePositionManager                 |   20,805 |      3,771 |

And also gas optimization

* feat: Support batch liquidity modification

Now contact size excess limit.
| NonfungiblePositionManager                 |   27,112 |     -2,536 |

So we need to choose one solution
1. Use modifyLiquidities to support batch liquidity modification
2. use current separate function

* feat: Add more test cases

* feat: Draft version one

* feat: Format codes

* feat: Remove deadline from liquidity parameters

* feat: Remove comments

* feat: Add more comments for modifyLiquidities payload

* feat: Add TransactionTooOld test cases

* feat: Add native token refund

* feat: Update test cases

* feat: Optimize gas

* feat: Rename burnAndTake parameter name

* feat: Rename variable

* feat: Rename variables
  • Loading branch information
ChefSnoopy authored Aug 1, 2024
1 parent bcbacc9 commit 2ecd625
Show file tree
Hide file tree
Showing 85 changed files with 1,706 additions and 539 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
182560
180160
Original file line number Diff line number Diff line change
@@ -1 +1 @@
636579
634347
Original file line number Diff line number Diff line change
@@ -1 +1 @@
904068
901398
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1270762
1267731

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
147155
145917
Original file line number Diff line number Diff line change
@@ -1 +1 @@
213706
212278
Original file line number Diff line number Diff line change
@@ -1 +1 @@
238930
237173

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
53942
53852
Original file line number Diff line number Diff line change
@@ -1 +1 @@
53680
53602
2 changes: 1 addition & 1 deletion .forge-snapshots/BinFungibleTokenTest#testBurn.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26848
26823
2 changes: 1 addition & 1 deletion .forge-snapshots/BinFungibleTokenTest#testMint.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
73705
73681
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1017615
1014388
Original file line number Diff line number Diff line change
@@ -1 +1 @@
977598
974603
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1022017
1018858
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1096580
1093305
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1056639
1053572
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1094456
1091207
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1017627
1014400
Original file line number Diff line number Diff line change
@@ -1 +1 @@
977610
974615
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1022014
1018855
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1094562
1091287
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1054621
1051554
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1092434
1089185
Original file line number Diff line number Diff line change
@@ -1 +1 @@
96000
95055
Original file line number Diff line number Diff line change
@@ -1 +1 @@
128542
126683
Original file line number Diff line number Diff line change
@@ -1 +1 @@
90549
89469
Original file line number Diff line number Diff line change
@@ -1 +1 @@
117963
116979
Original file line number Diff line number Diff line change
@@ -1 +1 @@
170446
168539
Original file line number Diff line number Diff line change
@@ -1 +1 @@
110528
109424
Original file line number Diff line number Diff line change
@@ -1 +1 @@
152204
150693

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
143866
142495
Original file line number Diff line number Diff line change
@@ -1 +1 @@
149552
148056

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
150192
148681
Original file line number Diff line number Diff line change
@@ -1 +1 @@
150227
148707
Original file line number Diff line number Diff line change
@@ -1 +1 @@
175579
173408
Original file line number Diff line number Diff line change
@@ -1 +1 @@
156380
154872
Original file line number Diff line number Diff line change
@@ -1 +1 @@
154380
152872
Original file line number Diff line number Diff line change
@@ -1 +1 @@
154370
152862

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
177434
175293
Original file line number Diff line number Diff line change
@@ -1 +1 @@
146632
145038
Original file line number Diff line number Diff line change
@@ -1 +1 @@
736974
740743
Original file line number Diff line number Diff line change
@@ -1 +1 @@
693861
697826
Original file line number Diff line number Diff line change
@@ -1 +1 @@
738290
741985
Original file line number Diff line number Diff line change
@@ -1 +1 @@
793398
797154
Original file line number Diff line number Diff line change
@@ -1 +1 @@
752832
756772
Original file line number Diff line number Diff line change
@@ -1 +1 @@
794750
798420
Original file line number Diff line number Diff line change
@@ -1 +1 @@
736986
740755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
693873
697838
Original file line number Diff line number Diff line change
@@ -1 +1 @@
738287
741982
Original file line number Diff line number Diff line change
@@ -1 +1 @@
791380
795136
Original file line number Diff line number Diff line change
@@ -1 +1 @@
750814
754754
Original file line number Diff line number Diff line change
@@ -1 +1 @@
792728
796398
2 changes: 1 addition & 1 deletion .forge-snapshots/CLSwapRouterTest#ExactInput.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
250776
248857
2 changes: 1 addition & 1 deletion .forge-snapshots/CLSwapRouterTest#ExactInputSingle.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
189707
188318
2 changes: 1 addition & 1 deletion .forge-snapshots/CLSwapRouterTest#ExactOutput.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
256829
254954
2 changes: 1 addition & 1 deletion .forge-snapshots/CLSwapRouterTest#ExactOutputSingle.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
189184
187837
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
684324
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
719013
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
285998
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
272130
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
179882
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
166247
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
212813
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
199174
1 change: 1 addition & 0 deletions .forge-snapshots/NonFungiblePositionManagerBatch#mint.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
619494
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
605846
2 changes: 1 addition & 1 deletion .forge-snapshots/NonfungiblePositionManager#burn.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
64460
64560
2 changes: 1 addition & 1 deletion .forge-snapshots/NonfungiblePositionManager#collect.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
266620
271543
Original file line number Diff line number Diff line change
@@ -1 +1 @@
160400
165661
Original file line number Diff line number Diff line change
@@ -1 +1 @@
193953
198579
2 changes: 1 addition & 1 deletion .forge-snapshots/NonfungiblePositionManager#mint.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
606838
609700
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = 'src'
out = 'foundry-out'
solc_version = '0.8.26'
optimizer_runs = 400
optimizer_runs = 9000
via_ir = true
ffi = true
fs_permissions = [
Expand Down
Loading

0 comments on commit 2ecd625

Please sign in to comment.