Skip to main content

ECDSASig

Git Source

ECDSASig

Contract for verifying ECDSA signatures against operator keys

Implements SigManager interface using OpenZeppelin's ECDSA library

Methods

_verifyKeySignature

function _verifyKeySignature(
address operator,
bytes memory key_,
bytes memory signature
) internal pure override returns (bool)

Verifies that a signature was created by the owner of a key

The key is expected to be a bytes32 that can be converted to an Ethereum address

Parameters

NameTypeDescription
operatoraddressThe address of the operator that owns the key
key_bytes memoryThe public key to verify against, encoded as bytes
signaturebytes memoryThe ECDSA signature to verify

Returns

NameTypeDescription
boolTrue if the signature was created by the key owner, false otherwise

recover

function recover(bytes32 hash, bytes memory signature) public pure returns (address) 

Recovers the signer address from a hash and signature

Wrapper around OpenZeppelin's ECDSA.recover

Parameters

NameTypeDescription
hashbytes32The message hash that was signed
signaturebytes memoryThe ECDSA signature

Returns

NameTypeDescription
addressThe address that created the signature