Skip to main content

Quorum

The Quorum contract implements a multi-validator consensus mechanism where claims are accepted when a majority of validators vote in favor.

Functions

submitClaim()

function submitClaim(
address appContract,
uint256 lastProcessedBlockNumber,
bytes32 outputsMerkleRoot
) external override

Submit a claim to the consensus. Only validators can call this function.

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
outputsMerkleRootbytes32The outputs Merkle root

numOfValidators()

function numOfValidators() external view override returns (uint256)

Get the number of validators.

Return Values

NameTypeDescription
[0]uint256The total number of validators

validatorId()

function validatorId(address validator) external view override returns (uint256)

Get the ID of a validator.

Parameters

NameTypeDescription
validatoraddressThe validator address

Return Values

NameTypeDescription
[0]uint256The validator ID (0 for non-validators, >0 for validators)

validatorById()

function validatorById(uint256 id) external view override returns (address)

Get the address of a validator by its ID.

Parameters

NameTypeDescription
iduint256The validator ID

Return Values

NameTypeDescription
[0]addressThe validator address (address(0) for invalid IDs)

numOfValidatorsInFavorOfAnyClaimInEpoch()

function numOfValidatorsInFavorOfAnyClaimInEpoch(
address appContract,
uint256 lastProcessedBlockNumber
) external view override returns (uint256)

Get the number of validators in favor of any claim in a given epoch.

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block

Return Values

NameTypeDescription
[0]uint256Number of validators in favor of any claim in the epoch

isValidatorInFavorOfAnyClaimInEpoch()

function isValidatorInFavorOfAnyClaimInEpoch(
address appContract,
uint256 lastProcessedBlockNumber,
uint256 id
) external view override returns (bool)

Check whether a validator is in favor of any claim in a given epoch.

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
iduint256The ID of the validator

Return Values

NameTypeDescription
[0]boolWhether validator is in favor of any claim in the epoch

numOfValidatorsInFavorOf()

function numOfValidatorsInFavorOf(
address appContract,
uint256 lastProcessedBlockNumber,
bytes32 outputsMerkleRoot
) external view override returns (uint256)

Get the number of validators in favor of a claim.

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
outputsMerkleRootbytes32The outputs Merkle root

Return Values

NameTypeDescription
[0]uint256Number of validators in favor of claim

isValidatorInFavorOf()

function isValidatorInFavorOf(
address appContract,
uint256 lastProcessedBlockNumber,
bytes32 outputsMerkleRoot,
uint256 id
) external view override returns (bool)

Check whether a validator is in favor of a claim.

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
outputsMerkleRootbytes32The outputs Merkle root
iduint256The ID of the validator

Return Values

NameTypeDescription
[0]boolWhether validator is in favor of claim

supportsInterface()

function supportsInterface(bytes4 interfaceId) public view override(IERC165, AbstractConsensus) returns (bool)

Check if the contract supports a specific interface.

Parameters

NameTypeDescription
interfaceIdbytes4The interface identifier

Return Values

NameTypeDescription
[0]boolTrue if the interface is supported

On this page

Useful resources to learn more

We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.