Skip to main content

KeyManager256

Git Source

KeyManager256

Manages storage and validation of operator keys using bytes32 values

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 encoded as bytes, or encoded zero 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
key_bytes 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
key_bytes memoryThe new key to register, encoded as bytes