SignerP256Upgradeable
Inherits: Initializable, AbstractSigner
*Implementation of {AbstractSigner} using xref:api:utils/cryptography#P256[P256] signatures. For {Account} usage, a {_setSigner} function is provided to set the {signer} public key. Doing so is easier for a factory, who is likely to use initializable clones of this contract. Example of usage:
contract MyAccountP256 is Account, SignerP256, Initializable {
function initialize(bytes32 qx, bytes32 qy) public initializer {
_setSigner(qx, qy);
}
}
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
SignerP256StorageLocation
bytes32 private constant SignerP256StorageLocation = 0x6c6e681eb9c9937bb0e9a845af882a34f03801b1b670c4e5431f8b41c16a2700;
Functions
_getSignerP256Storage
function _getSignerP256Storage() private pure returns (SignerP256Storage storage $);
__SignerP256_init
function __SignerP256_init(bytes32 qx, bytes32 qy) internal onlyInitializing;
__SignerP256_init_unchained
function __SignerP256_init_unchained(bytes32 qx, bytes32 qy) internal onlyInitializing;
_setSigner
Sets the signer with a P256 public key. This function should be called during construction or through an initializer.
function _setSigner(bytes32 qx, bytes32 qy) internal;
signer
Return the signer's P256 public key.
function signer() public view virtual returns (bytes32 qx, bytes32 qy);
_rawSignatureValidation
Signature validation algorithm. WARNING: Implementing a signature validation algorithm is a security-sensitive operation as it involves cryptographic verification. It is important to review and test thoroughly before deployment. Consider using one of the signature verification libraries (xref:api:utils/cryptography#ECDSA[ECDSA], xref:api:utils/cryptography#P256[P256] or xref:api:utils/cryptography#RSA[RSA]).
function _rawSignatureValidation(bytes32 hash, bytes calldata signature)
internal
view
virtual
override
returns (bool);
Errors
SignerP256InvalidPublicKey
error SignerP256InvalidPublicKey(bytes32 qx, bytes32 qy);
Structs
SignerP256Storage
Note: storage-location: erc7201:openzeppelin.storage.SignerP256
struct SignerP256Storage {
bytes32 _qx;
bytes32 _qy;
}