Authority

Git Source

Inherits: IAuthority, AbstractConsensus, Ownable

A consensus contract controlled by a single address, the owner.

This contract inherits from OpenZeppelin's Ownable contract. For more information on Ownable, please consult OpenZeppelin's official documentation.

State Variables

_validatedEpochs

Epochs with a submitted (and accepted) claim, per application.

Epochs are stored in bitmap structure by their number (last processed block number / epoch length).

mapping(address => BitMaps.BitMap) _validatedEpochs;

Functions

constructor

Reverts if the epoch length is zero.

constructor(address initialOwner, uint256 epochLength)
    AbstractConsensus(epochLength)
    Ownable(initialOwner);

Parameters

NameTypeDescription
initialOwneraddressThe initial contract owner
epochLengthuint256The epoch length

submitClaim

Submit a claim to the consensus.

MUST fire a ClaimSubmitted event.

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

Parameters

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

owner

Returns the address of the current owner.

function owner() public view override(IOwnable, Ownable) returns (address);

renounceOwnership

Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.

function renounceOwnership() public override(IOwnable, Ownable);

transferOwnership

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

function transferOwnership(address newOwner) public override(IOwnable, Ownable);

supportsInterface

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