KeyManager256
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
Name | Type | Description |
---|---|---|
key | bytes memory | The key to lookup |
Returns
Name | Type | Description |
---|---|---|
address | The 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
Name | Type | Description |
---|---|---|
operator | address | The operator address to lookup |
Returns
Name | Type | Description |
---|---|---|
memory | bytes | The 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
Name | Type | Description |
---|---|---|
timestamp | uint48 | The timestamp to check |
key_ | bytes memory | The key to check |
Returns
Name | Type | Description |
---|---|---|
bool | True 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
Name | Type | Description |
---|---|---|
operator | address | The operator address to update |
key_ | bytes memory | The new key to register, encoded as bytes |