@cancore/contracts 0.1.0 → 0.2.0-rc.3
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 +168 -9
- package/dist/abi.d.ts +6086 -1675
- package/dist/abi.js +1 -1
- package/dist/chunk-NV5IUURP.js +9252 -0
- package/dist/chunk-NV5IUURP.js.map +1 -0
- package/dist/{chunk-CIBYXHSX.js → chunk-VODZRADO.js} +2 -2
- package/dist/chunk-VODZRADO.js.map +1 -0
- package/dist/index.d.ts +849 -28
- package/dist/index.js +2065 -16
- package/dist/index.js.map +1 -1
- package/dist/networks.d.ts +2 -2
- package/dist/networks.js +1 -1
- package/package.json +10 -8
- package/spec/abi/AttestorSet.json +476 -0
- package/spec/abi/CNRX.json +1294 -0
- package/spec/abi/CNRXStaking.json +510 -0
- package/spec/abi/CancoreRouter.json +2564 -0
- package/spec/abi/FeeVault.json +604 -0
- package/spec/abi/HTLC.json +717 -0
- package/spec/abi/IBurnMintERC20.json +252 -0
- package/spec/abi/ICancoreRouter.json +1226 -0
- package/spec/abi/IHTLC.json +382 -0
- package/spec/abi/IPermit2.json +150 -0
- package/spec/abi/MultiBalanceChecker.json +34 -0
- package/spec/abi/PointsClaim.json +791 -0
- package/spec/protocol/asyncapi.json +1050 -0
- package/spec/protocol/messages.schema.json +414 -0
- package/spec/protocol/records.schema.json +93 -0
- package/spec/protocol/rest.schema.json +115 -0
- package/spec/protocol/typed-data/FillerAuth.json +58 -0
- package/spec/protocol/typed-data/FillerQuote.json +75 -0
- package/spec/protocol/typed-data/GatewayMessage.json +90 -0
- package/spec/protocol/typed-data/StakeBinding.json +75 -0
- package/spec/protocol/typed-data/TicketIntent.json +65 -0
- package/spec/protocol/typed-data/TicketReceipt.json +51 -0
- package/spec/protocol/vectors/draw.json +61 -0
- package/spec/protocol/vectors/jcs.json +59 -0
- package/spec/protocol/vectors/messages.json +343 -0
- package/spec/protocol/vectors/records.json +81 -0
- package/spec/typed-data/FillProof.json +199 -0
- package/spec/typed-data/FillTicket.json +83 -0
- package/spec/typed-data/Order.json +141 -0
- package/spec/typed-data/Quote.json +69 -0
- package/spec/vectors/canton-order.json +67 -0
- package/dist/chunk-CIBYXHSX.js.map +0 -1
- package/dist/chunk-ZSX67S72.js +0 -3423
- package/dist/chunk-ZSX67S72.js.map +0 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Valid example frames of filler protocol v1, one or more per type, built on the golden vectors (hashes are real). sig is a zero placeholder: @cancore/test-kit signs what it serves. Generated by scripts/gen-protocol-docs.mjs.",
|
|
3
|
+
"examples": {
|
|
4
|
+
"auth.challenge": [
|
|
5
|
+
{
|
|
6
|
+
"type": "auth.challenge",
|
|
7
|
+
"sentAt": 1789999980000,
|
|
8
|
+
"nonce": "0x63ed6389bd2a1d23bb678583c227172bda874e82b97b1c170bfeeb4373b4b0d5",
|
|
9
|
+
"expiresAt": "1790000030",
|
|
10
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"auth.response": [
|
|
14
|
+
{
|
|
15
|
+
"type": "auth.response",
|
|
16
|
+
"id": "a-1",
|
|
17
|
+
"fillerId": "acme-markets",
|
|
18
|
+
"keyAddress": "0x90f79bf6eb2c4f870365e785982e1f101e93b906",
|
|
19
|
+
"protocolVersion": "1",
|
|
20
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"auth.ok": [
|
|
24
|
+
{
|
|
25
|
+
"type": "auth.ok",
|
|
26
|
+
"fillerId": "acme-markets",
|
|
27
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
28
|
+
"sentAt": 1789999980200,
|
|
29
|
+
"re": "a-1",
|
|
30
|
+
"heartbeatIntervalMs": 15000
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"ping": [
|
|
34
|
+
{
|
|
35
|
+
"type": "ping",
|
|
36
|
+
"id": "p-1"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "ping",
|
|
40
|
+
"fillerId": "acme-markets",
|
|
41
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
42
|
+
"sentAt": 1789999995000,
|
|
43
|
+
"id": "gp-1"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"pong": [
|
|
47
|
+
{
|
|
48
|
+
"type": "pong",
|
|
49
|
+
"re": "gp-1"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "pong",
|
|
53
|
+
"fillerId": "acme-markets",
|
|
54
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
55
|
+
"sentAt": 1789999995100,
|
|
56
|
+
"re": "p-1"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"error": [
|
|
60
|
+
{
|
|
61
|
+
"type": "error",
|
|
62
|
+
"fillerId": "acme-markets",
|
|
63
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
64
|
+
"sentAt": 1790000023500,
|
|
65
|
+
"re": "i-2",
|
|
66
|
+
"code": "TICKET_CLOSED",
|
|
67
|
+
"message": "ticket.intent after acceptBy"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "error",
|
|
71
|
+
"sentAt": 1789999980100,
|
|
72
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
73
|
+
"re": "q-0",
|
|
74
|
+
"code": "UNAUTHENTICATED",
|
|
75
|
+
"message": "quote before auth.ok"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"epoch.weights": [
|
|
79
|
+
{
|
|
80
|
+
"type": "epoch.weights",
|
|
81
|
+
"fillerId": "acme-markets",
|
|
82
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
83
|
+
"sentAt": 1789999980300,
|
|
84
|
+
"epochId": "20717",
|
|
85
|
+
"startsAt": "1789948800",
|
|
86
|
+
"endsAt": "1790035200",
|
|
87
|
+
"weightsRoot": "0xa1c24765b55b34e0c206f808d2fac2e448d9db6f154d89f898921a80bad76e92"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"quote.request": [
|
|
91
|
+
{
|
|
92
|
+
"type": "quote.request",
|
|
93
|
+
"fillerId": "acme-markets",
|
|
94
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
95
|
+
"sentAt": 1789999990000,
|
|
96
|
+
"requestId": "req-7f3a9c21-4d88-4e5b-9a1e-0c2f6b8d4e31",
|
|
97
|
+
"route": {
|
|
98
|
+
"src": "eip155:11155111",
|
|
99
|
+
"dst": "eip155:421614"
|
|
100
|
+
},
|
|
101
|
+
"inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
|
|
102
|
+
"inputAmount": "1003000000",
|
|
103
|
+
"outputAsset": "0x75faf114eafb1bdbe2f0316df893fd58ce46aa4d",
|
|
104
|
+
"feeBps": 30,
|
|
105
|
+
"fillDeadlineHint": "1790000600",
|
|
106
|
+
"windowCloseAt": 1789999992000,
|
|
107
|
+
"quoteTtlMs": 60000,
|
|
108
|
+
"imbalanceHint": {
|
|
109
|
+
"dstAsset": "0x75faf114eafb1bdbe2f0316df893fd58ce46aa4d",
|
|
110
|
+
"netFlow24hUsd": "-12500.50"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"quote": [
|
|
115
|
+
{
|
|
116
|
+
"type": "quote",
|
|
117
|
+
"id": "q-1",
|
|
118
|
+
"requestId": "req-7f3a9c21-4d88-4e5b-9a1e-0c2f6b8d4e31",
|
|
119
|
+
"filler": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
|
|
120
|
+
"amountOut": "999000000",
|
|
121
|
+
"validUntil": "1790000060",
|
|
122
|
+
"nonce": "1",
|
|
123
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"quote.ack": [
|
|
127
|
+
{
|
|
128
|
+
"type": "quote.ack",
|
|
129
|
+
"fillerId": "acme-markets",
|
|
130
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
131
|
+
"sentAt": 1789999991001,
|
|
132
|
+
"re": "q-1",
|
|
133
|
+
"requestId": "req-7f3a9c21-4d88-4e5b-9a1e-0c2f6b8d4e31",
|
|
134
|
+
"quoteHash": "0xdfbd4a1d732d8a105714d38ed6c46b8ee6e299e8bf90990ac502ebaea19fbe70",
|
|
135
|
+
"receivedAt": 1789999991000,
|
|
136
|
+
"status": "COUNTED"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"quote.reconfirm": [
|
|
140
|
+
{
|
|
141
|
+
"type": "quote.reconfirm",
|
|
142
|
+
"fillerId": "acme-markets",
|
|
143
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
144
|
+
"sentAt": 1790000013000,
|
|
145
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
146
|
+
"requestId": "req-7f3a9c21-4d88-4e5b-9a1e-0c2f6b8d4e31",
|
|
147
|
+
"order": {
|
|
148
|
+
"user": "0xa11ce00000000000000000000000000000000001",
|
|
149
|
+
"originChainId": "11155111",
|
|
150
|
+
"inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
|
|
151
|
+
"inputAmount": "1003000000",
|
|
152
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000066eee",
|
|
153
|
+
"outputAsset": "0x00000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
|
|
154
|
+
"minReceived": "999000000",
|
|
155
|
+
"recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
|
|
156
|
+
"createdAt": "1790000000",
|
|
157
|
+
"fillDeadline": "1790000600",
|
|
158
|
+
"feeBps": "30"
|
|
159
|
+
},
|
|
160
|
+
"amountOut": "999000000",
|
|
161
|
+
"ticketTtl": 360,
|
|
162
|
+
"replyBy": 1790000016000
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"quote.reconfirm.reply": [
|
|
166
|
+
{
|
|
167
|
+
"type": "quote.reconfirm.reply",
|
|
168
|
+
"id": "r-1",
|
|
169
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
170
|
+
"accept": true,
|
|
171
|
+
"validUntil": "1790000400",
|
|
172
|
+
"nonce": "2",
|
|
173
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "quote.reconfirm.reply",
|
|
177
|
+
"id": "r-2",
|
|
178
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
179
|
+
"accept": false
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"ticket.offer": [
|
|
183
|
+
{
|
|
184
|
+
"type": "ticket.offer",
|
|
185
|
+
"fillerId": "acme-markets",
|
|
186
|
+
"sentAt": 1790000020000,
|
|
187
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
188
|
+
"attempt": 0,
|
|
189
|
+
"order": {
|
|
190
|
+
"user": "0xa11ce00000000000000000000000000000000001",
|
|
191
|
+
"originChainId": "11155111",
|
|
192
|
+
"inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
|
|
193
|
+
"inputAmount": "1003000000",
|
|
194
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000066eee",
|
|
195
|
+
"outputAsset": "0x00000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
|
|
196
|
+
"minReceived": "999000000",
|
|
197
|
+
"recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
|
|
198
|
+
"createdAt": "1790000000",
|
|
199
|
+
"fillDeadline": "1790000600",
|
|
200
|
+
"feeBps": "30"
|
|
201
|
+
},
|
|
202
|
+
"amountOut": "999000000",
|
|
203
|
+
"validFrom": "1790000040",
|
|
204
|
+
"validUntil": "1790000400",
|
|
205
|
+
"acceptBy": 1790000023000,
|
|
206
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"ticket.intent": [
|
|
210
|
+
{
|
|
211
|
+
"type": "ticket.intent",
|
|
212
|
+
"id": "i-1",
|
|
213
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
214
|
+
"attempt": 0,
|
|
215
|
+
"validFrom": "1790000040",
|
|
216
|
+
"validUntil": "1790000400",
|
|
217
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"ticket.decline": [
|
|
221
|
+
{
|
|
222
|
+
"type": "ticket.decline",
|
|
223
|
+
"id": "d-1",
|
|
224
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
225
|
+
"attempt": 0,
|
|
226
|
+
"reason": "TICKET_ISSUED_LATE",
|
|
227
|
+
"detail": "ticket.issued 3001 ms after acceptBy"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"ticket.intent.ack": [
|
|
231
|
+
{
|
|
232
|
+
"type": "ticket.intent.ack",
|
|
233
|
+
"fillerId": "acme-markets",
|
|
234
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
235
|
+
"sentAt": 1790000021001,
|
|
236
|
+
"re": "i-1",
|
|
237
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
238
|
+
"attempt": 0,
|
|
239
|
+
"intentHash": "0xf3a07f98be564fb062f1574d933fc33f40e5c9e36c0fec83d3b3c4c15e9199c2",
|
|
240
|
+
"receivedAt": 1790000021000
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"ticket.issued": [
|
|
244
|
+
{
|
|
245
|
+
"type": "ticket.issued",
|
|
246
|
+
"fillerId": "acme-markets",
|
|
247
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
248
|
+
"sentAt": 1790000024000,
|
|
249
|
+
"form": "evm",
|
|
250
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
251
|
+
"attempt": 0,
|
|
252
|
+
"ticket": {
|
|
253
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
254
|
+
"filler": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
|
|
255
|
+
"attempt": 0,
|
|
256
|
+
"validFrom": "1790000040",
|
|
257
|
+
"validUntil": "1790000400"
|
|
258
|
+
},
|
|
259
|
+
"ticketSig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"type": "ticket.issued",
|
|
263
|
+
"fillerId": "acme-markets",
|
|
264
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
265
|
+
"sentAt": 1790000024000,
|
|
266
|
+
"form": "canton",
|
|
267
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
268
|
+
"attempt": 0,
|
|
269
|
+
"deliveryOrderCid": "00a1b2c3d4e5f6#fixture-delivery-order",
|
|
270
|
+
"validUntil": "1790000400"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"ticket.receipt": [
|
|
274
|
+
{
|
|
275
|
+
"type": "ticket.receipt",
|
|
276
|
+
"id": "rc-1",
|
|
277
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
278
|
+
"attempt": 0,
|
|
279
|
+
"ticketHash": "0x466bc75e5efad07ad975aeea9ec731902bc804461686a6c8f76ef4fd50297819",
|
|
280
|
+
"ticketSigHash": "0x9d30145c6e97cad96cf7cee181ac9d5b879dea7fed0730d7197e84e28487292b",
|
|
281
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"fill.reported": [
|
|
285
|
+
{
|
|
286
|
+
"type": "fill.reported",
|
|
287
|
+
"id": "f-1",
|
|
288
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
289
|
+
"attempt": 0,
|
|
290
|
+
"txRef": "0xfc4cba975d6b96ed2be00adae2d970f61413b963279089dcfc6402ddccc42740"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"ticket.expired": [
|
|
294
|
+
{
|
|
295
|
+
"type": "ticket.expired",
|
|
296
|
+
"fillerId": "acme-markets",
|
|
297
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
298
|
+
"sentAt": 1790000460000,
|
|
299
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
300
|
+
"attempt": 0,
|
|
301
|
+
"result": "FILLED"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"type": "ticket.expired",
|
|
305
|
+
"fillerId": "acme-markets",
|
|
306
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
307
|
+
"sentAt": 1790000460000,
|
|
308
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
309
|
+
"attempt": 0,
|
|
310
|
+
"result": "EXEMPT",
|
|
311
|
+
"exemptReason": "DESTINATION_HALTED"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"order.settled": [
|
|
315
|
+
{
|
|
316
|
+
"type": "order.settled",
|
|
317
|
+
"fillerId": "acme-markets",
|
|
318
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
319
|
+
"sentAt": 1790000900000,
|
|
320
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
321
|
+
"payout": "1000000000",
|
|
322
|
+
"fee": "3000000",
|
|
323
|
+
"penaltyWithheld": "0",
|
|
324
|
+
"txRef": "0x8d99b79edaf0d9c062753bb308a72f52ec1ed8873fe06580c14524bb66a9f614"
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
"penalty.applied": [
|
|
328
|
+
{
|
|
329
|
+
"type": "penalty.applied",
|
|
330
|
+
"fillerId": "acme-markets",
|
|
331
|
+
"sig": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
332
|
+
"sentAt": 1790001000000,
|
|
333
|
+
"violationId": "v-1",
|
|
334
|
+
"code": "NO_SHOW",
|
|
335
|
+
"step": "L1",
|
|
336
|
+
"details": {
|
|
337
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
338
|
+
"attempt": 0
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Fixture draw record (attempt 0 of the test-kit fixture order, spec/protocol/vectors/draw.json) and the epoch record containing its t0, without sig — the gateway signs them. weightsRoot: OpenZeppelin StandardMerkleTree over [\"string\",\"uint256\",\"uint8\",\"uint16\"] = (fillerId, base, tier, reliabilityBps); weight = (base + step(tier)) × reliabilityBps.",
|
|
3
|
+
"draw": {
|
|
4
|
+
"orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
|
|
5
|
+
"source": "eip155:11155111",
|
|
6
|
+
"openRef": "0xbf27995945a87053970c38b8d6e1991aad68ab122b7b45147e9c38b2d33dc89a",
|
|
7
|
+
"t0": "1790000012",
|
|
8
|
+
"epochId": "20717",
|
|
9
|
+
"deltaDrand": 6,
|
|
10
|
+
"attempts": [
|
|
11
|
+
{
|
|
12
|
+
"attempt": 0,
|
|
13
|
+
"tBase": "1790000012",
|
|
14
|
+
"closedBy": null,
|
|
15
|
+
"drandRound": "32398885",
|
|
16
|
+
"drandRandomness": "0xb6d412641a7d58b20ef5dded4ae48e9358cc35710f90961d8fe6e99d0e0281ef",
|
|
17
|
+
"drandSignature": "0x8f6d5ddd520329a4ce9a25db41c0552a5ac04bd56577138cbb0ec2b9326af2b8012c7dc2c5bcddc439d922c93a281d24",
|
|
18
|
+
"candidates": [
|
|
19
|
+
{
|
|
20
|
+
"fillerId": "acme-markets",
|
|
21
|
+
"weight": "1500000"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"fillerId": "cancore-reserve",
|
|
25
|
+
"weight": "900000"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"fillerId": "zeta-liquidity",
|
|
29
|
+
"weight": "1000000"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"r": "599507",
|
|
33
|
+
"winnerFillerId": "acme-markets",
|
|
34
|
+
"fallbackReason": null
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"epoch": {
|
|
39
|
+
"epochId": "20717",
|
|
40
|
+
"startsAt": "1789948800",
|
|
41
|
+
"endsAt": "1790035200",
|
|
42
|
+
"weightsRoot": "0xa1c24765b55b34e0c206f808d2fac2e448d9db6f154d89f898921a80bad76e92",
|
|
43
|
+
"leaves": [
|
|
44
|
+
{
|
|
45
|
+
"fillerId": "acme-markets",
|
|
46
|
+
"base": "100",
|
|
47
|
+
"tier": 1,
|
|
48
|
+
"reliabilityBps": 10000
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"fillerId": "cancore-reserve",
|
|
52
|
+
"base": "100",
|
|
53
|
+
"tier": 0,
|
|
54
|
+
"reliabilityBps": 9000
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"fillerId": "zeta-liquidity",
|
|
58
|
+
"base": "100",
|
|
59
|
+
"tier": 0,
|
|
60
|
+
"reliabilityBps": 10000
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"stakeSteps": [
|
|
64
|
+
{
|
|
65
|
+
"tier": 0,
|
|
66
|
+
"minStake": "0",
|
|
67
|
+
"step": "0"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"tier": 1,
|
|
71
|
+
"minStake": "100000000000000000000000",
|
|
72
|
+
"step": "50"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"rMinBps": 5000,
|
|
76
|
+
"snapshotBlocks": {
|
|
77
|
+
"eip155:1": "23456789",
|
|
78
|
+
"eip155:56": "61234567"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "EIP-712 schema of FillProof — the struct CancoreRouter.settle verifies attestor signatures over — and its golden vectors. The contract is the source of truth: test/CancoreRouter.ts checks this file against FILLPROOF_TYPEHASH and hashFillProof. @cancore/contracts mirrors it (sdk: npm run sync) and checks the same vectors with its own encoder. Change the struct here and this repository's test fails at once; the SDK's fails once its `npm run sync` pulls the change (nothing checks the two repositories against each other automatically).",
|
|
3
|
+
"primaryType": "FillProof",
|
|
4
|
+
"domain": {
|
|
5
|
+
"$comment": "The SOURCE router of the order: settle recomputes the digest in its own domain, so a proof never verifies on another chain or router.",
|
|
6
|
+
"name": "CancoreRouter",
|
|
7
|
+
"version": "1",
|
|
8
|
+
"fields": [
|
|
9
|
+
"name",
|
|
10
|
+
"version",
|
|
11
|
+
"chainId",
|
|
12
|
+
"verifyingContract"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"typeString": "FillProof(uint8 kind,bytes32 orderHash,bytes32 destination,bytes32 fillRef,bytes32 recipient,bytes32 outputAsset,uint256 amountDelivered,uint64 filledAt,address filler,uint32 attempt,uint32 setId)",
|
|
16
|
+
"types": {
|
|
17
|
+
"FillProof": [
|
|
18
|
+
{
|
|
19
|
+
"name": "kind",
|
|
20
|
+
"type": "uint8"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "orderHash",
|
|
24
|
+
"type": "bytes32"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "destination",
|
|
28
|
+
"type": "bytes32"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "fillRef",
|
|
32
|
+
"type": "bytes32"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "recipient",
|
|
36
|
+
"type": "bytes32"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "outputAsset",
|
|
40
|
+
"type": "bytes32"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "amountDelivered",
|
|
44
|
+
"type": "uint256"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "filledAt",
|
|
48
|
+
"type": "uint64"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "filler",
|
|
52
|
+
"type": "address"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "attempt",
|
|
56
|
+
"type": "uint32"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "setId",
|
|
60
|
+
"type": "uint32"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"vectors": [
|
|
65
|
+
{
|
|
66
|
+
"note": "baseline",
|
|
67
|
+
"chainId": 31337,
|
|
68
|
+
"verifyingContract": "0x00000000000000000000000000000000caFe0001",
|
|
69
|
+
"message": {
|
|
70
|
+
"kind": 1,
|
|
71
|
+
"orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
72
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
|
|
73
|
+
"fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
74
|
+
"recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
|
|
75
|
+
"outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
|
|
76
|
+
"amountDelivered": "95000000000000000000",
|
|
77
|
+
"filledAt": "1790000000",
|
|
78
|
+
"filler": "0x5555555555555555555555555555555555555555",
|
|
79
|
+
"attempt": 1,
|
|
80
|
+
"setId": 1
|
|
81
|
+
},
|
|
82
|
+
"digest": "0x60710cde56b0ce205921f022e5bbeb6f3e9c016810f9597d5f5d4cd8388de68f"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"note": "every integer at its maximum: no field is narrower than the contract says",
|
|
86
|
+
"chainId": 31337,
|
|
87
|
+
"verifyingContract": "0x00000000000000000000000000000000caFe0001",
|
|
88
|
+
"message": {
|
|
89
|
+
"kind": 255,
|
|
90
|
+
"orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
91
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
|
|
92
|
+
"fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
93
|
+
"recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
|
|
94
|
+
"outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
|
|
95
|
+
"amountDelivered": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
|
|
96
|
+
"filledAt": "18446744073709551615",
|
|
97
|
+
"filler": "0x5555555555555555555555555555555555555555",
|
|
98
|
+
"attempt": 4294967295,
|
|
99
|
+
"setId": 4294967295
|
|
100
|
+
},
|
|
101
|
+
"digest": "0x01ce524359fa8b9b4cc736fc5da949f435071a25c07dd3af691318272c968379"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"note": "zero words and the zero address",
|
|
105
|
+
"chainId": 31337,
|
|
106
|
+
"verifyingContract": "0x00000000000000000000000000000000caFe0001",
|
|
107
|
+
"message": {
|
|
108
|
+
"kind": 0,
|
|
109
|
+
"orderHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
110
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
111
|
+
"fillRef": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
112
|
+
"recipient": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
113
|
+
"outputAsset": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
114
|
+
"amountDelivered": "0",
|
|
115
|
+
"filledAt": "0",
|
|
116
|
+
"filler": "0x0000000000000000000000000000000000000000",
|
|
117
|
+
"attempt": 0,
|
|
118
|
+
"setId": 0
|
|
119
|
+
},
|
|
120
|
+
"digest": "0x149dddd5a7f61b04d9bd11113d684e20464ae92b4c05d13ec039b157224ab723"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"note": "same proof, another router: the digest is bound to verifyingContract",
|
|
124
|
+
"chainId": 31337,
|
|
125
|
+
"verifyingContract": "0x00000000000000000000000000000000caFe0002",
|
|
126
|
+
"message": {
|
|
127
|
+
"kind": 1,
|
|
128
|
+
"orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
129
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
|
|
130
|
+
"fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
131
|
+
"recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
|
|
132
|
+
"outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
|
|
133
|
+
"amountDelivered": "95000000000000000000",
|
|
134
|
+
"filledAt": "1790000000",
|
|
135
|
+
"filler": "0x5555555555555555555555555555555555555555",
|
|
136
|
+
"attempt": 1,
|
|
137
|
+
"setId": 1
|
|
138
|
+
},
|
|
139
|
+
"digest": "0x3c8add09c5e2c9fcdf3329f25bcfd8f2aa5f19ada2647d310df4dd6c2062021c"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"note": "a Canton destination and a later attempt under set 2",
|
|
143
|
+
"chainId": 31337,
|
|
144
|
+
"verifyingContract": "0x00000000000000000000000000000000caFe0001",
|
|
145
|
+
"message": {
|
|
146
|
+
"kind": 1,
|
|
147
|
+
"orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
148
|
+
"destination": "0x0000000000000000000000000000000000000000000000008000000000000003",
|
|
149
|
+
"fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
150
|
+
"recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
|
|
151
|
+
"outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
|
|
152
|
+
"amountDelivered": "95000000000000000000",
|
|
153
|
+
"filledAt": "1790000000",
|
|
154
|
+
"filler": "0x5555555555555555555555555555555555555555",
|
|
155
|
+
"attempt": 3,
|
|
156
|
+
"setId": 2
|
|
157
|
+
},
|
|
158
|
+
"digest": "0x7c2d541d8b5cb9cea85e2a509b5135cae5b8b23b000a7530e030d3663e8096a5"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"note": "computed by CancoreRouter.hashFillProof on the local stand (CAN-1776): same proof, chain id 11155111",
|
|
162
|
+
"chainId": 11155111,
|
|
163
|
+
"verifyingContract": "0xa5Ca448044cbF78a8b2a3853598b879e2722ce65",
|
|
164
|
+
"message": {
|
|
165
|
+
"kind": 1,
|
|
166
|
+
"orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
167
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
|
|
168
|
+
"fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
169
|
+
"recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
|
|
170
|
+
"outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
|
|
171
|
+
"amountDelivered": "95000000000000000000",
|
|
172
|
+
"filledAt": "1790000000",
|
|
173
|
+
"filler": "0x5555555555555555555555555555555555555555",
|
|
174
|
+
"attempt": 1,
|
|
175
|
+
"setId": 1
|
|
176
|
+
},
|
|
177
|
+
"digest": "0xdde67a41f980bd1d31af88addcbbd5a08e095816d7acc2fd9323e5dce7d28410"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"note": "Canton source (CAN-2061): the delivery of test/vectors/canton-order.json's order, in the domain Daml settles in — chainId CANTON_ORIGIN_ID = 2^63 + 1 (a string: it does not survive a JSON number), verifyingContract CANTON_SOURCE_ANCHOR. Both are the test vector's, not a per-network deployment. The digest is canton-contracts intent-test/daml/Intent/Test/AttestationVectors.daml vDigestExpected (fillProofDigest cantonMainnet (goldenProofOff 0)); no router computes it",
|
|
181
|
+
"chainId": "9223372036854775809",
|
|
182
|
+
"verifyingContract": "0x2f37b46Ea93001829498b145985fb53028033701",
|
|
183
|
+
"message": {
|
|
184
|
+
"kind": 1,
|
|
185
|
+
"orderHash": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204",
|
|
186
|
+
"destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
187
|
+
"fillRef": "0xcef5e95eb00bff57a5c6565834f300cdc8c694151245ab062e86822a8819897a",
|
|
188
|
+
"recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
|
|
189
|
+
"outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
190
|
+
"amountDelivered": "1246760000",
|
|
191
|
+
"filledAt": "1789999700",
|
|
192
|
+
"filler": "0x5b38da6a701c568545dcfcb03fcb875f56beddc4",
|
|
193
|
+
"attempt": 1,
|
|
194
|
+
"setId": 1
|
|
195
|
+
},
|
|
196
|
+
"digest": "0x4f6622ad6a74c4e5e173e9baaa2bfb2b4f32c1ff2e160076df172d4ef557b660"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|