Skip to main content

PluginSetup

Description

An abstract contract that developers have to inherit from to write the setup of a plugin.

Implementation

external function prepareUpdate

Prepares the update of a plugin.

function prepareUpdate(address _dao, uint16 _currentBuild, struct IPluginSetup.SetupPayload _payload) external virtual 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.

internal function createERC1967Proxy

A convenience function to create an ERC-1967 proxy contract pointing to an implementation and being associated to a DAO.

function createERC1967Proxy(address _implementation, bytes _data) internal returns (address)
InputTypeDescription
_implementationaddressThe address of the implementation contract to which the proxy is pointing to.
_databytesThe data to initialize the storage of the proxy contract.
Output
0addressThe address of the created proxy contract.

public function supportsInterface

Checks if this or the parent contract supports an interface by its ID.

function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool)
InputTypeDescription
_interfaceIdbytes4The ID of the interface.
Output
0boolReturns true if the interface is supported.
© 2024