From e34dcd25b494b0c451040ef3f01e141f5138d108 Mon Sep 17 00:00:00 2001 From: Kacper Bak <290936+kbak@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:18:57 +0100 Subject: [PATCH] added gud.tech adapter (#12603) --- projects/gud-tech/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 projects/gud-tech/index.js diff --git a/projects/gud-tech/index.js b/projects/gud-tech/index.js new file mode 100644 index 000000000000..450d69d2e8ee --- /dev/null +++ b/projects/gud-tech/index.js @@ -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, }) + } + } +}) \ No newline at end of file