Skip to main content

IPluginSetup

Description

The interface required for a plugin setup contract to be consumed by the PluginSetupProcessor for plugin installations, updates, and uninstallations.

Implementation

public struct PreparedSetupData

struct PreparedSetupData {
address[] helpers;
struct PermissionLib.MultiTargetPermission[] permissions;
}

public struct SetupPayload

struct SetupPayload {
address plugin;
address[] currentHelpers;
bytes data;
}

external function prepareInstallation

Prepares the installation of a plugin.

function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData)
InputTypeDescription
_daoaddressThe address of the installing DAO.
_databytesThe bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file.
Output
pluginaddressThe address of the Plugin contract being prepared for installation.
preparedSetupDatastruct IPluginSetup.PreparedSetupDataThe deployed plugin's relevant data which consists of helpers and permissions.

external function prepareUpdate

Prepares the update of a plugin.

function prepareUpdate(address _dao, uint16 _currentBuild, struct IPluginSetup.SetupPayload _payload) external returns (bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData)
InputTypeDescription
_daoaddressThe address of the updating DAO.
_currentBuilduint16The build number of the plugin to update from.
_payloadstruct IPluginSetup.SetupPayloadThe relevant data necessary for the prepareUpdate. See above.
Output
initDatabytesThe initialization data to be passed to upgradeable contracts when the update is applied in the PluginSetupProcessor.
preparedSetupDatastruct IPluginSetup.PreparedSetupDataThe deployed plugin's relevant data which consists of helpers and permissions.

external function prepareUninstallation

Prepares the uninstallation of a plugin.

function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external returns (struct PermissionLib.MultiTargetPermission[] permissions)
InputTypeDescription
_daoaddressThe address of the uninstalling DAO.
_payloadstruct IPluginSetup.SetupPayloadThe relevant data necessary for the prepareUninstallation. See above.
Output
permissionsstruct PermissionLib.MultiTargetPermission[]The array of multi-targeted permission operations to be applied by the PluginSetupProcessor to the uninstalling DAO.

external function implementation

Returns the plugin implementation address.

function implementation() external view returns (address)
OutputTypeDescription
0addressThe address of the plugin implementation contract.

The implementation can be instantiated via the new keyword, cloned via the minimal clones pattern (see ERC-1167), or proxied via the UUPS pattern (see ERC-1822).

© 2024