diff --git a/src/v07/EntryPoint.sol b/src/v07/EntryPoint.sol index 438c6c2..5322939 100644 --- a/src/v07/EntryPoint.sol +++ b/src/v07/EntryPoint.sol @@ -17,14 +17,9 @@ import "account-abstraction/core/UserOperationLib.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; -/* - * Account-Abstraction (EIP-4337) singleton EntryPoint implementation. - * Only one instance required on each chain. - */ - -/// @custom:security-contact https://bounty.ethereum.org contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard { - // ERC165 + // Custom event for bubbling up callphase reverts. + error CallPhaseReverted(bytes reason); using UserOperationLib for PackedUserOperation; @@ -289,10 +284,13 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard bool success = Exec.call(mUserOp.sender, 0, callData, callGasLimit); if (!success) { bytes memory result = Exec.getReturnData(REVERT_REASON_MAX_LEN); - if (result.length > 0) { - emit UserOperationRevertReason(opInfo.userOpHash, mUserOp.sender, mUserOp.nonce, result); - } - mode = IPaymaster.PostOpMode.opReverted; + revert CallPhaseReverted(result); + + //bytes memory result = Exec.getReturnData(REVERT_REASON_MAX_LEN); + //if (result.length > 0) { + // emit UserOperationRevertReason(opInfo.userOpHash, mUserOp.sender, mUserOp.nonce, result); + //} + //mode = IPaymaster.PostOpMode.opReverted; } } @@ -517,7 +515,7 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard function _accountValidation(uint256 opIndex, PackedUserOperation calldata userOp, UserOpInfo memory outOpInfo) public - returns (uint256 validationData, uint256 paymasterValidationData, uint256 paymasterVerificationGasLimit) + returns (uint256 validationData, uint256 _paymasterValidationData, uint256 paymasterVerificationGasLimit) { uint256 preGas = gasleft(); MemoryUserOp memory mUserOp = outOpInfo.mUserOp; diff --git a/src/v08/EntryPoint.sol b/src/v08/EntryPoint.sol index 6246ece..d1e4140 100644 --- a/src/v08/EntryPoint.sol +++ b/src/v08/EntryPoint.sol @@ -25,6 +25,9 @@ import "@openzeppelin/contracts-51/utils/cryptography/EIP712.sol"; * @custom:security-contact https://bounty.ethereum.org */ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardTransient, EIP712 { + // Custom event for bubbling up callphase reverts. + error CallPhaseReverted(bytes reason); + using UserOperationLib for PackedUserOperation; /** @@ -189,13 +192,16 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT if (callData.length > 0) { bool success = Exec.call(mUserOp.sender, 0, callData, callGasLimit); if (!success) { - uint256 freePtr = _getFreePtr(); bytes memory result = Exec.getReturnData(REVERT_REASON_MAX_LEN); - if (result.length > 0) { - emit UserOperationRevertReason(opInfo.userOpHash, mUserOp.sender, mUserOp.nonce, result); - } - _restoreFreePtr(freePtr); - mode = IPaymaster.PostOpMode.opReverted; + revert CallPhaseReverted(result); + + //uint256 freePtr = _getFreePtr(); + //bytes memory result = Exec.getReturnData(REVERT_REASON_MAX_LEN); + //if (result.length > 0) { + // emit UserOperationRevertReason(opInfo.userOpHash, mUserOp.sender, mUserOp.nonce, result); + //} + //_restoreFreePtr(freePtr); + //mode = IPaymaster.PostOpMode.opReverted; } }