WarperPresetFactory
WarperPresetFactory
WarperPresetFactoryInitParams
struct WarperPresetFactoryInitParams {
contract IACL acl;
contract IMetahub metahub;
}
whenEnabled
modifier whenEnabled(bytes32 presetId)
Modifier to check that the preset is currently enabled.
whenDisabled
modifier whenDisabled(bytes32 presetId)
Modifier to check that the preset is currently disabled.
presetIsRegistered
modifier presetIsRegistered(bytes32 presetId)
Modifier to check that the preset is registered.
constructor
constructor() public
Constructor that gets called for the implementation contract.
initialize
function initialize(struct WarperPresetFactory.WarperPresetFactoryInitParams params) external
WarperPresetFactory initializer.
Name | Type | Description |
---|---|---|
params | struct WarperPresetFactory.WarperPresetFactoryInitParams | Initialization params. |
addPreset
function addPreset(bytes32 presetId, address implementation) external
Stores the association between `presetId` and `implementation` address. NOTE: Warper `implementation` must be deployed beforehand.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
implementation | address | Warper implementation address. |
removePreset
function removePreset(bytes32 presetId) external
Removes the association between `presetId` and its implementation.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
enablePreset
function enablePreset(bytes32 presetId) external
Enables warper preset, which makes it deployable.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
disablePreset
function disablePreset(bytes32 presetId) external
Disable warper preset, which makes non-deployable.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
deployPreset
function deployPreset(bytes32 presetId, bytes initData) external returns (address)
Deploys a new warper from the preset identified by `presetId`.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
initData | bytes | Warper initialization payload. |
Name | Type | Description |
---|---|---|
[0] | address | Deployed warper address. |
presetEnabled
function presetEnabled(bytes32 presetId) external view returns (bool)
Checks whether warper preset is enabled and available for deployment.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
presets
function presets() external view returns (struct IWarperPresetFactory.WarperPreset[])
Returns the list of all registered warper presets.
preset
function preset(bytes32 presetId) external view returns (struct IWarperPresetFactory.WarperPreset)
Returns the warper preset details.
Name | Type | Description |
---|---|---|
presetId | bytes32 | Warper preset id. |
contractKey
function contractKey() external pure returns (bytes4)
Returns implemented contract key.
Name | Type | Description |
---|---|---|
[0] | bytes4 | Contract key; |
supportsInterface
function supportsInterface(bytes4 interfaceId) public view returns (bool)
_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.
This function call must use less than 30 000 gas._
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal virtual
_Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
```solidity function authorizeUpgrade(address) internal override onlyOwner {} ```
_acl
function _acl() internal view virtual returns (contract IACL)
return the IACL address