From 5967c3b387313c8cc66d03f9731b24b4eb5b886d Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:58:34 +0000 Subject: [PATCH] Add Lisk OpUSDCBridgeAdapter --- deploy/consts.ts | 1 + deployments/deployments.json | 2 +- package.json | 2 +- tasks/testChainAdapter.ts | 13 ++++++++++--- yarn.lock | 8 ++++---- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/deploy/consts.ts b/deploy/consts.ts index 9a8e8e1ea..41cb25958 100644 --- a/deploy/consts.ts +++ b/deploy/consts.ts @@ -83,6 +83,7 @@ export const OP_STACK_ADDRESS_MAP: { [CHAIN_IDs.LISK]: { L1CrossDomainMessenger: "0x31B72D76FB666844C41EdF08dF0254875Dbb7edB", L1StandardBridge: "0x2658723Bf70c7667De6B25F99fcce13A16D25d08", + L1OpUSDCBridgeAdapter: "0xE3622468Ea7dD804702B56ca2a4f88C0936995e6", }, [CHAIN_IDs.MODE]: { L1CrossDomainMessenger: "0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f", diff --git a/deployments/deployments.json b/deployments/deployments.json index cb2162d3d..84bb06570 100644 --- a/deployments/deployments.json +++ b/deployments/deployments.json @@ -20,7 +20,7 @@ "SpokePoolVerifier": { "address": "0xB4A8d45647445EA9FC3E1058096142390683dBC2", "blockNumber": 19510875 }, "Mode_Adapter": { "address": "0xf1B59868697f3925b72889ede818B9E7ba0316d0", "blockNumber": 19914094 }, "MulticallHandler": { "address": "0x924a9f036260DdD5808007E1AA95f08eD08aA569", "blockNumber": 20277013 }, - "Lisk_Adapter": { "address": "0x8229E812f20537caA1e8Fb41749b4887B8a75C3B", "blockNumber": 20184545 }, + "Lisk_Adapter": { "address": "0x370B162f1e8335B368C77a3004F8c2C7BA18d451", "blockNumber": 21145174 }, "Blast_Adapter": { "address": "0xF2bEf5E905AAE0295003ab14872F811E914EdD81", "blockNumber": 20221494 }, "Scroll_Adapter": { "address": "0xb6129Ab69aEA75e6884c2D6ecf25293C343C519F", "blockNumber": 20318360 }, "Blast_DaiRetriever": { "address": "0x98Dd57048d7d5337e92D9102743528ea4Fea64aB", "blockNumber": 20378862 }, diff --git a/package.json b/package.json index e8e701a17..d714a74fe 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "pre-commit-hook": "sh scripts/preCommitHook.sh" }, "dependencies": { - "@across-protocol/constants": "^3.1.19", + "@across-protocol/constants": "^3.1.20", "@coral-xyz/anchor": "^0.30.1", "@defi-wonderland/smock": "^2.3.4", "@eth-optimism/contracts": "^0.5.40", diff --git a/tasks/testChainAdapter.ts b/tasks/testChainAdapter.ts index 2a889ffa5..5bb3b5376 100644 --- a/tasks/testChainAdapter.ts +++ b/tasks/testChainAdapter.ts @@ -32,13 +32,20 @@ task("testChainAdapter", "Verify a chain adapter") const adapterName = chains[spokeChainId] ?? `${spokeName[0].toUpperCase()}${spokeName.slice(1).toLowerCase()}_Adapter`; - const { address: adapterAddress, abi: adapterAbi } = await deployments.get(adapterName); + let { address: adapterAddress, abi: adapterAbi } = await deployments.get(adapterName); + adapterAddress = "0x370B162f1e8335B368C77a3004F8c2C7BA18d451"; const adapter = new ethers.Contract(adapterAddress, adapterAbi, provider); const tokenSymbol = args.token.toUpperCase(); const tokenAddress = TOKEN_SYMBOLS_MAP[tokenSymbol].addresses[hubChainId]; // For USDC this will resolve to native USDC on CCTP-enabled chains. - const l2Token = await hubPool.poolRebalanceRoute(spokeChainId, tokenAddress); + let l2Token = TOKEN_SYMBOLS_MAP[tokenSymbol]?.addresses[spokeChainId]; + if (tokenSymbol === "USDC") { + l2Token ??= + TOKEN_SYMBOLS_MAP["USDC.e"]?.addresses[spokeChainId] ?? + TOKEN_SYMBOLS_MAP.USDbC?.addresses[spokeChainId] ?? + TOKEN_SYMBOLS_MAP.USDzC?.addresses[spokeChainId]; + } if (l2Token === ethers.constants.AddressZero) { const proceed = await askYesNoQuestion( `\t\nWARNING: ${tokenSymbol} maps to address ${l2Token} on chain ${spokeChainId}\n\t\nProceed ?` @@ -54,7 +61,7 @@ task("testChainAdapter", "Verify a chain adapter") const { amount } = args; const scaledAmount = ethers.utils.parseUnits(amount, decimals); - if (balance.lt(amount)) { + if (balance.lt(scaledAmount)) { const proceed = await askYesNoQuestion( `\t\nWARNING: ${amount} ${tokenSymbol} may be lost.\n` + `\t\nProceed to send ${amount} ${tokenSymbol} to chain adapter ${adapterAddress} ?` diff --git a/yarn.lock b/yarn.lock index c66e7eaa3..a945b2df7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@across-protocol/constants@^3.1.19": - version "3.1.19" - resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.19.tgz#3c29b52ec5f2eece93a6abd50d580668b03dd7b3" - integrity sha512-XOFF+o64TDn57xNfUB38kWy8lYyE9lB7PBdyoMOadsXx00HC3KMznFi/paLRKT1iZ50vDwHp00tNZbr7Z7umzA== +"@across-protocol/constants@^3.1.20": + version "3.1.20" + resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.20.tgz#305bd41f5644b7db5d9fd12a6a6b4bbbbe2fd016" + integrity sha512-B5RsvuOQsZdFgLk0WcFZGmoivm6g6gv95a+YKVBydcxZkNxAsyP065UQEDAmvRXvPhqGyehhd52515Xa/3bzyg== "@across-protocol/contracts@^0.1.4": version "0.1.4"