ISelfHostedApplicationFactory

Git Source

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 application owner address is zero.

Reverts if the epoch length is zero.

function deployContracts(
    address authorityOwner,
    uint256 epochLength,
    address appOwner,
    bytes32 templateHash,
    bytes calldata dataAvailability,
    bytes32 salt
) external returns (IApplication, IAuthority);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
appOwneraddressThe initial application owner
templateHashbytes32The initial machine state hash
dataAvailabilitybytes
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,
    address appOwner,
    bytes32 templateHash,
    bytes calldata dataAvailability,
    bytes32 salt
) external view returns (address, address);

Parameters

NameTypeDescription
authorityOwneraddressThe initial authority owner
epochLengthuint256The epoch length
appOwneraddressThe initial application owner
templateHashbytes32The initial machine state hash
dataAvailabilitybytes
saltbytes32The salt used to deterministically generate the addresses

Returns

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