@cancore/contracts 0.1.0 → 0.2.0-rc.6

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 (50) hide show
  1. package/README.md +266 -10
  2. package/dist/abi.d.ts +6086 -1675
  3. package/dist/abi.js +1 -1
  4. package/dist/{chunk-CIBYXHSX.js → chunk-IAPV7XWJ.js} +2 -2
  5. package/dist/chunk-IAPV7XWJ.js.map +1 -0
  6. package/dist/chunk-NV5IUURP.js +9252 -0
  7. package/dist/chunk-NV5IUURP.js.map +1 -0
  8. package/dist/index.d.ts +1180 -29
  9. package/dist/index.js +2600 -17
  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 +2564 -0
  18. package/spec/abi/FeeVault.json +604 -0
  19. package/spec/abi/HTLC.json +717 -0
  20. package/spec/abi/IBurnMintERC20.json +252 -0
  21. package/spec/abi/ICancoreRouter.json +1226 -0
  22. package/spec/abi/IHTLC.json +382 -0
  23. package/spec/abi/IPermit2.json +150 -0
  24. package/spec/abi/MultiBalanceChecker.json +34 -0
  25. package/spec/abi/PointsClaim.json +791 -0
  26. package/spec/protocol/asyncapi.json +1288 -0
  27. package/spec/protocol/messages.schema.json +525 -0
  28. package/spec/protocol/records.schema.json +94 -0
  29. package/spec/protocol/rest.schema.json +118 -0
  30. package/spec/protocol/typed-data/FillerAuth.json +58 -0
  31. package/spec/protocol/typed-data/FillerKeyRegistration.json +69 -0
  32. package/spec/protocol/typed-data/FillerMessage.json +115 -0
  33. package/spec/protocol/typed-data/FillerQuote.json +75 -0
  34. package/spec/protocol/typed-data/GatewayMessage.json +93 -0
  35. package/spec/protocol/typed-data/StakeBinding.json +75 -0
  36. package/spec/protocol/typed-data/TicketIntent.json +113 -0
  37. package/spec/protocol/typed-data/TicketReceipt.json +51 -0
  38. package/spec/protocol/vectors/draw.json +61 -0
  39. package/spec/protocol/vectors/jcs.json +59 -0
  40. package/spec/protocol/vectors/messages.json +523 -0
  41. package/spec/protocol/vectors/records.json +81 -0
  42. package/spec/protocol/vectors/settle-attestations.json +542 -0
  43. package/spec/typed-data/FillProof.json +227 -0
  44. package/spec/typed-data/FillTicket.json +115 -0
  45. package/spec/typed-data/Order.json +141 -0
  46. package/spec/typed-data/Quote.json +69 -0
  47. package/spec/vectors/canton-order.json +67 -0
  48. package/dist/chunk-CIBYXHSX.js.map +0 -1
  49. package/dist/chunk-ZSX67S72.js +0 -3423
  50. package/dist/chunk-ZSX67S72.js.map +0 -1
@@ -0,0 +1,227 @@
1
+ {
2
+ "$comment": "EIP-712 schema of the variant A FillProof (twelve fields, CAN-2139; protocol.md §3.3) — the struct attestors sign, CancoreRouter.settle verifies (paying repayTo) and Daml Intent.FillProofVerify verifies on a Canton source — and its golden vectors. Written in @cancore/contracts ahead of the router: CAN-2140 copies this file byte for byte to evm-contracts abi/typed-data/FillProof.json, where test/CancoreRouter.ts checks every vector against FILLPROOF_TYPEHASH and hashFillProof; from then on evm-contracts is the source again and `npm run sync` brings it here. canton-contracts takes the Canton-source vector (typeHash, domainSeparator, structHash, digest) into intent-test AttestationVectors (CAN-2144). Digests by ethers TypedDataEncoder; this package checks them with an encoder of its own.",
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-markets\"). Daml FillProofVerify must reproduce typeHash, domainSeparator, structHash and digest",
204
+ "fillerIdString": "acme-markets",
205
+ "repayToParty": "acme-markets::1220acdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacde",
206
+ "chainId": "9223372036854775809",
207
+ "verifyingContract": "0x2f37b46Ea93001829498b145985fb53028033701",
208
+ "message": {
209
+ "kind": 1,
210
+ "orderHash": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204",
211
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
212
+ "fillRef": "0xcef5e95eb00bff57a5c6565834f300cdc8c694151245ab062e86822a8819897a",
213
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
214
+ "outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
215
+ "amountDelivered": "1246760000",
216
+ "filledAt": "1789999700",
217
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
218
+ "repayTo": "0xe61d35ec4ca48f587165d3138bd11c79b42e52f6de0cec4b9e2d4350017f1e87",
219
+ "attempt": 1,
220
+ "setId": 1
221
+ },
222
+ "domainSeparator": "0x1f754285aeeb7c329e1107ea7f22092765deea7fd0db2c98bce7e0bda644ec16",
223
+ "structHash": "0xde3d93c38518796a0d639e855b5a875eeccd7e2dc9417b28d4b7c36d04d9f58d",
224
+ "digest": "0xfdc7e00e2d79fb63ee6bcb3c46dbe531ee0c40eaa0a670c371902a862615df80"
225
+ }
226
+ ]
227
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$comment": "Variant A FillTicket (CAN-2139; protocol.md §3.3): seven fields, written here ahead of CancoreRouter.sol, which takes the same string before its first deployment and pins these vectors with hashTicket (CAN-2140). fillerId = keccak256(utf8(fillerId)); repayTo encoded for the source chain (§3.15). Digests by ethers TypedDataEncoder, checked in this package by the shipped encoder as well.",
3
+ "primaryType": "FillTicket",
4
+ "domain": {
5
+ "name": "CancoreFillTicket",
6
+ "version": "1",
7
+ "fields": [
8
+ "name",
9
+ "version"
10
+ ]
11
+ },
12
+ "typeString": "FillTicket(bytes32 orderHash,bytes32 fillerId,address deliveryKey,bytes32 repayTo,uint32 attempt,uint64 validFrom,uint64 validUntil)",
13
+ "types": {
14
+ "FillTicket": [
15
+ {
16
+ "name": "orderHash",
17
+ "type": "bytes32"
18
+ },
19
+ {
20
+ "name": "fillerId",
21
+ "type": "bytes32"
22
+ },
23
+ {
24
+ "name": "deliveryKey",
25
+ "type": "address"
26
+ },
27
+ {
28
+ "name": "repayTo",
29
+ "type": "bytes32"
30
+ },
31
+ {
32
+ "name": "attempt",
33
+ "type": "uint32"
34
+ },
35
+ {
36
+ "name": "validFrom",
37
+ "type": "uint64"
38
+ },
39
+ {
40
+ "name": "validUntil",
41
+ "type": "uint64"
42
+ }
43
+ ]
44
+ },
45
+ "vectors": [
46
+ {
47
+ "note": "protocol.md §3.3 hashTicket example: a fixed bytes32 orderHash input, fillerId keccak256(\"acme\"), repayTo the padded delivery key",
48
+ "message": {
49
+ "orderHash": "0xe61e980d40d1a666a509d2296c0d2658a40ff681e290c7646a75a550629ce1ad",
50
+ "fillerId": "0xe29dae06ef4c3e336b7538b6d4f52ca1ecec009b1df6fb501320e11b223aeeaf",
51
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
52
+ "repayTo": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
53
+ "attempt": 0,
54
+ "validFrom": "1789999000",
55
+ "validUntil": "1789999180"
56
+ },
57
+ "digest": "0xb751ce266445dfc74d2a1e7ec2b23f51bf36ccc97706f6d0d73e4be74f9d5c33"
58
+ },
59
+ {
60
+ "note": "ticket for the test-kit fixture order, attempt 0: EVM source, repayTo another address than the delivery key",
61
+ "fillerIdString": "acme-markets",
62
+ "message": {
63
+ "orderHash": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
64
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
65
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
66
+ "repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
67
+ "attempt": 0,
68
+ "validFrom": "1790000040",
69
+ "validUntil": "1790000400"
70
+ },
71
+ "digest": "0x8eaef6b8d59e72288487b0def58e0eb9200fa7600170351af985111eaec5a0a9"
72
+ },
73
+ {
74
+ "note": "Canton source (canton-order.json): repayTo = keccak256(utf8(partyId)) of the filler party",
75
+ "fillerIdString": "acme-markets",
76
+ "repayToParty": "acme-markets::1220acdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacdeacde",
77
+ "message": {
78
+ "orderHash": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204",
79
+ "fillerId": "0x112e2693409c427698100f54d0439fc3593fedb25221fe3a54c4823c0a0ee2d5",
80
+ "deliveryKey": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
81
+ "repayTo": "0xe61d35ec4ca48f587165d3138bd11c79b42e52f6de0cec4b9e2d4350017f1e87",
82
+ "attempt": 1,
83
+ "validFrom": "1789999500",
84
+ "validUntil": "1789999800"
85
+ },
86
+ "digest": "0xbbec903b320790bbe11b93446e183872ad43b3e2fa83d0a3daeb2cd79672b9c1"
87
+ },
88
+ {
89
+ "note": "every integer at its maximum",
90
+ "message": {
91
+ "orderHash": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
92
+ "fillerId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
93
+ "deliveryKey": "0xffffffffffffffffffffffffffffffffffffffff",
94
+ "repayTo": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
95
+ "attempt": 4294967295,
96
+ "validFrom": "18446744073709551615",
97
+ "validUntil": "18446744073709551615"
98
+ },
99
+ "digest": "0x041820b7007543c4750057958545f330ece16fc5ae81d4d30571b2f09269ccb3"
100
+ },
101
+ {
102
+ "note": "zero",
103
+ "message": {
104
+ "orderHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
105
+ "fillerId": "0x0000000000000000000000000000000000000000000000000000000000000000",
106
+ "deliveryKey": "0x0000000000000000000000000000000000000000",
107
+ "repayTo": "0x0000000000000000000000000000000000000000000000000000000000000000",
108
+ "attempt": 0,
109
+ "validFrom": "0",
110
+ "validUntil": "0"
111
+ },
112
+ "digest": "0x205fd8f9d58d390da2bf1158f6a4025274dfc0d1db56422610b271d0a5ddd098"
113
+ }
114
+ ]
115
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "$comment": "PROVISIONAL hand copy of the CancoreRouter.sol struct (evm-contracts f936594) until evm-contracts publishes abi/typed-data for it with its own vectors (follow-up F-1); digests by ethers TypedDataEncoder, checked in this package by the shipped encoder as well. The canton vector equals spec/vectors/canton-order.json (Solidity-pinned); the sepolia vector is the test-kit fixture order.",
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)",
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
+ },
63
+ "vectors": [
64
+ {
65
+ "note": "canton-source golden order (spec/vectors/canton-order.json)",
66
+ "chainId": "9223372036854775809",
67
+ "verifyingContract": "0x2f37b46ea93001829498b145985fb53028033701",
68
+ "message": {
69
+ "user": "0x47f0d84377b46651f7936ae656dcecefdc1a2a86",
70
+ "originChainId": "9223372036854775809",
71
+ "inputToken": "0x795ae88257786ea0e2cfe2c43b88b420993dc98f",
72
+ "inputAmount": "12505000000000",
73
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
74
+ "outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
75
+ "minReceived": "1200250000",
76
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
77
+ "createdAt": "1789999400",
78
+ "fillDeadline": "1790000000",
79
+ "feeBps": "30"
80
+ },
81
+ "digest": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204"
82
+ },
83
+ {
84
+ "note": "EVM-source fixture order of @cancore/test-kit (sepolia to arbitrum sepolia)",
85
+ "chainId": "11155111",
86
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
87
+ "message": {
88
+ "user": "0xa11ce00000000000000000000000000000000001",
89
+ "originChainId": "11155111",
90
+ "inputToken": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
91
+ "inputAmount": "1003000000",
92
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000066eee",
93
+ "outputAsset": "0x00000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
94
+ "minReceived": "999000000",
95
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
96
+ "createdAt": "1790000000",
97
+ "fillDeadline": "1790000600",
98
+ "feeBps": "30"
99
+ },
100
+ "digest": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6"
101
+ },
102
+ {
103
+ "note": "every integer at its maximum",
104
+ "chainId": "11155111",
105
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
106
+ "message": {
107
+ "user": "0xffffffffffffffffffffffffffffffffffffffff",
108
+ "originChainId": "18446744073709551615",
109
+ "inputToken": "0xffffffffffffffffffffffffffffffffffffffff",
110
+ "inputAmount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
111
+ "destination": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
112
+ "outputAsset": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
113
+ "minReceived": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
114
+ "recipient": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
115
+ "createdAt": "18446744073709551615",
116
+ "fillDeadline": "18446744073709551615",
117
+ "feeBps": "65535"
118
+ },
119
+ "digest": "0x86cc928e50ec1003b13c9474aca3fd27a02eba667560e281f47f1962388300f8"
120
+ },
121
+ {
122
+ "note": "zero words and the zero address",
123
+ "chainId": "11155111",
124
+ "verifyingContract": "0x00000000000000000000000000000000cafe0001",
125
+ "message": {
126
+ "user": "0x0000000000000000000000000000000000000000",
127
+ "originChainId": "0",
128
+ "inputToken": "0x0000000000000000000000000000000000000000",
129
+ "inputAmount": "0",
130
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000000",
131
+ "outputAsset": "0x0000000000000000000000000000000000000000000000000000000000000000",
132
+ "minReceived": "0",
133
+ "recipient": "0x0000000000000000000000000000000000000000000000000000000000000000",
134
+ "createdAt": "0",
135
+ "fillDeadline": "0",
136
+ "feeBps": "0"
137
+ },
138
+ "digest": "0x3da628e3bc0683cdb45726c73345d9d2c479dc7607d9fa31275cb5e59a0cbd44"
139
+ }
140
+ ]
141
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$comment": "PROVISIONAL hand copy of the CancoreRouter.sol struct (evm-contracts f936594) until evm-contracts publishes abi/typed-data for it with its own vectors (follow-up F-1); digests by ethers TypedDataEncoder, checked in this package by the shipped encoder as well.",
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": "0x585ec61a0813109803da9d47aea37a165f7df1371553f1e4ea8c139cf74058a6",
34
+ "quoteDeadline": "1790000030"
35
+ },
36
+ "digest": "0xacf52bd67ac646e4e85269571c6a0b8d4596b02b591afe28ef1d25d857878b7c"
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": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204",
64
+ "quoteDeadline": "1789999430"
65
+ },
66
+ "digest": "0x4a8ff126558a8cbbfcffce73bef171a6242a4e7bd074070bd0be77220f1f6dec"
67
+ }
68
+ ]
69
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "$description": "Golden vector for the EVM-form Order of a Canton-source intent (tech plan §3.2a). A Canton intent has no EVM user and no EVM input token, so both are deterministic labels derived from the Canton identifiers, and the source EIP-712 domain points at a fixed anchor address instead of a deployed router. Nothing on chain checks this construction: it is the only rule that makes a Canton delivery matchable on an EVM destination, and every implementation (Solidity tests, @cancore/contracts, the backend, the attestors, the fillers) must reproduce the orderHash below byte for byte.",
3
+ "$producedBy": "test/helpers/cantonOrder.ts — buildCantonSourceOrder(); verified against CancoreRouter.sourceOrderHash in test/CancoreRouter.ts",
4
+ "constants": {
5
+ "eip2294MaxChainId": "9223372036854775771",
6
+ "$eip2294MaxChainId": "floor((2^64 - 1) / 2) - 36. Every Canton origin id is above it, so no EVM chain can ever collide with one.",
7
+ "cantonOriginId": {
8
+ "mainnet": "9223372036854775809",
9
+ "testnet": "9223372036854775810",
10
+ "devnet": "9223372036854775811"
11
+ },
12
+ "$cantonOriginId": "2^63 + n. Above the EIP-2294 bound, inside uint64 (Order.originChainId), recognisable by eye. 2^63 itself is deliberately unassigned: a bare 9223372036854775808 in a config is more likely a truncation artefact than a deliberate choice.",
13
+ "cantonSourceAnchor": "0x2f37b46Ea93001829498b145985fb53028033701",
14
+ "$cantonSourceAnchor": "address(uint160(uint256(keccak256(\"cancore:canton-source-anchor:v1\")))) — the verifyingContract of the Canton source domain. One value for every Canton network: the domain already separates them through chainId. Register it once per origin id with setSourceRouter(originChainId, anchor) on every destination router — that call is WRITE-ONCE.",
15
+ "ownerLabelTag": "cancore:owner:v1",
16
+ "instrumentLabelTag": "cancore:instrument:v1",
17
+ "damlNumericScale": 10
18
+ },
19
+ "rules": {
20
+ "user": "address(uint160(uint256(keccak256(abi.encode(\"cancore:owner:v1\", ownerPartyId, requestId)))))",
21
+ "inputToken": "address(uint160(uint256(keccak256(abi.encode(\"cancore:instrument:v1\", instrumentAdmin, instrumentId)))))",
22
+ "inputAmount": "amount × 10^10 (Daml Numeric 10); the request is refused unless it is exact",
23
+ "minReceived": "minReceived × 10^decimals(wantToken); the request is refused unless it is exact",
24
+ "feeBps": "feeRate × 10000; refused unless it is a whole number and ≤ MAX_FEE_BPS (1000). The fee is INCLUSIVE on both rails: inputAmount is the total, payout = inputAmount × 10000 / (10000 + feeBps) floored, fee = inputAmount − payout",
25
+ "createdAt": "unix seconds, the signing time of the Canton request; refused unless it is a whole second. Part of the hash only: the destination does not check it",
26
+ "fillDeadline": "unix seconds; refused unless it is a whole second",
27
+ "$requestId": "requestId is part of the owner label on purpose: without it two identical requests in the same second share one orderHash, and one delivery would match two SwapIntents (AUD-E-13, AUD-C-3)."
28
+ },
29
+ "vector": {
30
+ "input": {
31
+ "ownerPartyId": "alice::1220a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9",
32
+ "requestId": "req-7f3a9c21-4d88-4e5b-9a1e-0c2f6b8d4e31",
33
+ "instrumentAdmin": "cancore-registry::1220f0e1d2c3b4a5968778695a4b3c2d1e0f0e1d2c3b4a5968778695a4b3c2d1e0f",
34
+ "instrumentId": "CNRX",
35
+ "amount": "1250.5",
36
+ "destinationChainId": "1",
37
+ "wantToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
38
+ "wantDecimals": 6,
39
+ "minReceived": "1200.25",
40
+ "recipient": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
41
+ "createdAt": 1789999400,
42
+ "fillDeadline": 1790000000,
43
+ "feeRate": "0.003",
44
+ "cantonOriginId": "9223372036854775809"
45
+ },
46
+ "order": {
47
+ "user": "0x47f0d84377B46651f7936AE656DCEceFDc1A2A86",
48
+ "originChainId": "9223372036854775809",
49
+ "inputToken": "0x795ae88257786ea0e2CFe2c43B88B420993dC98f",
50
+ "inputAmount": "12505000000000",
51
+ "destination": "0x0000000000000000000000000000000000000000000000000000000000000001",
52
+ "outputAsset": "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
53
+ "minReceived": "1200250000",
54
+ "recipient": "0x000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e",
55
+ "createdAt": "1789999400",
56
+ "fillDeadline": "1790000000",
57
+ "feeBps": "30"
58
+ },
59
+ "domain": {
60
+ "name": "CancoreRouter",
61
+ "version": "1",
62
+ "chainId": "9223372036854775809",
63
+ "verifyingContract": "0x2f37b46Ea93001829498b145985fb53028033701"
64
+ },
65
+ "orderHash": "0x770f1ebba8ab5b96e3efbed39c0f630d56f934f9f232771abaccdb0cf17ca204"
66
+ }
67
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/networks.ts"],"names":[],"mappings":"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","file":"chunk-CIBYXHSX.js","sourcesContent":["/**\n * `@cancore/contracts/networks` — the chains Cancore settles on, by the ids the\n * API uses (`sourceNetwork`, `targetNetwork` in an order are these keys).\n *\n * Three kinds, because three address formats and three signing models:\n * `evm` (0x…, EIP-155 chain id), `tron` (base58, same Solidity, no chain id in\n * the EVM sense), `canton` (party ids, no addresses at all). A caller that\n * branches on `kind` instead of on the id keeps working when a chain is added.\n *\n * Contract addresses live next door in `DEPLOYMENTS`, keyed by environment —\n * dev, testnet and mainnet each have their own HTLC — and `BYTECODE_HASHES`\n * (from `.`) is how a deployment at any of those addresses is verified.\n */\n\nexport type NetworkKind = 'evm' | 'tron' | 'canton';\n\nexport interface Network {\n /** The id the Cancore API uses for this chain. */\n id: string;\n kind: NetworkKind;\n name: string;\n /** EIP-155 chain id; absent for Tron and Canton. */\n chainId?: number;\n /** Where a transaction or address of this chain can be looked at. */\n explorerUrl?: string;\n nativeCurrency?: { name: string; symbol: string; decimals: number };\n testnet: boolean;\n}\n\nexport const NETWORKS: Readonly<Record<string, Network>> = {\n canton: { id: 'canton', kind: 'canton', name: 'Canton', testnet: false },\n ethereum: {\n id: 'ethereum', kind: 'evm', name: 'Ethereum', chainId: 1, explorerUrl: 'https://etherscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n sepolia: {\n id: 'sepolia', kind: 'evm', name: 'Sepolia', chainId: 11155111, explorerUrl: 'https://sepolia.etherscan.io',\n nativeCurrency: { name: 'Sepolia ETH', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n bnb: {\n id: 'bnb', kind: 'evm', name: 'BNB Chain', chainId: 56, explorerUrl: 'https://bscscan.com',\n nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18 }, testnet: false,\n },\n bnb_testnet: {\n id: 'bnb_testnet', kind: 'evm', name: 'BNB Testnet', chainId: 97, explorerUrl: 'https://testnet.bscscan.com',\n nativeCurrency: { name: 'Test BNB', symbol: 'tBNB', decimals: 18 }, testnet: true,\n },\n arbitrum: {\n id: 'arbitrum', kind: 'evm', name: 'Arbitrum One', chainId: 42161, explorerUrl: 'https://arbiscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n arbitrum_sepolia: {\n id: 'arbitrum_sepolia', kind: 'evm', name: 'Arbitrum Sepolia', chainId: 421614, explorerUrl: 'https://sepolia.arbiscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n robinhood: {\n id: 'robinhood', kind: 'evm', name: 'Robinhood Chain', chainId: 4663, explorerUrl: 'https://robinhoodchain.blockscout.com',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n robinhood_testnet: {\n id: 'robinhood_testnet', kind: 'evm', name: 'Robinhood Testnet', chainId: 46630, explorerUrl: 'https://explorer.testnet.chain.robinhood.com',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n tron_nile: { id: 'tron_nile', kind: 'tron', name: 'Tron Nile', explorerUrl: 'https://nile.tronscan.org', testnet: true },\n tron_shasta: { id: 'tron_shasta', kind: 'tron', name: 'Tron Shasta', explorerUrl: 'https://shasta.tronscan.org', testnet: true },\n};\n\n/** `eth` is an older alias of `ethereum` still seen in order payloads. */\nexport const NETWORK_ALIASES: Readonly<Record<string, string>> = { eth: 'ethereum' };\n\nexport function networkOf(id: string): Network | undefined {\n return NETWORKS[NETWORK_ALIASES[id] ?? id];\n}\n\nexport function networkKindOf(id: string): NetworkKind | undefined {\n return networkOf(id)?.kind;\n}\n\n/** The network for an EIP-155 chain id, e.g. from a wallet's `eth_chainId`. */\nexport function networkByChainId(chainId: number): Network | undefined {\n return Object.values(NETWORKS).find((n) => n.chainId === chainId);\n}\n"]}