@zoralabs/limit-orders 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/.turbo/turbo-build$colon$js.log +50 -51
  2. package/CHANGELOG.md +12 -0
  3. package/abis/ISetLimitOrderConfig.json +27 -0
  4. package/abis/{SimpleAccessManaged.json → Ownable.json} +29 -10
  5. package/abis/Ownable2Step.json +115 -0
  6. package/abis/PermittedCallers.json +181 -0
  7. package/abis/SwapWithLimitOrders.json +116 -3
  8. package/abis/ZoraLimitOrderBook.json +159 -35
  9. package/cache/solidity-files-cache.json +1 -1
  10. package/dist/index.cjs +191 -27
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.js +191 -27
  13. package/dist/index.js.map +1 -1
  14. package/dist/wagmiGenerated.d.ts +217 -32
  15. package/dist/wagmiGenerated.d.ts.map +1 -1
  16. package/out/BalanceDelta.sol/BalanceDeltaLibrary.json +1 -1
  17. package/out/BeforeSwapDelta.sol/BeforeSwapDeltaLibrary.json +1 -1
  18. package/out/BitMath.sol/BitMath.json +1 -1
  19. package/out/BytesLib.sol/BytesLib.json +1 -1
  20. package/out/CoinCommon.sol/CoinCommon.json +1 -1
  21. package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -1
  22. package/out/CoinConstants.sol/CoinConstants.json +1 -1
  23. package/out/Context.sol/Context.json +1 -1
  24. package/out/Currency.sol/CurrencyLibrary.json +1 -1
  25. package/out/CurrencyReserves.sol/CurrencyReserves.json +1 -1
  26. package/out/CustomRevert.sol/CustomRevert.json +1 -1
  27. package/out/DopplerMath.sol/DopplerMath.json +1 -1
  28. package/out/FixedPoint128.sol/FixedPoint128.json +1 -1
  29. package/out/FixedPoint96.sol/FixedPoint96.json +1 -1
  30. package/out/FullMath.sol/FullMath.json +1 -1
  31. package/out/IAllowanceTransfer.sol/IAllowanceTransfer.json +1 -1
  32. package/out/ICoin.sol/ICoin.json +1 -1
  33. package/out/ICoin.sol/IHasCoinType.json +1 -1
  34. package/out/ICoin.sol/IHasPoolKey.json +1 -1
  35. package/out/ICoin.sol/IHasSwapPath.json +1 -1
  36. package/out/ICoin.sol/IHasTotalSupplyForPositions.json +1 -1
  37. package/out/IDeployedCoinVersionLookup.sol/IDeployedCoinVersionLookup.json +1 -1
  38. package/out/IDopplerErrors.sol/IDopplerErrors.json +1 -1
  39. package/out/IEIP712.sol/IEIP712.json +1 -1
  40. package/out/IERC1363.sol/IERC1363.json +1 -1
  41. package/out/IERC165.sol/IERC165.json +1 -1
  42. package/out/IERC20.sol/IERC20.json +1 -1
  43. package/out/IERC20Minimal.sol/IERC20Minimal.json +1 -1
  44. package/out/IERC6909Claims.sol/IERC6909Claims.json +1 -1
  45. package/out/IERC7572.sol/IERC7572.json +1 -1
  46. package/out/IExtsload.sol/IExtsload.json +1 -1
  47. package/out/IExttload.sol/IExttload.json +1 -1
  48. package/out/IHasRewardsRecipients.sol/IHasRewardsRecipients.json +1 -1
  49. package/out/IHooks.sol/IHooks.json +1 -1
  50. package/out/IMsgSender.sol/IMsgSender.json +1 -1
  51. package/out/IPoolManager.sol/IPoolManager.json +1 -1
  52. package/out/IProtocolFees.sol/IProtocolFees.json +1 -1
  53. package/out/ISetLimitOrderConfig.sol/ISetLimitOrderConfig.json +1 -0
  54. package/out/ISupportsLimitOrderFill.sol/ISupportsLimitOrderFill.json +1 -1
  55. package/out/ISwapPathRouter.sol/ISwapPathRouter.json +1 -1
  56. package/out/ISwapRouter.sol/ISwapRouter.json +1 -1
  57. package/out/IUniswapV3SwapCallback.sol/IUniswapV3SwapCallback.json +1 -1
  58. package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4Hook.json +1 -1
  59. package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4HookWithUpdateableFee.json +1 -1
  60. package/out/IUpgradeableV4Hook.sol/IUpgradeableV4Hook.json +1 -1
  61. package/out/IWETH.sol/IWETH.json +1 -1
  62. package/out/IZoraHookRegistry.sol/IZoraHookRegistry.json +1 -1
  63. package/out/IZoraLimitOrderBook.sol/IZoraLimitOrderBook.json +1 -1
  64. package/out/IZoraLimitOrderBookCoinsInterface.sol/IZoraLimitOrderBookCoinsInterface.json +1 -1
  65. package/out/IZoraV4CoinHook.sol/IZoraV4CoinHook.json +1 -1
  66. package/out/LimitOrderCommon.sol/LimitOrderCommon.json +1 -1
  67. package/out/LimitOrderCreate.sol/LimitOrderCreate.json +1 -1
  68. package/out/LimitOrderFill.sol/LimitOrderFill.json +1 -1
  69. package/out/LimitOrderViews.sol/LimitOrderViews.json +1 -1
  70. package/out/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -1
  71. package/out/LiquidityAmounts.sol/LiquidityAmounts.json +1 -1
  72. package/out/LiquidityMath.sol/LiquidityMath.json +1 -1
  73. package/out/Lock.sol/Lock.json +1 -1
  74. package/out/NonzeroDeltaCount.sol/NonzeroDeltaCount.json +1 -1
  75. package/out/Ownable.sol/Ownable.json +1 -0
  76. package/out/Ownable2Step.sol/Ownable2Step.json +1 -0
  77. package/out/Path.sol/Path.json +1 -1
  78. package/out/PathKey.sol/PathKeyLibrary.json +1 -1
  79. package/out/PermittedCallers.sol/PermittedCallers.json +1 -0
  80. package/out/PoolId.sol/PoolIdLibrary.json +1 -1
  81. package/out/Position.sol/Position.json +1 -1
  82. package/out/SafeCast.sol/SafeCast.json +1 -1
  83. package/out/SafeCast160.sol/SafeCast160.json +1 -1
  84. package/out/SafeERC20.sol/SafeERC20.json +1 -1
  85. package/out/SqrtPriceMath.sol/SqrtPriceMath.json +1 -1
  86. package/out/StateLibrary.sol/StateLibrary.json +1 -1
  87. package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -1
  88. package/out/TickBitmap.sol/TickBitmap.json +1 -1
  89. package/out/TickMath.sol/TickMath.json +1 -1
  90. package/out/TransientSlot.sol/TransientSlot.json +1 -1
  91. package/out/TransientStateLibrary.sol/TransientStateLibrary.json +1 -1
  92. package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -1
  93. package/out/UnsafeMath.sol/UnsafeMath.json +1 -1
  94. package/out/V3ToV4SwapLib.sol/V3ToV4SwapLib.json +1 -1
  95. package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -1
  96. package/out/build-info/37e0124d88d60569.json +1 -0
  97. package/out/uniswap/BitMath.sol/BitMath.json +1 -1
  98. package/out/uniswap/CustomRevert.sol/CustomRevert.json +1 -1
  99. package/out/uniswap/FullMath.sol/FullMath.json +1 -1
  100. package/out/uniswap/SafeCast.sol/SafeCast.json +1 -1
  101. package/out/uniswap/TickMath.sol/TickMath.json +1 -1
  102. package/package/wagmiGenerated.ts +190 -26
  103. package/package.json +1 -1
  104. package/src/IZoraLimitOrderBook.sol +3 -5
  105. package/src/ZoraLimitOrderBook.sol +14 -45
  106. package/src/access/PermittedCallers.sol +41 -0
  107. package/src/router/ISetLimitOrderConfig.sol +12 -0
  108. package/src/router/SwapWithLimitOrders.sol +8 -9
  109. package/test/LimitOrderAccessControl.t.sol +173 -156
  110. package/test/LimitOrderFill.t.sol +0 -5
  111. package/test/SwapWithLimitOrders.t.sol +0 -2
  112. package/test/SwapWithLimitOrdersRouter.t.sol +0 -2
  113. package/test/gas/LimitOrderFillGas.t.sol +0 -7
  114. package/test/gas/LimitOrderSwapGas.t.sol +0 -6
  115. package/test/unit/SwapLimitOrdersUnit.t.sol +4 -4
  116. package/test/unit/SwapLimitOrdersValidation.t.sol +8 -8
  117. package/test/utils/BaseTest.sol +7 -16
  118. package/test/utils/TestableZoraLimitOrderBook.sol +2 -2
  119. package/abis/IAuthority.json +0 -31
  120. package/abis/SimpleAccessManager.json +0 -351
  121. package/out/IAuthority.sol/IAuthority.json +0 -1
  122. package/out/SimpleAccessManaged.sol/SimpleAccessManaged.json +0 -1
  123. package/out/SimpleAccessManager.sol/SimpleAccessManager.json +0 -1
  124. package/out/build-info/876cc09bc44cc8a7.json +0 -1
  125. package/src/access/SimpleAccessManaged.sol +0 -76
  126. package/src/access/SimpleAccessManager.sol +0 -268
  127. package/test/SimpleAccessManager.t.sol +0 -420
@@ -21,6 +21,11 @@
21
21
  "name": "permit2_",
22
22
  "type": "address",
23
23
  "internalType": "address"
24
+ },
25
+ {
26
+ "name": "owner_",
27
+ "type": "address",
28
+ "internalType": "address"
24
29
  }
25
30
  ],
26
31
  "stateMutability": "nonpayable"
@@ -29,6 +34,13 @@
29
34
  "type": "receive",
30
35
  "stateMutability": "payable"
31
36
  },
37
+ {
38
+ "type": "function",
39
+ "name": "acceptOwnership",
40
+ "inputs": [],
41
+ "outputs": [],
42
+ "stateMutability": "nonpayable"
43
+ },
32
44
  {
33
45
  "type": "function",
34
46
  "name": "getLimitOrderConfig",
@@ -67,6 +79,32 @@
67
79
  ],
68
80
  "stateMutability": "view"
69
81
  },
82
+ {
83
+ "type": "function",
84
+ "name": "owner",
85
+ "inputs": [],
86
+ "outputs": [
87
+ {
88
+ "name": "",
89
+ "type": "address",
90
+ "internalType": "address"
91
+ }
92
+ ],
93
+ "stateMutability": "view"
94
+ },
95
+ {
96
+ "type": "function",
97
+ "name": "pendingOwner",
98
+ "inputs": [],
99
+ "outputs": [
100
+ {
101
+ "name": "",
102
+ "type": "address",
103
+ "internalType": "address"
104
+ }
105
+ ],
106
+ "stateMutability": "view"
107
+ },
70
108
  {
71
109
  "type": "function",
72
110
  "name": "poolManager",
@@ -80,6 +118,13 @@
80
118
  ],
81
119
  "stateMutability": "view"
82
120
  },
121
+ {
122
+ "type": "function",
123
+ "name": "renounceOwnership",
124
+ "inputs": [],
125
+ "outputs": [],
126
+ "stateMutability": "nonpayable"
127
+ },
83
128
  {
84
129
  "type": "function",
85
130
  "name": "setLimitOrderConfig",
@@ -213,6 +258,19 @@
213
258
  ],
214
259
  "stateMutability": "payable"
215
260
  },
261
+ {
262
+ "type": "function",
263
+ "name": "transferOwnership",
264
+ "inputs": [
265
+ {
266
+ "name": "newOwner",
267
+ "type": "address",
268
+ "internalType": "address"
269
+ }
270
+ ],
271
+ "outputs": [],
272
+ "stateMutability": "nonpayable"
273
+ },
216
274
  {
217
275
  "type": "function",
218
276
  "name": "unlockCallback",
@@ -264,6 +322,44 @@
264
322
  ],
265
323
  "anonymous": false
266
324
  },
325
+ {
326
+ "type": "event",
327
+ "name": "OwnershipTransferStarted",
328
+ "inputs": [
329
+ {
330
+ "name": "previousOwner",
331
+ "type": "address",
332
+ "indexed": true,
333
+ "internalType": "address"
334
+ },
335
+ {
336
+ "name": "newOwner",
337
+ "type": "address",
338
+ "indexed": true,
339
+ "internalType": "address"
340
+ }
341
+ ],
342
+ "anonymous": false
343
+ },
344
+ {
345
+ "type": "event",
346
+ "name": "OwnershipTransferred",
347
+ "inputs": [
348
+ {
349
+ "name": "previousOwner",
350
+ "type": "address",
351
+ "indexed": true,
352
+ "internalType": "address"
353
+ },
354
+ {
355
+ "name": "newOwner",
356
+ "type": "address",
357
+ "indexed": true,
358
+ "internalType": "address"
359
+ }
360
+ ],
361
+ "anonymous": false
362
+ },
267
363
  {
268
364
  "type": "event",
269
365
  "name": "SwapWithLimitOrdersExecuted",
@@ -422,13 +518,30 @@
422
518
  },
423
519
  {
424
520
  "type": "error",
425
- "name": "OnlyAuthority",
521
+ "name": "OnlyPoolManager",
426
522
  "inputs": []
427
523
  },
428
524
  {
429
525
  "type": "error",
430
- "name": "OnlyPoolManager",
431
- "inputs": []
526
+ "name": "OwnableInvalidOwner",
527
+ "inputs": [
528
+ {
529
+ "name": "owner",
530
+ "type": "address",
531
+ "internalType": "address"
532
+ }
533
+ ]
534
+ },
535
+ {
536
+ "type": "error",
537
+ "name": "OwnableUnauthorizedAccount",
538
+ "inputs": [
539
+ {
540
+ "name": "account",
541
+ "type": "address",
542
+ "internalType": "address"
543
+ }
544
+ ]
432
545
  },
433
546
  {
434
547
  "type": "error",
@@ -18,7 +18,7 @@
18
18
  "internalType": "address"
19
19
  },
20
20
  {
21
- "name": "authority_",
21
+ "name": "owner_",
22
22
  "type": "address",
23
23
  "internalType": "address"
24
24
  },
@@ -36,16 +36,10 @@
36
36
  },
37
37
  {
38
38
  "type": "function",
39
- "name": "authority",
39
+ "name": "acceptOwnership",
40
40
  "inputs": [],
41
- "outputs": [
42
- {
43
- "name": "",
44
- "type": "address",
45
- "internalType": "address"
46
- }
47
- ],
48
- "stateMutability": "view"
41
+ "outputs": [],
42
+ "stateMutability": "nonpayable"
49
43
  },
50
44
  {
51
45
  "type": "function",
@@ -279,27 +273,66 @@
279
273
  },
280
274
  {
281
275
  "type": "function",
282
- "name": "poolManager",
276
+ "name": "isPermittedCaller",
277
+ "inputs": [
278
+ {
279
+ "name": "caller",
280
+ "type": "address",
281
+ "internalType": "address"
282
+ }
283
+ ],
284
+ "outputs": [
285
+ {
286
+ "name": "",
287
+ "type": "bool",
288
+ "internalType": "bool"
289
+ }
290
+ ],
291
+ "stateMutability": "view"
292
+ },
293
+ {
294
+ "type": "function",
295
+ "name": "owner",
283
296
  "inputs": [],
284
297
  "outputs": [
285
298
  {
286
299
  "name": "",
287
300
  "type": "address",
288
- "internalType": "contract IPoolManager"
301
+ "internalType": "address"
289
302
  }
290
303
  ],
291
304
  "stateMutability": "view"
292
305
  },
293
306
  {
294
307
  "type": "function",
295
- "name": "setAuthority",
296
- "inputs": [
308
+ "name": "pendingOwner",
309
+ "inputs": [],
310
+ "outputs": [
297
311
  {
298
- "name": "newAuthority",
312
+ "name": "",
299
313
  "type": "address",
300
314
  "internalType": "address"
301
315
  }
302
316
  ],
317
+ "stateMutability": "view"
318
+ },
319
+ {
320
+ "type": "function",
321
+ "name": "poolManager",
322
+ "inputs": [],
323
+ "outputs": [
324
+ {
325
+ "name": "",
326
+ "type": "address",
327
+ "internalType": "contract IPoolManager"
328
+ }
329
+ ],
330
+ "stateMutability": "view"
331
+ },
332
+ {
333
+ "type": "function",
334
+ "name": "renounceOwnership",
335
+ "inputs": [],
303
336
  "outputs": [],
304
337
  "stateMutability": "nonpayable"
305
338
  },
@@ -316,6 +349,37 @@
316
349
  "outputs": [],
317
350
  "stateMutability": "nonpayable"
318
351
  },
352
+ {
353
+ "type": "function",
354
+ "name": "setPermittedCallers",
355
+ "inputs": [
356
+ {
357
+ "name": "callers",
358
+ "type": "address[]",
359
+ "internalType": "address[]"
360
+ },
361
+ {
362
+ "name": "permitted",
363
+ "type": "bool[]",
364
+ "internalType": "bool[]"
365
+ }
366
+ ],
367
+ "outputs": [],
368
+ "stateMutability": "nonpayable"
369
+ },
370
+ {
371
+ "type": "function",
372
+ "name": "transferOwnership",
373
+ "inputs": [
374
+ {
375
+ "name": "newOwner",
376
+ "type": "address",
377
+ "internalType": "address"
378
+ }
379
+ ],
380
+ "outputs": [],
381
+ "stateMutability": "nonpayable"
382
+ },
319
383
  {
320
384
  "type": "function",
321
385
  "name": "unlockCallback",
@@ -402,19 +466,6 @@
402
466
  ],
403
467
  "stateMutability": "view"
404
468
  },
405
- {
406
- "type": "event",
407
- "name": "AuthorityUpdated",
408
- "inputs": [
409
- {
410
- "name": "authority",
411
- "type": "address",
412
- "indexed": false,
413
- "internalType": "address"
414
- }
415
- ],
416
- "anonymous": false
417
- },
418
469
  {
419
470
  "type": "event",
420
471
  "name": "LimitOrderCreated",
@@ -618,20 +669,61 @@
618
669
  "anonymous": false
619
670
  },
620
671
  {
621
- "type": "error",
622
- "name": "AccessManagedInvalidAuthority",
672
+ "type": "event",
673
+ "name": "OwnershipTransferStarted",
623
674
  "inputs": [
624
675
  {
625
- "name": "authority",
676
+ "name": "previousOwner",
626
677
  "type": "address",
678
+ "indexed": true,
679
+ "internalType": "address"
680
+ },
681
+ {
682
+ "name": "newOwner",
683
+ "type": "address",
684
+ "indexed": true,
627
685
  "internalType": "address"
628
686
  }
629
- ]
687
+ ],
688
+ "anonymous": false
630
689
  },
631
690
  {
632
- "type": "error",
633
- "name": "AccessManagedUnauthorized",
634
- "inputs": []
691
+ "type": "event",
692
+ "name": "OwnershipTransferred",
693
+ "inputs": [
694
+ {
695
+ "name": "previousOwner",
696
+ "type": "address",
697
+ "indexed": true,
698
+ "internalType": "address"
699
+ },
700
+ {
701
+ "name": "newOwner",
702
+ "type": "address",
703
+ "indexed": true,
704
+ "internalType": "address"
705
+ }
706
+ ],
707
+ "anonymous": false
708
+ },
709
+ {
710
+ "type": "event",
711
+ "name": "PermittedCallerUpdated",
712
+ "inputs": [
713
+ {
714
+ "name": "caller",
715
+ "type": "address",
716
+ "indexed": true,
717
+ "internalType": "address"
718
+ },
719
+ {
720
+ "name": "permitted",
721
+ "type": "bool",
722
+ "indexed": false,
723
+ "internalType": "bool"
724
+ }
725
+ ],
726
+ "anonymous": false
635
727
  },
636
728
  {
637
729
  "type": "error",
@@ -643,6 +735,11 @@
643
735
  "name": "ArrayLengthMismatch",
644
736
  "inputs": []
645
737
  },
738
+ {
739
+ "type": "error",
740
+ "name": "CallerNotPermitted",
741
+ "inputs": []
742
+ },
646
743
  {
647
744
  "type": "error",
648
745
  "name": "CoinMismatch",
@@ -756,11 +853,38 @@
756
853
  "name": "OrderNotMaker",
757
854
  "inputs": []
758
855
  },
856
+ {
857
+ "type": "error",
858
+ "name": "OwnableInvalidOwner",
859
+ "inputs": [
860
+ {
861
+ "name": "owner",
862
+ "type": "address",
863
+ "internalType": "address"
864
+ }
865
+ ]
866
+ },
867
+ {
868
+ "type": "error",
869
+ "name": "OwnableUnauthorizedAccount",
870
+ "inputs": [
871
+ {
872
+ "name": "account",
873
+ "type": "address",
874
+ "internalType": "address"
875
+ }
876
+ ]
877
+ },
759
878
  {
760
879
  "type": "error",
761
880
  "name": "PathMustHaveAtLeastOneStep",
762
881
  "inputs": []
763
882
  },
883
+ {
884
+ "type": "error",
885
+ "name": "PermittedCallersLengthMismatch",
886
+ "inputs": []
887
+ },
764
888
  {
765
889
  "type": "error",
766
890
  "name": "RouterMsgSenderInvalid",