@cancore/contracts 0.1.0 → 0.2.0-rc.13

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 (62) hide show
  1. package/README.md +522 -10
  2. package/dist/abi.d.ts +6598 -1675
  3. package/dist/abi.js +1 -1
  4. package/dist/chunk-2ELHDMZ7.js +9911 -0
  5. package/dist/chunk-2ELHDMZ7.js.map +1 -0
  6. package/dist/{chunk-CIBYXHSX.js → chunk-IAPV7XWJ.js} +2 -2
  7. package/dist/chunk-IAPV7XWJ.js.map +1 -0
  8. package/dist/index.d.ts +1774 -29
  9. package/dist/index.js +3692 -21
  10. package/dist/index.js.map +1 -1
  11. package/dist/networks.d.ts +2 -2
  12. package/dist/networks.js +1 -1
  13. package/package.json +10 -8
  14. package/spec/abi/AttestorSet.json +476 -0
  15. package/spec/abi/CNRX.json +1294 -0
  16. package/spec/abi/CNRXStaking.json +510 -0
  17. package/spec/abi/CancoreRouter.json +2666 -0
  18. package/spec/abi/FeeVault.json +604 -0
  19. package/spec/abi/HTLC.json +717 -0
  20. package/spec/abi/IAttribute.json +110 -0
  21. package/spec/abi/IBurnMintERC20.json +252 -0
  22. package/spec/abi/ICancoreRouter.json +1361 -0
  23. package/spec/abi/IFormula.json +28 -0
  24. package/spec/abi/IHTLC.json +382 -0
  25. package/spec/abi/IPayment.json +40 -0
  26. package/spec/abi/IPermit2.json +150 -0
  27. package/spec/abi/IResolver.json +55 -0
  28. package/spec/abi/IStep.json +30 -0
  29. package/spec/abi/IVariableRole.json +141 -0
  30. package/spec/abi/MultiBalanceChecker.json +34 -0
  31. package/spec/abi/PointsClaim.json +791 -0
  32. package/spec/constants.json +66 -0
  33. package/spec/protocol/asyncapi.json +1587 -0
  34. package/spec/protocol/messages.schema.json +906 -0
  35. package/spec/protocol/records.schema.json +94 -0
  36. package/spec/protocol/rest.schema.json +193 -0
  37. package/spec/protocol/typed-data/CantonTicketReceipt.json +77 -0
  38. package/spec/protocol/typed-data/FillerAuth.json +58 -0
  39. package/spec/protocol/typed-data/FillerKeyRegistration.json +69 -0
  40. package/spec/protocol/typed-data/FillerMessage.json +115 -0
  41. package/spec/protocol/typed-data/FillerQuote.json +75 -0
  42. package/spec/protocol/typed-data/GatewayMessage.json +95 -0
  43. package/spec/protocol/typed-data/StakeBinding.json +75 -0
  44. package/spec/protocol/typed-data/TicketIntent.json +113 -0
  45. package/spec/protocol/typed-data/TicketReceipt.json +51 -0
  46. package/spec/protocol/vectors/draw.json +61 -0
  47. package/spec/protocol/vectors/jcs.json +59 -0
  48. package/spec/protocol/vectors/messages.json +743 -0
  49. package/spec/protocol/vectors/records.json +81 -0
  50. package/spec/protocol/vectors/settle-attestations.json +544 -0
  51. package/spec/typed-data/FillProof.json +227 -0
  52. package/spec/typed-data/FillTicket.json +116 -0
  53. package/spec/typed-data/Order.json +169 -0
  54. package/spec/typed-data/Quote.json +79 -0
  55. package/spec/vectors/canton-destination.json +60 -0
  56. package/spec/vectors/canton-order.json +70 -0
  57. package/spec/vectors/evm-order.json +50 -0
  58. package/spec/vectors/fee-split.json +179 -0
  59. package/spec/vectors/permit-witness.json +150 -0
  60. package/dist/chunk-CIBYXHSX.js.map +0 -1
  61. package/dist/chunk-ZSX67S72.js +0 -3423
  62. package/dist/chunk-ZSX67S72.js.map +0 -1
@@ -0,0 +1,227 @@
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). The vectors are @cancore/contracts' canonical set (CAN-2139, sdk 4c6971f), byte for byte: the router computing each of them in test/CancoreRouter.ts is the cross-check between the two repositories.",
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,bytes32 fillerId,bytes32 repayTo,uint32 attempt,uint32 setId)",
16
+ "typeHash": "0xc37e18cdd22fbc1e707c1bcc554d9d29c2e6c5a44bb4a9a4dc38e2c28e2419ae",
17
+ "types": {
18
+ "FillProof": [
19
+ {
20
+ "name": "kind",
21
+ "type": "uint8"
22
+ },
23
+ {
24
+ "name": "orderHash",
25
+ "type": "bytes32"
26
+ },
27
+ {
28
+ "name": "destination",
29
+ "type": "bytes32"
30
+ },
31
+ {
32
+ "name": "fillRef",
33
+ "type": "bytes32"
34
+ },
35
+ {
36
+ "name": "recipient",
37
+ "type": "bytes32"
38
+ },
39
+ {
40
+ "name": "outputAsset",
41
+ "type": "bytes32"
42
+ },
43
+ {
44
+ "name": "amountDelivered",
45
+ "type": "uint256"
46
+ },
47
+ {
48
+ "name": "filledAt",
49
+ "type": "uint64"
50
+ },
51
+ {
52
+ "name": "fillerId",
53
+ "type": "bytes32"
54
+ },
55
+ {
56
+ "name": "repayTo",
57
+ "type": "bytes32"
58
+ },
59
+ {
60
+ "name": "attempt",
61
+ "type": "uint32"
62
+ },
63
+ {
64
+ "name": "setId",
65
+ "type": "uint32"
66
+ }
67
+ ]
68
+ },
69
+ "vectors": [
70
+ {
71
+ "note": "baseline: EVM source and destination, fillerId keccak256(\"acme\"), repayTo a padded EVM address",
72
+ "chainId": 31337,
73
+ "verifyingContract": "0x00000000000000000000000000000000caFe0001",
74
+ "message": {
75
+ "kind": 1,
76
+ "orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
77
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
78
+ "fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
79
+ "recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
80
+ "outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
81
+ "amountDelivered": "95000000000000000000",
82
+ "filledAt": "1790000000",
83
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
84
+ "repayTo": "0x0000000000000000000000005555555555555555555555555555555555555555",
85
+ "attempt": 1,
86
+ "setId": 1
87
+ },
88
+ "domainSeparator": "0x503f410fe6d9a92cb96e0a70062885290f68a1f72fb40330678e25b874731300",
89
+ "structHash": "0x800e6b4a1224dad7ca66111790954bd1f8eeb719f634932412949ab7534de529",
90
+ "digest": "0xb8567a7df02431d496c14b998f686c050d86c7552939aa67f66612d3602f4b6c"
91
+ },
92
+ {
93
+ "note": "every integer at its maximum, every word all ones: no field is narrower than the contract says",
94
+ "chainId": 31337,
95
+ "verifyingContract": "0x00000000000000000000000000000000caFe0001",
96
+ "message": {
97
+ "kind": 255,
98
+ "orderHash": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
99
+ "destination": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
100
+ "fillRef": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
101
+ "recipient": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
102
+ "outputAsset": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
103
+ "amountDelivered": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
104
+ "filledAt": "18446744073709551615",
105
+ "fillerId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
106
+ "repayTo": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
107
+ "attempt": 4294967295,
108
+ "setId": 4294967295
109
+ },
110
+ "domainSeparator": "0x503f410fe6d9a92cb96e0a70062885290f68a1f72fb40330678e25b874731300",
111
+ "structHash": "0x6d4f2ee32e02ff5cb479dbd8f18fd1306b89a2513db6cfa3da06c69992c96a3f",
112
+ "digest": "0x5850aac6189524d1b34d16b467bce6a3a5f6681255cb4abe83a28147d534fcdb"
113
+ },
114
+ {
115
+ "note": "zero words",
116
+ "chainId": 31337,
117
+ "verifyingContract": "0x00000000000000000000000000000000caFe0001",
118
+ "message": {
119
+ "kind": 0,
120
+ "orderHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
121
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000000",
122
+ "fillRef": "0x0000000000000000000000000000000000000000000000000000000000000000",
123
+ "recipient": "0x0000000000000000000000000000000000000000000000000000000000000000",
124
+ "outputAsset": "0x0000000000000000000000000000000000000000000000000000000000000000",
125
+ "amountDelivered": "0",
126
+ "filledAt": "0",
127
+ "fillerId": "0x0000000000000000000000000000000000000000000000000000000000000000",
128
+ "repayTo": "0x0000000000000000000000000000000000000000000000000000000000000000",
129
+ "attempt": 0,
130
+ "setId": 0
131
+ },
132
+ "domainSeparator": "0x503f410fe6d9a92cb96e0a70062885290f68a1f72fb40330678e25b874731300",
133
+ "structHash": "0x51713b6c288966f3e995793ff65a3cec60bfbc51c240bd2aa50ade3da1c284d0",
134
+ "digest": "0x5d5d4907e300a8d705d3d61c23c0b7bf0d34039c85e6e4eadc601fe3fe60e439"
135
+ },
136
+ {
137
+ "note": "same proof, another router: the digest is bound to verifyingContract",
138
+ "chainId": 31337,
139
+ "verifyingContract": "0x00000000000000000000000000000000caFe0002",
140
+ "message": {
141
+ "kind": 1,
142
+ "orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
143
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
144
+ "fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
145
+ "recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
146
+ "outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
147
+ "amountDelivered": "95000000000000000000",
148
+ "filledAt": "1790000000",
149
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
150
+ "repayTo": "0x0000000000000000000000005555555555555555555555555555555555555555",
151
+ "attempt": 1,
152
+ "setId": 1
153
+ },
154
+ "domainSeparator": "0x282a771d1c663bbda15fa1376f122d013f85569d94bdfa5c681ca6215c7db6b8",
155
+ "structHash": "0x800e6b4a1224dad7ca66111790954bd1f8eeb719f634932412949ab7534de529",
156
+ "digest": "0xce35f3f8838fad5b41bc9ab963682a6965334abf7340ea4618958b0ac26f6712"
157
+ },
158
+ {
159
+ "note": "Canton destination (protocol.md §3.13): destination keccak256(\"canton:mainnet\"), recipient keccak256(party), outputAsset keccak256(abi.encode(\"cancore:instrument:v1\", admin, id)), amount Numeric 10 × 10^10 (1200.25); a later attempt under set 2. The encoder itself is CAN-1935",
160
+ "chainId": 31337,
161
+ "verifyingContract": "0x00000000000000000000000000000000caFe0001",
162
+ "message": {
163
+ "kind": 1,
164
+ "orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
165
+ "destination": "0x8d6e3eea79c707a9549bdb1206260cd46ef29e86763e19a8a3f494bc6b499440",
166
+ "fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
167
+ "recipient": "0x8330f18e4203206b15fc33cb80a36595317e2638ec444305e71b9502faa9e628",
168
+ "outputAsset": "0x034bad92a7c82fb0e37b03e7795ae88257786ea0e2cfe2c43b88b420993dc98f",
169
+ "amountDelivered": "12002500000000",
170
+ "filledAt": "1790000000",
171
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
172
+ "repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
173
+ "attempt": 3,
174
+ "setId": 2
175
+ },
176
+ "domainSeparator": "0x503f410fe6d9a92cb96e0a70062885290f68a1f72fb40330678e25b874731300",
177
+ "structHash": "0x3c76a53bbcb8fe01a0902d30794bcabf6948476a85f7be9fc9c178e74af5d272",
178
+ "digest": "0xdebb837668be49db1a9a6a4b0aeb69839b92ce0095dc5016a3b0d541aad346ba"
179
+ },
180
+ {
181
+ "note": "same proof, another chain (11155111) and router",
182
+ "chainId": 11155111,
183
+ "verifyingContract": "0xa5Ca448044cbF78a8b2a3853598b879e2722ce65",
184
+ "message": {
185
+ "kind": 1,
186
+ "orderHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
187
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000aa36a7",
188
+ "fillRef": "0x2222222222222222222222222222222222222222222222222222222222222222",
189
+ "recipient": "0x0000000000000000000000003333333333333333333333333333333333333333",
190
+ "outputAsset": "0x0000000000000000000000004444444444444444444444444444444444444444",
191
+ "amountDelivered": "95000000000000000000",
192
+ "filledAt": "1790000000",
193
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
194
+ "repayTo": "0x0000000000000000000000005555555555555555555555555555555555555555",
195
+ "attempt": 1,
196
+ "setId": 1
197
+ },
198
+ "domainSeparator": "0x311d9cdf77fccd430656cbd12f0da889d7c14ab9832dec4dcf90f76557a4e9bf",
199
+ "structHash": "0x800e6b4a1224dad7ca66111790954bd1f8eeb719f634932412949ab7534de529",
200
+ "digest": "0x81c3633199fbeed50c8d6aa235b1fdd5e0fa98d21caf70dc331d47936faced4b"
201
+ },
202
+ {
203
+ "note": "Canton source: the delivery of spec/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; repayTo = keccak256(utf8(partyId)) of the filler party (repayToParty), fillerId keccak256(\"acme\") — the filler the order picked (OD-1). Daml FillProofVerify must reproduce typeHash, domainSeparator, structHash and digest",
204
+ "fillerIdString": "acme",
205
+ "repayToParty": "acme-markets::1220acdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacde",
206
+ "chainId": "9223372036854775809",
207
+ "verifyingContract": "0x2f37b46Ea93001829498b145985fb53028033701",
208
+ "message": {
209
+ "kind": 1,
210
+ "orderHash": "0x22e3a53ab72c6990b1971fd50b9ec6c527a003d987cd58d26058b380dd7ae79a",
211
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
212
+ "fillRef": "0xcef5e95eb00bff57a5c6565834f300cdc8c694151245ab062e86822a8819897a",
213
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
214
+ "outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
215
+ "amountDelivered": "1246760000",
216
+ "filledAt": "1789999700",
217
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
218
+ "repayTo": "0xe61d35ec4ca48f587165d3138bd11c79b42e52f6de0cec4b9e2d4350017f1e87",
219
+ "attempt": 1,
220
+ "setId": 1
221
+ },
222
+ "domainSeparator": "0x1f754285aeeb7c329e1107ea7f22092765deea7fd0db2c98bce7e0bda644ec16",
223
+ "structHash": "0x020e5d6af786617b2a3f47e44366fb5f0871ac8313edfa65653debb1590d5c04",
224
+ "digest": "0xbeb13e87d8daa5eff32f78a558611b5be48c31d5c2b187eeb523d99a8a5e5e16"
225
+ }
226
+ ]
227
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "$comment": "EIP-712 schema of FillTicket — the dispatcher's assignment CancoreRouter.fill verifies — and its golden vectors. The contract is the source of truth: test/CancoreRouter.ts checks this file against TICKET_TYPEHASH, TICKET_DOMAIN_SEPARATOR and hashTicket. @cancore/contracts mirrors it (sdk: npm run sync) and checks the same vectors with its own encoder. The vectors are @cancore/contracts' canonical set (CAN-2139, sdk 4c6971f), byte for byte: the router computing each of them in test/CancoreRouter.ts is the cross-check between the two repositories.",
3
+ "primaryType": "FillTicket",
4
+ "domain": {
5
+ "$comment": "The PROTOCOL domain: no chainId, no verifyingContract. orderHash is already the source-router digest, so one ticket verifies identically on every router and off-chain.",
6
+ "name": "CancoreFillTicket",
7
+ "version": "1",
8
+ "fields": [
9
+ "name",
10
+ "version"
11
+ ]
12
+ },
13
+ "typeString": "FillTicket(bytes32 orderHash,bytes32 fillerId,address deliveryKey,bytes32 repayTo,uint32 attempt,uint64 validFrom,uint64 validUntil)",
14
+ "types": {
15
+ "FillTicket": [
16
+ {
17
+ "name": "orderHash",
18
+ "type": "bytes32"
19
+ },
20
+ {
21
+ "name": "fillerId",
22
+ "type": "bytes32"
23
+ },
24
+ {
25
+ "name": "deliveryKey",
26
+ "type": "address"
27
+ },
28
+ {
29
+ "name": "repayTo",
30
+ "type": "bytes32"
31
+ },
32
+ {
33
+ "name": "attempt",
34
+ "type": "uint32"
35
+ },
36
+ {
37
+ "name": "validFrom",
38
+ "type": "uint64"
39
+ },
40
+ {
41
+ "name": "validUntil",
42
+ "type": "uint64"
43
+ }
44
+ ]
45
+ },
46
+ "vectors": [
47
+ {
48
+ "note": "protocol.md §3.3 hashTicket example: a fixed bytes32 orderHash input, fillerId keccak256(\"acme\"), repayTo the padded delivery key",
49
+ "message": {
50
+ "orderHash": "0xe61e980d40d1a666a509d2296c0d2658a40ff681e290c7646a75a550629ce1ad",
51
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
52
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
53
+ "repayTo": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
54
+ "attempt": 0,
55
+ "validFrom": "1789999000",
56
+ "validUntil": "1789999180"
57
+ },
58
+ "digest": "0xb751ce266445dfc74d2a1e7ec2b23f51bf36ccc97706f6d0d73e4be74f9d5c33"
59
+ },
60
+ {
61
+ "note": "ticket for the test-kit fixture order, attempt 0: EVM source, repayTo another address than the delivery key",
62
+ "fillerIdString": "acme-markets",
63
+ "message": {
64
+ "orderHash": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
65
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
66
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
67
+ "repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
68
+ "attempt": 0,
69
+ "validFrom": "1790000040",
70
+ "validUntil": "1790000400"
71
+ },
72
+ "digest": "0x963e823a2d9709d6630515731512094e45976407536974cb9f81817591ed1f16"
73
+ },
74
+ {
75
+ "note": "Canton source (canton-order.json): the filler the order picked (acme), repayTo = keccak256(utf8(partyId)) of the filler party",
76
+ "fillerIdString": "acme",
77
+ "repayToParty": "acme-markets::1220acdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacde",
78
+ "message": {
79
+ "orderHash": "0x22e3a53ab72c6990b1971fd50b9ec6c527a003d987cd58d26058b380dd7ae79a",
80
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
81
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
82
+ "repayTo": "0xe61d35ec4ca48f587165d3138bd11c79b42e52f6de0cec4b9e2d4350017f1e87",
83
+ "attempt": 1,
84
+ "validFrom": "1789999500",
85
+ "validUntil": "1789999800"
86
+ },
87
+ "digest": "0xc600cbeebb17532e040ee98ca7b2f1517a1e6748cfd9e1e2fb03ee6cbee3d054"
88
+ },
89
+ {
90
+ "note": "every integer at its maximum",
91
+ "message": {
92
+ "orderHash": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
93
+ "fillerId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
94
+ "deliveryKey": "0xffffffffffffffffffffffffffffffffffffffff",
95
+ "repayTo": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
96
+ "attempt": 4294967295,
97
+ "validFrom": "18446744073709551615",
98
+ "validUntil": "18446744073709551615"
99
+ },
100
+ "digest": "0x041820b7007543c4750057958545f330ece16fc5ae81d4d30571b2f09269ccb3"
101
+ },
102
+ {
103
+ "note": "zero",
104
+ "message": {
105
+ "orderHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
106
+ "fillerId": "0x0000000000000000000000000000000000000000000000000000000000000000",
107
+ "deliveryKey": "0x0000000000000000000000000000000000000000",
108
+ "repayTo": "0x0000000000000000000000000000000000000000000000000000000000000000",
109
+ "attempt": 0,
110
+ "validFrom": "0",
111
+ "validUntil": "0"
112
+ },
113
+ "digest": "0x205fd8f9d58d390da2bf1158f6a4025274dfc0d1db56422610b271d0a5ddd098"
114
+ }
115
+ ]
116
+ }
@@ -0,0 +1,169 @@
1
+ {
2
+ "$comment": "EIP-712 schema of Order verified by CancoreRouter. Source for @cancore/contracts sync; test/TypedDataVectors.ts checks its types and vectors against the router. Golden inputs from sdk b2e4afd802a389560e1b55828254f76968bd6721.",
3
+ "primaryType": "Order",
4
+ "domain": {
5
+ "name": "CancoreRouter",
6
+ "version": "1",
7
+ "fields": [
8
+ "name",
9
+ "version",
10
+ "chainId",
11
+ "verifyingContract"
12
+ ]
13
+ },
14
+ "typeString": "Order(address user,uint64 originChainId,address inputToken,uint256 inputAmount,bytes32 destination,bytes32 outputAsset,uint256 minReceived,bytes32 recipient,uint64 createdAt,uint64 fillDeadline,uint16 feeBps,bytes32 fillerId)",
15
+ "types": {
16
+ "Order": [
17
+ {
18
+ "name": "user",
19
+ "type": "address"
20
+ },
21
+ {
22
+ "name": "originChainId",
23
+ "type": "uint64"
24
+ },
25
+ {
26
+ "name": "inputToken",
27
+ "type": "address"
28
+ },
29
+ {
30
+ "name": "inputAmount",
31
+ "type": "uint256"
32
+ },
33
+ {
34
+ "name": "destination",
35
+ "type": "bytes32"
36
+ },
37
+ {
38
+ "name": "outputAsset",
39
+ "type": "bytes32"
40
+ },
41
+ {
42
+ "name": "minReceived",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "name": "recipient",
47
+ "type": "bytes32"
48
+ },
49
+ {
50
+ "name": "createdAt",
51
+ "type": "uint64"
52
+ },
53
+ {
54
+ "name": "fillDeadline",
55
+ "type": "uint64"
56
+ },
57
+ {
58
+ "name": "feeBps",
59
+ "type": "uint16"
60
+ },
61
+ {
62
+ "name": "fillerId",
63
+ "type": "bytes32"
64
+ }
65
+ ]
66
+ },
67
+ "vectors": [
68
+ {
69
+ "note": "canton-source golden order (spec/vectors/canton-order.json)",
70
+ "chainId": "9223372036854775809",
71
+ "verifyingContract": "0x2f37b46ea93001829498b145985fb53028033701",
72
+ "message": {
73
+ "user": "0x47f0d84377b46651f7936ae656dcecefdc1a2a86",
74
+ "originChainId": "9223372036854775809",
75
+ "inputToken": "0x795ae88257786ea0e2cfe2c43b88b420993dc98f",
76
+ "inputAmount": "12505000000000",
77
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
78
+ "outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
79
+ "minReceived": "1200250000",
80
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
81
+ "createdAt": "1789999400",
82
+ "fillDeadline": "1790000000",
83
+ "feeBps": "30",
84
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf"
85
+ },
86
+ "digest": "0x22e3a53ab72c6990b1971fd50b9ec6c527a003d987cd58d26058b380dd7ae79a"
87
+ },
88
+ {
89
+ "note": "EVM-source fixture order of @cancore/test-kit (sepolia to arbitrum sepolia)",
90
+ "chainId": "11155111",
91
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
92
+ "message": {
93
+ "user": "0xa11ce00000000000000000000000000000000001",
94
+ "originChainId": "11155111",
95
+ "inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
96
+ "inputAmount": "1003000000",
97
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000066eee",
98
+ "outputAsset": "0x00000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
99
+ "minReceived": "999000000",
100
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
101
+ "createdAt": "1790000000",
102
+ "fillDeadline": "1790000600",
103
+ "feeBps": "30",
104
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5"
105
+ },
106
+ "digest": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b"
107
+ },
108
+ {
109
+ "note": "every integer at its maximum",
110
+ "chainId": "11155111",
111
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
112
+ "message": {
113
+ "user": "0xffffffffffffffffffffffffffffffffffffffff",
114
+ "originChainId": "18446744073709551615",
115
+ "inputToken": "0xffffffffffffffffffffffffffffffffffffffff",
116
+ "inputAmount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
117
+ "destination": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
118
+ "outputAsset": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
119
+ "minReceived": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
120
+ "recipient": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
121
+ "createdAt": "18446744073709551615",
122
+ "fillDeadline": "18446744073709551615",
123
+ "feeBps": "65535",
124
+ "fillerId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
125
+ },
126
+ "digest": "0xfb6d2cba32ce501e0d2a2f4f4c7cb4380fc03aa833c5d1504b281165323e2d59"
127
+ },
128
+ {
129
+ "note": "zero words and the zero address",
130
+ "chainId": "11155111",
131
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
132
+ "message": {
133
+ "user": "0x0000000000000000000000000000000000000000",
134
+ "originChainId": "0",
135
+ "inputToken": "0x0000000000000000000000000000000000000000",
136
+ "inputAmount": "0",
137
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000000",
138
+ "outputAsset": "0x0000000000000000000000000000000000000000000000000000000000000000",
139
+ "minReceived": "0",
140
+ "recipient": "0x0000000000000000000000000000000000000000000000000000000000000000",
141
+ "createdAt": "0",
142
+ "fillDeadline": "0",
143
+ "feeBps": "0",
144
+ "fillerId": "0x0000000000000000000000000000000000000000000000000000000000000000"
145
+ },
146
+ "digest": "0xc623da4e472bc8cbe48f7cded744ec164f3caf592612a75d64bb7024f4ee6789"
147
+ },
148
+ {
149
+ "note": "Hardhat source domain: production router golden digest",
150
+ "chainId": "31337",
151
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
152
+ "message": {
153
+ "user": "0xa11ce00000000000000000000000000000000001",
154
+ "originChainId": "11155111",
155
+ "inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
156
+ "inputAmount": "1003000000",
157
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000066eee",
158
+ "outputAsset": "0x00000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
159
+ "minReceived": "999000000",
160
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
161
+ "createdAt": "1790000000",
162
+ "fillDeadline": "1790000600",
163
+ "feeBps": "30",
164
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5"
165
+ },
166
+ "digest": "0x1dda16e2253b9f25d589f051b1de5be25fdb56f3723c00471109e23b8e4314b0"
167
+ }
168
+ ]
169
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "$comment": "EIP-712 schema of Quote verified by CancoreRouter. Source for @cancore/contracts sync; test/TypedDataVectors.ts checks its types and vectors against the router. Golden inputs from sdk b2e4afd802a389560e1b55828254f76968bd6721.",
3
+ "primaryType": "Quote",
4
+ "domain": {
5
+ "name": "CancoreRouter",
6
+ "version": "1",
7
+ "fields": [
8
+ "name",
9
+ "version",
10
+ "chainId",
11
+ "verifyingContract"
12
+ ]
13
+ },
14
+ "typeString": "Quote(bytes32 orderHash,uint64 quoteDeadline)",
15
+ "types": {
16
+ "Quote": [
17
+ {
18
+ "name": "orderHash",
19
+ "type": "bytes32"
20
+ },
21
+ {
22
+ "name": "quoteDeadline",
23
+ "type": "uint64"
24
+ }
25
+ ]
26
+ },
27
+ "vectors": [
28
+ {
29
+ "note": "quote signer approves the fixture order",
30
+ "chainId": "11155111",
31
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
32
+ "message": {
33
+ "orderHash": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
34
+ "quoteDeadline": "1790000030"
35
+ },
36
+ "digest": "0x19f4365ffe4ca7c3dea71806d18e409cfe62c59dad4c9c6ac9b38d4200bf8969"
37
+ },
38
+ {
39
+ "note": "every integer at its maximum",
40
+ "chainId": "11155111",
41
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
42
+ "message": {
43
+ "orderHash": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
44
+ "quoteDeadline": "18446744073709551615"
45
+ },
46
+ "digest": "0x072fa3c045504f6548a932dee33c632e410e03c1707c960e17b071d4200d3db0"
47
+ },
48
+ {
49
+ "note": "zero",
50
+ "chainId": "11155111",
51
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
52
+ "message": {
53
+ "orderHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
54
+ "quoteDeadline": "0"
55
+ },
56
+ "digest": "0x073bf52876f4f94c77600e57aa4a20376c538f1f5d0f2ad2fe52209a8c777b3e"
57
+ },
58
+ {
59
+ "note": "canton source domain",
60
+ "chainId": "9223372036854775809",
61
+ "verifyingContract": "0x2f37b46ea93001829498b145985fb53028033701",
62
+ "message": {
63
+ "orderHash": "0x22e3a53ab72c6990b1971fd50b9ec6c527a003d987cd58d26058b380dd7ae79a",
64
+ "quoteDeadline": "1789999430"
65
+ },
66
+ "digest": "0xc77dff2a2eef3d324772ee5156003e55147351eecbee0826622bac4032f3c740"
67
+ },
68
+ {
69
+ "note": "Hardhat source domain: production router golden digest",
70
+ "chainId": "31337",
71
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
72
+ "message": {
73
+ "orderHash": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
74
+ "quoteDeadline": "1790000030"
75
+ },
76
+ "digest": "0x63877fbf7f35834ca64066328b372d6f826b8c1f42be410a87de9078338fa5bf"
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$comment": "An EVM-source order delivered on Canton and the FillProof of the delivery (protocol.md §3.13; CAN-1935): destination = keccak256(utf8(\"canton:<network>\")), outputAsset = keccak256(abi.encode(\"cancore:instrument:v1\", admin, id)), minReceived and amountDelivered = Daml Numeric 10 × 10^10, recipient = keccak256(utf8(partyId)); the proof copies destination, recipient and outputAsset from the order (CancoreRouter.settle compares them), fillRef = keccak256(utf8(updateId)), fillerId = keccak256(utf8(fillerId)), repayTo the padded EVM payout address. Network devnet (operator decision Р-3). The instrument, party and amount are those of the Canton-destination vector of spec/typed-data/FillProof.json (canton:mainnet), which the router test computes with hashFillProof. Digests by ethers TypedDataEncoder. Generated by scripts/gen-router-vectors.mjs.",
3
+ "vector": {
4
+ "networks": {
5
+ "mainnet": "0x8d6e3eea79c707a9549bdb1206260cd46ef29e86763e19a8a3f494bc6b499440",
6
+ "testnet": "0xe9988c091217763216d67a428bebd45f2f157fcf531ae52fba942fb9c0658682",
7
+ "devnet": "0x0f6f82ab16aa8bfd8099433fefad277a2ac9da342a11fe80fbfc3342c5bb0db9"
8
+ },
9
+ "input": {
10
+ "network": "devnet",
11
+ "instrumentAdmin": "cancore-registry::1220f0e1d2c3b4a5968778695a4b3c2d1e0f0e1d2c3b4a5968778695a4b3c2d1e0f",
12
+ "instrumentId": "CNRX",
13
+ "minReceived": "1200.25",
14
+ "amountDelivered": "1200.2500000001",
15
+ "recipientPartyId": "alice::1220a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9"
16
+ },
17
+ "encoded": {
18
+ "destination": "0x0f6f82ab16aa8bfd8099433fefad277a2ac9da342a11fe80fbfc3342c5bb0db9",
19
+ "outputAsset": "0x034bad92a7c82fb0e37b03e7795ae88257786ea0e2cfe2c43b88b420993dc98f",
20
+ "minReceived": "12002500000000",
21
+ "recipient": "0x8330f18e4203206b15fc33cb80a36595317e2638ec444305e71b9502faa9e628",
22
+ "amountDelivered": "12002500000001"
23
+ },
24
+ "domain": {
25
+ "chainId": 31337,
26
+ "verifyingContract": "0x00000000000000000000000000000000caFe0001"
27
+ },
28
+ "order": {
29
+ "user": "0xa11ce00000000000000000000000000000000001",
30
+ "originChainId": "31337",
31
+ "inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
32
+ "inputAmount": "1203610000",
33
+ "destination": "0x0f6f82ab16aa8bfd8099433fefad277a2ac9da342a11fe80fbfc3342c5bb0db9",
34
+ "outputAsset": "0x034bad92a7c82fb0e37b03e7795ae88257786ea0e2cfe2c43b88b420993dc98f",
35
+ "minReceived": "12002500000000",
36
+ "recipient": "0x8330f18e4203206b15fc33cb80a36595317e2638ec444305e71b9502faa9e628",
37
+ "createdAt": "1790000000",
38
+ "fillDeadline": "1790000600",
39
+ "feeBps": "30",
40
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5"
41
+ },
42
+ "orderHash": "0xab052e14369b46bf7a298daf3de9e563db7c60dc7562334f1243b16357606437",
43
+ "proof": {
44
+ "kind": 1,
45
+ "orderHash": "0xab052e14369b46bf7a298daf3de9e563db7c60dc7562334f1243b16357606437",
46
+ "destination": "0x0f6f82ab16aa8bfd8099433fefad277a2ac9da342a11fe80fbfc3342c5bb0db9",
47
+ "fillRef": "0x6e160b17d1a59750069b532ec354c9bfd5d99295375064d712fcb08284b50a1d",
48
+ "recipient": "0x8330f18e4203206b15fc33cb80a36595317e2638ec444305e71b9502faa9e628",
49
+ "outputAsset": "0x034bad92a7c82fb0e37b03e7795ae88257786ea0e2cfe2c43b88b420993dc98f",
50
+ "amountDelivered": "12002500000001",
51
+ "filledAt": "1790000300",
52
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
53
+ "repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
54
+ "attempt": 0,
55
+ "setId": 1
56
+ },
57
+ "structHash": "0x3f1343d942d7f21b9c8e7ba8eafbce0ee2652f803a240f8f17d56f9c6eff5fd5",
58
+ "digest": "0x68228fec9b687d9599b5758d44b19ec9c5f022c7aa50dbb0063cb48e1b4af81b"
59
+ }
60
+ }