Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SignerECDSA

Inherits: AbstractSigner

*Implementation of {AbstractSigner} using xref:api:utils/cryptography#ECDSA[ECDSA] signatures. For {Account} usage, a {_setSigner} function is provided to set the {signer} address. Doing so is easier for a factory, who is likely to use initializable clones of this contract. Example of usage:

contract MyAccountECDSA is Account, SignerECDSA, Initializable {
function initialize(address signerAddr) public initializer {
_setSigner(signerAddr);
}
}

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

_signer

address private _signer;

Functions

constructor

constructor(address signerAddr);

_setSigner

Sets the signer with the address of the native signer. This function should be called during construction or through an initializer.

function _setSigner(address signerAddr) internal;

signer

Return the signer's address.

function signer() public view virtual returns (address);

_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);