@across-protocol/contracts 6.0.0-beta.3 → 6.0.0-beta.5
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 +82 -12
- package/dist/src/svm/assets/idl/index.d.ts +5 -7
- package/dist/src/svm/assets/idl/index.js +6 -14
- package/dist/src/svm/assets/idl/svm_spoke.json +30 -13
- package/dist/src/svm/assets/index.d.ts +2 -3
- package/dist/src/svm/assets/index.js +0 -1
- package/dist/src/svm/assets/svm_spoke.d.ts +30 -13
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +11 -9
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +14 -11
- package/dist/src/svm/clients/SvmSpoke/instructions/initialize.d.ts +16 -8
- package/dist/src/svm/clients/SvmSpoke/instructions/initialize.js +19 -1
- package/dist/src/svm/clients/SvmSpoke/types/v5FillJit.d.ts +1 -0
- package/dist/src/svm/web3-v1/cctpV2Helpers.d.ts +36 -36
- package/package.json +12 -8
- package/svm/idl/multicall_handler.json +31 -0
- package/svm/idl/sponsored_cctp_src_periphery.json +1982 -0
- package/svm/idl/svm_spoke.json +3947 -0
- package/dist/src/svm/assets/idl/test.json +0 -243
- package/dist/src/svm/assets/test.d.ts +0 -249
- package/dist/src/svm/assets/test.js +0 -2
|
@@ -58,6 +58,8 @@ async function getInitializeInstructionAsync(input, config) {
|
|
|
58
58
|
const originalAccounts = {
|
|
59
59
|
signer: { value: input.signer ?? null, isWritable: true },
|
|
60
60
|
state: { value: input.state ?? null, isWritable: true },
|
|
61
|
+
thisProgram: { value: input.thisProgram ?? null, isWritable: false },
|
|
62
|
+
programData: { value: input.programData ?? null, isWritable: false },
|
|
61
63
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
62
64
|
};
|
|
63
65
|
const accounts = originalAccounts;
|
|
@@ -73,6 +75,10 @@ async function getInitializeInstructionAsync(input, config) {
|
|
|
73
75
|
],
|
|
74
76
|
});
|
|
75
77
|
}
|
|
78
|
+
if (!accounts.thisProgram.value) {
|
|
79
|
+
accounts.thisProgram.value =
|
|
80
|
+
'DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru';
|
|
81
|
+
}
|
|
76
82
|
if (!accounts.systemProgram.value) {
|
|
77
83
|
accounts.systemProgram.value =
|
|
78
84
|
'11111111111111111111111111111111';
|
|
@@ -82,6 +88,8 @@ async function getInitializeInstructionAsync(input, config) {
|
|
|
82
88
|
accounts: [
|
|
83
89
|
getAccountMeta(accounts.signer),
|
|
84
90
|
getAccountMeta(accounts.state),
|
|
91
|
+
getAccountMeta(accounts.thisProgram),
|
|
92
|
+
getAccountMeta(accounts.programData),
|
|
85
93
|
getAccountMeta(accounts.systemProgram),
|
|
86
94
|
],
|
|
87
95
|
programAddress,
|
|
@@ -96,12 +104,18 @@ function getInitializeInstruction(input, config) {
|
|
|
96
104
|
const originalAccounts = {
|
|
97
105
|
signer: { value: input.signer ?? null, isWritable: true },
|
|
98
106
|
state: { value: input.state ?? null, isWritable: true },
|
|
107
|
+
thisProgram: { value: input.thisProgram ?? null, isWritable: false },
|
|
108
|
+
programData: { value: input.programData ?? null, isWritable: false },
|
|
99
109
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
100
110
|
};
|
|
101
111
|
const accounts = originalAccounts;
|
|
102
112
|
// Original args.
|
|
103
113
|
const args = { ...input };
|
|
104
114
|
// Resolve default values.
|
|
115
|
+
if (!accounts.thisProgram.value) {
|
|
116
|
+
accounts.thisProgram.value =
|
|
117
|
+
'DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru';
|
|
118
|
+
}
|
|
105
119
|
if (!accounts.systemProgram.value) {
|
|
106
120
|
accounts.systemProgram.value =
|
|
107
121
|
'11111111111111111111111111111111';
|
|
@@ -111,6 +125,8 @@ function getInitializeInstruction(input, config) {
|
|
|
111
125
|
accounts: [
|
|
112
126
|
getAccountMeta(accounts.signer),
|
|
113
127
|
getAccountMeta(accounts.state),
|
|
128
|
+
getAccountMeta(accounts.thisProgram),
|
|
129
|
+
getAccountMeta(accounts.programData),
|
|
114
130
|
getAccountMeta(accounts.systemProgram),
|
|
115
131
|
],
|
|
116
132
|
programAddress,
|
|
@@ -119,7 +135,7 @@ function getInitializeInstruction(input, config) {
|
|
|
119
135
|
return instruction;
|
|
120
136
|
}
|
|
121
137
|
function parseInitializeInstruction(instruction) {
|
|
122
|
-
if (instruction.accounts.length <
|
|
138
|
+
if (instruction.accounts.length < 5) {
|
|
123
139
|
// TODO: Coded error.
|
|
124
140
|
throw new Error('Not enough accounts');
|
|
125
141
|
}
|
|
@@ -134,6 +150,8 @@ function parseInitializeInstruction(instruction) {
|
|
|
134
150
|
accounts: {
|
|
135
151
|
signer: getNextAccount(),
|
|
136
152
|
state: getNextAccount(),
|
|
153
|
+
thisProgram: getNextAccount(),
|
|
154
|
+
programData: getNextAccount(),
|
|
137
155
|
systemProgram: getNextAccount(),
|
|
138
156
|
},
|
|
139
157
|
data: getInitializeInstructionDataDecoder().decode(instruction.data),
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type Address, type Codec, type Decoder, type Encoder } from '@solana/kit';
|
|
9
9
|
import { type RelayData, type RelayDataArgs } from '.';
|
|
10
|
+
/** The funder must validate the relay against the source deposit and both repayment fields before signing the fill tx. */
|
|
10
11
|
export type V5FillJit = {
|
|
11
12
|
relayData: RelayData;
|
|
12
13
|
repaymentChainId: bigint;
|
|
@@ -58,8 +58,8 @@ export declare const encodeMessageHeaderV2: (header: MessageHeaderV2) => Buffer;
|
|
|
58
58
|
*/
|
|
59
59
|
export declare const decodeTokenMessengerV2MessageBody: (data: Buffer) => TokenMessengerV2MessageBody;
|
|
60
60
|
export declare const DecodedMessageBody: import("superstruct").Struct<{
|
|
61
|
-
burnToken: string;
|
|
62
61
|
amount: string;
|
|
62
|
+
burnToken: string;
|
|
63
63
|
mintRecipient: string;
|
|
64
64
|
messageSender: string;
|
|
65
65
|
feeExecuted?: string | undefined;
|
|
@@ -77,18 +77,18 @@ export declare const DecodedMessageBody: import("superstruct").Struct<{
|
|
|
77
77
|
hookData: import("superstruct").Struct<string | undefined, null>;
|
|
78
78
|
}>;
|
|
79
79
|
export declare const DecodedMessage: import("superstruct").Struct<{
|
|
80
|
-
|
|
81
|
-
nonce: string;
|
|
80
|
+
recipient: string;
|
|
82
81
|
sender: string;
|
|
83
82
|
messageBody: string;
|
|
83
|
+
sourceDomain: string;
|
|
84
|
+
nonce: string;
|
|
84
85
|
destinationDomain: string;
|
|
85
|
-
recipient: string;
|
|
86
86
|
destinationCaller: string;
|
|
87
87
|
finalityThresholdExecuted?: string | undefined;
|
|
88
88
|
minFinalityThreshold?: string | undefined;
|
|
89
89
|
decodedMessageBody?: {
|
|
90
|
-
burnToken: string;
|
|
91
90
|
amount: string;
|
|
91
|
+
burnToken: string;
|
|
92
92
|
mintRecipient: string;
|
|
93
93
|
messageSender: string;
|
|
94
94
|
feeExecuted?: string | undefined;
|
|
@@ -111,8 +111,8 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
111
111
|
}>;
|
|
112
112
|
messageBody: import("superstruct").Struct<string, null>;
|
|
113
113
|
decodedMessageBody: import("superstruct").Struct<{
|
|
114
|
-
burnToken: string;
|
|
115
114
|
amount: string;
|
|
115
|
+
burnToken: string;
|
|
116
116
|
mintRecipient: string;
|
|
117
117
|
messageSender: string;
|
|
118
118
|
feeExecuted?: string | undefined;
|
|
@@ -131,24 +131,24 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
131
131
|
}>;
|
|
132
132
|
}>;
|
|
133
133
|
export declare const AttestationMessage: import("superstruct").Struct<{
|
|
134
|
+
status: string;
|
|
134
135
|
message: string;
|
|
135
136
|
attestation: string;
|
|
136
|
-
status: string;
|
|
137
137
|
eventNonce: string;
|
|
138
138
|
cctpVersion: number;
|
|
139
139
|
decodedMessage?: {
|
|
140
|
-
|
|
141
|
-
nonce: string;
|
|
140
|
+
recipient: string;
|
|
142
141
|
sender: string;
|
|
143
142
|
messageBody: string;
|
|
143
|
+
sourceDomain: string;
|
|
144
|
+
nonce: string;
|
|
144
145
|
destinationDomain: string;
|
|
145
|
-
recipient: string;
|
|
146
146
|
destinationCaller: string;
|
|
147
147
|
finalityThresholdExecuted?: string | undefined;
|
|
148
148
|
minFinalityThreshold?: string | undefined;
|
|
149
149
|
decodedMessageBody?: {
|
|
150
|
-
burnToken: string;
|
|
151
150
|
amount: string;
|
|
151
|
+
burnToken: string;
|
|
152
152
|
mintRecipient: string;
|
|
153
153
|
messageSender: string;
|
|
154
154
|
feeExecuted?: string | undefined;
|
|
@@ -163,18 +163,18 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
163
163
|
eventNonce: import("superstruct").Struct<string, null>;
|
|
164
164
|
attestation: import("superstruct").Struct<string, null>;
|
|
165
165
|
decodedMessage: import("superstruct").Struct<{
|
|
166
|
-
|
|
167
|
-
nonce: string;
|
|
166
|
+
recipient: string;
|
|
168
167
|
sender: string;
|
|
169
168
|
messageBody: string;
|
|
169
|
+
sourceDomain: string;
|
|
170
|
+
nonce: string;
|
|
170
171
|
destinationDomain: string;
|
|
171
|
-
recipient: string;
|
|
172
172
|
destinationCaller: string;
|
|
173
173
|
finalityThresholdExecuted?: string | undefined;
|
|
174
174
|
minFinalityThreshold?: string | undefined;
|
|
175
175
|
decodedMessageBody?: {
|
|
176
|
-
burnToken: string;
|
|
177
176
|
amount: string;
|
|
177
|
+
burnToken: string;
|
|
178
178
|
mintRecipient: string;
|
|
179
179
|
messageSender: string;
|
|
180
180
|
feeExecuted?: string | undefined;
|
|
@@ -197,8 +197,8 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
197
197
|
}>;
|
|
198
198
|
messageBody: import("superstruct").Struct<string, null>;
|
|
199
199
|
decodedMessageBody: import("superstruct").Struct<{
|
|
200
|
-
burnToken: string;
|
|
201
200
|
amount: string;
|
|
201
|
+
burnToken: string;
|
|
202
202
|
mintRecipient: string;
|
|
203
203
|
messageSender: string;
|
|
204
204
|
feeExecuted?: string | undefined;
|
|
@@ -228,24 +228,24 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
228
228
|
}>;
|
|
229
229
|
export declare const AttestationResponse: import("superstruct").Struct<{
|
|
230
230
|
messages: {
|
|
231
|
+
status: string;
|
|
231
232
|
message: string;
|
|
232
233
|
attestation: string;
|
|
233
|
-
status: string;
|
|
234
234
|
eventNonce: string;
|
|
235
235
|
cctpVersion: number;
|
|
236
236
|
decodedMessage?: {
|
|
237
|
-
|
|
238
|
-
nonce: string;
|
|
237
|
+
recipient: string;
|
|
239
238
|
sender: string;
|
|
240
239
|
messageBody: string;
|
|
240
|
+
sourceDomain: string;
|
|
241
|
+
nonce: string;
|
|
241
242
|
destinationDomain: string;
|
|
242
|
-
recipient: string;
|
|
243
243
|
destinationCaller: string;
|
|
244
244
|
finalityThresholdExecuted?: string | undefined;
|
|
245
245
|
minFinalityThreshold?: string | undefined;
|
|
246
246
|
decodedMessageBody?: {
|
|
247
|
-
burnToken: string;
|
|
248
247
|
amount: string;
|
|
248
|
+
burnToken: string;
|
|
249
249
|
mintRecipient: string;
|
|
250
250
|
messageSender: string;
|
|
251
251
|
feeExecuted?: string | undefined;
|
|
@@ -258,24 +258,24 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
258
258
|
}[];
|
|
259
259
|
}, {
|
|
260
260
|
messages: import("superstruct").Struct<{
|
|
261
|
+
status: string;
|
|
261
262
|
message: string;
|
|
262
263
|
attestation: string;
|
|
263
|
-
status: string;
|
|
264
264
|
eventNonce: string;
|
|
265
265
|
cctpVersion: number;
|
|
266
266
|
decodedMessage?: {
|
|
267
|
-
|
|
268
|
-
nonce: string;
|
|
267
|
+
recipient: string;
|
|
269
268
|
sender: string;
|
|
270
269
|
messageBody: string;
|
|
270
|
+
sourceDomain: string;
|
|
271
|
+
nonce: string;
|
|
271
272
|
destinationDomain: string;
|
|
272
|
-
recipient: string;
|
|
273
273
|
destinationCaller: string;
|
|
274
274
|
finalityThresholdExecuted?: string | undefined;
|
|
275
275
|
minFinalityThreshold?: string | undefined;
|
|
276
276
|
decodedMessageBody?: {
|
|
277
|
-
burnToken: string;
|
|
278
277
|
amount: string;
|
|
278
|
+
burnToken: string;
|
|
279
279
|
mintRecipient: string;
|
|
280
280
|
messageSender: string;
|
|
281
281
|
feeExecuted?: string | undefined;
|
|
@@ -286,24 +286,24 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
286
286
|
} | null | undefined;
|
|
287
287
|
delayReason?: string | null | undefined;
|
|
288
288
|
}[], import("superstruct").Struct<{
|
|
289
|
+
status: string;
|
|
289
290
|
message: string;
|
|
290
291
|
attestation: string;
|
|
291
|
-
status: string;
|
|
292
292
|
eventNonce: string;
|
|
293
293
|
cctpVersion: number;
|
|
294
294
|
decodedMessage?: {
|
|
295
|
-
|
|
296
|
-
nonce: string;
|
|
295
|
+
recipient: string;
|
|
297
296
|
sender: string;
|
|
298
297
|
messageBody: string;
|
|
298
|
+
sourceDomain: string;
|
|
299
|
+
nonce: string;
|
|
299
300
|
destinationDomain: string;
|
|
300
|
-
recipient: string;
|
|
301
301
|
destinationCaller: string;
|
|
302
302
|
finalityThresholdExecuted?: string | undefined;
|
|
303
303
|
minFinalityThreshold?: string | undefined;
|
|
304
304
|
decodedMessageBody?: {
|
|
305
|
-
burnToken: string;
|
|
306
305
|
amount: string;
|
|
306
|
+
burnToken: string;
|
|
307
307
|
mintRecipient: string;
|
|
308
308
|
messageSender: string;
|
|
309
309
|
feeExecuted?: string | undefined;
|
|
@@ -318,18 +318,18 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
318
318
|
eventNonce: import("superstruct").Struct<string, null>;
|
|
319
319
|
attestation: import("superstruct").Struct<string, null>;
|
|
320
320
|
decodedMessage: import("superstruct").Struct<{
|
|
321
|
-
|
|
322
|
-
nonce: string;
|
|
321
|
+
recipient: string;
|
|
323
322
|
sender: string;
|
|
324
323
|
messageBody: string;
|
|
324
|
+
sourceDomain: string;
|
|
325
|
+
nonce: string;
|
|
325
326
|
destinationDomain: string;
|
|
326
|
-
recipient: string;
|
|
327
327
|
destinationCaller: string;
|
|
328
328
|
finalityThresholdExecuted?: string | undefined;
|
|
329
329
|
minFinalityThreshold?: string | undefined;
|
|
330
330
|
decodedMessageBody?: {
|
|
331
|
-
burnToken: string;
|
|
332
331
|
amount: string;
|
|
332
|
+
burnToken: string;
|
|
333
333
|
mintRecipient: string;
|
|
334
334
|
messageSender: string;
|
|
335
335
|
feeExecuted?: string | undefined;
|
|
@@ -352,8 +352,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
352
352
|
}>;
|
|
353
353
|
messageBody: import("superstruct").Struct<string, null>;
|
|
354
354
|
decodedMessageBody: import("superstruct").Struct<{
|
|
355
|
-
burnToken: string;
|
|
356
355
|
amount: string;
|
|
356
|
+
burnToken: string;
|
|
357
357
|
mintRecipient: string;
|
|
358
358
|
messageSender: string;
|
|
359
359
|
feeExecuted?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/contracts",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.5",
|
|
4
4
|
"author": "UMA Team",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"/contracts/**/*.sol",
|
|
15
|
-
"/dist/**/*"
|
|
15
|
+
"/dist/**/*",
|
|
16
|
+
"/svm/idl/svm_spoke.json",
|
|
17
|
+
"/svm/idl/multicall_handler.json",
|
|
18
|
+
"/svm/idl/sponsored_cctp_src_periphery.json"
|
|
16
19
|
],
|
|
17
20
|
"types": "dist/index.d.ts",
|
|
18
21
|
"main": "dist/index.js",
|
|
@@ -30,19 +33,20 @@
|
|
|
30
33
|
"format-contracts": "prettier --write \"contracts/**/*.sol\" \"script/**/*.sol\"",
|
|
31
34
|
"check-format-contracts": "prettier --check \"contracts/**/*.sol\" \"script/**/*.sol\"",
|
|
32
35
|
"lint-fix": "yarn prettier --write **/*.js **/*.ts ./programs/**/*.rs \"./contracts/**/*.sol\" && cargo +nightly fmt --all && cargo clippy",
|
|
33
|
-
"clean-fast": "for dir in node_modules dist cache-foundry out zkout; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\"
|
|
34
|
-
"clean": "rm -rf node_modules dist cache-foundry out zkout",
|
|
35
|
-
"generate-svm-artifacts": "bash ./scripts/svm/buildHelpers/buildIdl.sh &&
|
|
36
|
+
"clean-fast": "rm -rf svm/idl && for dir in node_modules dist cache-foundry out zkout; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" & done",
|
|
37
|
+
"clean": "rm -rf node_modules dist cache-foundry out zkout svm/idl",
|
|
38
|
+
"generate-svm-artifacts": "bash ./scripts/svm/buildHelpers/buildIdl.sh && ts-node ./scripts/svm/buildHelpers/generateSvmAssets.ts && yarn generate-svm-clients",
|
|
36
39
|
"generate-svm-test-idls": "bash ./scripts/svm/buildHelpers/buildTestIdls.sh",
|
|
37
40
|
"generate-svm-clients": "yarn ts-node ./scripts/svm/buildHelpers/generateSvmClients.ts && yarn ts-node ./scripts/svm/buildHelpers/renameClientsImports.ts",
|
|
38
41
|
"build-svm": "bash ./scripts/svm/buildHelpers/buildSvmLocalToolchain.sh",
|
|
39
42
|
"build-svm-solana-verify": "bash ./scripts/svm/buildHelpers/buildSolanaVerify.sh",
|
|
40
|
-
"build-ts": "rm -rf ./dist && tsc",
|
|
43
|
+
"build-ts": "rm -rf ./dist && tsc && yarn export-idl",
|
|
41
44
|
"typecheck-tests": "tsc -p tsconfig.test.json",
|
|
42
45
|
"test-svm-build-guard": "ts-mocha -p tsconfig.test.json -t 10000 test/svm/Scripts.SbfBuild.ts",
|
|
43
|
-
"
|
|
46
|
+
"test-svm-idl-package": "NODE_OPTIONS=--no-experimental-strip-types ts-mocha -p tsconfig.test.json -t 120000 test/svm-package/IdlPackage.ts",
|
|
47
|
+
"export-idl": "ts-node scripts/svm/buildHelpers/exportIdl.ts",
|
|
44
48
|
"export-evm-artifacts": "sh scripts/exportEvmArtifacts.sh",
|
|
45
|
-
"
|
|
49
|
+
"prepack": "yarn build-ts && yarn export-evm-artifacts",
|
|
46
50
|
"build": "yarn build-evm-foundry && yarn build-svm && yarn generate-svm-artifacts && yarn build-ts",
|
|
47
51
|
"build-verified": "yarn build-evm-foundry && yarn build-svm-solana-verify && yarn generate-svm-artifacts && yarn build-ts",
|
|
48
52
|
"pin-foundry": "sh scripts/foundry-version.sh pin",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "HaQe51FWtnmaEcuYEfPA7MRCXKrtqptat4oJdJ8zV5Be",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "multicall_handler",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "Created with Anchor"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "handle_v3_across_message",
|
|
12
|
+
"discriminator": [
|
|
13
|
+
131,
|
|
14
|
+
141,
|
|
15
|
+
52,
|
|
16
|
+
71,
|
|
17
|
+
16,
|
|
18
|
+
59,
|
|
19
|
+
196,
|
|
20
|
+
92
|
|
21
|
+
],
|
|
22
|
+
"accounts": [],
|
|
23
|
+
"args": [
|
|
24
|
+
{
|
|
25
|
+
"name": "message",
|
|
26
|
+
"type": "bytes"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|