IAuthorityFactory

Git Source

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)
    external
    returns (IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length

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, bytes32 salt)
    external
    returns (IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
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,
    bytes32 salt
) external view returns (address);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
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