From 6689c1d069a6416e02bd49ccbe7db892e77bcf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Mon, 16 Jan 2023 15:26:08 -0300 Subject: [PATCH 1/5] feat: make bridge tasks prettier and display more info for L2 to L1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tasks/bridge/deposits.ts | 13 +++++---- tasks/bridge/withdrawals.ts | 54 ++++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts index 3af628caf..3841b5a05 100644 --- a/tasks/bridge/deposits.ts +++ b/tasks/bridge/deposits.ts @@ -37,7 +37,7 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') (await graph.l1.provider.getBlock(e.blockNumber)).timestamp * 1000, ).toLocaleString()})`, tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, - amount: ethers.utils.formatEther(e.args.amount), + amount: prettyBigNumber(e.args.amount), status: emojifyRetryableStatus( await getL1ToL2MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), ), @@ -48,12 +48,10 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), ethers.BigNumber.from(0), ) - console.log( - `Found ${events.length} deposits with a total of ${ethers.utils.formatEther(total)} GRT`, - ) + console.log(`Found ${events.length} deposits with a total of ${prettyBigNumber(total)} GRT`) console.log( - 'L1 to L2 message status reference: 🚧 = not yet created, ❌ = creation failed, ⚠️ = funds deposited on L2, ✅ = redeemed, ⌛ = expired', + '\nL1 to L2 message status reference: 🚧 = not yet created, ❌ = creation failed, ⚠️ = funds deposited on L2, ✅ = redeemed, ⌛ = expired', ) printEvents(events) @@ -95,3 +93,8 @@ function emojifyRetryableStatus(status: L1ToL2MessageStatus): string { return '❌' } } + +// Format BigNumber to 2 decimal places +function prettyBigNumber(amount: ethers.BigNumber): string { + return (+ethers.utils.formatEther(amount)).toFixed(2) +} diff --git a/tasks/bridge/withdrawals.ts b/tasks/bridge/withdrawals.ts index ea1cb402a..447555f3a 100644 --- a/tasks/bridge/withdrawals.ts +++ b/tasks/bridge/withdrawals.ts @@ -29,31 +29,50 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + let totalGRTClaimed = ethers.BigNumber.from(0) + let totalGRTConfirmed = ethers.BigNumber.from(0) + let totalGRTUnconfirmed = ethers.BigNumber.from(0) + const events = await Promise.all( ( await gateway.queryFilter(gateway.filters.WithdrawalInitiated(), startBlock, endBlock) - ).map(async (e) => ({ - blockNumber: `${e.blockNumber} (${new Date( - (await graph.l2.provider.getBlock(e.blockNumber)).timestamp * 1000, - ).toLocaleString()})`, - tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, - amount: ethers.utils.formatEther(e.args.amount), - status: emojifyL2ToL1Status( - await getL2ToL1MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), - ), - })), + ).map(async (e) => { + const status = await getL2ToL1MessageStatus( + e.transactionHash, + graph.l1.provider, + graph.l2.provider, + ) + if (status === L2ToL1MessageStatus.EXECUTED) + totalGRTClaimed = totalGRTClaimed.add(e.args.amount) + if (status === L2ToL1MessageStatus.CONFIRMED) + totalGRTConfirmed = totalGRTConfirmed.add(e.args.amount) + if (status === L2ToL1MessageStatus.UNCONFIRMED) + totalGRTUnconfirmed = totalGRTUnconfirmed.add(e.args.amount) + + return { + blockNumber: `${e.blockNumber} (${new Date( + (await graph.l2.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()})`, + tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + amount: prettyBigNumber(e.args.amount), + status: emojifyL2ToL1Status(status), + } + }), ) - const total = events.reduce( - (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), - ethers.BigNumber.from(0), + console.log( + `Found ${events.length} withdrawals for a total of ${prettyBigNumber( + totalGRTClaimed.add(totalGRTConfirmed).add(totalGRTUnconfirmed), + )} GRT`, ) + console.log(`- Total GRT claimed on L1 (executed): ${prettyBigNumber(totalGRTClaimed)} GRT`) console.log( - `Found ${events.length} withdrawals for a total of ${ethers.utils.formatEther(total)} GRT`, + `- Total GRT claimable on L1 (confirmed): ${prettyBigNumber(totalGRTConfirmed)} GRT`, ) + console.log(`- Total GRT on transit (unconfirmed): ${prettyBigNumber(totalGRTUnconfirmed)} GRT`) console.log( - 'L2 to L1 message status reference: 🚧 = unconfirmed, ⚠️ = confirmed, ✅ = executed', + '\nL2 to L1 message status reference: 🚧 = unconfirmed, ⚠️ = confirmed, ✅ = executed', ) printEvents(events) @@ -91,3 +110,8 @@ function emojifyL2ToL1Status(status: L2ToL1MessageStatus): string { return '❌' } } + +// Format BigNumber to 2 decimal places +function prettyBigNumber(amount: ethers.BigNumber): string { + return (+ethers.utils.formatEther(amount)).toFixed(2) +} From 3ba7056130aa12c3730205b5e7a1faff9d8eb988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Wed, 18 Jan 2023 14:14:30 -0300 Subject: [PATCH 2/5] feat: show L1 and L2 txs on bridge tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tasks/bridge/deposits.ts | 84 +++++++++++++++++++++----------- tasks/bridge/withdrawals.ts | 95 +++++++++++++++++++++++++++---------- 2 files changed, 126 insertions(+), 53 deletions(-) diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts index 3841b5a05..3bb70dc91 100644 --- a/tasks/bridge/deposits.ts +++ b/tasks/bridge/deposits.ts @@ -3,7 +3,7 @@ import { cliOpts } from '../../cli/defaults' import { ethers } from 'ethers' import { Table } from 'console-table-printer' import { L1ToL2MessageStatus } from '@arbitrum/sdk' -import { getL1ToL2MessageStatus } from '../../cli/arbitrum' +import { getL1ToL2MessageStatus, getL1ToL2MessageReader } from '../../cli/arbitrum' export const TASK_BRIDGE_DEPOSITS = 'bridge:deposits' @@ -16,45 +16,67 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') ) .addOptionalParam('l1GraphConfig', cliOpts.graphConfig.description) .addOptionalParam('l2GraphConfig', cliOpts.graphConfig.description) - .addOptionalParam('startBlock', 'Start block for the search') - .addOptionalParam('endBlock', 'End block for the search') + .addOptionalParam('l1StartBlock', 'Start block on L1 for the search') + .addOptionalParam('l1EndBlock', 'End block on L1 for the search') + .addOptionalParam('l2StartBlock', 'Start block on L2 for the search') .setAction(async (taskArgs, hre) => { - console.log('> L1GraphTokenGateway deposits') + console.time('runtime') + console.log('> GRT Bridge deposits <\n') const graph = hre.graph(taskArgs) - const gateway = graph.l1.contracts.L1GraphTokenGateway - console.log(`Tracking 'DepositInitiated' events on ${gateway.address}`) + const l2Gateway = graph.l2.contracts.L2GraphTokenGateway + const l1Gateway = graph.l1.contracts.L1GraphTokenGateway + const l1StartBlock = taskArgs.l1StartBlock ? parseInt(taskArgs.l1StartBlock) : 0 + const l1EndBlock = taskArgs.l1EndBlock ? parseInt(taskArgs.l1EndBlock) : 'latest' + const l2StartBlock = taskArgs.l2StartBlock ? parseInt(taskArgs.l2StartBlock) : 0 - const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 - const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' - console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + console.log( + `Tracking 'DepositInitiated' events on L1GraphTokenGateway (${l1Gateway.address}) from block ${l1StartBlock} to block ${l1EndBlock}`, + ) + console.log( + `Tracking 'DepositFinalized' events on L2GraphTokenGateway (${l2Gateway.address}) from block ${l2StartBlock} onwards`, + ) - const events = await Promise.all( + const depositInitiatedEvents = await Promise.all( ( - await gateway.queryFilter(gateway.filters.DepositInitiated(), startBlock, endBlock) - ).map(async (e) => ({ - blockNumber: `${e.blockNumber} (${new Date( - (await graph.l1.provider.getBlock(e.blockNumber)).timestamp * 1000, - ).toLocaleString()})`, - tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, - amount: prettyBigNumber(e.args.amount), - status: emojifyRetryableStatus( - await getL1ToL2MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), - ), - })), + await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) + ).map(async (e) => { + const retryableTicket = await getL1ToL2MessageReader( + e.transactionHash, + graph.l1.provider, + graph.l2.provider, + ) + + return { + l1Tx: `Block ${e.blockNumber} (${new Date( + (await graph.l1.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()}) ${e.transactionHash}`, + l2Tx: `${retryableTicket.retryableCreationId}`, // Can't get block data because of arb node rate limit + amount: prettyBigNumber(e.args.amount), + status: emojifyRetryableStatus( + await getL1ToL2MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), + ), + } + }), ) - const total = events.reduce( + const total = depositInitiatedEvents.reduce( (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), ethers.BigNumber.from(0), ) - console.log(`Found ${events.length} deposits with a total of ${prettyBigNumber(total)} GRT`) + console.log( + `Found ${depositInitiatedEvents.length} deposits with a total of ${prettyBigNumber( + total, + )} GRT`, + ) console.log( '\nL1 to L2 message status reference: 🚧 = not yet created, ❌ = creation failed, ⚠️ = funds deposited on L2, ✅ = redeemed, ⌛ = expired', ) - printEvents(events) + printEvents(depositInitiatedEvents) + console.timeEnd('runtime') + console.timeLog('runtime') }) function printEvents(events: any[]) { @@ -62,18 +84,22 @@ function printEvents(events: any[]) { charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '⌛': 2, '❌': 2 }, columns: [ { name: 'status', color: 'green', alignment: 'center' }, - { name: 'blockNumber', color: 'green', alignment: 'center' }, + { name: 'l1Tx', color: 'green', alignment: 'center', maxLen: 72, title: 'L1 transaction' }, { - name: 'tx', + name: 'l2Tx', color: 'green', alignment: 'center', - maxLen: 88, + maxLen: 72, + title: 'L2 retryable ticket creation', }, - { name: 'amount', color: 'green', alignment: 'center' }, + { name: 'amount', color: 'green' }, ], }) - events.map((e) => tablePrinter.addRow(e)) + events.map((e) => { + tablePrinter.addRow(e) + tablePrinter.addRow({}) // For table padding + }) tablePrinter.printTable() } diff --git a/tasks/bridge/withdrawals.ts b/tasks/bridge/withdrawals.ts index 447555f3a..1d57b7cd4 100644 --- a/tasks/bridge/withdrawals.ts +++ b/tasks/bridge/withdrawals.ts @@ -1,9 +1,10 @@ import { task } from 'hardhat/config' import { cliOpts } from '../../cli/defaults' -import { ethers } from 'ethers' +import { BigNumber, ethers } from 'ethers' import { Table } from 'console-table-printer' import { L2ToL1MessageStatus } from '@arbitrum/sdk' import { getL2ToL1MessageStatus } from '../../cli/arbitrum' +import { keccak256 } from 'ethers/lib/utils' export const TASK_BRIDGE_WITHDRAWALS = 'bridge:withdrawals' @@ -16,26 +17,63 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway ) .addOptionalParam('l1GraphConfig', cliOpts.graphConfig.description) .addOptionalParam('l2GraphConfig', cliOpts.graphConfig.description) - .addOptionalParam('startBlock', 'Start block for the search') - .addOptionalParam('endBlock', 'End block for the search') + .addOptionalParam('l1StartBlock', 'Start block on L1 for the search') + .addOptionalParam('l2StartBlock', 'Start block on L2 for the search') + .addOptionalParam('l2EndBlock', 'End block on L2 for the search') .setAction(async (taskArgs, hre) => { - console.log('> L2GraphTokenGateway withdrawals') + console.time('runtime') + console.log('> GRT Bridge withdrawals <\n') const graph = hre.graph(taskArgs) - const gateway = graph.l2.contracts.L2GraphTokenGateway - console.log(`Tracking 'WithdrawalInitiated' events on ${gateway.address}`) + const l2Gateway = graph.l2.contracts.L2GraphTokenGateway + const l1Gateway = graph.l1.contracts.L1GraphTokenGateway + const l1StartBlock = taskArgs.l1StartBlock ? parseInt(taskArgs.l1StartBlock) : 0 + const l2StartBlock = taskArgs.l2StartBlock ? parseInt(taskArgs.l2StartBlock) : 0 + const l2EndBlock = taskArgs.l2EndBlock ? parseInt(taskArgs.l2EndBlock) : 'latest' - const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 - const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' - console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + console.log( + `Tracking 'WithdrawalInitiated' events on L2GraphTokenGateway (${l2Gateway.address}) from block ${l2StartBlock} to block ${l2EndBlock}`, + ) + console.log( + `Tracking 'WithdrawalFinalized' events on L1GraphTokenGateway (${l1Gateway.address}) from block ${l1StartBlock} onwards`, + ) let totalGRTClaimed = ethers.BigNumber.from(0) let totalGRTConfirmed = ethers.BigNumber.from(0) let totalGRTUnconfirmed = ethers.BigNumber.from(0) - const events = await Promise.all( + const withdrawalFinalizedEvents = await Promise.all( ( - await gateway.queryFilter(gateway.filters.WithdrawalInitiated(), startBlock, endBlock) + await l1Gateway.queryFilter(l1Gateway.filters.WithdrawalFinalized(), l1StartBlock) + ).map(async (e) => { + const receipt = await e.getTransactionReceipt() + const outBoxTransactionExecutedEvent = receipt.logs.find( + (log) => + log.topics[0] === + keccak256( + ethers.utils.toUtf8Bytes( + 'OutBoxTransactionExecuted(address,address,uint256,uint256)', + ), + ), + ) + + return { + blockNumber: e.blockNumber, + transactionHash: e.transactionHash, + transactionIndex: outBoxTransactionExecutedEvent + ? BigNumber.from(outBoxTransactionExecutedEvent.data) + : null, + } + }), + ) + + const withdrawalInitiatedEvents = await Promise.all( + ( + await l2Gateway.queryFilter( + l2Gateway.filters.WithdrawalInitiated(), + l2StartBlock, + l2EndBlock, + ) ).map(async (e) => { const status = await getL2ToL1MessageStatus( e.transactionHash, @@ -49,11 +87,20 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway if (status === L2ToL1MessageStatus.UNCONFIRMED) totalGRTUnconfirmed = totalGRTUnconfirmed.add(e.args.amount) + // Find L1 event + const l1Event = withdrawalFinalizedEvents.find((ev) => + ev.transactionIndex.eq(e.args.l2ToL1Id), + ) + return { - blockNumber: `${e.blockNumber} (${new Date( + l2Tx: `Block ${e.blockNumber} (${new Date( (await graph.l2.provider.getBlock(e.blockNumber)).timestamp * 1000, - ).toLocaleString()})`, - tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + ).toLocaleString()}) ${e.transactionHash}`, + l1Tx: l1Event + ? `Block ${l1Event.blockNumber} (${new Date( + (await graph.l1.provider.getBlock(l1Event.blockNumber)).timestamp * 1000, + ).toLocaleString()}) ${l1Event.transactionHash}` + : '-', amount: prettyBigNumber(e.args.amount), status: emojifyL2ToL1Status(status), } @@ -61,7 +108,7 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway ) console.log( - `Found ${events.length} withdrawals for a total of ${prettyBigNumber( + `\nFound ${withdrawalInitiatedEvents.length} withdrawals for a total of ${prettyBigNumber( totalGRTClaimed.add(totalGRTConfirmed).add(totalGRTUnconfirmed), )} GRT`, ) @@ -75,7 +122,9 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway '\nL2 to L1 message status reference: 🚧 = unconfirmed, ⚠️ = confirmed, ✅ = executed', ) - printEvents(events) + printEvents(withdrawalInitiatedEvents) + console.timeEnd('runtime') + console.timeLog('runtime') }) function printEvents(events: any[]) { @@ -83,18 +132,16 @@ function printEvents(events: any[]) { charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '❌': 2 }, columns: [ { name: 'status', color: 'green', alignment: 'center' }, - { name: 'blockNumber', color: 'green' }, - { - name: 'tx', - color: 'green', - alignment: 'center', - maxLen: 88, - }, + { name: 'l2Tx', color: 'green', alignment: 'center', maxLen: 72, title: 'L2 transaction' }, + { name: 'l1Tx', color: 'green', alignment: 'center', maxLen: 72, title: 'L1 transaction' }, { name: 'amount', color: 'green' }, ], }) - events.map((e) => tablePrinter.addRow(e)) + events.map((e) => { + tablePrinter.addRow(e) + tablePrinter.addRow({}) // For table padding + }) tablePrinter.printTable() } From 8f270a207713b1c9b86f0dd21f0d9bc1b1b64fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Wed, 25 Jan 2023 10:58:10 -0300 Subject: [PATCH 3/5] fix: remove unnecessary timeLog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tasks/bridge/deposits.ts | 6 +++++- tasks/bridge/withdrawals.ts | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts index 3bb70dc91..fa0d05cc8 100644 --- a/tasks/bridge/deposits.ts +++ b/tasks/bridge/deposits.ts @@ -37,6 +37,11 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') `Tracking 'DepositFinalized' events on L2GraphTokenGateway (${l2Gateway.address}) from block ${l2StartBlock} onwards`, ) + const amount = await ( + await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) + ).length + console.log(`Found ${amount} deposits on L1`) + const depositInitiatedEvents = await Promise.all( ( await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) @@ -76,7 +81,6 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') printEvents(depositInitiatedEvents) console.timeEnd('runtime') - console.timeLog('runtime') }) function printEvents(events: any[]) { diff --git a/tasks/bridge/withdrawals.ts b/tasks/bridge/withdrawals.ts index 1d57b7cd4..67a005dab 100644 --- a/tasks/bridge/withdrawals.ts +++ b/tasks/bridge/withdrawals.ts @@ -124,7 +124,6 @@ task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway printEvents(withdrawalInitiatedEvents) console.timeEnd('runtime') - console.timeLog('runtime') }) function printEvents(events: any[]) { From c380f5fe3bd9ec467a36ec590d256841cf5bce01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Fri, 15 Sep 2023 10:05:29 -0300 Subject: [PATCH 4/5] fix: simplify code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tasks/bridge/deposits.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts index fa0d05cc8..246c67c18 100644 --- a/tasks/bridge/deposits.ts +++ b/tasks/bridge/deposits.ts @@ -37,15 +37,15 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') `Tracking 'DepositFinalized' events on L2GraphTokenGateway (${l2Gateway.address}) from block ${l2StartBlock} onwards`, ) - const amount = await ( - await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) - ).length - console.log(`Found ${amount} deposits on L1`) + const deposits = await l1Gateway.queryFilter( + l1Gateway.filters.DepositInitiated(), + l1StartBlock, + l1EndBlock, + ) + console.log(`Found ${deposits.length} deposits on L1`) const depositInitiatedEvents = await Promise.all( - ( - await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) - ).map(async (e) => { + deposits.map(async (e) => { const retryableTicket = await getL1ToL2MessageReader( e.transactionHash, graph.l1.provider, From 436f82166e7a1d69dbc9609069ab2b9cb0421ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Fri, 15 Sep 2023 10:11:22 -0300 Subject: [PATCH 5/5] fix: remove extra console log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tasks/bridge/deposits.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts index 246c67c18..63d95238f 100644 --- a/tasks/bridge/deposits.ts +++ b/tasks/bridge/deposits.ts @@ -37,15 +37,10 @@ task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') `Tracking 'DepositFinalized' events on L2GraphTokenGateway (${l2Gateway.address}) from block ${l2StartBlock} onwards`, ) - const deposits = await l1Gateway.queryFilter( - l1Gateway.filters.DepositInitiated(), - l1StartBlock, - l1EndBlock, - ) - console.log(`Found ${deposits.length} deposits on L1`) - const depositInitiatedEvents = await Promise.all( - deposits.map(async (e) => { + ( + await l1Gateway.queryFilter(l1Gateway.filters.DepositInitiated(), l1StartBlock, l1EndBlock) + ).map(async (e) => { const retryableTicket = await getL1ToL2MessageReader( e.transactionHash, graph.l1.provider,