From b8eb7a6473961e52c4e6582243ef5aab59f17f46 Mon Sep 17 00:00:00 2001 From: mortimr Date: Tue, 20 Aug 2024 19:51:51 +0200 Subject: [PATCH] fix: invalid origin assignment for multi-exit case (#47) --- src/ERC20.mapping.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ERC20.mapping.ts b/src/ERC20.mapping.ts index fc9062d..3999dc1 100644 --- a/src/ERC20.mapping.ts +++ b/src/ERC20.mapping.ts @@ -545,7 +545,7 @@ export function handleExit(event: Exit): void { totalETH = totalETH.plus(ethValue); depositDataEntry.exitedEth = depositDataEntry.exitedEth.plus(ethValue); const exitQueue = vExitQueue.load(pool!.exitQueue); - const nextTicketIdx = exitQueue!.ticketCount.minus(BigInt.fromI32(1)); + const nextTicketIdx = exitQueue!.ticketCount.minus(BigInt.fromI32(details.length - idx)); const linkedTicketId = externalEntityUUID(Address.fromBytes(exitQueue!.address), [nextTicketIdx.toString()]); tickets.push(linkedTicketId);