@across-protocol/contracts 3.0.23 → 3.0.25
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/dist/deploy/consts.js +5 -5
- package/dist/hardhat.config.js +8 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/scripts/svm/bridgeLiabilityToHubPool.js +4 -6
- package/dist/scripts/svm/closeRelayerPdas.js +1 -2
- package/dist/scripts/svm/enableRoute.js +3 -3
- package/dist/scripts/svm/executeRebalanceToHubPool.js +2 -4
- package/dist/scripts/svm/executeRebalanceToSpokePool.js +7 -11
- package/dist/scripts/svm/fakeFillWithRandomDistribution.js +2 -3
- package/dist/scripts/svm/initialize.js +1 -2
- package/dist/scripts/svm/queryDeposits.js +1 -2
- package/dist/scripts/svm/queryFills.js +1 -2
- package/dist/scripts/svm/queryRoute.js +3 -3
- package/dist/scripts/svm/queryState.js +2 -2
- package/dist/scripts/svm/remoteHubPoolPauseDeposits.js +2 -4
- package/dist/scripts/svm/remoteHubPoolSetDepositRoute.js +2 -4
- package/dist/scripts/svm/remotePauseDeposits.js +2 -4
- package/dist/scripts/svm/simpleDeposit.js +3 -3
- package/dist/scripts/svm/simpleFakeRelayerRepayment.js +3 -4
- package/dist/scripts/svm/simpleFill.js +2 -3
- package/dist/src/DeploymentUtils.d.ts +1 -1
- package/dist/src/svm/assets/idl/index.d.ts +6 -0
- package/dist/src/svm/assets/idl/index.js +15 -0
- package/dist/src/svm/assets/idl/message_transmitter.json +1675 -0
- package/dist/src/svm/assets/idl/multicall_handler.json +31 -0
- package/dist/src/svm/assets/idl/svm_spoke.json +6006 -0
- package/dist/src/svm/assets/idl/test.json +243 -0
- package/dist/src/svm/assets/idl/token_messenger_minter.json +2049 -0
- package/dist/src/svm/assets/index.d.ts +6 -0
- package/dist/src/svm/assets/index.js +19 -0
- package/dist/src/svm/assets/message_transmitter.d.ts +1681 -0
- package/dist/src/svm/assets/message_transmitter.js +2 -0
- package/dist/src/svm/assets/multicall_handler.d.ts +37 -0
- package/dist/src/svm/assets/multicall_handler.js +2 -0
- package/dist/src/svm/assets/svm_spoke.d.ts +6012 -0
- package/dist/src/svm/assets/svm_spoke.js +2 -0
- package/dist/src/svm/assets/test.d.ts +249 -0
- package/dist/src/svm/assets/test.js +2 -0
- package/dist/src/svm/assets/token_messenger_minter.d.ts +2055 -0
- package/dist/src/svm/assets/token_messenger_minter.js +2 -0
- package/dist/src/svm/index.d.ts +2 -0
- package/dist/src/svm/index.js +2 -0
- package/dist/src/svm/programConnectors.d.ts +13 -0
- package/dist/src/svm/programConnectors.js +46 -0
- package/dist/src/types/svm.d.ts +4 -0
- package/package.json +7 -5
package/dist/deploy/consts.js
CHANGED
|
@@ -86,11 +86,6 @@ exports.OP_STACK_ADDRESS_MAP = {
|
|
|
86
86
|
L1StandardBridge: "0x88ff1e5b602916615391f55854588efcbb7663f0",
|
|
87
87
|
L1OpUSDCBridgeAdapter: common_1.ZERO_ADDRESS,
|
|
88
88
|
},
|
|
89
|
-
[utils_1.CHAIN_IDs.CHER]: {
|
|
90
|
-
L1CrossDomainMessenger: "0x9cf951e3f74b644e621b36ca9cea147a78d4c39f",
|
|
91
|
-
L1StandardBridge: "0xeb9bf100225c214efc3e7c651ebbadcf85177607",
|
|
92
|
-
L1OpUSDCBridgeAdapter: "0xC67A8c5f22b40274Ca7C4A56Db89569Ee2AD3FAb",
|
|
93
|
-
},
|
|
94
89
|
[utils_1.CHAIN_IDs.LISK]: {
|
|
95
90
|
L1CrossDomainMessenger: "0x31B72D76FB666844C41EdF08dF0254875Dbb7edB",
|
|
96
91
|
L1StandardBridge: "0x2658723Bf70c7667De6B25F99fcce13A16D25d08",
|
|
@@ -107,6 +102,11 @@ exports.OP_STACK_ADDRESS_MAP = {
|
|
|
107
102
|
L1CrossDomainMessenger: "0x592C1299e0F8331D81A28C0FC7352Da24eDB444a",
|
|
108
103
|
L1StandardBridge: "0xc473ca7E02af24c129c2eEf51F2aDf0411c1Df69",
|
|
109
104
|
},
|
|
105
|
+
[utils_1.CHAIN_IDs.SONEIUM]: {
|
|
106
|
+
L1CrossDomainMessenger: "0x9cf951e3f74b644e621b36ca9cea147a78d4c39f",
|
|
107
|
+
L1StandardBridge: "0xeb9bf100225c214efc3e7c651ebbadcf85177607",
|
|
108
|
+
L1OpUSDCBridgeAdapter: "0xC67A8c5f22b40274Ca7C4A56Db89569Ee2AD3FAb",
|
|
109
|
+
},
|
|
110
110
|
[utils_1.CHAIN_IDs.WORLD_CHAIN]: {
|
|
111
111
|
L1CrossDomainMessenger: "0xf931a81D18B1766d15695ffc7c1920a62b7e710a",
|
|
112
112
|
L1StandardBridge: "0x470458C91978D2d929704489Ad730DC3E3001113",
|
package/dist/hardhat.config.js
CHANGED
|
@@ -327,9 +327,9 @@ const config = {
|
|
|
327
327
|
accounts: { mnemonic },
|
|
328
328
|
companionNetworks: { l1: "mainnet" },
|
|
329
329
|
},
|
|
330
|
-
|
|
331
|
-
chainId: constants_1.CHAIN_IDs.
|
|
332
|
-
url:
|
|
330
|
+
soneium: {
|
|
331
|
+
chainId: constants_1.CHAIN_IDs.SONEIUM,
|
|
332
|
+
url: "https://soneium.blockscout.com",
|
|
333
333
|
saveDeployments: true,
|
|
334
334
|
accounts: { mnemonic },
|
|
335
335
|
companionNetworks: { l1: "mainnet" },
|
|
@@ -364,7 +364,7 @@ const config = {
|
|
|
364
364
|
worldchain: "blockscout",
|
|
365
365
|
alephzero: "blockscout",
|
|
366
366
|
ink: "blockscout",
|
|
367
|
-
|
|
367
|
+
soneium: "blockscout",
|
|
368
368
|
},
|
|
369
369
|
customChains: [
|
|
370
370
|
{
|
|
@@ -400,11 +400,11 @@ const config = {
|
|
|
400
400
|
},
|
|
401
401
|
},
|
|
402
402
|
{
|
|
403
|
-
network: "
|
|
404
|
-
chainId: constants_1.CHAIN_IDs.
|
|
403
|
+
network: "soneium",
|
|
404
|
+
chainId: constants_1.CHAIN_IDs.SONEIUM,
|
|
405
405
|
urls: {
|
|
406
|
-
apiURL: "https://blockscout.com/api",
|
|
407
|
-
browserURL: "https://blockscout.com",
|
|
406
|
+
apiURL: "https://soneium.blockscout.com/api",
|
|
407
|
+
browserURL: "https://soneium.blockscout.com",
|
|
408
408
|
},
|
|
409
409
|
},
|
|
410
410
|
{
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -56,16 +56,14 @@ const svm_1 = require("../../src/svm");
|
|
|
56
56
|
const constants_1 = require("@across-protocol/constants");
|
|
57
57
|
const common_1 = require("@uma/common");
|
|
58
58
|
const ethers_1 = require("ethers");
|
|
59
|
+
const svm_2 = require("../../src/svm");
|
|
59
60
|
const typechain_1 = require("../../typechain");
|
|
60
61
|
const helpers_1 = require("./utils/helpers");
|
|
61
62
|
// Set up Solana provider.
|
|
62
63
|
const provider = anchor_1.AnchorProvider.env();
|
|
63
64
|
anchor.setProvider(provider);
|
|
64
65
|
// Get Solana programs and IDLs.
|
|
65
|
-
const
|
|
66
|
-
const svmSpokeProgram = new anchor_1.Program(svmSpokeIdl, provider);
|
|
67
|
-
const messageTransmitterIdl = require("../../target/idl/message_transmitter.json");
|
|
68
|
-
const tokenMessengerMinterIdl = require("../../target/idl/token_messenger_minter.json");
|
|
66
|
+
const svmSpokeProgram = (0, svm_2.getSpokePoolProgram)(provider);
|
|
69
67
|
// CCTP domains.
|
|
70
68
|
const ethereumDomain = 0; // Ethereum
|
|
71
69
|
const solanaDomain = 5; // Solana
|
|
@@ -171,11 +169,11 @@ async function bridgeLiabilityToHubPool() {
|
|
|
171
169
|
console.log("✅ Bridge liability to hub pool completed successfully.");
|
|
172
170
|
}
|
|
173
171
|
async function bridgeTokensToHubPool(amount, signer, statePda, inputToken) {
|
|
174
|
-
const messageTransmitterProgram =
|
|
172
|
+
const messageTransmitterProgram = (0, svm_2.getMessageTransmitterProgram)(provider);
|
|
175
173
|
const vault = (0, spl_token_1.getAssociatedTokenAddressSync)(inputToken, statePda, true, spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
176
174
|
// Derive the transferLiability PDA
|
|
177
175
|
const [transferLiability] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("transfer_liability"), inputToken.toBuffer()], svmSpokeProgram.programId);
|
|
178
|
-
const tokenMessengerMinterProgram =
|
|
176
|
+
const tokenMessengerMinterProgram = (0, svm_2.getTokenMessengerMinterProgram)(provider);
|
|
179
177
|
const [tokenMessengerMinterSenderAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("sender_authority")], tokenMessengerMinterProgram.programId);
|
|
180
178
|
const [messageTransmitter] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter")], messageTransmitterProgram.programId);
|
|
181
179
|
const [tokenMessenger] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_messenger")], tokenMessengerMinterProgram.programId);
|
|
@@ -37,8 +37,7 @@ const svm_1 = require("../../src/svm");
|
|
|
37
37
|
// Set up the provider
|
|
38
38
|
const provider = anchor_1.AnchorProvider.env();
|
|
39
39
|
anchor.setProvider(provider);
|
|
40
|
-
const
|
|
41
|
-
const program = new anchor_1.Program(idl, provider);
|
|
40
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
42
41
|
const programId = program.programId;
|
|
43
42
|
// Parse arguments
|
|
44
43
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
@@ -29,15 +29,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
31
31
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
32
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
33
32
|
const spl_token_1 = require("@solana/spl-token");
|
|
33
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
34
34
|
const yargs_1 = __importDefault(require("yargs"));
|
|
35
35
|
const helpers_1 = require("yargs/helpers");
|
|
36
|
+
const svm_1 = require("../../src/svm");
|
|
36
37
|
// Set up the provider
|
|
37
38
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
39
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
40
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
41
|
const programId = program.programId;
|
|
42
42
|
console.log("SVM-Spoke Program ID:", programId.toString());
|
|
43
43
|
// Parse arguments
|
|
@@ -72,10 +72,8 @@ const svm_1 = require("../../src/svm");
|
|
|
72
72
|
const provider = anchor_1.AnchorProvider.env();
|
|
73
73
|
anchor.setProvider(provider);
|
|
74
74
|
// Get Solana programs.
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const messageTransmitterIdl = require("../../target/idl/message_transmitter.json");
|
|
78
|
-
const messageTransmitterProgram = new anchor_1.Program(messageTransmitterIdl, provider);
|
|
75
|
+
const svmSpokeProgram = (0, svm_1.getSpokePoolProgram)(provider);
|
|
76
|
+
const messageTransmitterProgram = (0, svm_1.getMessageTransmitterProgram)(provider);
|
|
79
77
|
const [messageTransmitterState] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter")], messageTransmitterProgram.programId);
|
|
80
78
|
const [authorityPda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter_authority"), svmSpokeProgram.programId.toBuffer()], messageTransmitterProgram.programId);
|
|
81
79
|
const [selfAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("self_authority")], svmSpokeProgram.programId);
|
|
@@ -32,29 +32,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
34
34
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
35
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
36
35
|
const spl_token_1 = require("@solana/spl-token");
|
|
36
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
37
37
|
const common_1 = require("@uma/common");
|
|
38
38
|
// eslint-disable-next-line camelcase
|
|
39
|
-
const constants_1 = require("
|
|
39
|
+
const constants_1 = require("@across-protocol/constants");
|
|
40
|
+
const ethers_1 = require("ethers");
|
|
40
41
|
const yargs_1 = __importDefault(require("yargs"));
|
|
41
42
|
const helpers_1 = require("yargs/helpers");
|
|
42
43
|
const svm_1 = require("../../src/svm");
|
|
43
|
-
const ethers_1 = require("ethers");
|
|
44
|
-
// eslint-disable-next-line camelcase
|
|
45
44
|
const typechain_1 = require("../../typechain");
|
|
46
|
-
const poolRebalanceTree_1 = require("./utils/poolRebalanceTree");
|
|
47
45
|
const helpers_2 = require("./utils/helpers");
|
|
46
|
+
const poolRebalanceTree_1 = require("./utils/poolRebalanceTree");
|
|
48
47
|
// Set up Solana provider.
|
|
49
48
|
const provider = anchor_1.AnchorProvider.env();
|
|
50
49
|
anchor.setProvider(provider);
|
|
51
50
|
// Get Solana programs.
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const messageTransmitterProgram = new anchor_1.Program(messageTransmitterIdl, provider);
|
|
56
|
-
const tokenMessengerMinterIdl = require("../../target/idl/token_messenger_minter.json");
|
|
57
|
-
const tokenMessengerMinterProgram = new anchor_1.Program(tokenMessengerMinterIdl, provider);
|
|
51
|
+
const svmSpokeProgram = (0, svm_1.getSpokePoolProgram)(provider);
|
|
52
|
+
const messageTransmitterProgram = (0, svm_1.getMessageTransmitterProgram)(provider);
|
|
53
|
+
const tokenMessengerMinterProgram = (0, svm_1.getTokenMessengerMinterProgram)(provider);
|
|
58
54
|
// Set up Ethereum provider and signer.
|
|
59
55
|
const isDevnet = (0, svm_1.isSolanaDevnet)(provider);
|
|
60
56
|
const nodeURL = isDevnet ? (0, common_1.getNodeUrl)("sepolia", true) : (0, common_1.getNodeUrl)("mainnet", true);
|
|
@@ -30,8 +30,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
// Note that this should be run only on devnet as this is fake fill and all filled tokens are sent to random recipients.
|
|
31
31
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
32
32
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
33
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
34
33
|
const spl_token_1 = require("@solana/spl-token");
|
|
34
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
35
35
|
const yargs_1 = __importDefault(require("yargs"));
|
|
36
36
|
const helpers_1 = require("yargs/helpers");
|
|
37
37
|
const svm_1 = require("../../src/svm");
|
|
@@ -39,8 +39,7 @@ const svm_1 = require("../../src/svm");
|
|
|
39
39
|
const provider = anchor_1.AnchorProvider.env();
|
|
40
40
|
anchor.setProvider(provider);
|
|
41
41
|
const signer = anchor.AnchorProvider.env().wallet.payer;
|
|
42
|
-
const
|
|
43
|
-
const program = new anchor_1.Program(idl, provider);
|
|
42
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
44
43
|
const programId = program.programId;
|
|
45
44
|
// Parse arguments
|
|
46
45
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
@@ -36,8 +36,7 @@ const svm_1 = require("../../src/svm");
|
|
|
36
36
|
// Set up the provider
|
|
37
37
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
38
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
39
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
40
|
const programId = program.programId;
|
|
42
41
|
// Parse arguments
|
|
43
42
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
@@ -36,8 +36,7 @@ const svm_1 = require("../../src/svm");
|
|
|
36
36
|
// Set up the provider
|
|
37
37
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
38
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
39
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
40
|
const programId = program.programId;
|
|
42
41
|
console.log("SVM-Spoke Program ID:", programId.toString());
|
|
43
42
|
// Parse arguments
|
|
@@ -36,8 +36,7 @@ const svm_1 = require("../../src/svm");
|
|
|
36
36
|
// Set up the provider
|
|
37
37
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
38
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
39
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
40
|
const programId = program.programId;
|
|
42
41
|
// Parse arguments
|
|
43
42
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)).option("seed", {
|
|
@@ -29,15 +29,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
31
31
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
32
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
33
32
|
const spl_token_1 = require("@solana/spl-token");
|
|
33
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
34
34
|
const yargs_1 = __importDefault(require("yargs"));
|
|
35
35
|
const helpers_1 = require("yargs/helpers");
|
|
36
|
+
const svm_1 = require("../../src/svm");
|
|
36
37
|
// Set up the provider
|
|
37
38
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
39
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
40
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
41
|
const programId = program.programId;
|
|
42
42
|
console.log("SVM-Spoke Program ID:", programId.toString());
|
|
43
43
|
// Parse arguments
|
|
@@ -32,11 +32,11 @@ const anchor_1 = require("@coral-xyz/anchor");
|
|
|
32
32
|
const web3_js_1 = require("@solana/web3.js");
|
|
33
33
|
const yargs_1 = __importDefault(require("yargs"));
|
|
34
34
|
const helpers_1 = require("yargs/helpers");
|
|
35
|
+
const svm_1 = require("../../src/svm");
|
|
35
36
|
// Set up the provider
|
|
36
37
|
const provider = anchor_1.AnchorProvider.env();
|
|
37
38
|
anchor.setProvider(provider);
|
|
38
|
-
const
|
|
39
|
-
const program = new anchor_1.Program(idl, provider);
|
|
39
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
40
40
|
const programId = program.programId;
|
|
41
41
|
console.log("SVM-Spoke Program ID:", programId.toString());
|
|
42
42
|
// Parse arguments
|
|
@@ -64,11 +64,9 @@ async function remoteHubPoolPauseDeposit() {
|
|
|
64
64
|
// CCTP domains.
|
|
65
65
|
const remoteDomain = 0; // Ethereum
|
|
66
66
|
// Get Solana programs and accounts.
|
|
67
|
-
const
|
|
68
|
-
const svmSpokeProgram = new anchor_1.Program(svmSpokeIdl, provider);
|
|
67
|
+
const svmSpokeProgram = (0, svm_1.getSpokePoolProgram)(provider);
|
|
69
68
|
const [statePda, _] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("state"), seed.toArrayLike(Buffer, "le", 8)], svmSpokeProgram.programId);
|
|
70
|
-
const
|
|
71
|
-
const messageTransmitterProgram = new anchor_1.Program(messageTransmitterIdl, provider);
|
|
69
|
+
const messageTransmitterProgram = (0, svm_1.getMessageTransmitterProgram)(provider);
|
|
72
70
|
const [messageTransmitterState] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter")], messageTransmitterProgram.programId);
|
|
73
71
|
const [authorityPda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter_authority"), svmSpokeProgram.programId.toBuffer()], messageTransmitterProgram.programId);
|
|
74
72
|
const [selfAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("self_authority")], svmSpokeProgram.programId);
|
|
@@ -71,8 +71,7 @@ async function remoteHubPoolSetDepositRoute() {
|
|
|
71
71
|
// CCTP domains.
|
|
72
72
|
const remoteDomain = 0; // Ethereum
|
|
73
73
|
// Get Solana programs and accounts.
|
|
74
|
-
const
|
|
75
|
-
const svmSpokeProgram = new anchor_1.Program(svmSpokeIdl, provider);
|
|
74
|
+
const svmSpokeProgram = (0, svm_1.getSpokePoolProgram)(provider);
|
|
76
75
|
const [statePda, _] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("state"), seed.toArrayLike(Buffer, "le", 8)], svmSpokeProgram.programId);
|
|
77
76
|
const [routePda] = web3_js_1.PublicKey.findProgramAddressSync([
|
|
78
77
|
Buffer.from("route"),
|
|
@@ -81,8 +80,7 @@ async function remoteHubPoolSetDepositRoute() {
|
|
|
81
80
|
new anchor_1.BN(destinationChainId).toArrayLike(Buffer, "le", 8),
|
|
82
81
|
], svmSpokeProgram.programId);
|
|
83
82
|
const vault = (0, spl_token_1.getAssociatedTokenAddressSync)(originToken, statePda, true, spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
84
|
-
const
|
|
85
|
-
const messageTransmitterProgram = new anchor_1.Program(messageTransmitterIdl, provider);
|
|
83
|
+
const messageTransmitterProgram = (0, svm_1.getMessageTransmitterProgram)(provider);
|
|
86
84
|
const [messageTransmitterState] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter")], messageTransmitterProgram.programId);
|
|
87
85
|
const [authorityPda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter_authority"), svmSpokeProgram.programId.toBuffer()], messageTransmitterProgram.programId);
|
|
88
86
|
const [selfAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("self_authority")], svmSpokeProgram.programId);
|
|
@@ -71,11 +71,9 @@ async function remotePauseDeposits() {
|
|
|
71
71
|
const remoteDomain = 0; // Ethereum
|
|
72
72
|
const localDomain = 5; // Solana
|
|
73
73
|
// Get Solana programs and accounts.
|
|
74
|
-
const
|
|
75
|
-
const svmSpokeProgram = new anchor_1.Program(svmSpokeIdl, provider);
|
|
74
|
+
const svmSpokeProgram = (0, svm_1.getSpokePoolProgram)(provider);
|
|
76
75
|
const [statePda, _] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("state"), seed.toArrayLike(Buffer, "le", 8)], svmSpokeProgram.programId);
|
|
77
|
-
const
|
|
78
|
-
const messageTransmitterProgram = new anchor_1.Program(messageTransmitterIdl, provider);
|
|
76
|
+
const messageTransmitterProgram = (0, svm_1.getMessageTransmitterProgram)(provider);
|
|
79
77
|
const [messageTransmitterState] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter")], messageTransmitterProgram.programId);
|
|
80
78
|
const [authorityPda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("message_transmitter_authority"), svmSpokeProgram.programId.toBuffer()], messageTransmitterProgram.programId);
|
|
81
79
|
const [selfAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("self_authority")], svmSpokeProgram.programId);
|
|
@@ -29,15 +29,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
31
31
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
32
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
33
32
|
const spl_token_1 = require("@solana/spl-token");
|
|
33
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
34
34
|
const yargs_1 = __importDefault(require("yargs"));
|
|
35
35
|
const helpers_1 = require("yargs/helpers");
|
|
36
|
+
const svm_1 = require("../../src/svm");
|
|
36
37
|
// Set up the provider
|
|
37
38
|
const provider = anchor_1.AnchorProvider.env();
|
|
38
39
|
anchor.setProvider(provider);
|
|
39
|
-
const
|
|
40
|
-
const program = new anchor_1.Program(idl, provider);
|
|
40
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
41
41
|
const programId = program.programId;
|
|
42
42
|
console.log("SVM-Spoke Program ID:", programId.toString());
|
|
43
43
|
// Parse arguments
|
|
@@ -29,17 +29,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
31
31
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
32
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
33
32
|
const spl_token_1 = require("@solana/spl-token");
|
|
33
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
34
|
+
const MerkleTree_1 = require("@uma/common/dist/MerkleTree");
|
|
34
35
|
const yargs_1 = __importDefault(require("yargs"));
|
|
35
36
|
const helpers_1 = require("yargs/helpers");
|
|
36
|
-
const MerkleTree_1 = require("@uma/common/dist/MerkleTree");
|
|
37
37
|
const svm_1 = require("../../src/svm");
|
|
38
38
|
// Set up the provider
|
|
39
39
|
const provider = anchor_1.AnchorProvider.env();
|
|
40
40
|
anchor.setProvider(provider);
|
|
41
|
-
const
|
|
42
|
-
const program = new anchor_1.Program(idl, provider);
|
|
41
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
43
42
|
const programId = program.programId;
|
|
44
43
|
// Parse arguments
|
|
45
44
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
@@ -30,16 +30,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
32
32
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
33
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
34
33
|
const spl_token_1 = require("@solana/spl-token");
|
|
34
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
35
35
|
const yargs_1 = __importDefault(require("yargs"));
|
|
36
36
|
const helpers_1 = require("yargs/helpers");
|
|
37
37
|
const svm_1 = require("../../src/svm");
|
|
38
38
|
// Set up the provider
|
|
39
39
|
const provider = anchor_1.AnchorProvider.env();
|
|
40
40
|
anchor.setProvider(provider);
|
|
41
|
-
const
|
|
42
|
-
const program = new anchor_1.Program(idl, provider);
|
|
41
|
+
const program = (0, svm_1.getSpokePoolProgram)(provider);
|
|
43
42
|
const programId = program.programId;
|
|
44
43
|
// Parse arguments
|
|
45
44
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function getDeployedAddress(contractName: string, networkId: number, throwOnError?: boolean): string | undefined;
|
|
1
|
+
export declare function getDeployedAddress(contractName: string, networkId: number | string, throwOnError?: boolean): string | undefined;
|
|
2
2
|
export declare function getDeployedBlockNumber(contractName: string, networkId: number): number;
|
|
3
3
|
export declare function getContractInfoFromAddress(contractAddress: string): {
|
|
4
4
|
chainId: Number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const MessageTransmitterIdl: any;
|
|
2
|
+
declare const MulticallHandlerIdl: any;
|
|
3
|
+
declare const SvmSpokeIdl: any;
|
|
4
|
+
declare const TestIdl: any;
|
|
5
|
+
declare const TokenMessengerMinterIdl: any;
|
|
6
|
+
export { MessageTransmitterIdl, MulticallHandlerIdl, SvmSpokeIdl, TestIdl, TokenMessengerMinterIdl };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file has been autogenerated. Do not edit manually.
|
|
3
|
+
// Generated by a script.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TokenMessengerMinterIdl = exports.TestIdl = exports.SvmSpokeIdl = exports.MulticallHandlerIdl = exports.MessageTransmitterIdl = void 0;
|
|
6
|
+
const MessageTransmitterIdl = require("./message_transmitter.json");
|
|
7
|
+
exports.MessageTransmitterIdl = MessageTransmitterIdl;
|
|
8
|
+
const MulticallHandlerIdl = require("./multicall_handler.json");
|
|
9
|
+
exports.MulticallHandlerIdl = MulticallHandlerIdl;
|
|
10
|
+
const SvmSpokeIdl = require("./svm_spoke.json");
|
|
11
|
+
exports.SvmSpokeIdl = SvmSpokeIdl;
|
|
12
|
+
const TestIdl = require("./test.json");
|
|
13
|
+
exports.TestIdl = TestIdl;
|
|
14
|
+
const TokenMessengerMinterIdl = require("./token_messenger_minter.json");
|
|
15
|
+
exports.TokenMessengerMinterIdl = TokenMessengerMinterIdl;
|