@inversealtruism/cairnx-core 0.1.37 → 0.1.40
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/dist/index.cjs +137 -5
- package/dist/index.d.cts +165 -7
- package/dist/index.d.ts +165 -7
- package/dist/index.js +128 -5
- package/package.json +2 -2
- package/test/vectors/cases-v29.json +886 -0
- package/test/vectors/cases.json +123 -0
- package/test/vectors/wa-parity-corpus.json +175 -0
package/test/vectors/cases.json
CHANGED
|
@@ -7450,6 +7450,129 @@
|
|
|
7450
7450
|
}
|
|
7451
7451
|
}
|
|
7452
7452
|
}
|
|
7453
|
+
},
|
|
7454
|
+
{
|
|
7455
|
+
"name": "v28-namegive-fclaim-fill",
|
|
7456
|
+
"events": [
|
|
7457
|
+
{
|
|
7458
|
+
"kind": "propose",
|
|
7459
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc28001d",
|
|
7460
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7461
|
+
"uri": "{\"commit\":\"0x103fb8eeae5e6827389b7a7b51ae659d5d0118d9d21398c3d9f1181440149364\",\"t\":\"ncommit\",\"v\":1}",
|
|
7462
|
+
"payloadHash": "0xaa38d67cedbf151f9f167d49991427d85353017304426db1af63d81e642e6cc5",
|
|
7463
|
+
"expiresEpoch": 900000000000000,
|
|
7464
|
+
"height": 60000,
|
|
7465
|
+
"pos": 1,
|
|
7466
|
+
"paidTo": {}
|
|
7467
|
+
},
|
|
7468
|
+
{
|
|
7469
|
+
"kind": "propose",
|
|
7470
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc28001e",
|
|
7471
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7472
|
+
"uri": "{\"name\":\"gemname\",\"salt\":\"a1a1a1a1a1a1a1a1\",\"t\":\"name\",\"v\":1}",
|
|
7473
|
+
"payloadHash": "0x4b496fea674f44b47b597633f7317dc0d1f2d871a7c7947a56246181c57fa2b4",
|
|
7474
|
+
"expiresEpoch": 900000000000000,
|
|
7475
|
+
"height": 60002,
|
|
7476
|
+
"pos": 1,
|
|
7477
|
+
"paidTo": {}
|
|
7478
|
+
},
|
|
7479
|
+
{
|
|
7480
|
+
"kind": "propose",
|
|
7481
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc28001f",
|
|
7482
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7483
|
+
"uri": "{\"name\":\"gemname\",\"salt\":\"a1a1a1a1a1a1a1a1\",\"t\":\"nfinalize\",\"v\":1}",
|
|
7484
|
+
"payloadHash": "0x63926275c4b89a7788ab506af975805569362a347f246ac96454552750167fa8",
|
|
7485
|
+
"expiresEpoch": 900000000000000,
|
|
7486
|
+
"height": 60010,
|
|
7487
|
+
"pos": 1,
|
|
7488
|
+
"paidTo": {
|
|
7489
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "500000000"
|
|
7490
|
+
}
|
|
7491
|
+
},
|
|
7492
|
+
{
|
|
7493
|
+
"kind": "propose",
|
|
7494
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc280020",
|
|
7495
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7496
|
+
"uri": "{\"give\":{\"name\":\"gemname\"},\"t\":\"offer\",\"v\":1,\"want\":{\"payto\":\"0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1\",\"value\":\"1000000000\"}}",
|
|
7497
|
+
"payloadHash": "0x0379d4c9e1aa33fd6159dc46ca69f16e726ef8430618d069da3ed2c0de4e890d",
|
|
7498
|
+
"expiresEpoch": 2024,
|
|
7499
|
+
"height": 60011,
|
|
7500
|
+
"pos": 0,
|
|
7501
|
+
"paidTo": {}
|
|
7502
|
+
},
|
|
7503
|
+
{
|
|
7504
|
+
"kind": "propose",
|
|
7505
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc280021",
|
|
7506
|
+
"proposer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
7507
|
+
"uri": "{\"offer\":\"0x00000000000000000000000000000000000000000000000000000000fc280020\",\"t\":\"fclaim\",\"v\":1}",
|
|
7508
|
+
"payloadHash": "0x64dd224736e033203635889c53a4ecd8c58ad20905e38c1465b54874e0e06439",
|
|
7509
|
+
"expiresEpoch": 2002,
|
|
7510
|
+
"height": 60012,
|
|
7511
|
+
"pos": 0,
|
|
7512
|
+
"paidTo": {}
|
|
7513
|
+
},
|
|
7514
|
+
{
|
|
7515
|
+
"kind": "attest",
|
|
7516
|
+
"txid": "0x00000000000000000000000000000000000000000000000000000000fc280022",
|
|
7517
|
+
"proposalId": "0x00000000000000000000000000000000000000000000000000000000fc280021",
|
|
7518
|
+
"attester": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
7519
|
+
"score": 100,
|
|
7520
|
+
"confidence": 0,
|
|
7521
|
+
"height": 60089,
|
|
7522
|
+
"pos": 0,
|
|
7523
|
+
"paidTo": {
|
|
7524
|
+
"0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1": "1030000000",
|
|
7525
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "15000000"
|
|
7526
|
+
}
|
|
7527
|
+
}
|
|
7528
|
+
],
|
|
7529
|
+
"tipHeight": 60094,
|
|
7530
|
+
"expectedState": {
|
|
7531
|
+
"balances": {},
|
|
7532
|
+
"bids": {},
|
|
7533
|
+
"feesPaid": "515000000",
|
|
7534
|
+
"names": {
|
|
7535
|
+
"gemname": {
|
|
7536
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000fc280022",
|
|
7537
|
+
"effectiveHeight": 60089,
|
|
7538
|
+
"height": 60089,
|
|
7539
|
+
"locked": false,
|
|
7540
|
+
"name": "gemname",
|
|
7541
|
+
"owner": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
7542
|
+
"paidThroughEpoch": 10760,
|
|
7543
|
+
"viaFill": true
|
|
7544
|
+
}
|
|
7545
|
+
},
|
|
7546
|
+
"offers": {
|
|
7547
|
+
"0x00000000000000000000000000000000000000000000000000000000fc280020": {
|
|
7548
|
+
"claimTxid": "0x00000000000000000000000000000000000000000000000000000000fc280021",
|
|
7549
|
+
"claimUntilHeight": 60090,
|
|
7550
|
+
"claimedBy": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
7551
|
+
"expiresEpoch": 2024,
|
|
7552
|
+
"feeBps": 150,
|
|
7553
|
+
"fill": {
|
|
7554
|
+
"buyer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
7555
|
+
"fee": "15000000",
|
|
7556
|
+
"height": 60089,
|
|
7557
|
+
"paid": "1030000000",
|
|
7558
|
+
"txid": "0x00000000000000000000000000000000000000000000000000000000fc280022"
|
|
7559
|
+
},
|
|
7560
|
+
"give": {
|
|
7561
|
+
"name": "gemname"
|
|
7562
|
+
},
|
|
7563
|
+
"height": 60011,
|
|
7564
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000fc280020",
|
|
7565
|
+
"seller": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7566
|
+
"status": "filled",
|
|
7567
|
+
"want": {
|
|
7568
|
+
"payto": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
7569
|
+
"value": "1000000000"
|
|
7570
|
+
}
|
|
7571
|
+
}
|
|
7572
|
+
},
|
|
7573
|
+
"tipHeight": 60094,
|
|
7574
|
+
"tokens": {}
|
|
7575
|
+
}
|
|
7453
7576
|
}
|
|
7454
7577
|
]
|
|
7455
7578
|
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"note": "WA-PARITY: the SHARED hostile-case corpus that keeps the three fill-boundary seams from ever diverging (cairnx-core verifyFillSpv, cairn-wallet fillspv.ts, cairn public/trade/swapguard.js). Homed here in csd-sdk; each consumer repo vendors a byte-identity-checked copy (the I2 dead-green lesson: the freshness check FAILS, never skips, if a copy drifts). Record-level + seam-agnostic: every seam materializes the SAME scenario in its own injection shape (cairnx-core builds abstract ChainEvents; wallet/site build REAL signed txs + prevout binds), so a wallet-vs-site split goes red. Two families: 'replay' cases exercise the grant/hold/completeness replay that ALL THREE seams share; 'terms' cases exercise the served-offer vs merkle-proven-offer bind that only the CALLERS do (wallet provenTermsMismatch + site verifyOfferContent), because cairnx-core verifyFillSpv takes NO served offer and re-derives everything from proven events.",
|
|
4
|
+
"consts": {
|
|
5
|
+
"V28_HEIGHT": 60000,
|
|
6
|
+
"EPOCH_LEN": 30,
|
|
7
|
+
"FCLAIM_MAX_EPOCH_AHEAD": 2,
|
|
8
|
+
"CLAIM_COOLDOWN_BLOCKS": 15,
|
|
9
|
+
"FILL_TIP_MARGIN": 4,
|
|
10
|
+
"TREASURY_ADDR": "0x6b09ce74e6070ebc982ab0fb793a211c4d24f016",
|
|
11
|
+
"FEE_BPS_V16": 150,
|
|
12
|
+
"note": "Each adapter MUST assert its own vendored constants equal these before running, so a silent constant drift reds the corpus (not a false green)."
|
|
13
|
+
},
|
|
14
|
+
"actors": {
|
|
15
|
+
"A": { "role": "seller" },
|
|
16
|
+
"B": { "role": "buyer" },
|
|
17
|
+
"C": { "role": "third-party" }
|
|
18
|
+
},
|
|
19
|
+
"backing": [
|
|
20
|
+
{ "by": "A", "height": "H0", "rec": { "t": "deploy", "ticker": "AAA", "decimals": 0, "supply": "1000", "mint": "issuer" }, "fee": "DEPLOY_FEE" },
|
|
21
|
+
{ "by": "A", "height": "H0+1", "rec": { "t": "mint", "ticker": "AAA", "amount": "1000" } }
|
|
22
|
+
],
|
|
23
|
+
"scenarios": [
|
|
24
|
+
{
|
|
25
|
+
"name": "honest-whole-fill",
|
|
26
|
+
"family": "replay",
|
|
27
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
28
|
+
"desc": "The buyer holds a live granted fclaim on an open whole-fill CSD offer, both buried, delivery >= 1. Accepted by every seam (the no-false-refusal baseline).",
|
|
29
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
30
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
31
|
+
"extra": [],
|
|
32
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
33
|
+
"attack": { "type": "none" },
|
|
34
|
+
"expect": "accept"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "honest-partial-fill",
|
|
38
|
+
"family": "replay",
|
|
39
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
40
|
+
"desc": "A partial-enabled offer (min set) with a buyer paying exactly min. Deliverable >= 1, accepted by every seam. Guards against a false-refuse of legitimate partials.",
|
|
41
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": "100000000" },
|
|
42
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
43
|
+
"extra": [],
|
|
44
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": "100000000" },
|
|
45
|
+
"attack": { "type": "none" },
|
|
46
|
+
"expect": "accept"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "below-depth-fill",
|
|
50
|
+
"family": "replay",
|
|
51
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
52
|
+
"desc": "The fclaim is not yet buried to requiredClaimDepth. Every seam REFUSES (fail-safe wait, not a burn).",
|
|
53
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
54
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
55
|
+
"extra": [],
|
|
56
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "absolute", "h": "H0+4" }, "pay": null },
|
|
57
|
+
"attack": { "type": "none" },
|
|
58
|
+
"expect": "reject"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "denied-fclaim",
|
|
62
|
+
"family": "replay",
|
|
63
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
64
|
+
"desc": "B holds fc1 (granted); B posts fc2 while fc1's hold is live -> the resolver DENIES fc2. A lying resolver aliases fc2 as granted. Filling fc2 attests an L0-valid but DELIVERY-LESS target = burn. Every seam re-derives the deny and REFUSES.",
|
|
65
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
66
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
67
|
+
"extra": [
|
|
68
|
+
{ "kind": "fclaim", "id": "F2", "by": "B", "offer": "OFFER", "height": "H0+5", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } }
|
|
69
|
+
],
|
|
70
|
+
"fill": { "me": "B", "fclaim": "F2", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
71
|
+
"attack": { "type": "none" },
|
|
72
|
+
"expect": "reject"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "forged-cancel-holder",
|
|
76
|
+
"family": "replay",
|
|
77
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
78
|
+
"desc": "C holds a valid fclaim fcC; B forges holdership and tries to fill fcC. resolve() would reject the payment (who !== claimedBy), burning it. Every seam re-derives that the hold is not mine and REFUSES.",
|
|
79
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
80
|
+
"fclaim": { "id": "FC", "by": "C", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
81
|
+
"extra": [],
|
|
82
|
+
"fill": { "me": "B", "fclaim": "FC", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
83
|
+
"attack": { "type": "none" },
|
|
84
|
+
"expect": "reject"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "ocancel-before-grant",
|
|
88
|
+
"family": "replay",
|
|
89
|
+
"seams": ["cairnxCore", "wallet", "site"],
|
|
90
|
+
"desc": "Seller A posts ocancel {AAA} with no live hold -> the offer is cancelled on-chain and any later fclaim is DENIED. A Byzantine/D2-aliasing resolver still reports the offer open and serves B's fclaim as the granted target. THE F8 CASE: the site includes the ocancel in its scan (swapguard.js) and refuses; the wallet's fillspv.ts must too (the R1 F8 fix). Every seam REFUSES; a wallet-vs-site split here goes red.",
|
|
91
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
92
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+5", "ee": { "kind": "epochOfPlus", "of": "H0+5", "plus": 2 } },
|
|
93
|
+
"extra": [
|
|
94
|
+
{ "kind": "ocancel", "id": "OC", "by": "A", "ticker": "AAA", "height": "H0+3" }
|
|
95
|
+
],
|
|
96
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
97
|
+
"attack": { "type": "none" },
|
|
98
|
+
"expect": "reject"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "withheld-cancel",
|
|
102
|
+
"family": "replay",
|
|
103
|
+
"seams": ["wallet", "site"],
|
|
104
|
+
"desc": "Seller A posts ocancel {AAA} on-chain BEFORE the fclaim grant, but a lying resolver OMITS the ocancel from the event/hint list it serves (the F8 COMPLETENESS attack, distinct from ocancel-before-grant where the cancel IS in the served set). Each seam must find the cancel via its OWN PoW-verified block-body scan and REFUSE. cairnx-core verifyFillSpv canNOT catch a withheld event - its event set IS the seam's hint list (io.offerEventIds), so completeness is a SEAM obligation the pure layer cannot verify. Hence this scenario is wallet/site-only; the cairnx-core adapter demonstrates the gap by materialising the withheld cancel on-chain-but-excluded-from-hints and asserting verifyFillSpv ACCEPTS (safe), which is exactly why the seams do their own scan.",
|
|
105
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
106
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+5", "ee": { "kind": "epochOfPlus", "of": "H0+5", "plus": 2 } },
|
|
107
|
+
"extra": [
|
|
108
|
+
{ "kind": "ocancel", "id": "OC", "by": "A", "ticker": "AAA", "height": "H0+3", "withheld": true }
|
|
109
|
+
],
|
|
110
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
111
|
+
"attack": { "type": "withheld-event", "event": "OC" },
|
|
112
|
+
"expect": "reject"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "payto-strip",
|
|
116
|
+
"family": "terms",
|
|
117
|
+
"seams": ["wallet", "site"],
|
|
118
|
+
"desc": "The open CSD offer is payto-LESS on-chain (recipient = the proven prevout owner A). A read-path attacker strips the funding tx scriptSig (recoverAttester -> null) and serves a /proposal whose want.payto is the attacker. The site + wallet bind the recipient to the MERKLE-PROVEN prevout owner and REFUSE. cairnxCore N/A: verifyFillSpv takes no served offer.",
|
|
119
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": null }, "min": null },
|
|
120
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
121
|
+
"extra": [],
|
|
122
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
123
|
+
"attack": { "type": "payto-substitute", "servedPayto": "ATTACKER", "scriptSig": "strip" },
|
|
124
|
+
"expect": "reject"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "payto-resign",
|
|
128
|
+
"family": "terms",
|
|
129
|
+
"seams": ["wallet", "site"],
|
|
130
|
+
"desc": "Same payto-less offer, but the attacker RE-SIGNS the funding tx with a throwaway key so recoverAttester returns the attacker (== served proposer). The bind derives the recipient from the merkle-proven PREVOUT OWNER (not the malleable scriptSig), so both seams still REFUSE.",
|
|
131
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": null }, "min": null },
|
|
132
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
133
|
+
"extra": [],
|
|
134
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
135
|
+
"attack": { "type": "payto-substitute", "servedPayto": "ATTACKER", "scriptSig": "resign" },
|
|
136
|
+
"expect": "reject"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "seller-swap",
|
|
140
|
+
"family": "terms",
|
|
141
|
+
"seams": ["wallet", "site"],
|
|
142
|
+
"desc": "The maker-rebate leg (offer.seller) is swapped to the attacker while want.payto stays honest. resolve() pays the rebate to the on-chain author; a mis-sized rebate leg makes resolve() reject AFTER payment = burn. Both seams bind offer.seller to the proven author and REFUSE.",
|
|
143
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
144
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
145
|
+
"extra": [],
|
|
146
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
147
|
+
"attack": { "type": "seller-substitute", "servedSeller": "ATTACKER" },
|
|
148
|
+
"expect": "reject"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "spurious-min-whole-fill",
|
|
152
|
+
"family": "terms",
|
|
153
|
+
"seams": ["wallet", "site"],
|
|
154
|
+
"desc": "The offer is a whole-fill open-CSD offer (no on-chain min). A lying resolver ADDS a spurious min -> previewFill flips to the PARTIAL branch (rebate:0) -> requiredFillOutputs drops the maker-rebate leg -> resolve() rejects 'maker rebate unpaid' AFTER payment = full burn (the R1.1 min-bind case). Both seams bind min (present/absent) to the proven record and REFUSE.",
|
|
155
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
156
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
157
|
+
"extra": [],
|
|
158
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
159
|
+
"attack": { "type": "min-substitute", "servedMin": "100000000" },
|
|
160
|
+
"expect": "reject"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "deflated-feeBps",
|
|
164
|
+
"family": "terms",
|
|
165
|
+
"seams": ["wallet", "site"],
|
|
166
|
+
"desc": "A lying resolver serves feeBps=0 for a >= V16 offer (real FEE_BPS_V16=150). requiredFillOutputs then under-sizes/omits the treasury fee leg -> resolve() rejects AFTER payment = burn. Both seams bind feeBps/height/taker/bid to the proven terms and REFUSE.",
|
|
167
|
+
"offer": { "id": "OFFER", "by": "A", "height": "H0+2", "give": { "ticker": "AAA", "amount": "10" }, "want": { "value": "500000000", "payto": "A" }, "min": null },
|
|
168
|
+
"fclaim": { "id": "F1", "by": "B", "offer": "OFFER", "height": "H0+3", "ee": { "kind": "epochOfPlus", "of": "H0+3", "plus": 2 } },
|
|
169
|
+
"extra": [],
|
|
170
|
+
"fill": { "me": "B", "fclaim": "F1", "tip": { "kind": "holdEndMinus", "n": 5 }, "pay": null },
|
|
171
|
+
"attack": { "type": "feeBps-substitute", "servedFeeBps": 0 },
|
|
172
|
+
"expect": "reject"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|