Skip to content

Commit

Permalink
Add carbondefi celo (#11139)
Browse files Browse the repository at this point in the history
* Add celo deployment

* Filter pairs if there is a gasToken defined to avoid duplicating tvl for the gas token
  • Loading branch information
tiagofilipenunes authored Jul 30, 2024
1 parent 7a9007e commit 543c39d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions projects/carbondefi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
},
Expand Down

0 comments on commit 543c39d

Please sign in to comment.