diff --git a/.changeset/calm-brooms-flow.md b/.changeset/calm-brooms-flow.md new file mode 100644 index 00000000..55c9c5f4 --- /dev/null +++ b/.changeset/calm-brooms-flow.md @@ -0,0 +1,5 @@ +--- +"@pimlico/alto": patch +--- + +Version updated till Dec 18 diff --git a/src/utils/userop.ts b/src/utils/userop.ts index 69fdf852..3347aa19 100644 --- a/src/utils/userop.ts +++ b/src/utils/userop.ts @@ -27,6 +27,7 @@ import { pad, parseAbi, parseEventLogs, + size, slice, toHex, zeroAddress @@ -132,11 +133,15 @@ export function unpackPaymasterAndData(paymasterAndData: Hex) { paymasterData: null } } + + const paymasterAndDataSize = size(paymasterAndData) + return { paymaster: getAddress(slice(paymasterAndData, 0, 20)), paymasterVerificationGasLimit: BigInt(slice(paymasterAndData, 20, 36)), paymasterPostOpGasLimit: BigInt(slice(paymasterAndData, 36, 52)), - paymasterData: slice(paymasterAndData, 52) + paymasterData: + paymasterAndDataSize > 52 ? slice(paymasterAndData, 52) : null } }