From 6c4e587d9ee7f70595177eac83ed8d52e4dd2d7b Mon Sep 17 00:00:00 2001 From: realdealshaman Date: Fri, 13 Sep 2024 23:27:47 +0100 Subject: [PATCH] add new adapters for electroswap --- projects/electroswap-v2/index.js | 7 +++++++ projects/electroswap-v3/index.js | 8 ++++++++ projects/helper/chains.json | 1 + projects/helper/env.js | 1 + projects/helper/tokenMapping.js | 4 ++++ 5 files changed, 21 insertions(+) create mode 100644 projects/electroswap-v2/index.js create mode 100644 projects/electroswap-v3/index.js diff --git a/projects/electroswap-v2/index.js b/projects/electroswap-v2/index.js new file mode 100644 index 00000000000..35fbf2c4a3c --- /dev/null +++ b/projects/electroswap-v2/index.js @@ -0,0 +1,7 @@ +const { getUniTVL } = require('../helper/unknownTokens') + +module.exports={ + etn: { + tvl: getUniTVL({ factory: '0x203D550ed6fA9dAB8A4190720CF9F65138abd15B', useDefaultCoreAssets: false }), + } +} \ No newline at end of file diff --git a/projects/electroswap-v3/index.js b/projects/electroswap-v3/index.js new file mode 100644 index 00000000000..b580d9c6e93 --- /dev/null +++ b/projects/electroswap-v3/index.js @@ -0,0 +1,8 @@ +const { uniV3Export } = require("../helper/uniswapV3"); + +module.exports = uniV3Export({ + etn: { + factory: "0xbF6Bcbe2be545135391777F3B4698be92E2EB8cA", + fromBlock: 1242016, + }, +}); diff --git a/projects/helper/chains.json b/projects/helper/chains.json index 4e98db8806e..5f339a813f1 100644 --- a/projects/helper/chains.json +++ b/projects/helper/chains.json @@ -112,6 +112,7 @@ "ethereumclassic", "ethf", "ethpow", + "etn", "europa", "everscale", "evmos", diff --git a/projects/helper/env.js b/projects/helper/env.js index ebdf0c7329f..69b6c82ea8f 100644 --- a/projects/helper/env.js +++ b/projects/helper/env.js @@ -13,6 +13,7 @@ const DEFAULTS = { ANKR_API_KEY: '79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01', RENEC_RPC: "https://api-mainnet-beta.renec.foundation:8899/", IDEX_RPC: "https://xchain-rpc.idex.io", + ETN_RPC: "https://rpc.ankr.com/electroneum" } const ENV_KEYS = [ diff --git a/projects/helper/tokenMapping.js b/projects/helper/tokenMapping.js index b67ae6f720f..90e0b745157 100644 --- a/projects/helper/tokenMapping.js +++ b/projects/helper/tokenMapping.js @@ -1,3 +1,4 @@ +const { decimals } = require('@defillama/sdk/build/erc20') let coreAssets = require('./coreAssets.json') const ADDRESSES = coreAssets const nullAddress = ADDRESSES.null @@ -127,6 +128,9 @@ const fixBalancesTokens = { '0x6c76971f98945ae98dd7d4dfca8711ebea946ea6': { coingeckoId: "wrapped-steth", decimals: 18 }, '0xaf204776c7245bf4147c2612bf6e5972ee483701': { coingeckoId: "savings-dai", decimals: 18 }, }, + etn: { + '0x138dafbda0ccb3d8e39c19edb0510fc31b7c1c77': { coingeckoId: "electroneum", decimals: 18 } + } } ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })