ISelfHostedApplicationFactory
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
| Name | Type | Description |
|---|---|---|
<none> | IAuthorityFactory | The authority factory |
getApplicationFactory
Get the factory used to deploy IApplication contracts
function getApplicationFactory() external view returns (IApplicationFactory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | IApplicationFactory | The 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
| Name | Type | Description |
|---|---|---|
authorityOwner | address | The initial authority owner |
epochLength | uint256 | The epoch length |
claimStagingPeriod | uint256 | The claim staging period |
templateHash | bytes32 | The initial machine state hash |
inputBox | IInputBox | The input box contract |
withdrawalConfig | WithdrawalConfig | The withdrawal configuration |
salt | bytes32 | The salt used to deterministically generate the addresses |
Returns
| Name | Type | Description |
|---|---|---|
<none> | IApplication | The application contract |
<none> | IAuthority | The 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
| Name | Type | Description |
|---|---|---|
authorityOwner | address | The initial authority owner |
epochLength | uint256 | The epoch length |
claimStagingPeriod | uint256 | The claim staging period |
templateHash | bytes32 | The initial machine state hash |
inputBox | IInputBox | The input box contract |
withdrawalConfig | WithdrawalConfig | The withdrawal configuration |
salt | bytes32 | The salt used to deterministically generate the addresses |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The application address |
<none> | address | The authority address |