From 2b0d0651edd598d5b5bfadf26ba4b78ef7557373 Mon Sep 17 00:00:00 2001 From: Emre Kaya Date: Wed, 13 Mar 2024 04:31:00 +0300 Subject: [PATCH 1/2] replace chainIds to endpointIds --- constants/{chainIds.json => endpointIds.json} | 0 tasks/bridge.js | 2 +- tasks/setTrustedRemote.js | 4 ++-- tasks/swapAndBridge.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename constants/{chainIds.json => endpointIds.json} (100%) diff --git a/constants/chainIds.json b/constants/endpointIds.json similarity index 100% rename from constants/chainIds.json rename to constants/endpointIds.json diff --git a/tasks/bridge.js b/tasks/bridge.js index 747b5b6..abf209c 100644 --- a/tasks/bridge.js +++ b/tasks/bridge.js @@ -1,4 +1,4 @@ -const CHAIN_IDS = require("../constants/chainIds.json") +const CHAIN_IDS = require("../constants/endpointIds.json") const NATIVE_OFT_ARGS = require("../constants/nativeOftArgs.json") module.exports = async function (taskArgs, hre) { diff --git a/tasks/setTrustedRemote.js b/tasks/setTrustedRemote.js index 2a665f6..875c6ee 100644 --- a/tasks/setTrustedRemote.js +++ b/tasks/setTrustedRemote.js @@ -1,4 +1,4 @@ -const CHAIN_IDS = require("../constants/chainIds.json") +const ENDPOINT_IDS = require("../constants/endpointIds.json") const { getDeploymentAddresses } = require("../utils/readStatic") const OFT_ARGS = require("../constants/oftArgs.json") const NATIVE_OFT_ARGS = require("../constants/nativeOftArgs.json") @@ -7,7 +7,7 @@ module.exports = async function (taskArgs, hre) { const localChain = hre.network.name; const remoteChain = taskArgs.targetNetwork; - const remoteChainId = CHAIN_IDS[remoteChain] + const remoteChainId = ENDPOINT_IDS[remoteChain] const remoteOft = getDeploymentAddresses(remoteChain)[OFT_ARGS[remoteChain].contractName] const remoteNativeOft = getDeploymentAddresses(remoteChain)[NATIVE_OFT_ARGS[remoteChain].contractName] diff --git a/tasks/swapAndBridge.js b/tasks/swapAndBridge.js index 67905a0..8c6356f 100644 --- a/tasks/swapAndBridge.js +++ b/tasks/swapAndBridge.js @@ -1,10 +1,10 @@ -const CHAIN_IDS = require("../constants/chainIds.json") +const ENDPOINT_IDS = require("../constants/endpointIds.json") const OFT_ARGS = require("../constants/oftArgs.json") module.exports = async function (taskArgs, hre) { const signers = await ethers.getSigners() const owner = signers[0] - const dstChainId = CHAIN_IDS[taskArgs.targetNetwork] + const dstChainId = ENDPOINT_IDS[taskArgs.targetNetwork] const amount = ethers.utils.parseEther(taskArgs.amount) const oft = await ethers.getContract(OFT_ARGS[hre.network.name].contractName) const bridge = await ethers.getContract("SwappableBridge") From 65b195d96bdb643bd1a94ef324424dd1e15b5725 Mon Sep 17 00:00:00 2001 From: Emre Kaya Date: Wed, 13 Mar 2024 04:33:42 +0300 Subject: [PATCH 2/2] update bridge.js file --- tasks/bridge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/bridge.js b/tasks/bridge.js index abf209c..62b7221 100644 --- a/tasks/bridge.js +++ b/tasks/bridge.js @@ -1,10 +1,10 @@ -const CHAIN_IDS = require("../constants/endpointIds.json") +const ENDPOINT_IDS = require("../constants/endpointIds.json") const NATIVE_OFT_ARGS = require("../constants/nativeOftArgs.json") module.exports = async function (taskArgs, hre) { const signers = await ethers.getSigners() const owner = signers[0] - const dstChainId = CHAIN_IDS[taskArgs.targetNetwork] + const dstChainId = ENDPOINT_IDS[taskArgs.targetNetwork] const amount = ethers.utils.parseEther(taskArgs.amount) const nativeOft = await ethers.getContract(NATIVE_OFT_ARGS[hre.network.name].contractName) const bridge = await ethers.getContract("SwappableBridge")