Skip to content

Commit

Permalink
Add Lisk OpUSDCBridgeAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Nov 21, 2024
1 parent fac5dd1 commit 5967c3b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions deploy/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const OP_STACK_ADDRESS_MAP: {
[CHAIN_IDs.LISK]: {
L1CrossDomainMessenger: "0x31B72D76FB666844C41EdF08dF0254875Dbb7edB",
L1StandardBridge: "0x2658723Bf70c7667De6B25F99fcce13A16D25d08",
L1OpUSDCBridgeAdapter: "0xE3622468Ea7dD804702B56ca2a4f88C0936995e6",
},
[CHAIN_IDs.MODE]: {
L1CrossDomainMessenger: "0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f",
Expand Down
2 changes: 1 addition & 1 deletion deployments/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 10 additions & 3 deletions tasks/testChainAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?`
Expand All @@ -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} ?`
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5967c3b

Please sign in to comment.