Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postop reverts #2

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions src/EntryPoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -711,31 +711,40 @@ contract EntryPoint is
actualGasCost = actualGas * gasPrice;
if (mode != IPaymaster.PostOpMode.postOpReverted) {
uint256 remainingGas = gasleft();
try
IPaymaster(paymaster).postOp{
gas: mUserOp.paymasterPostOpGasLimit
}(mode, context, actualGasCost, gasPrice)
// solhint-disable-next-line no-empty-blocks
{

} 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
try IPaymaster(paymaster).postOp{gas: mUserOp.paymasterPostOpGasLimit}(
mode, context, actualGasCost, gasPrice
) {} catch (bytes memory reason) {
revert FailedOpWithRevert(
0,
"AA50 postOp reverted",
reason
);
}
//try
// IPaymaster(paymaster).postOp{
// gas: mUserOp.paymasterPostOpGasLimit
// }(mode, context, actualGasCost, gasPrice)
//// solhint-disable-next-line no-empty-blocks
//{

//} 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
// );
//}
paymasterPostOpGasLimit = remainingGas - gasleft();
}
}
Expand Down
Loading