-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EntryPoint revert if postOp reverts with short revert reason (#308)
* Makes comments and formatting consistent * @inheritdoc IEntryPoint * Reverts contracts/test/TestHelpers.sol * fix: entrypoint does not revert even first postOp reverts with short revert reason * lint * gas-report * Update IEntryPoint.sol - add missing 'INonceManager' * Update EntryPoint.sol - fix lint errors * Update gas-checker.txt manually * Update gas-checker.txt - add newline for the 'diff' * Update gas-checker.txt manually --------- Co-authored-by: Matt Masurka <[email protected]> Co-authored-by: leekt <[email protected]>
- Loading branch information
1 parent
f2b09e6
commit 7f6c103
Showing
4 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
pragma solidity ^0.8.12; | ||
|
||
import "../core/BasePaymaster.sol"; | ||
|
||
/** | ||
* test postOp revert with custom error | ||
*/ | ||
error CustomError(); | ||
|
||
contract TestPaymasterRevertCustomError is BasePaymaster { | ||
// solhint-disable no-empty-blocks | ||
constructor(IEntryPoint _entryPoint) BasePaymaster(_entryPoint) | ||
{} | ||
|
||
function _validatePaymasterUserOp(UserOperation calldata userOp, bytes32, uint256) | ||
internal virtual override view | ||
returns (bytes memory context, uint256 validationData) { | ||
validationData = 0; | ||
context = abi.encodePacked(userOp.sender); | ||
} | ||
|
||
function _postOp(PostOpMode mode, bytes calldata, uint256) internal override { | ||
if(mode == PostOpMode.postOpReverted) { | ||
return; | ||
} | ||
|
||
revert CustomError(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters