IApplicationFactory
Functions
newApplication
Deploy a new application.
On success, MUST emit an ApplicationCreated
event.
Reverts if the application owner address is zero.
function newApplication(
IOutputsMerkleRootValidator outputsMerkleRootValidator,
address appOwner,
bytes32 templateHash,
bytes calldata dataAvailability
) external returns (IApplication);
Parameters
Name | Type | Description |
---|---|---|
outputsMerkleRootValidator | IOutputsMerkleRootValidator | The initial outputs Merkle root validator contract |
appOwner | address | The initial application owner |
templateHash | bytes32 | The initial machine state hash |
dataAvailability | bytes |
Returns
Name | Type | Description |
---|---|---|
<none> | IApplication | The application |
newApplication
Deploy a new application deterministically.
On success, MUST emit an ApplicationCreated
event.
Reverts if the application owner address is zero.
function newApplication(
IOutputsMerkleRootValidator outputsMerkleRootValidator,
address appOwner,
bytes32 templateHash,
bytes calldata dataAvailability,
bytes32 salt
) external returns (IApplication);
Parameters
Name | Type | Description |
---|---|---|
outputsMerkleRootValidator | IOutputsMerkleRootValidator | The initial outputs Merkle root validator contract |
appOwner | address | The initial application owner |
templateHash | bytes32 | The initial machine state hash |
dataAvailability | bytes | |
salt | bytes32 | The salt used to deterministically generate the application contract address |
Returns
Name | Type | Description |
---|---|---|
<none> | IApplication | The application |
calculateApplicationAddress
Calculate the address of an application contract to be deployed deterministically.
Beware that only the newApplication
function with the salt
parameter
is able to deterministically deploy an application.
function calculateApplicationAddress(
IOutputsMerkleRootValidator outputsMerkleRootValidator,
address appOwner,
bytes32 templateHash,
bytes calldata dataAvailability,
bytes32 salt
) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
outputsMerkleRootValidator | IOutputsMerkleRootValidator | The initial outputs Merkle root validator contract |
appOwner | address | The initial application owner |
templateHash | bytes32 | The initial machine state hash |
dataAvailability | bytes | |
salt | bytes32 | The salt used to deterministically generate the application contract address |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The deterministic application contract address |
Events
ApplicationCreated
A new application was deployed.
MUST be triggered on a successful call to newApplication
.
event ApplicationCreated(
IOutputsMerkleRootValidator indexed outputsMerkleRootValidator,
address appOwner,
bytes32 templateHash,
bytes dataAvailability,
IApplication appContract
);
Parameters
Name | Type | Description |
---|---|---|
outputsMerkleRootValidator | IOutputsMerkleRootValidator | The initial outputs Merkle root validator contract |
appOwner | address | The initial application owner |
templateHash | bytes32 | The initial machine state hash |
dataAvailability | bytes | |
appContract | IApplication | The application contract |