From 1fbdbf6dce88ad40089b181957acc34f61142a65 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Thu, 2 May 2024 08:27:34 +0200 Subject: [PATCH] prePo: track blast --- projects/prePo/index.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/projects/prePo/index.js b/projects/prePo/index.js index f436e3694838..52322d428158 100644 --- a/projects/prePo/index.js +++ b/projects/prePo/index.js @@ -5,7 +5,9 @@ const config = { arbitrum: { factory: '0x6f889e3fce9b13fe8cefa068a48f4074292e663c', fromBlock: 70478558 }, } -module.exports = {} +const config2 = { + blast: { factory: '0xB40DBBb7931Cfef8Be73AEEC6c67d3809bD4600B', fromBlock: 309120 }, +} Object.keys(config).forEach(chain => { const { fromBlock, factory, } = config[chain] @@ -14,7 +16,6 @@ Object.keys(config).forEach(chain => { const logs = await getLogs({ api, target: factory, - topics: ['0xe56f19ada061bf6161817694d647d94134afe9d3e877db1d8118b3012b744635'], eventAbi: 'event MarketCreation(address, address, address, uint256, uint256, uint256, uint256, uint256 expiryTime)', onlyArgs: true, fromBlock: fromBlock, @@ -32,3 +33,22 @@ Object.keys(config).forEach(chain => { } }) + + +Object.keys(config2).forEach(chain => { + const { fromBlock, factory, } = config2[chain] + module.exports[chain] = { + tvl: async (api) => { + const logs = await getLogs({ + api, + target: factory, + eventAbi: 'event MarketCreated(bytes32 indexed, address, address, uint256)', + onlyArgs: true, + fromBlock: fromBlock, + }) + const tokens = logs.map(i => i[2]) + return api.sumTokens({ owner: factory, tokens }) + } + } +}) +