@orbs-network/spot 2.4.4 → 2.5.0
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.
- package/README.md +8 -9
- package/config.json +128 -93
- package/index.html +1 -1
- package/out/MockDexRouter.sol/MockDexRouter.abi.json +11 -0
- package/out/MockParaswap.sol/MockTokenTransferProxy.abi.json +11 -0
- package/out/OrderValidationLib.Fuzz.t.sol/OrderValidationLibFuzzTest.abi.json +2 -2
- package/out/ResolutionLib.Fuzz.t.sol/ResolutionLibFuzzTest.abi.json +2 -2
- package/out/Settler.sol/Settler.abi.json +23 -13
- package/out/UniversalAdapter.sol/UniversalAdapter.abi.json +2 -29
- package/out/{DelegatingAdapter.sol/DelegatingAdapter.abi.json → UniversalAdapter.t.sol/MockResolvedAdapter.abi.json} +45 -9
- package/out/UniversalAdapter.t.sol/UniversalAdapterTest.abi.json +76 -4
- package/package.json +4 -9
- package/script/input/examples.json +56 -0
- package/script/input/repermit.skeleton.json +17 -17
- package/out/06_DeployDelegatingAdapter.s.sol/DeployDelegatingAdapter.abi.json +0 -28
- package/out/DelegatingAdapter.t.sol/DelegatingAdapterTest.abi.json +0 -916
- package/out/DelegatingAdapter.t.sol/MockDelegateTarget.abi.json +0 -22
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"name": "delegateSwap",
|
|
5
5
|
"inputs": [
|
|
6
6
|
{
|
|
7
|
-
"name": "",
|
|
7
|
+
"name": "hash",
|
|
8
8
|
"type": "bytes32",
|
|
9
9
|
"internalType": "bytes32"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
"name": "",
|
|
12
|
+
"name": "resolvedAmountOut",
|
|
13
13
|
"type": "uint256",
|
|
14
14
|
"internalType": "uint256"
|
|
15
15
|
},
|
|
@@ -394,36 +394,9 @@
|
|
|
394
394
|
"name": "FailedCall",
|
|
395
395
|
"inputs": []
|
|
396
396
|
},
|
|
397
|
-
{
|
|
398
|
-
"type": "error",
|
|
399
|
-
"name": "InsufficientBalance",
|
|
400
|
-
"inputs": [
|
|
401
|
-
{
|
|
402
|
-
"name": "balance",
|
|
403
|
-
"type": "uint256",
|
|
404
|
-
"internalType": "uint256"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
"name": "needed",
|
|
408
|
-
"type": "uint256",
|
|
409
|
-
"internalType": "uint256"
|
|
410
|
-
}
|
|
411
|
-
]
|
|
412
|
-
},
|
|
413
397
|
{
|
|
414
398
|
"type": "error",
|
|
415
399
|
"name": "InvalidTarget",
|
|
416
400
|
"inputs": []
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
"type": "error",
|
|
420
|
-
"name": "SafeERC20FailedOperation",
|
|
421
|
-
"inputs": [
|
|
422
|
-
{
|
|
423
|
-
"name": "token",
|
|
424
|
-
"type": "address",
|
|
425
|
-
"internalType": "address"
|
|
426
|
-
}
|
|
427
|
-
]
|
|
428
401
|
}
|
|
429
402
|
]
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"type": "constructor",
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"name": "_expectedResolvedAmountOut",
|
|
7
|
+
"type": "uint256",
|
|
8
|
+
"internalType": "uint256"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "_expectedTarget",
|
|
12
|
+
"type": "address",
|
|
13
|
+
"internalType": "address"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"stateMutability": "nonpayable"
|
|
17
|
+
},
|
|
2
18
|
{
|
|
3
19
|
"type": "function",
|
|
4
20
|
"name": "delegateSwap",
|
|
@@ -9,7 +25,7 @@
|
|
|
9
25
|
"internalType": "bytes32"
|
|
10
26
|
},
|
|
11
27
|
{
|
|
12
|
-
"name": "",
|
|
28
|
+
"name": "resolvedAmountOut",
|
|
13
29
|
"type": "uint256",
|
|
14
30
|
"internalType": "uint256"
|
|
15
31
|
},
|
|
@@ -376,27 +392,47 @@
|
|
|
376
392
|
}
|
|
377
393
|
],
|
|
378
394
|
"outputs": [],
|
|
379
|
-
"stateMutability": "
|
|
395
|
+
"stateMutability": "view"
|
|
380
396
|
},
|
|
381
397
|
{
|
|
382
|
-
"type": "
|
|
383
|
-
"name": "
|
|
384
|
-
"inputs": [
|
|
398
|
+
"type": "function",
|
|
399
|
+
"name": "expectedResolvedAmountOut",
|
|
400
|
+
"inputs": [],
|
|
401
|
+
"outputs": [
|
|
385
402
|
{
|
|
386
|
-
"name": "
|
|
403
|
+
"name": "",
|
|
404
|
+
"type": "uint256",
|
|
405
|
+
"internalType": "uint256"
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"stateMutability": "view"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"type": "function",
|
|
412
|
+
"name": "expectedTarget",
|
|
413
|
+
"inputs": [],
|
|
414
|
+
"outputs": [
|
|
415
|
+
{
|
|
416
|
+
"name": "",
|
|
387
417
|
"type": "address",
|
|
388
418
|
"internalType": "address"
|
|
389
419
|
}
|
|
390
|
-
]
|
|
420
|
+
],
|
|
421
|
+
"stateMutability": "view"
|
|
391
422
|
},
|
|
392
423
|
{
|
|
393
424
|
"type": "error",
|
|
394
|
-
"name": "
|
|
425
|
+
"name": "InvalidTarget",
|
|
395
426
|
"inputs": []
|
|
396
427
|
},
|
|
397
428
|
{
|
|
398
429
|
"type": "error",
|
|
399
|
-
"name": "
|
|
430
|
+
"name": "UnexpectedResolvedAmount",
|
|
431
|
+
"inputs": []
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "error",
|
|
435
|
+
"name": "UnexpectedTarget",
|
|
400
436
|
"inputs": []
|
|
401
437
|
}
|
|
402
438
|
]
|
|
@@ -128,6 +128,19 @@
|
|
|
128
128
|
],
|
|
129
129
|
"stateMutability": "view"
|
|
130
130
|
},
|
|
131
|
+
{
|
|
132
|
+
"type": "function",
|
|
133
|
+
"name": "exec",
|
|
134
|
+
"inputs": [],
|
|
135
|
+
"outputs": [
|
|
136
|
+
{
|
|
137
|
+
"name": "",
|
|
138
|
+
"type": "address",
|
|
139
|
+
"internalType": "contract Executor"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"stateMutability": "view"
|
|
143
|
+
},
|
|
131
144
|
{
|
|
132
145
|
"type": "function",
|
|
133
146
|
"name": "executor",
|
|
@@ -245,6 +258,32 @@
|
|
|
245
258
|
],
|
|
246
259
|
"stateMutability": "view"
|
|
247
260
|
},
|
|
261
|
+
{
|
|
262
|
+
"type": "function",
|
|
263
|
+
"name": "paraswapRouter",
|
|
264
|
+
"inputs": [],
|
|
265
|
+
"outputs": [
|
|
266
|
+
{
|
|
267
|
+
"name": "",
|
|
268
|
+
"type": "address",
|
|
269
|
+
"internalType": "contract MockParaswapAugustus"
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
"stateMutability": "view"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"type": "function",
|
|
276
|
+
"name": "permit2",
|
|
277
|
+
"inputs": [],
|
|
278
|
+
"outputs": [
|
|
279
|
+
{
|
|
280
|
+
"name": "",
|
|
281
|
+
"type": "address",
|
|
282
|
+
"internalType": "contract MockPermit2"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"stateMutability": "view"
|
|
286
|
+
},
|
|
248
287
|
{
|
|
249
288
|
"type": "function",
|
|
250
289
|
"name": "reactor",
|
|
@@ -258,6 +297,19 @@
|
|
|
258
297
|
],
|
|
259
298
|
"stateMutability": "view"
|
|
260
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"type": "function",
|
|
302
|
+
"name": "reactorMock",
|
|
303
|
+
"inputs": [],
|
|
304
|
+
"outputs": [
|
|
305
|
+
{
|
|
306
|
+
"name": "",
|
|
307
|
+
"type": "address",
|
|
308
|
+
"internalType": "contract MockReactor"
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"stateMutability": "view"
|
|
312
|
+
},
|
|
261
313
|
{
|
|
262
314
|
"type": "function",
|
|
263
315
|
"name": "recipient",
|
|
@@ -472,28 +524,35 @@
|
|
|
472
524
|
},
|
|
473
525
|
{
|
|
474
526
|
"type": "function",
|
|
475
|
-
"name": "
|
|
527
|
+
"name": "test_delegateSwap_forwards_live_resolved_amount",
|
|
476
528
|
"inputs": [],
|
|
477
529
|
"outputs": [],
|
|
478
530
|
"stateMutability": "nonpayable"
|
|
479
531
|
},
|
|
480
532
|
{
|
|
481
533
|
"type": "function",
|
|
482
|
-
"name": "
|
|
534
|
+
"name": "test_executor_routes_default_adapter_through_universal",
|
|
483
535
|
"inputs": [],
|
|
484
536
|
"outputs": [],
|
|
485
537
|
"stateMutability": "nonpayable"
|
|
486
538
|
},
|
|
487
539
|
{
|
|
488
540
|
"type": "function",
|
|
489
|
-
"name": "
|
|
541
|
+
"name": "test_executor_routes_p2_adapter_through_universal",
|
|
490
542
|
"inputs": [],
|
|
491
543
|
"outputs": [],
|
|
492
544
|
"stateMutability": "nonpayable"
|
|
493
545
|
},
|
|
494
546
|
{
|
|
495
547
|
"type": "function",
|
|
496
|
-
"name": "
|
|
548
|
+
"name": "test_executor_routes_paraswap_adapter_through_universal",
|
|
549
|
+
"inputs": [],
|
|
550
|
+
"outputs": [],
|
|
551
|
+
"stateMutability": "nonpayable"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"type": "function",
|
|
555
|
+
"name": "test_swap_reverts_invalid_target",
|
|
497
556
|
"inputs": [],
|
|
498
557
|
"outputs": [],
|
|
499
558
|
"stateMutability": "nonpayable"
|
|
@@ -524,6 +583,19 @@
|
|
|
524
583
|
],
|
|
525
584
|
"stateMutability": "view"
|
|
526
585
|
},
|
|
586
|
+
{
|
|
587
|
+
"type": "function",
|
|
588
|
+
"name": "tokenTransferProxy",
|
|
589
|
+
"inputs": [],
|
|
590
|
+
"outputs": [
|
|
591
|
+
{
|
|
592
|
+
"name": "",
|
|
593
|
+
"type": "address",
|
|
594
|
+
"internalType": "contract MockTokenTransferProxy"
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
"stateMutability": "view"
|
|
598
|
+
},
|
|
527
599
|
{
|
|
528
600
|
"type": "function",
|
|
529
601
|
"name": "triggerLower",
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbs-network/spot",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"mcpName": "io.github.orbs-network/spot",
|
|
3
|
+
"version": "2.5.0",
|
|
5
4
|
"description": "**A DeFi protocol for noncustodial advanced order types on EVM chains.**",
|
|
6
5
|
"homepage": "https://orbs-network.github.io/spot/",
|
|
7
6
|
"bugs": {
|
|
@@ -13,20 +12,16 @@
|
|
|
13
12
|
},
|
|
14
13
|
"license": "MIT",
|
|
15
14
|
"author": "danielz@orbs.com",
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=18"
|
|
18
|
-
},
|
|
19
15
|
"workspaces": [
|
|
20
|
-
"skill"
|
|
21
|
-
"mcp"
|
|
16
|
+
"skill"
|
|
22
17
|
],
|
|
23
18
|
"scripts": {
|
|
24
19
|
"fmt": "forge fmt",
|
|
25
|
-
"sync": "
|
|
20
|
+
"sync": "./script/sync.zsh",
|
|
26
21
|
"build": "npm run sync && forge build --extra-output-files abi",
|
|
27
22
|
"test": "forge test",
|
|
28
23
|
"prepublishOnly": "npm run fmt && npm run build && npm run test",
|
|
29
|
-
"postpublish": "npm publish -w skill && npm
|
|
24
|
+
"postpublish": "npm publish -w skill && npm pack -w skill"
|
|
30
25
|
},
|
|
31
26
|
"files": [
|
|
32
27
|
"config.json",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"title": "Limit Order",
|
|
4
|
+
"chainId": 42161,
|
|
5
|
+
"swapper": "0x2222222222222222222222222222222222222222",
|
|
6
|
+
"inputToken": "0x1111111111111111111111111111111111111111",
|
|
7
|
+
"inputAmount": "1000000",
|
|
8
|
+
"inputMaxAmount": "1000000",
|
|
9
|
+
"outputToken": "0x3333333333333333333333333333333333333333",
|
|
10
|
+
"outputLimit": "250000000000000",
|
|
11
|
+
"outputTriggerLower": "0",
|
|
12
|
+
"outputTriggerUpper": "0",
|
|
13
|
+
"nonce": "1712345601",
|
|
14
|
+
"start": "1712345601",
|
|
15
|
+
"deadline": "1712345901",
|
|
16
|
+
"epoch": 0,
|
|
17
|
+
"slippage": 500,
|
|
18
|
+
"signature": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb1b"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"title": "Stop-Loss Order",
|
|
22
|
+
"chainId": 1,
|
|
23
|
+
"swapper": "0x5555555555555555555555555555555555555555",
|
|
24
|
+
"inputToken": "0x4444444444444444444444444444444444444444",
|
|
25
|
+
"inputAmount": "5000000000000000000",
|
|
26
|
+
"inputMaxAmount": "5000000000000000000",
|
|
27
|
+
"outputToken": "0x6666666666666666666666666666666666666666",
|
|
28
|
+
"outputLimit": "0",
|
|
29
|
+
"outputTriggerLower": "9000000000000",
|
|
30
|
+
"outputTriggerUpper": "0",
|
|
31
|
+
"nonce": "1712346602",
|
|
32
|
+
"start": "1712346602",
|
|
33
|
+
"deadline": "1712347202",
|
|
34
|
+
"epoch": 0,
|
|
35
|
+
"slippage": 500,
|
|
36
|
+
"signature": "0xccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd1c"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"title": "TWAP Order",
|
|
40
|
+
"chainId": 8453,
|
|
41
|
+
"swapper": "0x8888888888888888888888888888888888888888",
|
|
42
|
+
"inputToken": "0x7777777777777777777777777777777777777777",
|
|
43
|
+
"inputAmount": "3000000",
|
|
44
|
+
"inputMaxAmount": "12000000",
|
|
45
|
+
"outputToken": "0x9999999999999999999999999999999999999999",
|
|
46
|
+
"outputLimit": "0",
|
|
47
|
+
"outputTriggerLower": "0",
|
|
48
|
+
"outputTriggerUpper": "0",
|
|
49
|
+
"nonce": "1712347603",
|
|
50
|
+
"start": "1712347603",
|
|
51
|
+
"deadline": "1712348503",
|
|
52
|
+
"epoch": 300,
|
|
53
|
+
"slippage": 500,
|
|
54
|
+
"signature": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1b"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"domain": {
|
|
3
3
|
"name": "RePermit",
|
|
4
4
|
"version": "1",
|
|
5
|
-
"chainId": "<
|
|
5
|
+
"chainId": "<CHAIN_ID>",
|
|
6
6
|
"verifyingContract": "<REPERMIT>"
|
|
7
7
|
},
|
|
8
8
|
"primaryType": "RePermitWitnessTransferFrom",
|
|
@@ -154,8 +154,8 @@
|
|
|
154
154
|
},
|
|
155
155
|
"message": {
|
|
156
156
|
"permitted": {
|
|
157
|
-
"token": "<
|
|
158
|
-
"amount": "<
|
|
157
|
+
"token": "<INPUT_TOKEN>",
|
|
158
|
+
"amount": "<INPUT_MAX_AMOUNT>"
|
|
159
159
|
},
|
|
160
160
|
"spender": "<REACTOR>",
|
|
161
161
|
"nonce": "<NONCE>",
|
|
@@ -166,29 +166,29 @@
|
|
|
166
166
|
"exchange": {
|
|
167
167
|
"adapter": "<ADAPTER>",
|
|
168
168
|
"ref": "<REFERRER>",
|
|
169
|
-
"share":
|
|
169
|
+
"share": 0,
|
|
170
170
|
"data": "<ADAPTER_USER_DATA>"
|
|
171
171
|
},
|
|
172
172
|
"swapper": "<SWAPPER>",
|
|
173
173
|
"nonce": "<NONCE>",
|
|
174
174
|
"start": "<START>",
|
|
175
175
|
"deadline": "<DEADLINE>",
|
|
176
|
-
"chainid": "<
|
|
177
|
-
"exclusivity":
|
|
178
|
-
"epoch": "<
|
|
179
|
-
"slippage":
|
|
180
|
-
"freshness":
|
|
176
|
+
"chainid": "<CHAIN_ID>",
|
|
177
|
+
"exclusivity": 0,
|
|
178
|
+
"epoch": "<EPOCH_SECONDS>",
|
|
179
|
+
"slippage": 500,
|
|
180
|
+
"freshness": 50,
|
|
181
181
|
"input": {
|
|
182
|
-
"token": "<
|
|
183
|
-
"amount": "<
|
|
184
|
-
"maxAmount": "<
|
|
182
|
+
"token": "<INPUT_TOKEN>",
|
|
183
|
+
"amount": "<INPUT_AMOUNT>",
|
|
184
|
+
"maxAmount": "<INPUT_MAX_AMOUNT>"
|
|
185
185
|
},
|
|
186
186
|
"output": {
|
|
187
|
-
"token": "<
|
|
188
|
-
"limit": "<
|
|
189
|
-
"triggerLower": "<
|
|
190
|
-
"triggerUpper": "<
|
|
191
|
-
"recipient": "<
|
|
187
|
+
"token": "<OUTPUT_TOKEN>",
|
|
188
|
+
"limit": "<OUTPUT_LIMIT>",
|
|
189
|
+
"triggerLower": "<OUTPUT_TRIGGER_LOWER>",
|
|
190
|
+
"triggerUpper": "<OUTPUT_TRIGGER_UPPER>",
|
|
191
|
+
"recipient": "<OUTPUT_RECIPIENT>"
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "function",
|
|
4
|
-
"name": "IS_SCRIPT",
|
|
5
|
-
"inputs": [],
|
|
6
|
-
"outputs": [
|
|
7
|
-
{
|
|
8
|
-
"name": "",
|
|
9
|
-
"type": "bool",
|
|
10
|
-
"internalType": "bool"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"stateMutability": "view"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"type": "function",
|
|
17
|
-
"name": "run",
|
|
18
|
-
"inputs": [],
|
|
19
|
-
"outputs": [
|
|
20
|
-
{
|
|
21
|
-
"name": "adapter",
|
|
22
|
-
"type": "address",
|
|
23
|
-
"internalType": "address"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"stateMutability": "nonpayable"
|
|
27
|
-
}
|
|
28
|
-
]
|