From 543c39d9b0c07fa204417800cce94ca051f4a4d5 Mon Sep 17 00:00:00 2001 From: Tiago <66181828+tiagofilipenunes@users.noreply.github.com> Date: Tue, 30 Jul 2024 05:15:35 +0100 Subject: [PATCH] Add carbondefi celo (#11139) * Add celo deployment * Filter pairs if there is a gasToken defined to avoid duplicating tvl for the gas token --- projects/carbondefi/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/carbondefi/index.js b/projects/carbondefi/index.js index 85a5897ddfd9..36f28828d07d 100644 --- a/projects/carbondefi/index.js +++ b/projects/carbondefi/index.js @@ -9,17 +9,22 @@ const config = { fromBlock: 79146720, controller: "0xe4816658ad10bF215053C533cceAe3f59e1f1087", }, + celo: { + fromBlock: 26828280, + controller: "0x6619871118D144c1c28eC3b23036FC1f0829ed3a", + gasToken: "0x471EcE3750Da237f93B8E339c536989b8978a438", + }, }; Object.keys(config).forEach((chain) => { - const { controller, fromBlock } = config[chain]; + const { controller, fromBlock, gasToken } = config[chain]; module.exports[chain] = { tvl: async (api) => { const pairs = await api.call({ target:controller, abi: 'function pairs() view returns (address[2][])', }) - const tokens = pairs.flat() + const tokens = pairs.filter(pair => !gasToken || (pair[0] !== gasToken && pair[1] !== gasToken)).flat() return sumTokens2({ api, owner: controller, tokens }); },