From 0c308661850d2e98459e1db39a0a3029c1ef5a97 Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:25:33 +0100 Subject: [PATCH] throw if postOp reverts --- src/v07/EntryPoint.sol | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/v07/EntryPoint.sol b/src/v07/EntryPoint.sol index 72e6a08..01b9ea9 100644 --- a/src/v07/EntryPoint.sol +++ b/src/v07/EntryPoint.sol @@ -719,22 +719,25 @@ contract EntryPoint is { } catch { - emit PostOpRevertReason( - opInfo.userOpHash, - opInfo.mUserOp.sender, - opInfo.mUserOp.nonce, - Exec.getReturnData(REVERT_REASON_MAX_LEN) - ); - actualGas = preGas - gasleft() + opInfo.preOpGas; - ( - actualGasCost, - paymasterPostOpGasLimit - ) = _postExecution( - IPaymaster.PostOpMode.postOpReverted, - opInfo, - context, - actualGas + revert FailedOpWithRevert( + 0, "AA50 postOp reverted", Exec.getReturnData(REVERT_REASON_MAX_LEN) ); + //emit PostOpRevertReason( + // opInfo.userOpHash, + // opInfo.mUserOp.sender, + // opInfo.mUserOp.nonce, + // Exec.getReturnData(REVERT_REASON_MAX_LEN) + //); + //actualGas = preGas - gasleft() + opInfo.preOpGas; + //( + // actualGasCost, + // paymasterPostOpGasLimit + //) = _postExecution( + // IPaymaster.PostOpMode.postOpReverted, + // opInfo, + // context, + // actualGas + //); } paymasterPostOpGasLimit = remainingGas - gasleft(); }