Skip to main content

KeyManagerBytes

Git Source

KeyManagerBytes

Manages storage and validation of operator keys

Extends KeyManager to provide key management functionality

Methods

operatorByKey

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

Gets the operator address associated with a key

Parameters

NameTypeDescription
keybytes memoryThe key to lookup

Returns

NameTypeDescription
addressThe operator address that owns the key, or zero address if none

operatorKey

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

Gets an operator's active key at the current capture timestamp

Parameters

NameTypeDescription
operatoraddressThe operator address to lookup

Returns

NameTypeDescription
memorybytesThe operator's active key, or empty bytes if none

keyWasActiveAt

function keyWasActiveAt(uint48 timestamp, bytes memory key) public view override 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

_updateKey

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

Updates an operator's key

Handles key rotation by disabling old key and registering new one

Parameters

NameTypeDescription
operatoraddressThe operator address to update
keybytes memoryThe new key to register