From 1e404be1ad31767ec227460319d504bbb0875136 Mon Sep 17 00:00:00 2001 From: Chase Coleman Date: Mon, 21 Aug 2023 19:38:39 +0000 Subject: [PATCH 1/3] Add zkSync and Base to Across adapter --- src/adapters/across/index.ts | 63 +++++++++++++++++++++-------------- src/data/bridgeNetworkData.ts | 2 +- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/src/adapters/across/index.ts b/src/adapters/across/index.ts index d590a1f0..934a62ab 100644 --- a/src/adapters/across/index.ts +++ b/src/adapters/across/index.ts @@ -27,6 +27,12 @@ const contracts = { optimism: { spokePoolv2: "0xa420b2d1c0841415A695b81E5B867BCD07Dff8C9", spokePoolv2p5: "0x6f26Bf09B1C792e3228e5467807a900A503c0281" + }, + era: { + spokePoolv2p5: "0xE0B015E54d54fc84a6cB9B666099c46adE9335FF" + }, + base: { + spokePoolv2p5: "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64" } } as const; @@ -111,34 +117,39 @@ const relaysParamsv2: PartialContractEventParams = { }; const constructParams = (chain: SupportedChains) => { - // New Spoke Pools - const finalDepositParamsv2p5 = { - ...depositParamsv2p5, - target: contracts[chain].spokePoolv2p5, - }; + const eventParams: PartialContractEventParams[] = []; - const finalRelaysParamsv2p5 = { - ...relaysParamsv2p5, - target: contracts[chain].spokePoolv2p5, - }; + const chainConfig = contracts[chain] // Old Spoke Pools - const finalDepositParamsv2 = { - ...depositParamsv2, - target: contracts[chain].spokePoolv2, - }; - - const finalRelaysParamsv2 = { - ...relaysParamsv2, - target: contracts[chain].spokePoolv2, - }; - - const eventParams = [ - finalDepositParamsv2p5, - finalRelaysParamsv2p5, - finalDepositParamsv2, - finalRelaysParamsv2, - ] + if ("spokePoolv2" in chainConfig) { + const finalDepositParamsv2 = { + ...depositParamsv2, + target: chainConfig.spokePoolv2, + }; + eventParams.push(finalDepositParamsv2); + + const finalRelaysParamsv2 = { + ...relaysParamsv2, + target: chainConfig.spokePoolv2, + }; + eventParams.push(finalRelaysParamsv2); + } + + // New Spoke Pools + if ("spokePoolv2p5" in chainConfig) { + const finalDepositParamsv2p5 = { + ...depositParamsv2p5, + target: chainConfig.spokePoolv2p5, + }; + eventParams.push(finalDepositParamsv2p5); + + const finalRelaysParamsv2p5 = { + ...relaysParamsv2p5, + target: chainConfig.spokePoolv2p5, + }; + eventParams.push(finalRelaysParamsv2p5); + } return async (fromBlock: number, toBlock: number) => getTxDataFromEVMEventLogs("across", chain, fromBlock, toBlock, eventParams); @@ -149,6 +160,8 @@ const adapter: BridgeAdapter = { polygon: constructParams("polygon"), arbitrum: constructParams("arbitrum"), optimism: constructParams("optimism"), + era: constructParams("era"), + base: constructParams("base"), }; export default adapter; diff --git a/src/data/bridgeNetworkData.ts b/src/data/bridgeNetworkData.ts index 0cb33035..67e3ab22 100644 --- a/src/data/bridgeNetworkData.ts +++ b/src/data/bridgeNetworkData.ts @@ -294,7 +294,7 @@ export default [ iconLink: "icons:across", largeTxThreshold: 10000, url: "", - chains: ["Ethereum", "Polygon", "Arbitrum", "Optimism"], + chains: ["Ethereum", "Polygon", "Arbitrum", "Optimism", "zkSync Era"], }, /* { From 59383c19304dda935674c5838df3c3b995ecc467 Mon Sep 17 00:00:00 2001 From: Chase Coleman Date: Mon, 21 Aug 2023 19:56:37 +0000 Subject: [PATCH 2/3] Add Base to supported networks --- src/data/bridgeNetworkData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/bridgeNetworkData.ts b/src/data/bridgeNetworkData.ts index 67e3ab22..9d1231f2 100644 --- a/src/data/bridgeNetworkData.ts +++ b/src/data/bridgeNetworkData.ts @@ -294,7 +294,7 @@ export default [ iconLink: "icons:across", largeTxThreshold: 10000, url: "", - chains: ["Ethereum", "Polygon", "Arbitrum", "Optimism", "zkSync Era"], + chains: ["Ethereum", "Polygon", "Arbitrum", "Optimism", "zkSync Era", "Base"], }, /* { From 2b2ceb2f20451aa8c068d7aa874e58bc31cf7da2 Mon Sep 17 00:00:00 2001 From: vrtnd Date: Wed, 23 Aug 2023 15:09:59 +0300 Subject: [PATCH 3/3] Fix across zksync --- src/adapters/across/index.ts | 18 +++++++++--------- src/data/bridgeNetworkData.ts | 11 +++++++---- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/adapters/across/index.ts b/src/adapters/across/index.ts index 934a62ab..1812791e 100644 --- a/src/adapters/across/index.ts +++ b/src/adapters/across/index.ts @@ -14,26 +14,26 @@ For all tokens using 'spokepool' contracts: const contracts = { ethereum: { spokePoolv2: "0x4D9079Bb4165aeb4084c526a32695dCfd2F77381", - spokePoolv2p5: "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5" + spokePoolv2p5: "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5", }, polygon: { spokePoolv2: "0x69B5c72837769eF1e7C164Abc6515DcFf217F920", - spokePoolv2p5: "0x9295ee1d8C5b022Be115A2AD3c30C72E34e7F096" + spokePoolv2p5: "0x9295ee1d8C5b022Be115A2AD3c30C72E34e7F096", }, arbitrum: { spokePoolv2: "0xB88690461dDbaB6f04Dfad7df66B7725942FEb9C", - spokePoolv2p5: "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A" + spokePoolv2p5: "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A", }, optimism: { spokePoolv2: "0xa420b2d1c0841415A695b81E5B867BCD07Dff8C9", - spokePoolv2p5: "0x6f26Bf09B1C792e3228e5467807a900A503c0281" + spokePoolv2p5: "0x6f26Bf09B1C792e3228e5467807a900A503c0281", }, era: { - spokePoolv2p5: "0xE0B015E54d54fc84a6cB9B666099c46adE9335FF" + spokePoolv2p5: "0xE0B015E54d54fc84a6cB9B666099c46adE9335FF", }, base: { - spokePoolv2p5: "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64" - } + spokePoolv2p5: "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64", + }, } as const; type SupportedChains = keyof typeof contracts; @@ -119,7 +119,7 @@ const relaysParamsv2: PartialContractEventParams = { const constructParams = (chain: SupportedChains) => { const eventParams: PartialContractEventParams[] = []; - const chainConfig = contracts[chain] + const chainConfig = contracts[chain]; // Old Spoke Pools if ("spokePoolv2" in chainConfig) { @@ -160,7 +160,7 @@ const adapter: BridgeAdapter = { polygon: constructParams("polygon"), arbitrum: constructParams("arbitrum"), optimism: constructParams("optimism"), - era: constructParams("era"), + "zksync era": constructParams("era"), base: constructParams("base"), }; diff --git a/src/data/bridgeNetworkData.ts b/src/data/bridgeNetworkData.ts index 9d1231f2..8c3b7aec 100644 --- a/src/data/bridgeNetworkData.ts +++ b/src/data/bridgeNetworkData.ts @@ -108,18 +108,18 @@ export default [ // gnosis: "xdai", // }, // }, -// { - // id: 8, + // { + // id: 8, // displayName: "ChainPort", // bridgeDbName: "chainport", // iconLink: "icons:chainport", - // largeTxThreshold: 10000, + // largeTxThreshold: 10000, // url: "", // chains: ["Ethereum", "Polygon", "Fantom", "Avalanche", "Aurora", "BSC"], // chainMapping: { // avalanche: "avax", // }, - // }, + // }, { id: 9, displayName: "Portal by Wormhole", @@ -295,6 +295,9 @@ export default [ largeTxThreshold: 10000, url: "", chains: ["Ethereum", "Polygon", "Arbitrum", "Optimism", "zkSync Era", "Base"], + chainMapping: { + "zksync era": "era", + }, }, /* {