Skip to content

LockToVotePluginSetup ​

Contract · src/setup/LockToVotePluginSetup.sol

Explained in: Lock to Vote Plugin

Author: Aragon X - 2022-2025

Inherits: PluginSetup

The setup contract of the LockToVotePlugin contract.

security-contact: sirt@aragon.org

Constructor ​

constructor ​

solidity
constructor()

The contract constructor deploying the implementation contracts to use.

Functions ​

decodeInstallationParams ​

solidity
function decodeInstallationParams(
    bytes _data
) external pure returns (LockToVotePluginSetup.InstallationParameters installationParams)

Selector: 0x64e074a5

Decodes the given byte array into the original installation parameters

ReturnsTypeDescription
installationParamsLockToVotePluginSetup.InstallationParameters

encodeInstallationParams ​

solidity
function encodeInstallationParams(
    LockToVotePluginSetup.InstallationParameters installationParams
) external pure returns (bytes)

Selector: 0xc65ba11e

Encodes the given installation parameters into a byte array

ParameterTypeDescription
installationParamsLockToVotePluginSetup.InstallationParameters

implementation ​

solidity
function implementation() external view returns (address)

Selector: 0x5c60da1b

Returns the plugin implementation address.

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

ReturnsTypeDescription
[0]addressThe address of the plugin implementation contract.

prepareInstallation ​

solidity
function prepareInstallation(
    address _dao,
    bytes _installParameters
) external returns (address plugin, IPluginSetup.PreparedSetupData preparedSetupData)

Selector: 0xf10832f1

Prepares the installation of a plugin.

ParameterTypeDescription
_daoaddressThe address of the installing DAO.
_installParametersbytes
ReturnsTypeDescription
pluginaddressThe address of the Plugin contract being prepared for installation.
preparedSetupDataIPluginSetup.PreparedSetupDataThe deployed plugin's relevant data which consists of helpers and permissions.

prepareUninstallation ​

solidity
function prepareUninstallation(
    address _dao,
    IPluginSetup.SetupPayload _payload
) external view returns (PermissionLib.MultiTargetPermission[] permissions)

Selector: 0x9cb0a124

Prepares the uninstallation of a plugin.

ParameterTypeDescription
_daoaddressThe address of the uninstalling DAO.
_payloadIPluginSetup.SetupPayloadThe relevant data necessary for the prepareUninstallation. See above.
ReturnsTypeDescription
permissionsPermissionLib.MultiTargetPermission[]The array of multi-targeted permission operations to be applied by the PluginSetupProcessor to the uninstalling DAO.

prepareUpdate ​

solidity
function prepareUpdate(
    address _dao,
    uint16 _fromBuild,
    IPluginSetup.SetupPayload _payload
) external returns (bytes, IPluginSetup.PreparedSetupData)

Selector: 0xa8a9c29e

Prepares the update of a plugin.

Dev: Since the underlying plugin is non-upgradeable, this non-virtual function must always revert.

ParameterTypeDescription
_daoaddressThe address of the updating DAO.
_fromBuilduint16The build number of the plugin to update from.
_payloadIPluginSetup.SetupPayloadThe relevant data necessary for the prepareUpdate. See above.
ReturnsTypeDescription
[0]bytesThe initialization data to be passed to upgradeable contracts when the update is applied in the PluginSetupProcessor.
[1]IPluginSetup.PreparedSetupDataThe deployed plugin's relevant data which consists of helpers and permissions.

protocolVersion ​

solidity
function protocolVersion() external pure returns (uint8[3])

Selector: 0x2ae9c600

Returns the semantic Aragon OSx protocol version number that the implementing contract is associated with.

Dev: This version number is not to be confused with the release and build numbers found in the Version.Tag struct inside the PluginRepo contract being used to version plugin setup and associated plugin implementation contracts.

ReturnsTypeDescription
[0]uint8[3]Returns the semantic Aragon OSx protocol version number.

supportsInterface ​

solidity
function supportsInterface(bytes4 _interfaceId) external view returns (bool)

Selector: 0x01ffc9a7

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

ParameterTypeDescription
_interfaceIdbytes4The ID of the interface.

Errors ​

NonUpgradeablePlugin ​

solidity
error NonUpgradeablePlugin()

Thrown when attempting to prepare an update on a non-upgradeable plugin.

TokenNotContract ​

solidity
error TokenNotContract(address token)

Thrown if token address is passed which is not a token.

ParameterTypeDescription
tokenaddressThe token address

TokenNotERC20 ​

solidity
error TokenNotERC20(address token)

Thrown if token address is not ERC20.

ParameterTypeDescription
tokenaddressThe token address

WrongHelpersArrayLength ​

solidity
error WrongHelpersArrayLength(uint256 length)

Thrown if passed helpers array is of wrong length.

ParameterTypeDescription
lengthuint256The array length of passed helpers.

Structs ​

InstallationParameters ​

solidity
struct InstallationParameters {
    IERC20 token;
    MajorityVotingBase.VotingSettings votingSettings;
    bytes pluginMetadata;
    address createProposalCaller;
    address executeCaller;
    IPlugin.TargetConfig targetConfig;
}

Struct containing all the parameters to set up the plugin, helpers and permissions

FieldTypeDescription
tokenIERC20The address of the token that users can lock for voting (staking token in most cases)
votingSettingsMajorityVotingBase.VotingSettingsThe voting plugin settings
pluginMetadatabytesAn IPFS URI pointing to a pinned JSON file with the plugin's details
createProposalCalleraddressThe address that can call createProposal (can be ANY_ADDR)
executeCalleraddressThe address that can call execute (can be ANY_ADDR)
targetConfigIPlugin.TargetConfigWhere and how the plugin will execute actions

PreparedSetupData ​

Inherited from IPluginSetup.

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

The data associated with a prepared setup.

FieldTypeDescription
helpersaddress[]The address array of helpers (contracts or EOAs) associated with this plugin version after the installation or update.
permissionsPermissionLib.MultiTargetPermission[]The array of multi-targeted permission operations to be applied by the PluginSetupProcessor to the installing or updating DAO.

SetupPayload ​

Inherited from IPluginSetup.

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

The payload for plugin updates and uninstallations containing the existing contracts as well as optional data to be consumed by the plugin setup.

FieldTypeDescription
pluginaddressThe address of the Plugin.
currentHelpersaddress[]The address array of all current helpers (contracts or EOAs) associated with the plugin to update from.
databytesThe bytes-encoded data containing the input parameters for the preparation of update/uninstall as specified in the corresponding ABI on the version's metadata.