SignerERC7913Upgradeable
Inherits: Initializable, AbstractSigner
*Implementation of {AbstractSigner} using
https://eips.ethereum.org/EIPS/eip-7913[ERC-7913] signature verification.
For {Account} usage, a {_setSigner} function is provided to set the ERC-7913 formatted {signer}.
Doing so is easier for a factory, who is likely to use initializable clones of this contract.
The signer is a bytes
object that concatenates a verifier address and a key: verifier || key
.
Example of usage:
contract MyAccountERC7913 is Account, SignerERC7913, Initializable {
function initialize(bytes memory signer_) public initializer {
_setSigner(signer_);
}
function setSigner(bytes memory signer_) public onlyEntryPointOrSelf {
_setSigner(signer_);
}
}
IMPORTANT: Failing to call {_setSigner} either during construction (if used standalone) or during initialization (if used as a clone) may leave the signer either front-runnable or unusable.*
State Variables
SignerERC7913StorageLocation
bytes32 private constant SignerERC7913StorageLocation =
0x170786af7cf7b78916dca5a937f25e3b9b70ae3faee6f0db68cda91b7e818e00;
Functions
_getSignerERC7913Storage
function _getSignerERC7913Storage() private pure returns (SignerERC7913Storage storage $);
__SignerERC7913_init
function __SignerERC7913_init(bytes memory signer_) internal onlyInitializing;
__SignerERC7913_init_unchained
function __SignerERC7913_init_unchained(bytes memory signer_) internal onlyInitializing;
signer
Return the ERC-7913 signer (i.e. verifier || key
).
function signer() public view virtual returns (bytes memory);
_setSigner
Sets the signer (i.e. verifier || key
) with an ERC-7913 formatted signer.
function _setSigner(bytes memory signer_) internal;
_rawSignatureValidation
Verifies a signature using SignatureChecker-isValidSignatureNow-bytes-bytes32-bytes-
with {signer}, hash
and signature
.
function _rawSignatureValidation(bytes32 hash, bytes calldata signature)
internal
view
virtual
override
returns (bool);
Structs
SignerERC7913Storage
Note: storage-location: erc7201:openzeppelin.storage.SignerERC7913
struct SignerERC7913Storage {
bytes _signer;
}