-
Notifications
You must be signed in to change notification settings - Fork 63
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
1 parent
5d8bfbf
commit 74670ac
Showing
1 changed file
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import {IValidator} from "../interfaces/IERC7579Modules.sol"; | ||
import {PackedUserOperation} from "../interfaces/PackedUserOperation.sol"; | ||
import {SIG_VALIDATION_FAILED_UINT, MODULE_TYPE_VALIDATOR, ERC1271_INVALID} from "../types/Constants.sol"; | ||
|
||
contract EmitIdentifierValidator is IValidator { | ||
event IdentifierEmitted(bytes id, address indexed kernel); | ||
|
||
function onInstall(bytes calldata _data) external payable override { | ||
emit IdentifierEmitted(_data, msg.sender); | ||
} | ||
|
||
function onUninstall(bytes calldata) external payable override {} | ||
|
||
function isModuleType(uint256 typeID) external pure override returns (bool) { | ||
return typeID == MODULE_TYPE_VALIDATOR; | ||
} | ||
|
||
function isInitialized(address) external pure override returns (bool) { | ||
return true; | ||
} | ||
|
||
function validateUserOp(PackedUserOperation calldata, bytes32) external payable override returns (uint256) { | ||
return SIG_VALIDATION_FAILED_UINT; | ||
} | ||
|
||
function isValidSignatureWithSender(address, bytes32, bytes calldata) external pure override returns (bytes4) { | ||
return ERC1271_INVALID; | ||
} | ||
} |