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

ISelfHostedApplicationFactory

Git Source

Inherits: IVersionGetter, IConsensusFactoryErrors, IApplicationFactoryErrors

Title: Self-hosted Application Factory interface

Functions

getAuthorityFactory

Get the factory used to deploy IAuthority contracts

function getAuthorityFactory() external view returns (IAuthorityFactory);

Returns

NameTypeDescription
<none>IAuthorityFactoryThe authority factory

getApplicationFactory

Get the factory used to deploy IApplication contracts

function getApplicationFactory() external view returns (IApplicationFactory);

Returns

NameTypeDescription
<none>IApplicationFactoryThe application factory

deployContracts

Deploy new application and authority contracts deterministically.

Reverts if the authority owner address is zero.

Reverts if the epoch length is zero.

function deployContracts(
    address authorityOwner,
    uint256 epochLength,
    uint256 claimStagingPeriod,
    bytes32 templateHash,
    IInputBox inputBox,
    WithdrawalConfig calldata withdrawalConfig,
    bytes32 salt
) external returns (IApplication, IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
claimStagingPerioduint256The claim staging period
templateHashbytes32The initial machine state hash
inputBoxIInputBoxThe input box contract
withdrawalConfigWithdrawalConfigThe withdrawal configuration
saltbytes32The salt used to deterministically generate the addresses

Returns

NameTypeDescription
<none>IApplicationThe application contract
<none>IAuthorityThe authority contract

calculateAddresses

Calculate the addresses of the application and authority contracts to be deployed deterministically.

function calculateAddresses(
    address authorityOwner,
    uint256 epochLength,
    uint256 claimStagingPeriod,
    bytes32 templateHash,
    IInputBox inputBox,
    WithdrawalConfig calldata withdrawalConfig,
    bytes32 salt
) external view returns (address, address);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
claimStagingPerioduint256The claim staging period
templateHashbytes32The initial machine state hash
inputBoxIInputBoxThe input box contract
withdrawalConfigWithdrawalConfigThe withdrawal configuration
saltbytes32The salt used to deterministically generate the addresses

Returns

NameTypeDescription
<none>addressThe application address
<none>addressThe authority address