Skip to content

Commit

Permalink
added gud.tech adapter (DefiLlama#12603)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbak authored Dec 7, 2024
1 parent b0908f3 commit e34dcd2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions projects/gud-tech/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { getLogs2 } = require('../helper/cache/getLogs');
const { sumTokens2 } = require('../helper/unwrapLPs');

const config = {
zircuit: { factory: '0xF9D8fC35C11cF6acd3D04CA1C3F7F4Fa65e20dCf', fromBlock: 6586739, missing: ['0xfd418e42783382e86ae91e445406600ba144d162']},
}

Object.keys(config).forEach(chain => {
const { factory, fromBlock, missing = [] } = config[chain]
module.exports[chain] = {
tvl: async (api) => {
const logs = await getLogs2({ api, factory, eventAbi: 'event TokenStakabilityChanged(address token, bool enabled)', fromBlock, })
const tokens = logs.map(i => i.token).concat(missing)
return sumTokens2({ api, owner: factory, tokens, permitFailure: true, })
}
}
})

0 comments on commit e34dcd2

Please sign in to comment.