Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IAuthorityFactory

Git Source

Inherits: IVersionGetter, IConsensusFactoryErrors

Title: Authority Factory interface

Functions

newAuthority

Deploy a new authority.

On success, MUST emit an AuthorityCreated event.

Reverts if the authority owner address is zero.

Reverts if the epoch length is zero.

function newAuthority(
    address authorityOwner,
    uint256 epochLength,
    uint256 claimStagingPeriod
) external returns (IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
claimStagingPerioduint256The claim staging period

Returns

NameTypeDescription
<none>IAuthorityThe authority

newAuthority

Deploy a new authority deterministically.

On success, MUST emit an AuthorityCreated event.

Reverts if the authority owner address is zero.

Reverts if the epoch length is zero.

function newAuthority(
    address authorityOwner,
    uint256 epochLength,
    uint256 claimStagingPeriod,
    bytes32 salt
) external returns (IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
claimStagingPerioduint256The claim staging period
saltbytes32The salt used to deterministically generate the authority address

Returns

NameTypeDescription
<none>IAuthorityThe authority

calculateAuthorityAddress

Calculate the address of an authority to be deployed deterministically.

Beware that only the newAuthority function with the salt parameter is able to deterministically deploy an authority.

function calculateAuthorityAddress(
    address authorityOwner,
    uint256 epochLength,
    uint256 claimStagingPeriod,
    bytes32 salt
) external view returns (address);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
claimStagingPerioduint256The claim staging period
saltbytes32The salt used to deterministically generate the authority address

Returns

NameTypeDescription
<none>addressThe deterministic authority address

Events

AuthorityCreated

A new authority was deployed.

MUST be triggered on a successful call to newAuthority.

event AuthorityCreated(IAuthority authority);

Parameters

NameTypeDescription
authorityIAuthorityThe authority