Skip to main content

KeyManager

Git Source

KeyManager

Abstract contract for managing keys

Methods

_updateKey

function _updateKey(address operator, bytes memory key) internal virtual

Updates the key associated with an operator

Parameters

NameTypeDescription
operatoraddressThe address of the operator
keybytes memoryThe key to update

operatorByKey

function operatorByKey(
bytes memory key
) public view virtual returns (address)

Returns the operator address associated with a given key

Parameters

NameTypeDescription
keybytes memoryThe key for which to find the associated operator

Returns

NameTypeDescription
addressThe address of the operator linked to the specified key

operatorKey

function operatorKey(
address operator
) public view virtual returns (bytes memory)

Returns the current or previous key for a given operator

Returns the previous key if the key was updated in the current epoch

Parameters

NameTypeDescription
operatoraddressThe address of the operator

Returns

NameTypeDescription
memorybytesThe key associated with the specified operator

keyWasActiveAt

function keyWasActiveAt(uint48 timestamp, bytes memory key) public view virtual returns (bool)

Checks if a key was active at a specific timestamp

Parameters

NameTypeDescription
timestampuint48The timestamp to check
keybytes memoryThe key to check

Returns

NameTypeDescription
boolTrue if the key was active at the timestamp, false otherwise