ValidatorDetails
Modified from KRogLA's work for Lido.
State Variables
PUBKEY_LENGTH
The validator pubkey byte length.
SIGNATURE_LENGTH
The validator signature byte length.
UINT40_MAX
The maximum uint40 value.
Functions
computeStorageKeyOffset
Compute the storage key offset.
Parameters
position
bytes32
The storage slot.
operatorId
uint8
The operator ID.
keyIndex
uint256
The key index.
saveValidatorDetails
Store operator details.
Parameters
position
bytes32
The storage slot.
operatorId
uint8
The operator ID.
startIndex
uint256
The start index.
keysCount
uint256
Keys count to load.
pubkeys
bytes
Keys buffer to read from.
signatures
bytes
Signatures buffer to read from.
Returns
<none>
uint40
totalKeysCount New total keys count.
swapValidatorDetails
Swap operator detail indexes in storage.
Parameters
position
bytes32
The storage slot.
operatorId
uint8
The operator ID.
startIndex1
uint256
The start index of the first set of keys.
startIndex2
uint256
The start index of the second set of keys.
keysCount
uint256
Keys count to swap.
removeValidatorDetails
Remove validator details from storage.
Parameters
position
bytes32
The storage slot.
operatorId
uint8
The Operator ID.
startIndex
uint256
The start index.
keysCount
uint256
Keys count to load.
totalKeysCount
uint256
Current total keys count for operator.
Returns
<none>
uint40
totalKeysCount New total keys count.
loadValidatorDetails
Load validator details from storage.
Parameters
position
bytes32
The storage slot.
operatorId
uint8
The operator ID.
startIndex
uint256
The start index.
keysCount
uint256
Keys count to load.
pubkeys
bytes
Pre-allocated key buffer to read in.
signatures
bytes
Pre-allocated signature buffer to read in.
bufferOffset
uint256
start offset in pubkeys
/signatures
buffer to place values (in number of keys).
allocateMemoryForPubKeys
Allocate memory for keyCount
public keys.
Parameters
keyCount
uint256
The number of public keys.
allocateMemory
Allocate memory for count
validator details.
Parameters
count
uint256
The number of validators.
Events
ValidatorDetailsAdded
Emitted when a new validator signing key is added.
Parameters
operatorId
uint8
The operator ID.
pubkey
bytes
The validator public key.
ValidatorDetailsRemoved
Emitted when a validator signing key is removed.
Parameters
operatorId
uint8
The operator ID.
pubkey
bytes
The validator public key.
ValidatorDetailsSwapped
Emitted when the indexes of two validator signing keys are swapped.
Parameters
operatorId
uint8
The operator ID.
pubkey1
bytes
The first validator public key.
pubkey2
bytes
The second validator public key.
Errors
INVALID_KEYS_COUNT
Thrown when the number of keys is invalid.
INDEXES_OVERLAP
Thrown when the indexes of keys overlap.
LENGTH_MISMATCH
Thrown when the keys and signatures lengths mismatch.
EMPTY_KEY
Thrown when the key is empty.
Last updated