Skip to main content

TokenVotingSetup

Description

The setup contract of the TokenVoting plugin.

Implementation

public variable governanceERC20Base

The address of the GovernanceERC20 base contract.

address governanceERC20Base

public variable governanceWrappedERC20Base

The address of the GovernanceWrappedERC20 base contract.

address governanceWrappedERC20Base

public struct TokenSettings

struct TokenSettings {
address addr;
string name;
string symbol;
}

error TokenNotContract

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

error TokenNotContract(address token)
InputTypeDescription
tokenaddressThe token address

error TokenNotERC20

Thrown if token address is not ERC20.

error TokenNotERC20(address token)
InputTypeDescription
tokenaddressThe token address

error WrongHelpersArrayLength

Thrown if passed helpers array is of wrong length.

error WrongHelpersArrayLength(uint256 length)
InputTypeDescription
lengthuint256The array length of passed helpers.

public function constructor

The contract constructor deploying the plugin implementation contract and receiving the governance token base contracts to clone from.

constructor(contract GovernanceERC20 _governanceERC20Base, contract GovernanceWrappedERC20 _governanceWrappedERC20Base) public
InputTypeDescription
_governanceERC20Basecontract GovernanceERC20The base GovernanceERC20 contract to create clones from.
_governanceWrappedERC20Basecontract GovernanceWrappedERC20The base GovernanceWrappedERC20 contract to create clones from.

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 prepareUninstallation

Prepares the uninstallation of a plugin.

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