Skip to content

IWarperPresetFactory

IWarperPresetFactory

InvalidWarperPresetInterface

error InvalidWarperPresetInterface()

Thrown when the implementation does not support the IWarperPreset interface

DuplicateWarperPresetId

error DuplicateWarperPresetId(bytes32 presetId)

Thrown when the warper preset id is already present in the storage.

DisabledWarperPreset

error DisabledWarperPreset(bytes32 presetId)

Thrown when the warper preset has been disabled, when it was expected for it to be enabled.

EnabledWarperPreset

error EnabledWarperPreset(bytes32 presetId)

Thrown when the warper preset has been enabled, when it was expected for it to be disabled.

WarperPresetNotRegistered

error WarperPresetNotRegistered(bytes32 presetId)

Thrown when it was expected for the warper preset to be registeredr.

EmptyPresetData

error EmptyPresetData()

Thrown when the provided preset initialization data is empty.

WarperPreset

struct WarperPreset {
  bytes32 id;
  address implementation;
  bool enabled;
}

WarperPresetAdded

event WarperPresetAdded(bytes32 presetId, address implementation)

Emitted when new warper preset is added.

WarperPresetDisabled

event WarperPresetDisabled(bytes32 presetId)

Emitted when a warper preset is disabled.

WarperPresetEnabled

event WarperPresetEnabled(bytes32 presetId)

Emitted when a warper preset is enabled.

WarperPresetRemoved

event WarperPresetRemoved(bytes32 presetId)

Emitted when a warper preset is enabled.

WarperPresetDeployed

event WarperPresetDeployed(bytes32 presetId, address warper)

Emitted when a warper preset is deployed.

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.