@across-protocol/contracts 6.0.0-beta.2 → 6.0.0-beta.4
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 +195 -34
- package/contracts/chain-adapters/Solana_Adapter.sol +4 -7
- package/contracts/handlers/HyperliquidDepositHandler.sol +2 -2
- package/contracts/interfaces/SpokePoolPeripheryInterface.sol +16 -4
- package/contracts/libraries/HyperCoreLib.sol +113 -20
- package/contracts/libraries/PeripherySigningLib.sol +56 -0
- package/contracts/periphery/SpokePoolPeriphery.sol +58 -10
- package/dist/broadcast/deployed-addresses.json +19 -0
- package/dist/evm/artifacts/Constants.sol/Constants.json +1 -1
- package/dist/evm/artifacts/DeploymentUtils.sol/DeploymentUtils.json +1 -1
- package/dist/evm/artifacts/DstOFTHandler.sol/DstOFTHandler.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockAddressWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockFinder.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockIdentifierWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockLpTokenFactory.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockOptimisticOracle.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockStore.json +1 -1
- package/dist/evm/artifacts/HyperCoreFlowExecutor.sol/HyperCoreFlowExecutor.json +1 -1
- package/dist/evm/artifacts/HyperCoreLib.sol/HyperCoreLib.json +1 -1
- package/dist/evm/artifacts/HyperliquidDepositHandler.sol/HyperliquidDepositHandler.json +1 -1
- package/dist/evm/artifacts/PeripherySigningLib.sol/PeripherySigningLib.json +1 -1
- package/dist/evm/artifacts/Solana_Adapter.sol/Solana_Adapter.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SwapProxy.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPDstPeriphery.sol/SponsoredCCTPDstPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPSrcPeriphery.sol/SponsoredCCTPSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredOFTSrcPeriphery.sol/SponsoredOFTSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SwapHandler.sol/SwapHandler.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SwapProxy.json +1 -1
- package/dist/src/consts.js +1 -0
- 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/sponsored_cctp_src_periphery.json +41 -24
- package/dist/src/svm/assets/idl/svm_spoke.json +1001 -2171
- package/dist/src/svm/assets/index.d.ts +2 -3
- package/dist/src/svm/assets/index.js +0 -1
- package/dist/src/svm/assets/sponsored_cctp_src_periphery.d.ts +41 -24
- package/dist/src/svm/assets/svm_spoke.d.ts +996 -2166
- package/dist/src/svm/assets/token_messenger_minter_v2.d.ts +18 -18
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.d.ts +0 -1
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.js +0 -1
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.d.ts +24 -12
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.js +30 -12
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.d.ts +4 -5
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.js +4 -8
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.d.ts +1 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.js +1 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.d.ts +21 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.d.ts +2 -2
- package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.js +2 -2
- package/dist/src/svm/clients/SvmSpoke/accounts/index.d.ts +0 -3
- package/dist/src/svm/clients/SvmSpoke/accounts/index.js +0 -3
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +94 -22
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +133 -24
- package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.d.ts +75 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.js +144 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.d.ts +16 -8
- package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.js +3 -3
- package/dist/src/svm/clients/SvmSpoke/instructions/index.d.ts +2 -7
- package/dist/src/svm/clients/SvmSpoke/instructions/index.js +2 -7
- package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.d.ts +58 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.js +134 -0
- package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.d.ts +29 -47
- package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.js +29 -61
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.d.ts +25 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.js +33 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.d.ts +18 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.d.ts +43 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.js +48 -0
- package/dist/src/svm/clients/SvmSpoke/types/index.d.ts +9 -1
- package/dist/src/svm/clients/SvmSpoke/types/index.js +9 -1
- package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.d.ts +39 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.js +59 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.d.ts +17 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.d.ts +19 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.js +28 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.d.ts +25 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillJit.d.ts +22 -0
- package/dist/src/svm/clients/SvmSpoke/types/{slowFill.js → v5FillJit.js} +11 -11
- package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.d.ts +29 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.js +38 -0
- package/dist/src/svm/web3-v1/cctpV2Helpers.d.ts +51 -65
- package/dist/src/svm/web3-v1/cctpV2Helpers.js +1 -1
- package/dist/src/svm/web3-v1/coders.d.ts +1 -1
- package/dist/src/svm/web3-v1/coders.js +4 -4
- package/dist/src/svm/web3-v1/conversionUtils.d.ts +1 -1
- package/dist/src/svm/web3-v1/conversionUtils.js +3 -3
- package/dist/src/svm/web3-v1/helpers.d.ts +1 -114
- package/dist/src/svm/web3-v1/helpers.js +1 -179
- package/dist/src/svm/web3-v1/instructionParamsUtils.d.ts +11 -26
- package/dist/src/svm/web3-v1/instructionParamsUtils.js +5 -90
- package/dist/src/svm/web3-v1/programConnectors.d.ts +1 -1
- package/dist/src/svm/web3-v1/programConnectors.js +2 -2
- package/dist/src/svm/web3-v1/relayHashUtils.d.ts +2 -6
- package/dist/src/svm/web3-v1/relayHashUtils.js +5 -66
- package/dist/src/svm/web3-v1/solanaProgramUtils.d.ts +1 -1
- package/dist/src/svm/web3-v1/solanaProgramUtils.js +7 -7
- package/dist/src/svm/web3-v1/transactionUtils.js +3 -3
- package/dist/src/svm/web3-v2/solanaProgramUtils.d.ts +1 -1
- package/dist/src/svm/web3-v2/solanaProgramUtils.js +4 -4
- package/dist/src/types/svm.d.ts +1 -46
- package/package.json +28 -13
- package/svm/idl/multicall_handler.json +31 -0
- package/svm/idl/sponsored_cctp_src_periphery.json +1982 -0
- package/svm/idl/svm_spoke.json +3930 -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
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.d.ts +0 -30
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.js +0 -66
- package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.d.ts +0 -31
- package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.js +0 -70
- package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.d.ts +0 -31
- package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.js +0 -67
- package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.d.ts +0 -27
- package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.js +0 -66
- package/dist/src/svm/clients/SvmSpoke/instructions/deposit.d.ts +0 -131
- package/dist/src/svm/clients/SvmSpoke/instructions/deposit.js +0 -241
- package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.d.ts +0 -127
- package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.js +0 -239
- package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.d.ts +0 -104
- package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.js +0 -259
- package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.d.ts +0 -108
- package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.js +0 -265
- package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.d.ts +0 -39
- package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.js +0 -63
- package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.d.ts +0 -76
- package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.js +0 -187
- package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.d.ts +0 -135
- package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.js +0 -243
- package/dist/src/svm/clients/SvmSpoke/types/slowFill.d.ts +0 -22
- package/dist/target/types/svm_spoke.d.ts +0 -5106
- package/dist/target/types/svm_spoke.js +0 -2
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
import { Keypair,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Keypair, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import { Idl, Program } from "@anchor-lang/core";
|
|
3
|
+
import { RelayerRefundLeafSolana } from "../../types/svm";
|
|
4
|
+
import { SvmSpokeAnchor } from "../assets";
|
|
5
|
+
type InstructionParamsProgram = Pick<Program<SvmSpokeAnchor>, "programId" | "provider" | "methods"> & {
|
|
6
|
+
idl: Idl;
|
|
7
|
+
};
|
|
5
8
|
/**
|
|
6
|
-
* Loads execute relayer refund leaf parameters.
|
|
9
|
+
* Loads execute relayer refund leaf parameters and waits for the writes to be confirmed.
|
|
7
10
|
*/
|
|
8
|
-
export declare function loadExecuteRelayerRefundLeafParams(program:
|
|
11
|
+
export declare function loadExecuteRelayerRefundLeafParams(program: InstructionParamsProgram, caller: PublicKey, rootBundleId: number, relayerRefundLeaf: RelayerRefundLeafSolana, proof: number[][]): Promise<PublicKey>;
|
|
9
12
|
/**
|
|
10
13
|
* Closes the instruction parameters account.
|
|
11
14
|
*/
|
|
12
|
-
export declare function closeInstructionParams(program:
|
|
13
|
-
|
|
14
|
-
* Creates instructions to load fill relay parameters.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createFillRelayParamsInstructions(program: Program<SvmSpoke>, signer: PublicKey, relayData: RelayData, repaymentChainId: BN, repaymentAddress: PublicKey): Promise<{
|
|
17
|
-
loadInstructions: TransactionInstruction[];
|
|
18
|
-
closeInstruction: TransactionInstruction;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Loads fill relay parameters.
|
|
22
|
-
*/
|
|
23
|
-
export declare function loadFillRelayParams(program: Program<SvmSpoke>, signer: Keypair, relayData: RelayData, repaymentChainId: BN, repaymentAddress: PublicKey): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Loads request slow fill parameters.
|
|
26
|
-
*/
|
|
27
|
-
export declare function loadRequestSlowFillParams(program: Program<SvmSpoke>, signer: Keypair, relayData: RelayData): Promise<TransactionInstruction[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Loads execute slow relay leaf parameters.
|
|
30
|
-
*/
|
|
31
|
-
export declare function loadExecuteSlowRelayLeafParams(program: Program<SvmSpoke>, signer: Keypair, slowFillLeaf: SlowFillLeaf, rootBundleId: number, proof: number[][]): Promise<TransactionInstruction[]>;
|
|
15
|
+
export declare function closeInstructionParams(program: InstructionParamsProgram, signer: Keypair): Promise<void>;
|
|
16
|
+
export {};
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExecuteRelayerRefundLeafParams = loadExecuteRelayerRefundLeafParams;
|
|
4
4
|
exports.closeInstructionParams = closeInstructionParams;
|
|
5
|
-
exports.createFillRelayParamsInstructions = createFillRelayParamsInstructions;
|
|
6
|
-
exports.loadFillRelayParams = loadFillRelayParams;
|
|
7
|
-
exports.loadRequestSlowFillParams = loadRequestSlowFillParams;
|
|
8
|
-
exports.loadExecuteSlowRelayLeafParams = loadExecuteSlowRelayLeafParams;
|
|
9
5
|
const web3_js_1 = require("@solana/web3.js");
|
|
10
6
|
const coders_1 = require("./coders");
|
|
11
7
|
/**
|
|
12
|
-
* Loads execute relayer refund leaf parameters.
|
|
8
|
+
* Loads execute relayer refund leaf parameters and waits for the writes to be confirmed.
|
|
13
9
|
*/
|
|
14
10
|
async function loadExecuteRelayerRefundLeafParams(program, caller, rootBundleId, relayerRefundLeaf, proof) {
|
|
15
11
|
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.
|
|
@@ -27,7 +23,10 @@ async function loadExecuteRelayerRefundLeafParams(program, caller, rootBundleId,
|
|
|
27
23
|
await program.methods.initializeInstructionParams(instructionParamsBytes.length).rpc();
|
|
28
24
|
for (let i = 0; i < instructionParamsBytes.length; i += maxInstructionParamsFragment) {
|
|
29
25
|
const fragment = instructionParamsBytes.slice(i, i + maxInstructionParamsFragment);
|
|
30
|
-
|
|
26
|
+
// Preflight must see the preceding initialization; wait for confirmed visibility before the caller executes.
|
|
27
|
+
await program.methods
|
|
28
|
+
.writeInstructionParamsFragment(i, fragment)
|
|
29
|
+
.rpc({ preflightCommitment: "processed", commitment: "confirmed" });
|
|
31
30
|
}
|
|
32
31
|
return instructionParams;
|
|
33
32
|
}
|
|
@@ -42,87 +41,3 @@ async function closeInstructionParams(program, signer) {
|
|
|
42
41
|
await (0, web3_js_1.sendAndConfirmTransaction)(program.provider.connection, new web3_js_1.Transaction().add(closeIx), [signer]);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates instructions to load fill relay parameters.
|
|
47
|
-
*/
|
|
48
|
-
async function createFillRelayParamsInstructions(program, signer, relayData, repaymentChainId, repaymentAddress) {
|
|
49
|
-
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.
|
|
50
|
-
const accountCoder = new coders_1.LargeAccountsCoder(program.idl);
|
|
51
|
-
const instructionParamsBytes = await accountCoder.encode("fillRelayParams", {
|
|
52
|
-
relayData,
|
|
53
|
-
repaymentChainId,
|
|
54
|
-
repaymentAddress,
|
|
55
|
-
});
|
|
56
|
-
const loadInstructions = [];
|
|
57
|
-
loadInstructions.push(await program.methods.initializeInstructionParams(instructionParamsBytes.length).accounts({ signer }).instruction());
|
|
58
|
-
for (let i = 0; i < instructionParamsBytes.length; i += maxInstructionParamsFragment) {
|
|
59
|
-
const fragment = instructionParamsBytes.slice(i, i + maxInstructionParamsFragment);
|
|
60
|
-
loadInstructions.push(await program.methods.writeInstructionParamsFragment(i, fragment).accounts({ signer }).instruction());
|
|
61
|
-
}
|
|
62
|
-
const closeInstruction = await program.methods.closeInstructionParams().accounts({ signer }).instruction();
|
|
63
|
-
return { loadInstructions, closeInstruction };
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Loads fill relay parameters.
|
|
67
|
-
*/
|
|
68
|
-
async function loadFillRelayParams(program, signer, relayData, repaymentChainId, repaymentAddress) {
|
|
69
|
-
// Close the instruction params account if the caller has used it before.
|
|
70
|
-
await closeInstructionParams(program, signer);
|
|
71
|
-
// Execute load instructions sequentially.
|
|
72
|
-
const { loadInstructions } = await createFillRelayParamsInstructions(program, signer.publicKey, relayData, repaymentChainId, repaymentAddress);
|
|
73
|
-
for (let i = 0; i < loadInstructions.length; i += 1) {
|
|
74
|
-
await (0, web3_js_1.sendAndConfirmTransaction)(program.provider.connection, new web3_js_1.Transaction().add(loadInstructions[i]), [signer]);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Loads request slow fill parameters.
|
|
79
|
-
*/
|
|
80
|
-
async function loadRequestSlowFillParams(program, signer, relayData) {
|
|
81
|
-
// Close the instruction params account if the caller has used it before.
|
|
82
|
-
await closeInstructionParams(program, signer);
|
|
83
|
-
// Execute load instructions sequentially.
|
|
84
|
-
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.
|
|
85
|
-
const accountCoder = new coders_1.LargeAccountsCoder(program.idl);
|
|
86
|
-
const instructionParamsBytes = await accountCoder.encode("requestSlowFillParams", { relayData });
|
|
87
|
-
const loadInstructions = [];
|
|
88
|
-
loadInstructions.push(await program.methods
|
|
89
|
-
.initializeInstructionParams(instructionParamsBytes.length)
|
|
90
|
-
.accounts({ signer: signer.publicKey })
|
|
91
|
-
.instruction());
|
|
92
|
-
for (let i = 0; i < instructionParamsBytes.length; i += maxInstructionParamsFragment) {
|
|
93
|
-
const fragment = instructionParamsBytes.slice(i, i + maxInstructionParamsFragment);
|
|
94
|
-
loadInstructions.push(await program.methods
|
|
95
|
-
.writeInstructionParamsFragment(i, fragment)
|
|
96
|
-
.accounts({ signer: signer.publicKey })
|
|
97
|
-
.instruction());
|
|
98
|
-
}
|
|
99
|
-
return loadInstructions;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Loads execute slow relay leaf parameters.
|
|
103
|
-
*/
|
|
104
|
-
async function loadExecuteSlowRelayLeafParams(program, signer, slowFillLeaf, rootBundleId, proof) {
|
|
105
|
-
// Close the instruction params account if the caller has used it before.
|
|
106
|
-
await closeInstructionParams(program, signer);
|
|
107
|
-
// Execute load instructions sequentially.
|
|
108
|
-
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.
|
|
109
|
-
const accountCoder = new coders_1.LargeAccountsCoder(program.idl);
|
|
110
|
-
const instructionParamsBytes = await accountCoder.encode("executeSlowRelayLeafParams", {
|
|
111
|
-
slowFillLeaf,
|
|
112
|
-
rootBundleId,
|
|
113
|
-
proof,
|
|
114
|
-
});
|
|
115
|
-
const loadInstructions = [];
|
|
116
|
-
loadInstructions.push(await program.methods
|
|
117
|
-
.initializeInstructionParams(instructionParamsBytes.length)
|
|
118
|
-
.accounts({ signer: signer.publicKey })
|
|
119
|
-
.instruction());
|
|
120
|
-
for (let i = 0; i < instructionParamsBytes.length; i += maxInstructionParamsFragment) {
|
|
121
|
-
const fragment = instructionParamsBytes.slice(i, i + maxInstructionParamsFragment);
|
|
122
|
-
loadInstructions.push(await program.methods
|
|
123
|
-
.writeInstructionParamsFragment(i, fragment)
|
|
124
|
-
.accounts({ signer: signer.publicKey })
|
|
125
|
-
.instruction());
|
|
126
|
-
}
|
|
127
|
-
return loadInstructions;
|
|
128
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnchorProvider, Idl, Program } from "@
|
|
1
|
+
import { AnchorProvider, Idl, Program } from "@anchor-lang/core";
|
|
2
2
|
import { SupportedNetworks } from "../../types/svm";
|
|
3
3
|
import { MulticallHandlerAnchor, SvmSpokeAnchor, MessageTransmitterV2Anchor, TokenMessengerMinterV2Anchor, SponsoredCctpSrcPeripheryAnchor } from "../assets";
|
|
4
4
|
type ProgramOptions = {
|
|
@@ -6,13 +6,13 @@ exports.getMulticallHandlerProgram = getMulticallHandlerProgram;
|
|
|
6
6
|
exports.getMessageTransmitterV2Program = getMessageTransmitterV2Program;
|
|
7
7
|
exports.getTokenMessengerMinterV2Program = getTokenMessengerMinterV2Program;
|
|
8
8
|
exports.getSponsoredCctpSrcPeripheryProgram = getSponsoredCctpSrcPeripheryProgram;
|
|
9
|
-
const
|
|
9
|
+
const core_1 = require("@anchor-lang/core");
|
|
10
10
|
const DeploymentUtils_1 = require("../../DeploymentUtils");
|
|
11
11
|
const assets_1 = require("../assets");
|
|
12
12
|
const helpers_1 = require("./helpers");
|
|
13
13
|
function getConnectedProgram(idl, provider, programId) {
|
|
14
14
|
idl.address = programId;
|
|
15
|
-
return new
|
|
15
|
+
return new core_1.Program(idl, provider);
|
|
16
16
|
}
|
|
17
17
|
// Resolves the program ID from options or defaults to the deployed address. Prioritizes programId, falls back to
|
|
18
18
|
// network, and if network is not defined, determines the network from the provider's RPC URL. Throws an error if
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BN } from "@
|
|
2
|
-
import { RelayerRefundLeaf, RelayerRefundLeafSolana
|
|
1
|
+
import { BN } from "@anchor-lang/core";
|
|
2
|
+
import { RelayerRefundLeaf, RelayerRefundLeafSolana } from "../../types/svm";
|
|
3
3
|
/**
|
|
4
4
|
* Calculates the relay hash from relay data and chain ID.
|
|
5
5
|
*/
|
|
@@ -24,7 +24,3 @@ export declare function calculateRelayerRefundLeafHashUint8Array(relayData: Rela
|
|
|
24
24
|
* Hash function for relayer refund leaves.
|
|
25
25
|
*/
|
|
26
26
|
export declare const relayerRefundHashFn: (input: RelayerRefundLeaf | RelayerRefundLeafSolana) => string;
|
|
27
|
-
/**
|
|
28
|
-
* Hash function for slow fill leaves.
|
|
29
|
-
*/
|
|
30
|
-
export declare function slowFillHashFn(slowFillLeaf: SlowFillLeaf): string;
|
|
@@ -5,8 +5,7 @@ exports.calculateRelayHashUint8Array = calculateRelayHashUint8Array;
|
|
|
5
5
|
exports.calculateRelayEventHashUint8Array = calculateRelayEventHashUint8Array;
|
|
6
6
|
exports.hashNonEmptyMessage = hashNonEmptyMessage;
|
|
7
7
|
exports.calculateRelayerRefundLeafHashUint8Array = calculateRelayerRefundLeafHashUint8Array;
|
|
8
|
-
|
|
9
|
-
const anchor_1 = require("@coral-xyz/anchor");
|
|
8
|
+
const core_1 = require("@anchor-lang/core");
|
|
10
9
|
const ethers_1 = require("ethers");
|
|
11
10
|
const borsh_1 = require("borsh");
|
|
12
11
|
/**
|
|
@@ -23,8 +22,8 @@ function calculateRelayHashUint8Array(relayData, chainId) {
|
|
|
23
22
|
relayData.outputAmount.toArrayLike(Buffer, "le", 8),
|
|
24
23
|
relayData.originChainId.toArrayLike(Buffer, "le", 8),
|
|
25
24
|
Buffer.from(relayData.depositId),
|
|
26
|
-
new
|
|
27
|
-
new
|
|
25
|
+
new core_1.BN(relayData.fillDeadline).toArrayLike(Buffer, "le", 4),
|
|
26
|
+
new core_1.BN(relayData.exclusivityDeadline).toArrayLike(Buffer, "le", 4),
|
|
28
27
|
hashNonEmptyMessage(relayData.message), // Replace with hash of message, so that relay hash can be recovered from event.
|
|
29
28
|
chainId.toArrayLike(Buffer, "le", 8),
|
|
30
29
|
]);
|
|
@@ -46,8 +45,8 @@ function calculateRelayEventHashUint8Array(relayEventData, chainId) {
|
|
|
46
45
|
relayEventData.outputAmount.toArrayLike(Buffer, "le", 8),
|
|
47
46
|
relayEventData.originChainId.toArrayLike(Buffer, "le", 8),
|
|
48
47
|
Buffer.from(relayEventData.depositId),
|
|
49
|
-
new
|
|
50
|
-
new
|
|
48
|
+
new core_1.BN(relayEventData.fillDeadline).toArrayLike(Buffer, "le", 4),
|
|
49
|
+
new core_1.BN(relayEventData.exclusivityDeadline).toArrayLike(Buffer, "le", 4),
|
|
51
50
|
Buffer.from(relayEventData.messageHash), // Renamed to messageHash in the event data.
|
|
52
51
|
chainId.toArrayLike(Buffer, "le", 8),
|
|
53
52
|
]);
|
|
@@ -147,63 +146,3 @@ const relayerRefundHashFn = (input) => {
|
|
|
147
146
|
}
|
|
148
147
|
};
|
|
149
148
|
exports.relayerRefundHashFn = relayerRefundHashFn;
|
|
150
|
-
/**
|
|
151
|
-
* Class for slow fill data.
|
|
152
|
-
*/
|
|
153
|
-
class SlowFillData {
|
|
154
|
-
constructor(properties) {
|
|
155
|
-
Object.assign(this, properties);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Schema for slow fill data.
|
|
160
|
-
*/
|
|
161
|
-
const slowFillDataSchema = new Map([
|
|
162
|
-
[
|
|
163
|
-
SlowFillData,
|
|
164
|
-
{
|
|
165
|
-
kind: "struct",
|
|
166
|
-
fields: [
|
|
167
|
-
["depositor", [32]],
|
|
168
|
-
["recipient", [32]],
|
|
169
|
-
["exclusiveRelayer", [32]],
|
|
170
|
-
["inputToken", [32]],
|
|
171
|
-
["outputToken", [32]],
|
|
172
|
-
["inputAmount", [32]],
|
|
173
|
-
["outputAmount", "u64"],
|
|
174
|
-
["originChainId", "u64"],
|
|
175
|
-
["depositId", [32]],
|
|
176
|
-
["fillDeadline", "u32"],
|
|
177
|
-
["exclusivityDeadline", "u32"],
|
|
178
|
-
["message", ["u8"]],
|
|
179
|
-
["chainId", "u64"],
|
|
180
|
-
["updatedOutputAmount", "u64"],
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
]);
|
|
185
|
-
/**
|
|
186
|
-
* Hash function for slow fill leaves.
|
|
187
|
-
*/
|
|
188
|
-
function slowFillHashFn(slowFillLeaf) {
|
|
189
|
-
const data = new SlowFillData({
|
|
190
|
-
depositor: Uint8Array.from(slowFillLeaf.relayData.depositor.toBuffer()),
|
|
191
|
-
recipient: Uint8Array.from(slowFillLeaf.relayData.recipient.toBuffer()),
|
|
192
|
-
exclusiveRelayer: Uint8Array.from(slowFillLeaf.relayData.exclusiveRelayer.toBuffer()),
|
|
193
|
-
inputToken: Uint8Array.from(slowFillLeaf.relayData.inputToken.toBuffer()),
|
|
194
|
-
outputToken: Uint8Array.from(slowFillLeaf.relayData.outputToken.toBuffer()),
|
|
195
|
-
inputAmount: slowFillLeaf.relayData.inputAmount,
|
|
196
|
-
outputAmount: slowFillLeaf.relayData.outputAmount,
|
|
197
|
-
originChainId: slowFillLeaf.relayData.originChainId,
|
|
198
|
-
depositId: Uint8Array.from(Buffer.from(slowFillLeaf.relayData.depositId)),
|
|
199
|
-
fillDeadline: slowFillLeaf.relayData.fillDeadline,
|
|
200
|
-
exclusivityDeadline: slowFillLeaf.relayData.exclusivityDeadline,
|
|
201
|
-
message: Uint8Array.from(slowFillLeaf.relayData.message),
|
|
202
|
-
chainId: slowFillLeaf.chainId,
|
|
203
|
-
updatedOutputAmount: slowFillLeaf.updatedOutputAmount,
|
|
204
|
-
});
|
|
205
|
-
const serializedData = (0, borsh_1.serialize)(slowFillDataSchema, data);
|
|
206
|
-
// SVM leaves require the first 64 bytes to be 0 to ensure EVM leaves cannot be played on SVM and vice versa
|
|
207
|
-
const contentToHash = Buffer.concat([Buffer.alloc(64, 0), serializedData]);
|
|
208
|
-
return ethers_1.ethers.utils.keccak256(contentToHash);
|
|
209
|
-
}
|
|
@@ -8,7 +8,7 @@ exports.getEvent = getEvent;
|
|
|
8
8
|
exports.readProgramEvents = readProgramEvents;
|
|
9
9
|
exports.subscribeToCpiEventsForProgram = subscribeToCpiEventsForProgram;
|
|
10
10
|
exports.stringifyCpiEvent = stringifyCpiEvent;
|
|
11
|
-
const
|
|
11
|
+
const core_1 = require("@anchor-lang/core");
|
|
12
12
|
const web3_js_1 = require("@solana/web3.js");
|
|
13
13
|
const borsh_1 = require("borsh");
|
|
14
14
|
const conversionUtils_1 = require("./conversionUtils");
|
|
@@ -16,11 +16,11 @@ const conversionUtils_1 = require("./conversionUtils");
|
|
|
16
16
|
* Finds a program address with a given label and optional extra seeds.
|
|
17
17
|
*/
|
|
18
18
|
function findProgramAddress(label, program, extraSeeds) {
|
|
19
|
-
const seeds = [Buffer.from(
|
|
19
|
+
const seeds = [Buffer.from(core_1.utils.bytes.utf8.encode(label))];
|
|
20
20
|
if (extraSeeds) {
|
|
21
21
|
for (const extraSeed of extraSeeds) {
|
|
22
22
|
if (typeof extraSeed === "string") {
|
|
23
|
-
seeds.push(Buffer.from(
|
|
23
|
+
seeds.push(Buffer.from(core_1.utils.bytes.utf8.encode(extraSeed)));
|
|
24
24
|
}
|
|
25
25
|
else if (Array.isArray(extraSeed)) {
|
|
26
26
|
seeds.push(Buffer.from(extraSeed));
|
|
@@ -67,8 +67,8 @@ function processEventFromTx(txResult, programs) {
|
|
|
67
67
|
singleIxAccount !== undefined &&
|
|
68
68
|
program.programId.equals(ixProgramId) &&
|
|
69
69
|
eventAuthorities.get(ixProgramId.toString())?.equals(singleIxAccount)) {
|
|
70
|
-
const ixData =
|
|
71
|
-
const eventData =
|
|
70
|
+
const ixData = core_1.utils.bytes.bs58.decode(ix.data);
|
|
71
|
+
const eventData = core_1.utils.bytes.base64.encode(Buffer.from(new Uint8Array(ixData).slice(8)));
|
|
72
72
|
const event = program.coder.events.decode(eventData);
|
|
73
73
|
events.push({
|
|
74
74
|
program: program.programId,
|
|
@@ -174,7 +174,7 @@ function parseDepositId(value) {
|
|
|
174
174
|
}
|
|
175
175
|
// Deserialize the full depositId using the Borsh schema
|
|
176
176
|
const depositId = (0, borsh_1.deserialize)(depositIdSchema, DepositId, Buffer.from(value));
|
|
177
|
-
return new
|
|
177
|
+
return new core_1.BN(depositId.value).toString();
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
180
|
* Stringifies a CPI event.
|
|
@@ -187,7 +187,7 @@ function stringifyCpiEvent(obj, eventName) {
|
|
|
187
187
|
}
|
|
188
188
|
return obj.toString();
|
|
189
189
|
}
|
|
190
|
-
else if (
|
|
190
|
+
else if (core_1.BN.isBN(obj)) {
|
|
191
191
|
return obj.toString();
|
|
192
192
|
}
|
|
193
193
|
else if (typeof obj === "bigint") {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendTransactionWithLookupTable = sendTransactionWithLookupTable;
|
|
4
4
|
exports.sendTransactionWithExistingLookupTable = sendTransactionWithExistingLookupTable;
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@anchor-lang/core");
|
|
6
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
7
7
|
/**
|
|
8
8
|
* Sends a transaction using an Address Lookup Table for large numbers of accounts.
|
|
@@ -22,7 +22,7 @@ async function sendTransactionWithLookupTable(connection, instructions, sender,
|
|
|
22
22
|
recentSlot: await connection.getSlot(),
|
|
23
23
|
});
|
|
24
24
|
// Submit the ALT creation transaction
|
|
25
|
-
await
|
|
25
|
+
await core_1.web3.sendAndConfirmTransaction(connection, new core_1.web3.Transaction().add(lookupTableInstruction), [sender], {
|
|
26
26
|
commitment: "confirmed",
|
|
27
27
|
skipPreflight: true,
|
|
28
28
|
});
|
|
@@ -34,7 +34,7 @@ async function sendTransactionWithLookupTable(connection, instructions, sender,
|
|
|
34
34
|
payer: sender.publicKey,
|
|
35
35
|
addresses: lookupAddresses.slice(i, i + maxExtendedAccounts),
|
|
36
36
|
});
|
|
37
|
-
await
|
|
37
|
+
await core_1.web3.sendAndConfirmTransaction(connection, new core_1.web3.Transaction().add(extendInstruction), [sender], {
|
|
38
38
|
commitment: "confirmed",
|
|
39
39
|
skipPreflight: true,
|
|
40
40
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Idl } from "@
|
|
1
|
+
import { Idl } from "@anchor-lang/core";
|
|
2
2
|
import web3, { Address, Commitment, GetSignaturesForAddressApi, Signature } from "@solana/kit";
|
|
3
3
|
import { RpcClient } from "./types";
|
|
4
4
|
type GetSignaturesForAddressConfig = Parameters<GetSignaturesForAddressApi["getSignaturesForAddress"]>[1];
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.readProgramEvents = readProgramEvents;
|
|
7
7
|
exports.readEvents = readEvents;
|
|
8
8
|
exports.readFillEventFromFillStatusPda = readFillEventFromFillStatusPda;
|
|
9
|
-
const
|
|
9
|
+
const core_1 = require("@anchor-lang/core");
|
|
10
10
|
const kit_1 = __importDefault(require("@solana/kit"));
|
|
11
11
|
/**
|
|
12
12
|
* Reads all events for a specific program.
|
|
@@ -79,9 +79,9 @@ async function processEventFromTx(txResult, programId, programIdl) {
|
|
|
79
79
|
singleIxAccount !== undefined &&
|
|
80
80
|
programId == ixProgramId &&
|
|
81
81
|
eventAuthorities.get(ixProgramId.toString()) == singleIxAccount) {
|
|
82
|
-
const ixData =
|
|
83
|
-
const eventData =
|
|
84
|
-
let event = new
|
|
82
|
+
const ixData = core_1.utils.bytes.bs58.decode(ix.data);
|
|
83
|
+
const eventData = core_1.utils.bytes.base64.encode(Buffer.from(new Uint8Array(ixData).slice(8)));
|
|
84
|
+
let event = new core_1.BorshEventCoder(programIdl).decode(eventData);
|
|
85
85
|
events.push({
|
|
86
86
|
program: programId,
|
|
87
87
|
data: event?.data,
|
package/dist/src/types/svm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BN } from "@
|
|
1
|
+
import { BN } from "@anchor-lang/core";
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
import { BigNumber } from "ethers";
|
|
4
4
|
/**
|
|
@@ -23,14 +23,6 @@ export interface RelayerRefundLeafSolana {
|
|
|
23
23
|
refundAddresses: PublicKey[];
|
|
24
24
|
}
|
|
25
25
|
export type RelayerRefundLeafType = RelayerRefundLeaf | RelayerRefundLeafSolana;
|
|
26
|
-
/**
|
|
27
|
-
* Slow Fill Leaf Interface
|
|
28
|
-
*/
|
|
29
|
-
export interface SlowFillLeaf {
|
|
30
|
-
relayData: RelayData;
|
|
31
|
-
chainId: BN;
|
|
32
|
-
updatedOutputAmount: BN;
|
|
33
|
-
}
|
|
34
26
|
/**
|
|
35
27
|
* Relay Data Interface
|
|
36
28
|
*/
|
|
@@ -84,16 +76,6 @@ export type DepositDataValues = [
|
|
|
84
76
|
*/
|
|
85
77
|
export type FillDataValues = [number[], RelayData, BN, PublicKey];
|
|
86
78
|
export type FillDataParams = [number[], RelayData | null, BN | null, PublicKey | null];
|
|
87
|
-
/**
|
|
88
|
-
* Request Slow Fill Data Interfaces
|
|
89
|
-
*/
|
|
90
|
-
export type RequestSlowFillDataValues = [number[], RelayData];
|
|
91
|
-
export type RequestSlowFillDataParams = [number[], RelayData | null];
|
|
92
|
-
/**
|
|
93
|
-
* Execute Slow Relay Leaf Data Interfaces
|
|
94
|
-
*/
|
|
95
|
-
export type ExecuteSlowRelayLeafDataValues = [number[], SlowFillLeaf, number, number[][]];
|
|
96
|
-
export type ExecuteSlowRelayLeafDataParams = [number[], SlowFillLeaf | null, number | null, number[][] | null];
|
|
97
79
|
/**
|
|
98
80
|
* Across+ Message Interface
|
|
99
81
|
*/
|
|
@@ -137,30 +119,3 @@ export type FillAccounts = {
|
|
|
137
119
|
systemProgram: PublicKey;
|
|
138
120
|
program: PublicKey;
|
|
139
121
|
};
|
|
140
|
-
/**
|
|
141
|
-
* Request Slow Fill Accounts
|
|
142
|
-
*/
|
|
143
|
-
export type RequestSlowFillAccounts = {
|
|
144
|
-
signer: PublicKey;
|
|
145
|
-
instructionParams: PublicKey;
|
|
146
|
-
state: PublicKey;
|
|
147
|
-
fillStatus: PublicKey;
|
|
148
|
-
systemProgram: PublicKey;
|
|
149
|
-
program: PublicKey;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Execute Slow Relay Leaf Accounts
|
|
153
|
-
*/
|
|
154
|
-
export type ExecuteSlowRelayLeafAccounts = {
|
|
155
|
-
signer: PublicKey;
|
|
156
|
-
instructionParams: PublicKey;
|
|
157
|
-
state: PublicKey;
|
|
158
|
-
rootBundle: PublicKey;
|
|
159
|
-
fillStatus: PublicKey;
|
|
160
|
-
mint: PublicKey;
|
|
161
|
-
recipientTokenAccount: PublicKey;
|
|
162
|
-
vault: PublicKey;
|
|
163
|
-
tokenProgram: PublicKey;
|
|
164
|
-
systemProgram: PublicKey;
|
|
165
|
-
program: PublicKey;
|
|
166
|
-
};
|
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.4",
|
|
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,24 +33,32 @@
|
|
|
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",
|
|
39
|
+
"generate-svm-test-idls": "bash ./scripts/svm/buildHelpers/buildTestIdls.sh",
|
|
36
40
|
"generate-svm-clients": "yarn ts-node ./scripts/svm/buildHelpers/generateSvmClients.ts && yarn ts-node ./scripts/svm/buildHelpers/renameClientsImports.ts",
|
|
37
41
|
"build-svm": "bash ./scripts/svm/buildHelpers/buildSvmLocalToolchain.sh",
|
|
38
42
|
"build-svm-solana-verify": "bash ./scripts/svm/buildHelpers/buildSolanaVerify.sh",
|
|
39
|
-
"build-ts": "rm -rf ./dist && tsc",
|
|
40
|
-
"
|
|
43
|
+
"build-ts": "rm -rf ./dist && tsc && yarn export-idl",
|
|
44
|
+
"typecheck-tests": "tsc -p tsconfig.test.json",
|
|
45
|
+
"test-svm-build-guard": "ts-mocha -p tsconfig.test.json -t 10000 test/svm/Scripts.SbfBuild.ts",
|
|
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",
|
|
41
48
|
"export-evm-artifacts": "sh scripts/exportEvmArtifacts.sh",
|
|
42
|
-
"
|
|
49
|
+
"prepack": "yarn build-ts && yarn export-evm-artifacts",
|
|
43
50
|
"build": "yarn build-evm-foundry && yarn build-svm && yarn generate-svm-artifacts && yarn build-ts",
|
|
44
51
|
"build-verified": "yarn build-evm-foundry && yarn build-svm-solana-verify && yarn generate-svm-artifacts && yarn build-ts",
|
|
45
52
|
"pin-foundry": "sh scripts/foundry-version.sh pin",
|
|
46
53
|
"build-evm-foundry": "forge build",
|
|
47
54
|
"test-evm": "yarn test-evm-foundry",
|
|
48
55
|
"test-evm-foundry": "FOUNDRY_PROFILE=local-test forge test",
|
|
49
|
-
"test-svm": "IS_TEST=true yarn build-svm && yarn generate-svm-artifacts && anchor test --skip-build",
|
|
50
|
-
"test-svm-
|
|
56
|
+
"test-svm": "IS_TEST=true yarn build-svm && yarn generate-svm-artifacts && yarn generate-svm-test-idls && anchor test --skip-build --validator legacy",
|
|
57
|
+
"test-svm-production": "IS_TEST=false yarn build-svm-solana-verify && yarn generate-svm-artifacts && NODE_OPTIONS=--no-experimental-strip-types ts-node scripts/svm/testProduction.ts",
|
|
58
|
+
"test-svm-gateway": "ts-node scripts/svm/testRealGateway.ts",
|
|
59
|
+
"bench-svm-cu": "NODE_OPTIONS=--no-experimental-strip-types ts-node scripts/svm/benchmarkCu.ts",
|
|
60
|
+
"test-svm-gateway-vectors": "NODE_OPTIONS=--no-experimental-strip-types ts-mocha -p tsconfig.json -t 10000 test/svm-gateway/PathVectors.ts",
|
|
61
|
+
"test-svm-solana-verify": "IS_TEST=true yarn build-svm-solana-verify && yarn generate-svm-artifacts && yarn generate-svm-test-idls && anchor test --skip-build --validator legacy",
|
|
51
62
|
"test": "yarn test-evm && yarn test-svm",
|
|
52
63
|
"test-verified": "yarn test-evm && yarn test-svm-solana-verify",
|
|
53
64
|
"evm-contract-sizes": "forge build --sizes",
|
|
@@ -77,7 +88,8 @@
|
|
|
77
88
|
},
|
|
78
89
|
"dependencies": {
|
|
79
90
|
"@across-protocol/constants": "^3.1.124",
|
|
80
|
-
"@
|
|
91
|
+
"@anchor-lang/borsh": "1.1.2",
|
|
92
|
+
"@anchor-lang/core": "1.1.2",
|
|
81
93
|
"@eth-optimism/contracts": "^0.5.40",
|
|
82
94
|
"@ethersproject/bignumber": "5.7.0",
|
|
83
95
|
"@ethersproject/bytes": "5.7.0",
|
|
@@ -88,7 +100,7 @@
|
|
|
88
100
|
"@openzeppelin/contracts-v4": "npm:@openzeppelin/contracts@4.9.6",
|
|
89
101
|
"@solana-program/address-lookup-table": "0.10.0",
|
|
90
102
|
"@solana/kit": "^5.4.0",
|
|
91
|
-
"@solana/web3.js": "1.98.
|
|
103
|
+
"@solana/web3.js": "1.98.4",
|
|
92
104
|
"bs58": "^6.0.0",
|
|
93
105
|
"ethers": "5.7.2"
|
|
94
106
|
},
|
|
@@ -98,7 +110,7 @@
|
|
|
98
110
|
"@openzeppelin/foundry-upgrades": "^0.4.0",
|
|
99
111
|
"@safe-global/protocol-kit": "7.0.0",
|
|
100
112
|
"@solana-program/token": "0.9.0",
|
|
101
|
-
"@solana/spl-token": "0.4.
|
|
113
|
+
"@solana/spl-token": "0.4.15",
|
|
102
114
|
"@types/bn.js": "^5.1.0",
|
|
103
115
|
"@types/chai": "^4.3.1",
|
|
104
116
|
"@types/mocha": "^9.1.1",
|
|
@@ -148,6 +160,9 @@
|
|
|
148
160
|
"secp256k1@5.0.0": "5.0.1"
|
|
149
161
|
},
|
|
150
162
|
"resolutions": {
|
|
163
|
+
"@anchor-lang/borsh": "1.1.2",
|
|
164
|
+
"@anchor-lang/errors": "1.1.2",
|
|
165
|
+
"@solana/web3.js": "1.98.4",
|
|
151
166
|
"**/eccrypto/secp256k1": "3.8.1",
|
|
152
167
|
"**/eth-crypto/secp256k1": "5.0.1",
|
|
153
168
|
"**/create-hash/sha.js": "2.4.12",
|
|
@@ -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
|
+
}
|