IAuthorityFactory
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
Name | Type | Description |
---|---|---|
authorityOwner | address | The initial authority owner |
epochLength | uint256 | The epoch length |
Returns
Name | Type | Description |
---|---|---|
<none> | IAuthority | The 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
Name | Type | Description |
---|---|---|
authorityOwner | address | The initial authority owner |
epochLength | uint256 | The epoch length |
salt | bytes32 | The salt used to deterministically generate the authority address |
Returns
Name | Type | Description |
---|---|---|
<none> | IAuthority | The 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
Name | Type | Description |
---|---|---|
authorityOwner | address | The initial authority owner |
epochLength | uint256 | The epoch length |
salt | bytes32 | The salt used to deterministically generate the authority address |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The deterministic authority address |
Events
AuthorityCreated
A new authority was deployed.
MUST be triggered on a successful call to newAuthority
.
event AuthorityCreated(IAuthority authority);
Parameters
Name | Type | Description |
---|---|---|
authority | IAuthority | The authority |