Skip to content

Commit

Permalink
prePo: track blast
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed May 2, 2024
1 parent 2a89031 commit 1fbdbf6
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions projects/prePo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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,
Expand All @@ -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 })
}
}
})

0 comments on commit 1fbdbf6

Please sign in to comment.