Skip to main content

ConsolidationsChecker

Git Source

Inherits: EIP712, IConsolidationsChecker

Author: StakeWise

Defines the functionality for checking signatures of oracles for validators consolidations

State Variables

_signatureLength

uint256 private constant _signatureLength = 65;

_consolidationsCheckerTypeHash

bytes32 private constant _consolidationsCheckerTypeHash =
keccak256("ConsolidationsChecker(address vault,bytes validators)");

_keeper

IKeeper private immutable _keeper;

Functions

constructor

Constructor

constructor(address keeper) EIP712("ConsolidationsChecker", "1");

Parameters

NameTypeDescription
keeperaddressThe address of the Keeper contract

verifySignatures

Verifies the signatures of oracles for validators consolidations. Reverts if the signatures are invalid.

function verifySignatures(address vault, bytes calldata validators, bytes calldata signatures) external view override;

Parameters

NameTypeDescription
vaultaddressThe address of the vault
validatorsbytesThe concatenation of the validators' data
signaturesbytesThe concatenation of the oracles' signatures

isValidSignatures

Function for checking signatures of oracles for validators consolidations

function isValidSignatures(address vault, bytes calldata validators, bytes calldata signatures)
public
view
override
returns (bool);

Parameters

NameTypeDescription
vaultaddressThe address of the vault
validatorsbytesThe concatenation of the validators' data
signaturesbytesThe concatenation of the oracles' signatures

Returns

NameTypeDescription
<none>booltrue if the signatures are valid, false otherwise

_isValidSignatures

Internal function for verifying oracles' signatures

function _isValidSignatures(uint256 requiredSignatures, bytes32 message, bytes calldata signatures)
private
view
returns (bool);

Parameters

NameTypeDescription
requiredSignaturesuint256The number of signatures required for the verification to pass
messagebytes32The message that was signed
signaturesbytesThe concatenation of the oracles' signatures

Returns

NameTypeDescription
<none>boolTrue if the signatures are valid, otherwise false