From 2ae24433aa5db6a7a6431d5e49643e2dc2176343 Mon Sep 17 00:00:00 2001 From: ryanC Date: Sun, 25 Aug 2024 16:09:28 +0900 Subject: [PATCH 1/2] feat: add cronos zkevm config --- src/adapters/xy-finance/constants.ts | 21 +++++++++++-- src/adapters/xy-finance/index.ts | 47 ++++++++++++++-------------- src/data/bridgeNetworkData.ts | 2 ++ 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/adapters/xy-finance/constants.ts b/src/adapters/xy-finance/constants.ts index 6e271a6e..b8741327 100644 --- a/src/adapters/xy-finance/constants.ts +++ b/src/adapters/xy-finance/constants.ts @@ -23,6 +23,7 @@ export enum Chain { Blast = 'blast', XLayer = 'xlayer', Taiko = 'taiko', + CronosZkevm = 'cronos_zkevm', } export enum VAULTS_TOKEN { @@ -379,6 +380,20 @@ export const YBridgeVaultsTokenContractAddress: Record, Addre [Chain.Wemix]: "0x73Ce60416035B8D7019f6399778c14ccf5C9c7A1", [Chain.Blast]: "0x73Ce60416035B8D7019f6399778c14ccf5C9c7A1", [Chain.XLayer]: "0x73Ce60416035B8D7019f6399778c14ccf5C9c7A1", - [Chain.Taiko]: "0x73Ce60416035B8D7019f6399778c14ccf5C9c7A1" + [Chain.Taiko]: "0x73Ce60416035B8D7019f6399778c14ccf5C9c7A1", + [Chain.CronosZkevm]: "0xE22747472A565e96D0867741811193895b9538f2", } export const XYRouterContractAddress: Record = { @@ -432,5 +448,6 @@ export const XYRouterContractAddress: Record = { [Chain.Wemix]: "0x6471fAd467ac2854b403e7FE3e95FBbB3287a7ee", [Chain.Blast]: "0x43A86823EBBe2ECF9A384aDfD989E26A30626458", [Chain.XLayer]: "0x6A816cEE105a9409D8df0A83d8eeaeD9EB4309fE", - [Chain.Taiko]: "0xedC061306A79257f15108200C5B82ACc874C239d" + [Chain.Taiko]: "0xedC061306A79257f15108200C5B82ACc874C239d", + [Chain.CronosZkevm]: "0x986138f6ed1350a85De6B18280f7d139F74B7282", } \ No newline at end of file diff --git a/src/adapters/xy-finance/index.ts b/src/adapters/xy-finance/index.ts index 21e8ee39..c6582b35 100644 --- a/src/adapters/xy-finance/index.ts +++ b/src/adapters/xy-finance/index.ts @@ -152,29 +152,30 @@ const constructParams = (chain: Chain) => { }; const adapter: BridgeAdapter = { - ethereum: constructParams(Chain.Ethereum), - scroll: constructParams(Chain.Scroll), - mantle: constructParams(Chain.Mantle), - linea: constructParams(Chain.Linea), - base: constructParams(Chain.Base), - arbitrum: constructParams(Chain.Arbitrum), - 'zksync era': constructParams(Chain.ZkSync), - bsc: constructParams(Chain.Bsc), - polygon: constructParams(Chain.Polygon), - klaytn: constructParams(Chain.Klaytn), - 'polygon zkevm': constructParams(Chain.PolygonZkevm), - avalanche: constructParams(Chain.Avalanche), - optimism: constructParams(Chain.Optimism), - cronos: constructParams(Chain.Cronos), - fantom: constructParams(Chain.Fantom), - astar: constructParams(Chain.Astar), - kcc: constructParams(Chain.Kcc), - moonriver: constructParams(Chain.Moonriver), - thundercore: constructParams(Chain.ThunderCore), - wemix: constructParams(Chain.Wemix), - blast: constructParams(Chain.Blast), - 'x layer': constructParams(Chain.XLayer), - taiko: constructParams(Chain.Taiko), + // ethereum: constructParams(Chain.Ethereum), + // scroll: constructParams(Chain.Scroll), + // mantle: constructParams(Chain.Mantle), + // linea: constructParams(Chain.Linea), + // base: constructParams(Chain.Base), + // arbitrum: constructParams(Chain.Arbitrum), + // 'zksync era': constructParams(Chain.ZkSync), + // bsc: constructParams(Chain.Bsc), + // polygon: constructParams(Chain.Polygon), + // klaytn: constructParams(Chain.Klaytn), + // 'polygon zkevm': constructParams(Chain.PolygonZkevm), + // avalanche: constructParams(Chain.Avalanche), + // optimism: constructParams(Chain.Optimism), + // cronos: constructParams(Chain.Cronos), + // fantom: constructParams(Chain.Fantom), + // astar: constructParams(Chain.Astar), + // kcc: constructParams(Chain.Kcc), + // moonriver: constructParams(Chain.Moonriver), + // thundercore: constructParams(Chain.ThunderCore), + // wemix: constructParams(Chain.Wemix), + // blast: constructParams(Chain.Blast), + // 'x layer': constructParams(Chain.XLayer), + // taiko: constructParams(Chain.Taiko), + 'cronos zkevm': constructParams(Chain.CronosZkevm), }; export default adapter; diff --git a/src/data/bridgeNetworkData.ts b/src/data/bridgeNetworkData.ts index 3950719c..9bf027a6 100644 --- a/src/data/bridgeNetworkData.ts +++ b/src/data/bridgeNetworkData.ts @@ -977,12 +977,14 @@ export default [ "X Layer", // "Numbers", "Taiko", + "Cronos zkEVM" ], chainMapping: { "zksync era": "era", "polygon zkevm": "polygon_zkevm", avalanche: "avax", "x layer": "xlayer", + "cronos zkevm": "cronos_zkevm", }, }, // { From 49e6c55416fbaba00b19588610d4b51b89cd61b3 Mon Sep 17 00:00:00 2001 From: ryanC Date: Sun, 25 Aug 2024 16:16:31 +0900 Subject: [PATCH 2/2] chore: bump up sdk --- package-lock.json | 8 +++--- package.json | 2 +- src/adapters/xy-finance/index.ts | 46 ++++++++++++++++---------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index b9f0b068..ef5a9a34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@defillama/sdk": "^5.0.77", + "@defillama/sdk": "^5.0.80", "@graphql-typed-document-node/core": "^3.2.0", "@solana/web3.js": "^1.87.3", "async-retry": "^1.3.1", @@ -1226,9 +1226,9 @@ } }, "node_modules/@defillama/sdk": { - "version": "5.0.77", - "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.77.tgz", - "integrity": "sha512-ceHVLU2Y0WCvhCUADFrGLir2ApyOmCkJuYFgANQFL/bRL3RmzjhquQKrQJRhAxeosxoqz79V29b2zxvjUYMThw==", + "version": "5.0.80", + "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.80.tgz", + "integrity": "sha512-XG1tm90rWmTnv55Du6cUHvSI3XVCSbVVjAHcDh9f2hOHuoKezx1zTjBrDUirYQ4yCCe2zl2g4QmUgD6JR96ibA==", "dependencies": { "@aws-sdk/client-s3": "^3.400.0", "@elastic/elasticsearch": "^8.13.1", diff --git a/package.json b/package.json index 59c37ca4..149491fe 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "ts-loader": "^9.3.1" }, "dependencies": { - "@defillama/sdk": "^5.0.77", + "@defillama/sdk": "^5.0.80", "@graphql-typed-document-node/core": "^3.2.0", "@solana/web3.js": "^1.87.3", "async-retry": "^1.3.1", diff --git a/src/adapters/xy-finance/index.ts b/src/adapters/xy-finance/index.ts index c6582b35..307f81ba 100644 --- a/src/adapters/xy-finance/index.ts +++ b/src/adapters/xy-finance/index.ts @@ -152,29 +152,29 @@ const constructParams = (chain: Chain) => { }; const adapter: BridgeAdapter = { - // ethereum: constructParams(Chain.Ethereum), - // scroll: constructParams(Chain.Scroll), - // mantle: constructParams(Chain.Mantle), - // linea: constructParams(Chain.Linea), - // base: constructParams(Chain.Base), - // arbitrum: constructParams(Chain.Arbitrum), - // 'zksync era': constructParams(Chain.ZkSync), - // bsc: constructParams(Chain.Bsc), - // polygon: constructParams(Chain.Polygon), - // klaytn: constructParams(Chain.Klaytn), - // 'polygon zkevm': constructParams(Chain.PolygonZkevm), - // avalanche: constructParams(Chain.Avalanche), - // optimism: constructParams(Chain.Optimism), - // cronos: constructParams(Chain.Cronos), - // fantom: constructParams(Chain.Fantom), - // astar: constructParams(Chain.Astar), - // kcc: constructParams(Chain.Kcc), - // moonriver: constructParams(Chain.Moonriver), - // thundercore: constructParams(Chain.ThunderCore), - // wemix: constructParams(Chain.Wemix), - // blast: constructParams(Chain.Blast), - // 'x layer': constructParams(Chain.XLayer), - // taiko: constructParams(Chain.Taiko), + ethereum: constructParams(Chain.Ethereum), + scroll: constructParams(Chain.Scroll), + mantle: constructParams(Chain.Mantle), + linea: constructParams(Chain.Linea), + base: constructParams(Chain.Base), + arbitrum: constructParams(Chain.Arbitrum), + 'zksync era': constructParams(Chain.ZkSync), + bsc: constructParams(Chain.Bsc), + polygon: constructParams(Chain.Polygon), + klaytn: constructParams(Chain.Klaytn), + 'polygon zkevm': constructParams(Chain.PolygonZkevm), + avalanche: constructParams(Chain.Avalanche), + optimism: constructParams(Chain.Optimism), + cronos: constructParams(Chain.Cronos), + fantom: constructParams(Chain.Fantom), + astar: constructParams(Chain.Astar), + kcc: constructParams(Chain.Kcc), + moonriver: constructParams(Chain.Moonriver), + thundercore: constructParams(Chain.ThunderCore), + wemix: constructParams(Chain.Wemix), + blast: constructParams(Chain.Blast), + 'x layer': constructParams(Chain.XLayer), + taiko: constructParams(Chain.Taiko), 'cronos zkevm': constructParams(Chain.CronosZkevm), };