-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
29 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
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
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,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
/* solhint-disable no-unused-vars */ | ||
import { ERC7579ValidatorBase } from "src/Modules.sol"; | ||
import { PackedUserOperation } from "src/external/ERC4337.sol"; | ||
|
||
contract MockValidatorFalse is ERC7579ValidatorBase { | ||
function onInstall(bytes calldata data) external virtual override { } | ||
|
||
function onUninstall(bytes calldata data) external virtual override { } | ||
|
||
function validateUserOp( | ||
PackedUserOperation calldata userOp, | ||
bytes32 userOpHash | ||
) | ||
external | ||
virtual | ||
override | ||
returns (ValidationData) | ||
{ | ||
return _packValidationData({ sigFailed: true, validUntil: type(uint48).max, validAfter: 0 }); | ||
} | ||
|
||
function isValidSignatureWithSender( | ||
address sender, | ||
bytes32 hash, | ||
bytes calldata data | ||
) | ||
external | ||
view | ||
virtual | ||
override | ||
returns (bytes4) | ||
{ | ||
return EIP1271_FAILED; | ||
} | ||
|
||
function isModuleType(uint256 typeID) external pure override returns (bool) { | ||
return typeID == TYPE_VALIDATOR; | ||
} | ||
|
||
function isInitialized(address smartAccount) external pure returns (bool) { | ||
return false; | ||
} | ||
} |