File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+
3+ pragma solidity ^ 0.8.0 ;
4+
5+ import {IValidator} from "../interfaces/IERC7579Modules.sol " ;
6+ import {PackedUserOperation} from "../interfaces/PackedUserOperation.sol " ;
7+ import {SIG_VALIDATION_FAILED_UINT, MODULE_TYPE_VALIDATOR, ERC1271_INVALID } from "../types/Constants.sol " ;
8+
9+ contract EmitIdentifierValidator is IValidator {
10+ event IdentifierEmitted (bytes id , address indexed kernel );
11+
12+ function onInstall (bytes calldata _data ) external payable override {
13+ emit IdentifierEmitted (_data, msg .sender );
14+ }
15+
16+ function onUninstall (bytes calldata ) external payable override {}
17+
18+ function isModuleType (uint256 typeID ) external pure override returns (bool ) {
19+ return typeID == MODULE_TYPE_VALIDATOR;
20+ }
21+
22+ function isInitialized (address ) external pure override returns (bool ) {
23+ return true ;
24+ }
25+
26+ function validateUserOp (PackedUserOperation calldata , bytes32 ) external payable override returns (uint256 ) {
27+ return SIG_VALIDATION_FAILED_UINT;
28+ }
29+
30+ function isValidSignatureWithSender (address , bytes32 , bytes calldata ) external pure override returns (bytes4 ) {
31+ return ERC1271_INVALID ;
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments