Git Source
BaseMiddlewareReader
A helper contract for view functions that combines core manager functionality
This contract serves as a foundation for building custom middleware by providing essential
management capabilities that can be extended with additional functionality.
Methods
getCaptureTimestamp
function getCaptureTimestamp() public view override returns (uint48 timestamp)
Gets the capture timestamp from the middleware
Returns
Name | Type | Description |
---|
timestamp | uint48 | timestamp The capture timestamp |
stakeToPower
function stakeToPower(address vault, uint256 stake) public view override returns (uint256 power)
Converts stake amount to voting power using a 1:1 ratio
Parameters
Name | Type | Description |
---|
vault | address | The vault address (unused in this implementation) |
stake | uint256 | The stake amount |
Returns
Name | Type | Description |
---|
power | uint256 | power The calculated voting power (equal to stake) |
NETWORK
function NETWORK() external view returns (address)
Gets the network address
Returns
Name | Type | Description |
---|
| address | The network address |
SLASHING_WINDOW
function SLASHING_WINDOW() external view returns (uint48)
Gets the slashing window
Returns
Name | Type | Description |
---|
| uint48 | The slashing window |
VAULT_REGISTRY
function VAULT_REGISTRY() external view returns (address)
Gets the vault registry address
Returns
Name | Type | Description |
---|
| address | The vault registry address |
OPERATOR_REGISTRY
function OPERATOR_REGISTRY() external view returns (address)
Gets the operator registry address
Returns
Name | Type | Description |
---|
| address | The operator registry address |
OPERATOR_NET_OPTIN
function OPERATOR_NET_OPTIN() external view returns (address)
Gets the operator net opt-in address
Returns
Name | Type | Description |
---|
| address | The operator net opt-in address |
operatorsLength
function operatorsLength() external view returns (uint256)
Gets the number of operators
Returns
Name | Type | Description |
---|
| uint256 | The number of operators |
operatorWithTimesAt
function operatorWithTimesAt(
uint256 pos
) external view returns (address, uint48, uint48)
Gets the operator and its times at a specific position
Parameters
Name | Type | Description |
---|
pos | uint256 | The position |
Returns
Name | Type | Description |
---|
| address | The operator address, start time, and end time |
| uint48 | |
| uint48 | |
activeOperators
function activeOperators() external view returns (address[] memory)
Gets the list of active operators
Returns
Name | Type | Description |
---|
memory | address[] | The list of active operators |
activeOperatorsAt
function activeOperatorsAt(
uint48 timestamp
) external view returns (address[] memory)
Gets the list of active operators at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active operators at the given timestamp |
operatorWasActiveAt
function operatorWasActiveAt(uint48 timestamp, address operator) external view returns (bool)
Checks if an operator was active at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
Returns
Name | Type | Description |
---|
| bool | True if the operator was active at the given timestamp, false otherwise |
isOperatorRegistered
function isOperatorRegistered(
address operator
) external view returns (bool)
Checks if an operator is registered
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
Returns
Name | Type | Description |
---|
| bool | True if the operator is registered, false otherwise |
subnetworksLength
function subnetworksLength() external view returns (uint256)
Gets the number of subnetworks
Returns
Name | Type | Description |
---|
| uint256 | The number of subnetworks |
subnetworkWithTimesAt
function subnetworkWithTimesAt(
uint256 pos
) external view returns (uint160, uint48, uint48)
Gets the subnetwork and its times at a specific position
Parameters
Name | Type | Description |
---|
pos | uint256 | The position |
Returns
Name | Type | Description |
---|
| uint160 | The subnetwork address, start time, and end time |
| uint48 | |
| uint48 | |
activeSubnetworks
function activeSubnetworks() external view returns (uint160[] memory)
Gets the list of active subnetworks
Returns
Name | Type | Description |
---|
memory | uint160[] | The list of active subnetworks |
activeSubnetworksAt
function activeSubnetworksAt(
uint48 timestamp
) external view returns (uint160[] memory)
Gets the list of active subnetworks at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
Returns
Name | Type | Description |
---|
memory | uint160[] | The list of active subnetworks at the given timestamp |
subnetworkWasActiveAt
function subnetworkWasActiveAt(uint48 timestamp, uint96 subnetwork) external view returns (bool)
Checks if a subnetwork was active at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
subnetwork | uint96 | The subnetwork address |
Returns
Name | Type | Description |
---|
| bool | True if the subnetwork was active at the given timestamp, false otherwise |
sharedVaultsLength
function sharedVaultsLength() external view returns (uint256)
Gets the number of shared vaults
Returns
Name | Type | Description |
---|
| uint256 | The number of shared vaults |
sharedVaultWithTimesAt
function sharedVaultWithTimesAt(
uint256 pos
) external view returns (address, uint48, uint48)
Gets the shared vault and its times at a specific position
Parameters
Name | Type | Description |
---|
pos | uint256 | The position |
Returns
Name | Type | Description |
---|
| address | The shared vault address, start time, and end time |
| uint48 | |
| uint48 | |
activeSharedVaults
function activeSharedVaults() external view returns (address[] memory)
Gets the list of active shared vaults
Returns
Name | Type | Description |
---|
memory | address[] | The list of active shared vaults |
activeSharedVaultsAt
function activeSharedVaultsAt(
uint48 timestamp
) external view returns (address[] memory)
Gets the list of active shared vaults at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active shared vaults at the given timestamp |
operatorVaultsLength
function operatorVaultsLength(
address operator
) external view returns (uint256)
Gets the number of vaults for a specific operator
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
Returns
Name | Type | Description |
---|
| uint256 | The number of vaults for the given operator |
operatorVaultWithTimesAt
function operatorVaultWithTimesAt(address operator, uint256 pos) external view returns (address, uint48, uint48)
Gets the operator vault and its times at a specific position
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
pos | uint256 | The position |
Returns
Name | Type | Description |
---|
| address | The operator vault address, start time, and end time |
| uint48 | |
| uint48 | |
activeOperatorVaults
function activeOperatorVaults(
address operator
) external view returns (address[] memory)
Gets the list of active vaults for a specific operator
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults for the given operator |
activeOperatorVaultsAt
function activeOperatorVaultsAt(uint48 timestamp, address operator) external view returns (address[] memory)
Gets the list of active vaults for a specific operator at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults for the given operator at the given timestamp |
activeVaults
function activeVaults() external view returns (address[] memory)
Gets the list of active vaults
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults |
activeVaultsAt
function activeVaultsAt(
uint48 timestamp
) external view returns (address[] memory)
Gets the list of active vaults at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults at the given timestamp |
activeVaults
function activeVaults(
address operator
) external view returns (address[] memory)
Gets the list of active vaults for a specific operator
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults for the given operator |
activeVaultsAt
function activeVaultsAt(uint48 timestamp, address operator) external view returns (address[] memory)
Gets the list of active vaults for a specific operator at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
Returns
Name | Type | Description |
---|
memory | address[] | The list of active vaults for the given operator at the given timestamp |
vaultWasActiveAt
function vaultWasActiveAt(uint48 timestamp, address operator, address vault) external view returns (bool)
Checks if a vault was active at a specific timestamp for a specific operator
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
vault | address | The vault address |
Returns
Name | Type | Description |
---|
| bool | True if the vault was active at the given timestamp for the given operator, false otherwise |
sharedVaultWasActiveAt
function sharedVaultWasActiveAt(uint48 timestamp, address vault) external view returns (bool)
Checks if a shared vault was active at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
vault | address | The shared vault address |
Returns
Name | Type | Description |
---|
| bool | True if the shared vault was active at the given timestamp, false otherwise |
operatorVaultWasActiveAt
function operatorVaultWasActiveAt(uint48 timestamp, address operator, address vault) external view returns (bool)
Checks if an operator vault was active at a specific timestamp for a specific operator
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
vault | address | The vault address |
Returns
Name | Type | Description |
---|
| bool | True if the operator vault was active at the given timestamp for the given operator, false otherwise |
getOperatorPower
function getOperatorPower(address operator, address vault, uint96 subnetwork) external view returns (uint256)
Gets the power of an operator for a specific vault and subnetwork
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
vault | address | The vault address |
subnetwork | uint96 | The subnetwork address |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator for the given vault and subnetwork |
getOperatorPowerAt
function getOperatorPowerAt(
uint48 timestamp,
address operator,
address vault,
uint96 subnetwork
) external view returns (uint256)
Gets the power of an operator for a specific vault and subnetwork at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
vault | address | The vault address |
subnetwork | uint96 | The subnetwork address |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator for the given vault and subnetwork at the given timestamp |
getOperatorPower
function getOperatorPower(
address operator
) external view returns (uint256)
Gets the power of an operator
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator |
getOperatorPowerAt
function getOperatorPowerAt(uint48 timestamp, address operator) external view returns (uint256)
Gets the power of an operator at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator at the given timestamp |
getOperatorPower
function getOperatorPower(
address operator,
address[] memory vaults,
uint160[] memory subnetworks
) external view returns (uint256)
Gets the power of an operator for specific vaults and subnetworks
Parameters
Name | Type | Description |
---|
operator | address | The operator address |
vaults | address[] memory | The list of vault addresses |
subnetworks | uint160[] memory | The list of subnetwork addresses |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator for the given vaults and subnetworks |
getOperatorPowerAt
function getOperatorPowerAt(
uint48 timestamp,
address operator,
address[] memory vaults,
uint160[] memory subnetworks
) external view returns (uint256)
Gets the power of an operator for specific vaults and subnetworks at a specific timestamp
Parameters
Name | Type | Description |
---|
timestamp | uint48 | The timestamp |
operator | address | The operator address |
vaults | address[] memory | The list of vault addresses |
subnetworks | uint160[] memory | The list of subnetwork addresses |
Returns
Name | Type | Description |
---|
| uint256 | The power of the operator for the given vaults and subnetworks at the given timestamp |
totalPower
function totalPower(
address[] memory operators
) external view returns (uint256)
Gets the total power of a list of operators
Parameters
Name | Type | Description |
---|
operators | address[] memory | The list of operator addresses |
Returns
Name | Type | Description |
---|
| uint256 | The total power of the given operators |