Skip to content

Commit 0210bef

Browse files
committed
fix: process EP 0.8 events
1 parent 1334908 commit 0210bef

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/entryPoint.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {
33
EntryPointV0_6_0,
44
EntryPointV0_7_0_UserOperationEvent_eventArgs,
55
EntryPointV0_7_0,
6+
EntryPointV0_8_0_UserOperationEvent_eventArgs,
7+
EntryPointV0_8_0,
68
eventLog,
79
handlerContext,
810
} from "generated";
@@ -70,3 +72,35 @@ async function handleUserOperationEvent_0_7(
7072
entryPoint: event.srcAddress.toLowerCase(),
7173
});
7274
}
75+
76+
EntryPointV0_8_0.UserOperationEvent.handler(async ({ event, context }) => {
77+
handleUserOperationEvent_08(event, context);
78+
});
79+
80+
async function handleUserOperationEvent_08(
81+
event: eventLog<EntryPointV0_8_0_UserOperationEvent_eventArgs>,
82+
context: handlerContext
83+
) {
84+
const hash = event.params.userOpHash;
85+
const bundler = event.transaction.from
86+
? event.transaction.from.toLowerCase()
87+
: undefined;
88+
89+
context.UserOp.set({
90+
id: `${event.chainId}-${hash}`,
91+
chainId: event.chainId,
92+
blockNumber: event.block.number,
93+
blockTimestamp: event.block.timestamp,
94+
transactionIndex: event.transaction.transactionIndex,
95+
transactionHash: event.transaction.hash,
96+
hash,
97+
actualGasCost: event.params.actualGasCost,
98+
actualGasUsed: event.params.actualGasUsed,
99+
nonce: event.params.nonce,
100+
bundler,
101+
paymaster: event.params.paymaster.toLowerCase(),
102+
sender: event.params.sender.toLowerCase(),
103+
success: event.params.success,
104+
entryPoint: event.srcAddress.toLowerCase(),
105+
});
106+
}

0 commit comments

Comments
 (0)