From 9a5a4e48cc3e268febf27ec08ba73b853d41e424 Mon Sep 17 00:00:00 2001 From: Michael-A-Heuer Date: Fri, 9 Feb 2024 11:32:20 +0000 Subject: [PATCH] Update the Aragon OSx docs by commit 1b4d80a --- .../02-implementation.md | 4 +- .../03-non-upgradeable-plugin/index.md | 2 +- .../07-publication/index.md | 11 +- docs/osx/03-reference-guide/core/dao/IDAO.md | 227 ------- .../core/permission/IPermissionCondition.md | 26 - .../core/permission/PermissionCondition.md | 21 - .../PermissionConditionUpgradeable.md | 21 - .../core/permission/PermissionLib.md | 47 -- .../03-reference-guide/core/plugin/IPlugin.md | 25 - .../03-reference-guide/core/plugin/Plugin.md | 41 -- .../core/plugin/PluginCloneable.md | 49 -- .../core/plugin/PluginUUPSUpgradeable.md | 79 --- .../dao-authorizable/DaoAuthorizable.md | 43 -- .../DaoAuthorizableUpgradeable.md | 45 -- .../core/plugin/membership/IMembership.md | 59 -- .../core/plugin/proposal/IProposal.md | 49 -- .../core/plugin/proposal/Proposal.md | 82 --- .../plugin/proposal/ProposalUpgradeable.md | 82 --- .../03-reference-guide/core/utils/BitMap.md | 25 - .../osx/03-reference-guide/core/utils/auth.md | 30 - .../repo/placeholder}/PlaceholderSetup.md | 0 .../framework/plugin/setup/IPluginSetup.md | 88 --- .../framework/plugin/setup/PluginSetup.md | 53 -- .../plugin/setup/PluginSetupProcessor.md | 8 +- .../plugins/governance/admin/Admin.md | 81 --- .../plugins/governance/admin/AdminSetup.md | 74 --- .../majority-voting/IMajorityVoting.md | 179 ----- .../majority-voting/MajorityVotingBase.md | 629 ------------------ .../addresslist/AddresslistVoting.md | 162 ----- .../addresslist/AddresslistVotingSetup.md | 60 -- .../majority-voting/token/TokenVoting.md | 150 ----- .../majority-voting/token/TokenVotingSetup.md | 127 ---- .../plugins/governance/multisig/IMultisig.md | 105 --- .../plugins/governance/multisig/Multisig.md | 449 ------------- .../governance/multisig/MultisigSetup.md | 66 -- .../plugins/utils/Addresslist.md | 100 --- .../03-reference-guide/plugins/utils/Ratio.md | 33 - .../token/ERC20/IERC20MintableUpgradeable.md | 20 - .../token/ERC20/governance/GovernanceERC20.md | 104 --- .../governance/GovernanceWrappedERC20.md | 116 ---- .../governance/IGovernanceWrappedERC20.md | 33 - docs/osx/03-reference-guide/utils/Proxy.md | 16 - .../03-reference-guide/utils/UncheckedMath.md | 43 -- .../utils/protocol/IProtocolVersion.md | 21 - .../utils/protocol/ProtocolVersion.md | 23 - .../utils/protocol/VersionComparisonLib.md | 95 --- 46 files changed, 9 insertions(+), 3794 deletions(-) delete mode 100644 docs/osx/03-reference-guide/core/dao/IDAO.md delete mode 100644 docs/osx/03-reference-guide/core/permission/IPermissionCondition.md delete mode 100644 docs/osx/03-reference-guide/core/permission/PermissionCondition.md delete mode 100644 docs/osx/03-reference-guide/core/permission/PermissionConditionUpgradeable.md delete mode 100644 docs/osx/03-reference-guide/core/permission/PermissionLib.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/IPlugin.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/Plugin.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/PluginCloneable.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizableUpgradeable.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/membership/IMembership.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/proposal/IProposal.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/proposal/Proposal.md delete mode 100644 docs/osx/03-reference-guide/core/plugin/proposal/ProposalUpgradeable.md delete mode 100644 docs/osx/03-reference-guide/core/utils/BitMap.md delete mode 100644 docs/osx/03-reference-guide/core/utils/auth.md rename docs/osx/03-reference-guide/{plugins/placeholder-version => framework/plugin/repo/placeholder}/PlaceholderSetup.md (100%) delete mode 100644 docs/osx/03-reference-guide/framework/plugin/setup/IPluginSetup.md delete mode 100644 docs/osx/03-reference-guide/framework/plugin/setup/PluginSetup.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/admin/Admin.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/admin/AdminSetup.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/IMajorityVoting.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/MajorityVotingBase.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVoting.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVotingSetup.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVoting.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVotingSetup.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/multisig/IMultisig.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/multisig/Multisig.md delete mode 100644 docs/osx/03-reference-guide/plugins/governance/multisig/MultisigSetup.md delete mode 100644 docs/osx/03-reference-guide/plugins/utils/Addresslist.md delete mode 100644 docs/osx/03-reference-guide/plugins/utils/Ratio.md delete mode 100644 docs/osx/03-reference-guide/token/ERC20/IERC20MintableUpgradeable.md delete mode 100644 docs/osx/03-reference-guide/token/ERC20/governance/GovernanceERC20.md delete mode 100644 docs/osx/03-reference-guide/token/ERC20/governance/GovernanceWrappedERC20.md delete mode 100644 docs/osx/03-reference-guide/token/ERC20/governance/IGovernanceWrappedERC20.md delete mode 100644 docs/osx/03-reference-guide/utils/Proxy.md delete mode 100644 docs/osx/03-reference-guide/utils/UncheckedMath.md delete mode 100644 docs/osx/03-reference-guide/utils/protocol/IProtocolVersion.md delete mode 100644 docs/osx/03-reference-guide/utils/protocol/ProtocolVersion.md delete mode 100644 docs/osx/03-reference-guide/utils/protocol/VersionComparisonLib.md diff --git a/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md b/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md index b8db293a..d0b8af77 100644 --- a/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md +++ b/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md @@ -42,9 +42,9 @@ Setting this permission is key because it ensures only signers who have been gra Now that we have created the permission, we will use it to protect the implementation. We want to make sure only the authorized callers holding the `ADMIN_EXECUTE_PERMISSION`, can use the function. -Because we have initialized the [`PluginClonable` base contract](../../../03-reference-guide/core/plugin/PluginCloneable.md), we can now use its features, i.e., the [`auth` modifier](../../../03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md#internal-modifier-auth) provided through the `DaoAuthorizable` base class. The `auth('ADMIN_EXECUTE_PERMISSION')` returns an error if the address calling on the function has not been granted that permission, effectively protecting from malicious use cases. +Because we have initialized the [`PluginClonable` base contract](https://github.com/aragon/osx-commons/blob/develop/contracts/src/plugin/PluginCloneable.sol), we can now use its features, i.e., the [`auth` modifier](https://github.com/aragon/osx-commons/blob/1cf46ff15dbda8481f9ee37558e7ea8b257d51f2/contracts/src/permission/auth/DaoAuthorizable.sol#L30-L35) provided through the `DaoAuthorizable` base class. The `auth('ADMIN_EXECUTE_PERMISSION')` returns an error if the address calling on the function has not been granted that permission, effectively protecting from malicious use cases. -Later, we will also use the [`dao()` getter function from the base contract](../../../03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md#public-function-dao), which returns the associated DAO for that plugin. +Later, we will also use the [`dao()` getter function from the base contract](https://github.com/aragon/osx-commons/blob/1cf46ff15dbda8481f9ee37558e7ea8b257d51f2/contracts/src/permission/auth/DaoAuthorizable.sol#L24-L28), which returns the associated DAO for that plugin. ```solidity contract SimpleAdmin is PluginCloneable { diff --git a/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md b/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md index a38c8f84..bf7da198 100644 --- a/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md +++ b/docs/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md @@ -339,7 +339,7 @@ To publish new versions in the future, ## Conclusion -Hope this tutorial is useful to get you started developing for Aragon! If you need any additional support or questions, feel free to hop into our [Discord](https://discord.gg/Wpk36QRdMN) and ask away. +Hope this tutorial is useful to get you started developing for Aragon! If you need any additional support or questions, feel free to hop into our [Discord](https://discord.com/channels/672466989217873929/742442842474938478) and ask away. Excited to see what you build! 🔥 diff --git a/docs/osx/02-how-to-guides/02-plugin-development/07-publication/index.md b/docs/osx/02-how-to-guides/02-plugin-development/07-publication/index.md index f3dfd9c0..0b6bf097 100644 --- a/docs/osx/02-how-to-guides/02-plugin-development/07-publication/index.md +++ b/docs/osx/02-how-to-guides/02-plugin-development/07-publication/index.md @@ -45,14 +45,10 @@ You may want to have a publishing script directly off of your Hardhat project. I ```js import buildMetadata1 from '../../contracts/release1/build1/build-metadata.json'; import releaseMetadata1 from '../../contracts/release1/release-metadata.json'; -import { - networkNameMapping, - osxContracts, - findEventTopicLog, - addDeployedContract, -} from '../../utils/helpers'; +import {networkNameMapping, osxContracts, addDeployedContract} from '../../utils/helpers'; import {toHex} from '../../utils/ipfs-upload'; import {uploadToIPFS} from '../../utils/ipfs-upload'; +import {findEventTopicLog} from '@aragon/osx-commons-sdk'; import { PluginRepoFactory__factory, PluginRepoRegistry__factory, @@ -116,9 +112,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { PluginRepoRegistry__factory.createInterface(), 'PluginRepoRegistered' ); - if (!eventLog) { - throw new Error('Failed to get PluginRepoRegistered event log'); - } const pluginRepo = PluginRepo__factory.connect(eventLog.args.pluginRepo, deployer); diff --git a/docs/osx/03-reference-guide/core/dao/IDAO.md b/docs/osx/03-reference-guide/core/dao/IDAO.md deleted file mode 100644 index 38dbaed0..00000000 --- a/docs/osx/03-reference-guide/core/dao/IDAO.md +++ /dev/null @@ -1,227 +0,0 @@ -## Description - -The interface required for DAOs within the Aragon App DAO framework. - -## Implementation - -### public struct Action - -```solidity -struct Action { - address to; - uint256 value; - bytes data; -} -``` - -### external function hasPermission - -Checks if an address has permission on a contract via a permission identifier and considers if `ANY_ADDRESS` was used in the granting process. - -```solidity -function hasPermission(address _where, address _who, bytes32 _permissionId, bytes _data) external view returns (bool) -``` - -| Input | Type | Description | -| :-------------- | --------- | ----------------------------------------------------------------- | -| `_where` | `address` | The address of the contract. | -| `_who` | `address` | The address of a EOA or contract to give the permissions. | -| `_permissionId` | `bytes32` | The permission identifier. | -| `_data` | `bytes` | The optional data passed to the `PermissionCondition` registered. | -| **Output** | | -| `0` | `bool` | Returns true if the address has permission, false if not. | - -### external function setMetadata - -Updates the DAO metadata (e.g., an IPFS hash). - -```solidity -function setMetadata(bytes _metadata) external -``` - -| Input | Type | Description | -| :---------- | ------- | ----------------------------------------- | -| `_metadata` | `bytes` | The IPFS hash of the new metadata object. | - -### event MetadataSet - -Emitted when the DAO metadata is updated. - -```solidity -event MetadataSet(bytes metadata) -``` - -| Input | Type | Description | -| :--------- | ------- | ----------------------------------------- | -| `metadata` | `bytes` | The IPFS hash of the new metadata object. | - -### external function execute - -Executes a list of actions. If a zero allow-failure map is provided, a failing action reverts the entire execution. If a non-zero allow-failure map is provided, allowed actions can fail without the entire call being reverted. - -```solidity -function execute(bytes32 _callId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) external returns (bytes[], uint256) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_callId` | `bytes32` | The ID of the call. The definition of the value of `callId` is up to the calling contract and can be used, e.g., as a nonce. | -| `_actions` | `struct IDAO.Action[]` | The array of actions. | -| `_allowFailureMap` | `uint256` | A bitmap allowing execution to succeed, even if individual actions might revert. If the bit at index `i` is 1, the execution succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| **Output** | | -| `0` | `bytes[]` | The array of results obtained from the executed actions in `bytes`. | -| `1` | `uint256` | The resulting failure map containing the actions have actually failed. | - -### event Executed - -Emitted when a proposal is executed. - -```solidity -event Executed(address actor, bytes32 callId, struct IDAO.Action[] actions, uint256 allowFailureMap, uint256 failureMap, bytes[] execResults) -``` - -| Input | Type | Description | -| :---------------- | ---------------------- | ----------------------------------------------------------------- | -| `actor` | `address` | The address of the caller. | -| `callId` | `bytes32` | The ID of the call. | -| `actions` | `struct IDAO.Action[]` | The array of actions executed. | -| `allowFailureMap` | `uint256` | The allow failure map encoding which actions are allowed to fail. | -| `failureMap` | `uint256` | The failure map encoding which actions have failed. | -| `execResults` | `bytes[]` | The array with the results of the executed actions. | - -_The value of `callId` is defined by the component/contract calling the execute function. A `Plugin` implementation can use it, for example, as a nonce._ - -### event StandardCallbackRegistered - -Emitted when a standard callback is registered. - -```solidity -event StandardCallbackRegistered(bytes4 interfaceId, bytes4 callbackSelector, bytes4 magicNumber) -``` - -| Input | Type | Description | -| :----------------- | -------- | --------------------------------------------------------------------- | -| `interfaceId` | `bytes4` | The ID of the interface. | -| `callbackSelector` | `bytes4` | The selector of the callback function. | -| `magicNumber` | `bytes4` | The magic number to be registered for the callback function selector. | - -### external function deposit - -Deposits (native) tokens to the DAO contract with a reference string. - -```solidity -function deposit(address _token, uint256 _amount, string _reference) external payable -``` - -| Input | Type | Description | -| :----------- | --------- | ------------------------------------------------------------------- | -| `_token` | `address` | The address of the token or address(0) in case of the native token. | -| `_amount` | `uint256` | The amount of tokens to deposit. | -| `_reference` | `string` | The reference describing the deposit reason. | - -### event Deposited - -Emitted when a token deposit has been made to the DAO. - -```solidity -event Deposited(address sender, address token, uint256 amount, string _reference) -``` - -| Input | Type | Description | -| :----------- | --------- | -------------------------------------------- | -| `sender` | `address` | The address of the sender. | -| `token` | `address` | The address of the deposited token. | -| `amount` | `uint256` | The amount of tokens deposited. | -| `_reference` | `string` | The reference describing the deposit reason. | - -### event NativeTokenDeposited - -Emitted when a native token deposit has been made to the DAO. - -```solidity -event NativeTokenDeposited(address sender, uint256 amount) -``` - -| Input | Type | Description | -| :------- | --------- | -------------------------------------- | -| `sender` | `address` | The address of the sender. | -| `amount` | `uint256` | The amount of native tokens deposited. | - -_This event is intended to be emitted in the `receive` function and is therefore bound by the gas limitations for `send`/`transfer` calls introduced by [ERC-2929](https://eips.ethereum.org/EIPS/eip-2929)._ - -### external function setTrustedForwarder - -Setter for the trusted forwarder verifying the meta transaction. - -```solidity -function setTrustedForwarder(address _trustedForwarder) external -``` - -| Input | Type | Description | -| :------------------ | --------- | ------------------------------ | -| `_trustedForwarder` | `address` | The trusted forwarder address. | - -### external function getTrustedForwarder - -Getter for the trusted forwarder verifying the meta transaction. - -```solidity -function getTrustedForwarder() external view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------------------ | -| `0` | `address` | The trusted forwarder address. | - -### event TrustedForwarderSet - -Emitted when a new TrustedForwarder is set on the DAO. - -```solidity -event TrustedForwarderSet(address forwarder) -``` - -| Input | Type | Description | -| :---------- | --------- | -------------------------- | -| `forwarder` | `address` | the new forwarder address. | - -### external function isValidSignature - -Checks whether a signature is valid for a provided hash according to [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271). - -```solidity -function isValidSignature(bytes32 _hash, bytes _signature) external returns (bytes4) -``` - -| Input | Type | Description | -| :----------- | --------- | ------------------------------------------------------------------------------------------------ | -| `_hash` | `bytes32` | The hash of the data to be signed. | -| `_signature` | `bytes` | The signature byte array associated with `_hash`. | -| **Output** | | -| `0` | `bytes4` | Returns the `bytes4` magic value `0x1626ba7e` if the signature is valid and `0xffffffff` if not. | - -### external function registerStandardCallback - -Registers an ERC standard having a callback by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and callback function signature. - -```solidity -function registerStandardCallback(bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber) external -``` - -| Input | Type | Description | -| :------------------ | -------- | ------------------------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| `_callbackSelector` | `bytes4` | The selector of the callback function. | -| `_magicNumber` | `bytes4` | The magic number to be registered for the function signature. | - -### external function setSignatureValidator - -Removed function being left here to not corrupt the IDAO interface ID. Any call will revert. - -```solidity -function setSignatureValidator(address) external -``` - -_Introduced in v1.0.0. Removed in v1.4.0._ - - diff --git a/docs/osx/03-reference-guide/core/permission/IPermissionCondition.md b/docs/osx/03-reference-guide/core/permission/IPermissionCondition.md deleted file mode 100644 index 6c7a3f3f..00000000 --- a/docs/osx/03-reference-guide/core/permission/IPermissionCondition.md +++ /dev/null @@ -1,26 +0,0 @@ -## Description - -An interface to be implemented to support custom permission logic. - -To attach a condition to a permission, the `grantWithCondition` function must be used and refer to the implementing contract's address with the `condition` argument. - -## Implementation - -### external function isGranted - -Checks if a call is permitted. - -```solidity -function isGranted(address _where, address _who, bytes32 _permissionId, bytes _data) external view returns (bool isPermitted) -``` - -| Input | Type | Description | -| :-------------- | --------- | -------------------------------------------------------------------- | -| `_where` | `address` | The address of the target contract. | -| `_who` | `address` | The address (EOA or contract) for which the permissions are checked. | -| `_permissionId` | `bytes32` | The permission identifier. | -| `_data` | `bytes` | Optional data passed to the `PermissionCondition` implementation. | -| **Output** | | -| `isPermitted` | `bool` | Returns true if the call is permitted. | - - diff --git a/docs/osx/03-reference-guide/core/permission/PermissionCondition.md b/docs/osx/03-reference-guide/core/permission/PermissionCondition.md deleted file mode 100644 index a5e2571e..00000000 --- a/docs/osx/03-reference-guide/core/permission/PermissionCondition.md +++ /dev/null @@ -1,21 +0,0 @@ -## Description - -An abstract contract for non-upgradeable contracts instantiated via the `new` keyword to inherit from to support customary permissions depending on arbitrary on-chain state. - -## Implementation - -### public function supportsInterface - -Checks if an interface is supported by this or its parent contract. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - - diff --git a/docs/osx/03-reference-guide/core/permission/PermissionConditionUpgradeable.md b/docs/osx/03-reference-guide/core/permission/PermissionConditionUpgradeable.md deleted file mode 100644 index f6e622b4..00000000 --- a/docs/osx/03-reference-guide/core/permission/PermissionConditionUpgradeable.md +++ /dev/null @@ -1,21 +0,0 @@ -## Description - -An abstract contract for upgradeable or cloneable contracts to inherit from and to support customary permissions depending on arbitrary on-chain state. - -## Implementation - -### public function supportsInterface - -Checks if an interface is supported by this or its parent contract. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - - diff --git a/docs/osx/03-reference-guide/core/permission/PermissionLib.md b/docs/osx/03-reference-guide/core/permission/PermissionLib.md deleted file mode 100644 index e4059b29..00000000 --- a/docs/osx/03-reference-guide/core/permission/PermissionLib.md +++ /dev/null @@ -1,47 +0,0 @@ -## Description - -A library containing objects for permission processing. - -## Implementation - -### public variable NO_CONDITION - -A constant expressing that no condition is applied to a permission. - -```solidity -address NO_CONDITION -``` - -### enum Operation - -```solidity -enum Operation { - Grant, - Revoke, - GrantWithCondition -} -``` - -### public struct SingleTargetPermission - -```solidity -struct SingleTargetPermission { - enum PermissionLib.Operation operation; - address who; - bytes32 permissionId; -} -``` - -### public struct MultiTargetPermission - -```solidity -struct MultiTargetPermission { - enum PermissionLib.Operation operation; - address where; - address who; - address condition; - bytes32 permissionId; -} -``` - - diff --git a/docs/osx/03-reference-guide/core/plugin/IPlugin.md b/docs/osx/03-reference-guide/core/plugin/IPlugin.md deleted file mode 100644 index c8941e3c..00000000 --- a/docs/osx/03-reference-guide/core/plugin/IPlugin.md +++ /dev/null @@ -1,25 +0,0 @@ -## Description - -An interface defining the traits of a plugin. - -## Implementation - -### enum PluginType - -```solidity -enum PluginType { - UUPS, - Cloneable, - Constructable -} -``` - -### external function pluginType - -Returns the plugin's type - -```solidity -function pluginType() external view returns (enum IPlugin.PluginType) -``` - - diff --git a/docs/osx/03-reference-guide/core/plugin/Plugin.md b/docs/osx/03-reference-guide/core/plugin/Plugin.md deleted file mode 100644 index 707dd026..00000000 --- a/docs/osx/03-reference-guide/core/plugin/Plugin.md +++ /dev/null @@ -1,41 +0,0 @@ -## Description - -An abstract, non-upgradeable contract to inherit from when creating a plugin being deployed via the `new` keyword. - -## Implementation - -### internal function constructor - -Constructs the plugin by storing the associated DAO. - -```solidity -constructor(contract IDAO _dao) internal -``` - -| Input | Type | Description | -| :----- | --------------- | ----------------- | -| `_dao` | `contract IDAO` | The DAO contract. | - -### public function pluginType - -Returns the plugin's type - -```solidity -function pluginType() public pure returns (enum IPlugin.PluginType) -``` - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/PluginCloneable.md b/docs/osx/03-reference-guide/core/plugin/PluginCloneable.md deleted file mode 100644 index ae410d77..00000000 --- a/docs/osx/03-reference-guide/core/plugin/PluginCloneable.md +++ /dev/null @@ -1,49 +0,0 @@ -## Description - -An abstract, non-upgradeable contract to inherit from when creating a plugin being deployed via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)). - -## Implementation - -### internal function constructor - -Disables the initializers on the implementation contract to prevent it from being left uninitialized. - -```solidity -constructor() internal -``` - -### internal function \_\_PluginCloneable_init - -Initializes the plugin by storing the associated DAO. - -```solidity -function __PluginCloneable_init(contract IDAO _dao) internal virtual -``` - -| Input | Type | Description | -| :----- | --------------- | ----------------- | -| `_dao` | `contract IDAO` | The DAO contract. | - -### public function pluginType - -Returns the plugin's type - -```solidity -function pluginType() public pure returns (enum IPlugin.PluginType) -``` - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md b/docs/osx/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md deleted file mode 100644 index 98bfd2a3..00000000 --- a/docs/osx/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md +++ /dev/null @@ -1,79 +0,0 @@ -## Description - -An abstract, upgradeable contract to inherit from when creating a plugin being deployed via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). - -## Implementation - -### internal function constructor - -Disables the initializers on the implementation contract to prevent it from being left uninitialized. - -```solidity -constructor() internal -``` - -### public function pluginType - -Returns the plugin's type - -```solidity -function pluginType() public pure returns (enum IPlugin.PluginType) -``` - -### public variable UPGRADE_PLUGIN_PERMISSION_ID - -The ID of the permission required to call the `_authorizeUpgrade` function. - -```solidity -bytes32 UPGRADE_PLUGIN_PERMISSION_ID -``` - -### internal function \_\_PluginUUPSUpgradeable_init - -Initializes the plugin by storing the associated DAO. - -```solidity -function __PluginUUPSUpgradeable_init(contract IDAO _dao) internal virtual -``` - -| Input | Type | Description | -| :----- | --------------- | ----------------- | -| `_dao` | `contract IDAO` | The DAO contract. | - -### public function supportsInterface - -Checks if an interface is supported by this or its parent contract. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### public function implementation - -Returns the address of the implementation contract in the [proxy storage slot](https://eips.ethereum.org/EIPS/eip-1967) slot the [UUPS proxy](https://eips.ethereum.org/EIPS/eip-1822) is pointing to. - -```solidity -function implementation() public view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------------------------------- | -| `0` | `address` | The address of the implementation contract. | - -### internal function \_authorizeUpgrade - -Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). - -```solidity -function _authorizeUpgrade(address) internal virtual -``` - -_The caller must have the `UPGRADE_PLUGIN_PERMISSION_ID` permission._ - - diff --git a/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md b/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md deleted file mode 100644 index f6b2e3d0..00000000 --- a/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizable.md +++ /dev/null @@ -1,43 +0,0 @@ -## Description - -An abstract contract providing a meta-transaction compatible modifier for non-upgradeable contracts instantiated via the `new` keyword to authorize function calls through an associated DAO. - -## Implementation - -### internal function constructor - -Constructs the contract by setting the associated DAO. - -```solidity -constructor(contract IDAO _dao) internal -``` - -| Input | Type | Description | -| :----- | --------------- | --------------------------- | -| `_dao` | `contract IDAO` | The associated DAO address. | - -### public function dao - -Returns the DAO contract. - -```solidity -function dao() public view returns (contract IDAO) -``` - -| Output | Type | Description | -| ------ | --------------- | ----------------- | -| `0` | `contract IDAO` | The DAO contract. | - -### internal modifier auth - -A modifier to make functions on inheriting contracts authorized. Permissions to call the function are checked through the associated DAO's permission manager. - -```solidity -modifier auth(bytes32 _permissionId) -``` - -| Input | Type | Description | -| :-------------- | --------- | ---------------------------------------------------------------------------------- | -| `_permissionId` | `bytes32` | The permission identifier required to call the method this modifier is applied to. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizableUpgradeable.md b/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizableUpgradeable.md deleted file mode 100644 index 99eed379..00000000 --- a/docs/osx/03-reference-guide/core/plugin/dao-authorizable/DaoAuthorizableUpgradeable.md +++ /dev/null @@ -1,45 +0,0 @@ -## Description - -An abstract contract providing a meta-transaction compatible modifier for upgradeable or cloneable contracts to authorize function calls through an associated DAO. - -Make sure to call `__DaoAuthorizableUpgradeable_init` during initialization of the inheriting contract. - -## Implementation - -### internal function \_\_DaoAuthorizableUpgradeable_init - -Initializes the contract by setting the associated DAO. - -```solidity -function __DaoAuthorizableUpgradeable_init(contract IDAO _dao) internal -``` - -| Input | Type | Description | -| :----- | --------------- | --------------------------- | -| `_dao` | `contract IDAO` | The associated DAO address. | - -### public function dao - -Returns the DAO contract. - -```solidity -function dao() public view returns (contract IDAO) -``` - -| Output | Type | Description | -| ------ | --------------- | ----------------- | -| `0` | `contract IDAO` | The DAO contract. | - -### internal modifier auth - -A modifier to make functions on inheriting contracts authorized. Permissions to call the function are checked through the associated DAO's permission manager. - -```solidity -modifier auth(bytes32 _permissionId) -``` - -| Input | Type | Description | -| :-------------- | --------- | ---------------------------------------------------------------------------------- | -| `_permissionId` | `bytes32` | The permission identifier required to call the method this modifier is applied to. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/membership/IMembership.md b/docs/osx/03-reference-guide/core/plugin/membership/IMembership.md deleted file mode 100644 index f8489cbe..00000000 --- a/docs/osx/03-reference-guide/core/plugin/membership/IMembership.md +++ /dev/null @@ -1,59 +0,0 @@ -## Description - -An interface to be implemented by DAO plugins that define membership. - -## Implementation - -### event MembersAdded - -Emitted when members are added to the DAO plugin. - -```solidity -event MembersAdded(address[] members) -``` - -| Input | Type | Description | -| :-------- | ----------- | ------------------------------------ | -| `members` | `address[]` | The list of new members being added. | - -### event MembersRemoved - -Emitted when members are removed from the DAO plugin. - -```solidity -event MembersRemoved(address[] members) -``` - -| Input | Type | Description | -| :-------- | ----------- | ------------------------------------------- | -| `members` | `address[]` | The list of existing members being removed. | - -### event MembershipContractAnnounced - -Emitted to announce the membership being defined by a contract. - -```solidity -event MembershipContractAnnounced(address definingContract) -``` - -| Input | Type | Description | -| :----------------- | --------- | ------------------------------------- | -| `definingContract` | `address` | The contract defining the membership. | - -### external function isMember - -Checks if an account is a member of the DAO. - -```solidity -function isMember(address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ----------------------------------------- | -| `_account` | `address` | The address of the account to be checked. | -| **Output** | | -| `0` | `bool` | Whether the account is a member or not. | - -_This function must be implemented in the plugin contract that introduces the members to the DAO._ - - diff --git a/docs/osx/03-reference-guide/core/plugin/proposal/IProposal.md b/docs/osx/03-reference-guide/core/plugin/proposal/IProposal.md deleted file mode 100644 index df610200..00000000 --- a/docs/osx/03-reference-guide/core/plugin/proposal/IProposal.md +++ /dev/null @@ -1,49 +0,0 @@ -## Description - -An interface to be implemented by DAO plugins that create and execute proposals. - -## Implementation - -### event ProposalCreated - -Emitted when a proposal is created. - -```solidity -event ProposalCreated(uint256 proposalId, address creator, uint64 startDate, uint64 endDate, bytes metadata, struct IDAO.Action[] actions, uint256 allowFailureMap) -``` - -| Input | Type | Description | -| :---------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | -| `creator` | `address` | The creator of the proposal. | -| `startDate` | `uint64` | The start date of the proposal in seconds. | -| `endDate` | `uint64` | The end date of the proposal in seconds. | -| `metadata` | `bytes` | The metadata of the proposal. | -| `actions` | `struct IDAO.Action[]` | The actions that will be executed if the proposal passes. | -| `allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | - -### event ProposalExecuted - -Emitted when a proposal is executed. - -```solidity -event ProposalExecuted(uint256 proposalId) -``` - -| Input | Type | Description | -| :----------- | --------- | ----------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | - -### external function proposalCount - -Returns the proposal count determining the next proposal ID. - -```solidity -function proposalCount() external view returns (uint256) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------- | -| `0` | `uint256` | The proposal count. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/proposal/Proposal.md b/docs/osx/03-reference-guide/core/plugin/proposal/Proposal.md deleted file mode 100644 index dc5f703e..00000000 --- a/docs/osx/03-reference-guide/core/plugin/proposal/Proposal.md +++ /dev/null @@ -1,82 +0,0 @@ -## Description - -An abstract contract containing the traits and internal functionality to create and execute proposals that can be inherited by non-upgradeable DAO plugins. - -## Implementation - -### public function proposalCount - -Returns the proposal count determining the next proposal ID. - -```solidity -function proposalCount() public view returns (uint256) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------- | -| `0` | `uint256` | The proposal count. | - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### internal function \_createProposalId - -Creates a proposal ID. - -```solidity -function _createProposalId() internal returns (uint256 proposalId) -``` - -| Output | Type | Description | -| ------------ | --------- | ---------------- | -| `proposalId` | `uint256` | The proposal ID. | - -### internal function \_createProposal - -Internal function to create a proposal. - -```solidity -function _createProposal(address _creator, bytes _metadata, uint64 _startDate, uint64 _endDate, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_creator` | `address` | | -| `_metadata` | `bytes` | The proposal metadata. | -| `_startDate` | `uint64` | The start date of the proposal in seconds. | -| `_endDate` | `uint64` | The end date of the proposal in seconds. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### internal function \_executeProposal - -Internal function to execute a proposal. - -```solidity -function _executeProposal(contract IDAO _dao, uint256 _proposalId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (bytes[] execResults, uint256 failureMap) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | -| `_actions` | `struct IDAO.Action[]` | The array of actions to be executed. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| **Output** | | -| `execResults` | `bytes[]` | The array with the results of the executed actions. | -| `failureMap` | `uint256` | The failure map encoding which actions have failed. | - - diff --git a/docs/osx/03-reference-guide/core/plugin/proposal/ProposalUpgradeable.md b/docs/osx/03-reference-guide/core/plugin/proposal/ProposalUpgradeable.md deleted file mode 100644 index e84418b5..00000000 --- a/docs/osx/03-reference-guide/core/plugin/proposal/ProposalUpgradeable.md +++ /dev/null @@ -1,82 +0,0 @@ -## Description - -An abstract contract containing the traits and internal functionality to create and execute proposals that can be inherited by upgradeable DAO plugins. - -## Implementation - -### public function proposalCount - -Returns the proposal count determining the next proposal ID. - -```solidity -function proposalCount() public view returns (uint256) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------- | -| `0` | `uint256` | The proposal count. | - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### internal function \_createProposalId - -Creates a proposal ID. - -```solidity -function _createProposalId() internal returns (uint256 proposalId) -``` - -| Output | Type | Description | -| ------------ | --------- | ---------------- | -| `proposalId` | `uint256` | The proposal ID. | - -### internal function \_createProposal - -Internal function to create a proposal. - -```solidity -function _createProposal(address _creator, bytes _metadata, uint64 _startDate, uint64 _endDate, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_creator` | `address` | | -| `_metadata` | `bytes` | The proposal metadata. | -| `_startDate` | `uint64` | The start date of the proposal in seconds. | -| `_endDate` | `uint64` | The end date of the proposal in seconds. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### internal function \_executeProposal - -Internal function to execute a proposal. - -```solidity -function _executeProposal(contract IDAO _dao, uint256 _proposalId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (bytes[] execResults, uint256 failureMap) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | -| `_actions` | `struct IDAO.Action[]` | The array of actions to be executed. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| **Output** | | -| `execResults` | `bytes[]` | The array with the results of the executed actions. | -| `failureMap` | `uint256` | The failure map encoding which actions have failed. | - - diff --git a/docs/osx/03-reference-guide/core/utils/BitMap.md b/docs/osx/03-reference-guide/core/utils/BitMap.md deleted file mode 100644 index 0838cfd8..00000000 --- a/docs/osx/03-reference-guide/core/utils/BitMap.md +++ /dev/null @@ -1,25 +0,0 @@ -### internal function hasBit - -```solidity -function hasBit(uint256 bitmap, uint8 index) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | -------------------------------------------------------- | -| `bitmap` | `uint256` | The `uint256` representation of bits. | -| `index` | `uint8` | The index number to check whether 1 or 0 is set. | -| **Output** | | -| `0` | `bool` | Returns `true` if the bit is set at `index` on `bitmap`. | - -### internal function flipBit - -```solidity -function flipBit(uint256 bitmap, uint8 index) internal pure returns (uint256) -``` - -| Input | Type | Description | -| :--------- | --------- | -------------------------------------------------------- | -| `bitmap` | `uint256` | The `uint256` representation of bits. | -| `index` | `uint8` | The index number to set the bit. | -| **Output** | | -| `0` | `uint256` | Returns a new number in which the bit is set at `index`. | diff --git a/docs/osx/03-reference-guide/core/utils/auth.md b/docs/osx/03-reference-guide/core/utils/auth.md deleted file mode 100644 index 57bedaa0..00000000 --- a/docs/osx/03-reference-guide/core/utils/auth.md +++ /dev/null @@ -1,30 +0,0 @@ -### error DaoUnauthorized - -Thrown if a call is unauthorized in the associated DAO. - -```solidity -error DaoUnauthorized(address dao, address where, address who, bytes32 permissionId) -``` - -| Input | Type | Description | -| :------------- | --------- | ----------------------------------------------------- | -| `dao` | `address` | The associated DAO. | -| `where` | `address` | The context in which the authorization reverted. | -| `who` | `address` | The address (EOA or contract) missing the permission. | -| `permissionId` | `bytes32` | The permission identifier. | - -### internal function \_auth - -A free function checking if a caller is granted permissions on a target contract via a permission identifier that redirects the approval to a `PermissionCondition` if this was specified in the setup. - -```solidity -function _auth(contract IDAO _dao, address _where, address _who, bytes32 _permissionId, bytes _data) internal view -``` - -| Input | Type | Description | -| :-------------- | --------------- | ----------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | | -| `_where` | `address` | The address of the target contract for which `who` receives permission. | -| `_who` | `address` | The address (EOA or contract) owning the permission. | -| `_permissionId` | `bytes32` | The permission identifier. | -| `_data` | `bytes` | The optional data passed to the `PermissionCondition` registered. | diff --git a/docs/osx/03-reference-guide/plugins/placeholder-version/PlaceholderSetup.md b/docs/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md similarity index 100% rename from docs/osx/03-reference-guide/plugins/placeholder-version/PlaceholderSetup.md rename to docs/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md diff --git a/docs/osx/03-reference-guide/framework/plugin/setup/IPluginSetup.md b/docs/osx/03-reference-guide/framework/plugin/setup/IPluginSetup.md deleted file mode 100644 index cb21b50b..00000000 --- a/docs/osx/03-reference-guide/framework/plugin/setup/IPluginSetup.md +++ /dev/null @@ -1,88 +0,0 @@ -## 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 - -```solidity -struct PreparedSetupData { - address[] helpers; - struct PermissionLib.MultiTargetPermission[] permissions; -} -``` - -### public struct SetupPayload - -```solidity -struct SetupPayload { - address plugin; - address[] currentHelpers; - bytes data; -} -``` - -### external function prepareInstallation - -Prepares the installation of a plugin. - -```solidity -function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the installing DAO. | -| `_data` | `bytes` | The bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file. | -| **Output** | | -| `plugin` | `address` | The address of the `Plugin` contract being prepared for installation. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUpdate - -Prepares the update of a plugin. - -```solidity -function prepareUpdate(address _dao, uint16 _currentBuild, struct IPluginSetup.SetupPayload _payload) external returns (bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the updating DAO. | -| `_currentBuild` | `uint16` | The build number of the plugin to update from. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUpdate`. See above. | -| **Output** | | -| `initData` | `bytes` | The initialization data to be passed to upgradeable contracts when the update is applied in the `PluginSetupProcessor`. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUninstallation - -Prepares the uninstallation of a plugin. - -```solidity -function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external returns (struct PermissionLib.MultiTargetPermission[] permissions) -``` - -| Input | Type | Description | -| :------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the uninstalling DAO. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUninstallation`. See above. | -| **Output** | | -| `permissions` | `struct 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. - -```solidity -function implementation() external view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------------------------- | -| `0` | `address` | The address of the plugin implementation contract. | - -_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ - - diff --git a/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetup.md b/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetup.md deleted file mode 100644 index 47189f22..00000000 --- a/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetup.md +++ /dev/null @@ -1,53 +0,0 @@ -## 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. - -```solidity -function prepareUpdate(address _dao, uint16 _currentBuild, struct IPluginSetup.SetupPayload _payload) external virtual returns (bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the updating DAO. | -| `_currentBuild` | `uint16` | The build number of the plugin to update from. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUpdate`. See above. | -| **Output** | | -| `initData` | `bytes` | The initialization data to be passed to upgradeable contracts when the update is applied in the `PluginSetupProcessor`. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### internal function createERC1967Proxy - -A convenience function to create an [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy contract pointing to an implementation and being associated to a DAO. - -```solidity -function createERC1967Proxy(address _implementation, bytes _data) internal returns (address) -``` - -| Input | Type | Description | -| :---------------- | --------- | ----------------------------------------------------------------------------- | -| `_implementation` | `address` | The address of the implementation contract to which the proxy is pointing to. | -| `_data` | `bytes` | The data to initialize the storage of the proxy contract. | -| **Output** | | -| `0` | `address` | The address of the created proxy contract. | - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - - diff --git a/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md b/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md index 6d7ec27c..0ceda55b 100644 --- a/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md +++ b/docs/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md @@ -420,10 +420,10 @@ Applies the permissions of a prepared update of an UUPS upgradeable proxy contra function applyUpdate(address _dao, struct PluginSetupProcessor.ApplyUpdateParams _params) external ``` -| Input | Type | Description | -| :-------- | ----------------------------------------------- | -------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the updating DAO. | -| `_params` | `struct PluginSetupProcessor.ApplyUpdateParams` | The struct containing the parameters for the `applyInstallation` function. | +| Input | Type | Description | +| :-------- | ----------------------------------------------- | -------------------------------------------------------------------- | +| `_dao` | `address` | The address of the updating DAO. | +| `_params` | `struct PluginSetupProcessor.ApplyUpdateParams` | The struct containing the parameters for the `applyUpdate` function. | ### external function prepareUninstallation diff --git a/docs/osx/03-reference-guide/plugins/governance/admin/Admin.md b/docs/osx/03-reference-guide/plugins/governance/admin/Admin.md deleted file mode 100644 index 05f57b3a..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/admin/Admin.md +++ /dev/null @@ -1,81 +0,0 @@ -## Description - -The admin governance plugin giving execution permission on the DAO to a single address. - -## Implementation - -### internal variable ADMIN_INTERFACE_ID - -The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. - -```solidity -bytes4 ADMIN_INTERFACE_ID -``` - -### public variable EXECUTE_PROPOSAL_PERMISSION_ID - -The ID of the permission required to call the `executeProposal` function. - -```solidity -bytes32 EXECUTE_PROPOSAL_PERMISSION_ID -``` - -### external function initialize - -Initializes the contract. - -```solidity -function initialize(contract IDAO _dao) external -``` - -| Input | Type | Description | -| :----- | --------------- | ------------------- | -| `_dao` | `contract IDAO` | The associated DAO. | - -_This method is required to support [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)._ - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### external function isMember - -Checks if an account is a member of the DAO. - -```solidity -function isMember(address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ----------------------------------------- | -| `_account` | `address` | The address of the account to be checked. | -| **Output** | | -| `0` | `bool` | Whether the account is a member or not. | - -_This function must be implemented in the plugin contract that introduces the members to the DAO._ - -### external function executeProposal - -Creates and executes a new proposal. - -```solidity -function executeProposal(bytes _metadata, struct IDAO.Action[] _actions, uint256 _allowFailureMap) external -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_metadata` | `bytes` | The metadata of the proposal. | -| `_actions` | `struct IDAO.Action[]` | The actions to be executed. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/admin/AdminSetup.md b/docs/osx/03-reference-guide/plugins/governance/admin/AdminSetup.md deleted file mode 100644 index 5b1df1a9..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/admin/AdminSetup.md +++ /dev/null @@ -1,74 +0,0 @@ -## Description - -The setup contract of the `Admin` plugin. - -## Implementation - -### error AdminAddressInvalid - -Thrown if the admin address is zero. - -```solidity -error AdminAddressInvalid(address admin) -``` - -| Input | Type | Description | -| :------ | --------- | ------------------ | -| `admin` | `address` | The admin address. | - -### public function constructor - -The constructor setting the `Admin` implementation contract to clone from. - -```solidity -constructor() public -``` - -### external function prepareInstallation - -Prepares the installation of a plugin. - -```solidity -function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the installing DAO. | -| `_data` | `bytes` | The bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file. | -| **Output** | | -| `plugin` | `address` | The address of the `Plugin` contract being prepared for installation. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUninstallation - -Prepares the uninstallation of a plugin. - -```solidity -function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external view returns (struct PermissionLib.MultiTargetPermission[] permissions) -``` - -| Input | Type | Description | -| :------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the uninstalling DAO. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUninstallation`. See above. | -| **Output** | | -| `permissions` | `struct PermissionLib.MultiTargetPermission[]` | The array of multi-targeted permission operations to be applied by the `PluginSetupProcessor` to the uninstalling DAO. | - -_Currently, there is no reliable way to revoke the `ADMIN_EXECUTE_PERMISSION_ID` from all addresses it has been granted to. Accordingly, only the `EXECUTE_PERMISSION_ID` is revoked for this uninstallation._ - -### external function implementation - -Returns the plugin implementation address. - -```solidity -function implementation() external view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------------------------- | -| `0` | `address` | The address of the plugin implementation contract. | - -_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/IMajorityVoting.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/IMajorityVoting.md deleted file mode 100644 index e4487a1f..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/IMajorityVoting.md +++ /dev/null @@ -1,179 +0,0 @@ -## Description - -The interface of majority voting plugin. - -## Implementation - -### enum VoteOption - -```solidity -enum VoteOption { - None, - Abstain, - Yes, - No -} -``` - -### event VoteCast - -Emitted when a vote is cast by a voter. - -```solidity -event VoteCast(uint256 proposalId, address voter, enum IMajorityVoting.VoteOption voteOption, uint256 votingPower) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | ---------------------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | -| `voter` | `address` | The voter casting the vote. | -| `voteOption` | `enum IMajorityVoting.VoteOption` | The casted vote option. | -| `votingPower` | `uint256` | The voting power behind this vote. | - -### external function supportThreshold - -Returns the support threshold parameter stored in the voting settings. - -```solidity -function supportThreshold() external view returns (uint32) -``` - -| Output | Type | Description | -| ------ | -------- | -------------------------------- | -| `0` | `uint32` | The support threshold parameter. | - -### external function minParticipation - -Returns the minimum participation parameter stored in the voting settings. - -```solidity -function minParticipation() external view returns (uint32) -``` - -| Output | Type | Description | -| ------ | -------- | ------------------------------------ | -| `0` | `uint32` | The minimum participation parameter. | - -### external function isSupportThresholdReached - -Checks if the support value defined as $$\texttt{support} = \frac{N_\text{yes}}{N_\text{yes}+N_\text{no}}$$ for a proposal vote is greater than the support threshold. - -```solidity -function isSupportThresholdReached(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the support is greater than the support threshold and `false` otherwise. | - -### external function isSupportThresholdReachedEarly - -Checks if the worst-case support value defined as $$\texttt{worstCaseSupport} = \frac{N_\text{yes}}{ N_\text{total}-N_\text{abstain}}$$ for a proposal vote is greater than the support threshold. - -```solidity -function isSupportThresholdReachedEarly(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the worst-case support is greater than the support threshold and `false` otherwise. | - -### external function isMinParticipationReached - -Checks if the participation value defined as $$\texttt{participation} = \frac{N_\text{yes}+N_\text{no}+N_\text{abstain}}{N_\text{total}}$$ for a proposal vote is greater or equal than the minimum participation value. - -```solidity -function isMinParticipationReached(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ---------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the participation is greater than the minimum participation and `false` otherwise. | - -### external function canVote - -Checks if an account can participate on a proposal vote. This can be because the vote - -- has not started, -- has ended, -- was executed, or -- the voter doesn't have voting powers. - -```solidity -function canVote(uint256 _proposalId, address _account, enum IMajorityVoting.VoteOption _voteOption) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | ------------------------------------------------------------- | -| `_proposalId` | `uint256` | The proposal Id. | -| `_account` | `address` | The account address to be checked. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | Whether the voter abstains, supports or opposes the proposal. | -| **Output** | | -| `0` | `bool` | Returns true if the account is allowed to vote. | - -_The function assumes the queried proposal exists._ - -### external function canExecute - -Checks if a proposal can be executed. - -```solidity -function canExecute(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal to be checked. | -| **Output** | | -| `0` | `bool` | True if the proposal can be executed, false otherwise. | - -### external function vote - -Votes for a vote option and, optionally, executes the proposal. - -```solidity -function vote(uint256 _proposalId, enum IMajorityVoting.VoteOption _voteOption, bool _tryEarlyExecution) external -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option. | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | - -_`_voteOption`, 1 -> abstain, 2 -> yes, 3 -> no_ - -### external function execute - -Executes a proposal. - -```solidity -function execute(uint256 _proposalId) external -``` - -| Input | Type | Description | -| :------------ | --------- | -------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | - -### external function getVoteOption - -Returns whether the account has voted for the proposal. Note, that this does not check if the account has voting power. - -```solidity -function getVoteOption(uint256 _proposalId, address _account) external view returns (enum IMajorityVoting.VoteOption) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | ------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | The account address to be checked. | -| **Output** | | -| `0` | `enum IMajorityVoting.VoteOption` | The vote option cast by a voter for a certain proposal. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/MajorityVotingBase.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/MajorityVotingBase.md deleted file mode 100644 index 7a578d04..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/MajorityVotingBase.md +++ /dev/null @@ -1,629 +0,0 @@ -## Description - -The abstract implementation of majority voting plugins. - -### Parameterization - -We define two parameters -$$\texttt{support} = \frac{N_\text{yes}}{N_\text{yes} + N_\text{no}} \in [0,1]$$ -and -$$\texttt{participation} = \frac{N_\text{yes} + N_\text{no} + N_\text{abstain}}{N_\text{total}} \in [0,1],$$ -where $N_\text{yes}$, $N_\text{no}$, and $N_\text{abstain}$ are the yes, no, and abstain votes that have been cast and $N_\text{total}$ is the total voting power available at proposal creation time. - -#### Limit Values: Support Threshold & Minimum Participation - -Two limit values are associated with these parameters and decide if a proposal execution should be possible: $\texttt{supportThreshold} \in [0,1]$ and $\texttt{minParticipation} \in [0,1]$. - -For threshold values, $>$ comparison is used. This **does not** include the threshold value. E.g., for $\texttt{supportThreshold} = 50\%$, the criterion is fulfilled if there is at least one more yes than no votes ($N_\text{yes} = N_\text{no} + 1$). -For minimum values, $\ge{}$ comparison is used. This **does** include the minimum participation value. E.g., for $\texttt{minParticipation} = 40\%$ and $N_\text{total} = 10$, the criterion is fulfilled if 4 out of 10 votes were casted. - -Majority voting implies that the support threshold is set with -$$\texttt{supportThreshold} \ge 50\% .$$ -However, this is not enforced by the contract code and developers can make unsafe parameters and only the frontend will warn about bad parameter settings. - -### Execution Criteria - -After the vote is closed, two criteria decide if the proposal passes. - -#### The Support Criterion - -For a proposal to pass, the required ratio of yes and no votes must be met: -$$(1- \texttt{supportThreshold}) \cdot N_\text{yes} > \texttt{supportThreshold} \cdot N_\text{no}.$$ -Note, that the inequality yields the simple majority voting condition for $\texttt{supportThreshold}=\frac{1}{2}$. - -#### The Participation Criterion - -For a proposal to pass, the minimum voting power must have been cast: -$$N_\text{yes} + N_\text{no} + N_\text{abstain} \ge \texttt{minVotingPower},$$ -where $\texttt{minVotingPower} = \texttt{minParticipation} \cdot N_\text{total}$. - -### Vote Replacement Execution - -The contract allows votes to be replaced. Voters can vote multiple times and only the latest voteOption is tallied. - -### Early Execution - -This contract allows a proposal to be executed early, iff the vote outcome cannot change anymore by more people voting. Accordingly, vote replacement and early execution are /// mutually exclusive options. -The outcome cannot change anymore iff the support threshold is met even if all remaining votes are no votes. We call this number the worst-case number of no votes and define it as - -$$N_\text{no, worst-case} = N_\text{no, worst-case} + \texttt{remainingVotes}$$ - -where - -$$\texttt{remainingVotes} = N_\text{total}-\underbrace{(N_\text{yes}+N_\text{no}+N_\text{abstain})}_{\text{turnout}}.$$ - -We can use this quantity to calculate the worst-case support that would be obtained if all remaining votes are casted with no: - -$$ -\begin{align*} - \texttt{worstCaseSupport} - &= \frac{N_\text{yes}}{N_\text{yes} + (N_\text{no, worst-case})} \\[3mm] - &= \frac{N_\text{yes}}{N_\text{yes} + (N_\text{no} + \texttt{remainingVotes})} \\[3mm] - &= \frac{N_\text{yes}}{N_\text{yes} + N_\text{no} + N_\text{total} - (N_\text{yes} + N_\text{no} + N_\text{abstain})} \\[3mm] - &= \frac{N_\text{yes}}{N_\text{total} - N_\text{abstain}} -\end{align*} -$$ - -In analogy, we can modify [the support criterion](#the-support-criterion) from above to allow for early execution: - -$$ -\begin{align*} - (1 - \texttt{supportThreshold}) \cdot N_\text{yes} - &> \texttt{supportThreshold} \cdot N_\text{no, worst-case} \\[3mm] - &> \texttt{supportThreshold} \cdot (N_\text{no} + \texttt{remainingVotes}) \\[3mm] - &> \texttt{supportThreshold} \cdot (N_\text{no} + N_\text{total}-(N_\text{yes}+N_\text{no}+N_\text{abstain})) \\[3mm] - &> \texttt{supportThreshold} \cdot (N_\text{total} - N_\text{yes} - N_\text{abstain}) -\end{align*} -$$ - -Accordingly, early execution is possible when the vote is open, the modified support criterion, and the particicpation criterion are met. - -This contract implements the `IMajorityVoting` interface. - -## Implementation - -### enum VotingMode - -```solidity -enum VotingMode { - Standard, - EarlyExecution, - VoteReplacement -} -``` - -### public struct VotingSettings - -```solidity -struct VotingSettings { - enum MajorityVotingBase.VotingMode votingMode; - uint32 supportThreshold; - uint32 minParticipation; - uint64 minDuration; - uint256 minProposerVotingPower; -} -``` - -### public struct Proposal - -```solidity -struct Proposal { - bool executed; - struct MajorityVotingBase.ProposalParameters parameters; - struct MajorityVotingBase.Tally tally; - mapping(address => enum IMajorityVoting.VoteOption) voters; - struct IDAO.Action[] actions; - uint256 allowFailureMap; -} -``` - -### public struct ProposalParameters - -```solidity -struct ProposalParameters { - enum MajorityVotingBase.VotingMode votingMode; - uint32 supportThreshold; - uint64 startDate; - uint64 endDate; - uint64 snapshotBlock; - uint256 minVotingPower; -} -``` - -### public struct Tally - -```solidity -struct Tally { - uint256 abstain; - uint256 yes; - uint256 no; -} -``` - -### internal variable MAJORITY_VOTING_BASE_INTERFACE_ID - -The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. - -```solidity -bytes4 MAJORITY_VOTING_BASE_INTERFACE_ID -``` - -### public variable UPDATE_VOTING_SETTINGS_PERMISSION_ID - -The ID of the permission required to call the `updateVotingSettings` function. - -```solidity -bytes32 UPDATE_VOTING_SETTINGS_PERMISSION_ID -``` - -### internal variable proposals - -A mapping between proposal IDs and proposal information. - -```solidity -mapping(uint256 => struct MajorityVotingBase.Proposal) proposals -``` - -### error DateOutOfBounds - -Thrown if a date is out of bounds. - -```solidity -error DateOutOfBounds(uint64 limit, uint64 actual) -``` - -| Input | Type | Description | -| :------- | -------- | ----------------- | -| `limit` | `uint64` | The limit value. | -| `actual` | `uint64` | The actual value. | - -### error MinDurationOutOfBounds - -Thrown if the minimal duration value is out of bounds (less than one hour or greater than 1 year). - -```solidity -error MinDurationOutOfBounds(uint64 limit, uint64 actual) -``` - -| Input | Type | Description | -| :------- | -------- | ----------------- | -| `limit` | `uint64` | The limit value. | -| `actual` | `uint64` | The actual value. | - -### error ProposalCreationForbidden - -Thrown when a sender is not allowed to create a proposal. - -```solidity -error ProposalCreationForbidden(address sender) -``` - -| Input | Type | Description | -| :------- | --------- | ------------------- | -| `sender` | `address` | The sender address. | - -### error VoteCastForbidden - -Thrown if an account is not allowed to cast a vote. This can be because the vote - -- has not started, -- has ended, -- was executed, or -- the account doesn't have voting powers. - -```solidity -error VoteCastForbidden(uint256 proposalId, address account, enum IMajorityVoting.VoteOption voteOption) -``` - -| Input | Type | Description | -| :----------- | --------------------------------- | ----------------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | -| `account` | `address` | The address of the \_account. | -| `voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option. | - -### error ProposalExecutionForbidden - -Thrown if the proposal execution is forbidden. - -```solidity -error ProposalExecutionForbidden(uint256 proposalId) -``` - -| Input | Type | Description | -| :----------- | --------- | ----------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | - -### event VotingSettingsUpdated - -Emitted when the voting settings are updated. - -```solidity -event VotingSettingsUpdated(enum MajorityVotingBase.VotingMode votingMode, uint32 supportThreshold, uint32 minParticipation, uint64 minDuration, uint256 minProposerVotingPower) -``` - -| Input | Type | Description | -| :----------------------- | ------------------------------------ | ------------------------------------------------------- | -| `votingMode` | `enum MajorityVotingBase.VotingMode` | A parameter to select the vote mode. | -| `supportThreshold` | `uint32` | The support threshold value. | -| `minParticipation` | `uint32` | The minimum participation value. | -| `minDuration` | `uint64` | The minimum duration of the proposal vote in seconds. | -| `minProposerVotingPower` | `uint256` | The minimum voting power required to create a proposal. | - -### internal function \_\_MajorityVotingBase_init - -Initializes the component to be used by inheriting contracts. - -```solidity -function __MajorityVotingBase_init(contract IDAO _dao, struct MajorityVotingBase.VotingSettings _votingSettings) internal -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------------ | ----------------------------------------- | -| `_dao` | `contract IDAO` | The IDAO interface of the associated DAO. | -| `_votingSettings` | `struct MajorityVotingBase.VotingSettings` | The voting settings. | - -_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### public function vote - -Votes for a vote option and, optionally, executes the proposal. - -```solidity -function vote(uint256 _proposalId, enum IMajorityVoting.VoteOption _voteOption, bool _tryEarlyExecution) public virtual -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option. | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | - -_`_voteOption`, 1 -> abstain, 2 -> yes, 3 -> no_ - -### public function execute - -Executes a proposal. - -```solidity -function execute(uint256 _proposalId) public virtual -``` - -| Input | Type | Description | -| :------------ | --------- | -------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | - -### public function getVoteOption - -Returns whether the account has voted for the proposal. Note, that this does not check if the account has voting power. - -```solidity -function getVoteOption(uint256 _proposalId, address _voter) public view virtual returns (enum IMajorityVoting.VoteOption) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | ------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voter` | `address` | | -| **Output** | | -| `0` | `enum IMajorityVoting.VoteOption` | The vote option cast by a voter for a certain proposal. | - -### public function canVote - -Checks if an account can participate on a proposal vote. This can be because the vote - -- has not started, -- has ended, -- was executed, or -- the voter doesn't have voting powers. - -```solidity -function canVote(uint256 _proposalId, address _voter, enum IMajorityVoting.VoteOption _voteOption) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | ------------------------------------------------------------- | -| `_proposalId` | `uint256` | The proposal Id. | -| `_voter` | `address` | | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | Whether the voter abstains, supports or opposes the proposal. | -| **Output** | | -| `0` | `bool` | Returns true if the account is allowed to vote. | - -_The function assumes the queried proposal exists._ - -### public function canExecute - -Checks if a proposal can be executed. - -```solidity -function canExecute(uint256 _proposalId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal to be checked. | -| **Output** | | -| `0` | `bool` | True if the proposal can be executed, false otherwise. | - -### public function isSupportThresholdReached - -Checks if the support value defined as $$\texttt{support} = \frac{N_\text{yes}}{N_\text{yes}+N_\text{no}}$$ for a proposal vote is greater than the support threshold. - -```solidity -function isSupportThresholdReached(uint256 _proposalId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the support is greater than the support threshold and `false` otherwise. | - -### public function isSupportThresholdReachedEarly - -Checks if the worst-case support value defined as $$\texttt{worstCaseSupport} = \frac{N_\text{yes}}{ N_\text{total}-N_\text{abstain}}$$ for a proposal vote is greater than the support threshold. - -```solidity -function isSupportThresholdReachedEarly(uint256 _proposalId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the worst-case support is greater than the support threshold and `false` otherwise. | - -### public function isMinParticipationReached - -Checks if the participation value defined as $$\texttt{participation} = \frac{N_\text{yes}+N_\text{no}+N_\text{abstain}}{N_\text{total}}$$ for a proposal vote is greater or equal than the minimum participation value. - -```solidity -function isMinParticipationReached(uint256 _proposalId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ---------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the participation is greater than the minimum participation and `false` otherwise. | - -### public function supportThreshold - -Returns the support threshold parameter stored in the voting settings. - -```solidity -function supportThreshold() public view virtual returns (uint32) -``` - -| Output | Type | Description | -| ------ | -------- | -------------------------------- | -| `0` | `uint32` | The support threshold parameter. | - -### public function minParticipation - -Returns the minimum participation parameter stored in the voting settings. - -```solidity -function minParticipation() public view virtual returns (uint32) -``` - -| Output | Type | Description | -| ------ | -------- | ------------------------------------ | -| `0` | `uint32` | The minimum participation parameter. | - -### public function minDuration - -Returns the minimum duration parameter stored in the voting settings. - -```solidity -function minDuration() public view virtual returns (uint64) -``` - -| Output | Type | Description | -| ------ | -------- | ------------------------------- | -| `0` | `uint64` | The minimum duration parameter. | - -### public function minProposerVotingPower - -Returns the minimum voting power required to create a proposal stored in the voting settings. - -```solidity -function minProposerVotingPower() public view virtual returns (uint256) -``` - -| Output | Type | Description | -| ------ | --------- | ------------------------------------------------------- | -| `0` | `uint256` | The minimum voting power required to create a proposal. | - -### public function votingMode - -Returns the vote mode stored in the voting settings. - -```solidity -function votingMode() public view virtual returns (enum MajorityVotingBase.VotingMode) -``` - -| Output | Type | Description | -| ------ | ------------------------------------ | ------------------------ | -| `0` | `enum MajorityVotingBase.VotingMode` | The vote mode parameter. | - -### public function totalVotingPower - -Returns the total voting power checkpointed for a specific block number. - -```solidity -function totalVotingPower(uint256 _blockNumber) public view virtual returns (uint256) -``` - -| Input | Type | Description | -| :------------- | --------- | ----------------------- | -| `_blockNumber` | `uint256` | The block number. | -| **Output** | | -| `0` | `uint256` | The total voting power. | - -### public function getProposal - -Returns all information for a proposal vote by its ID. - -```solidity -function getProposal(uint256 _proposalId) public view virtual returns (bool open, bool executed, struct MajorityVotingBase.ProposalParameters parameters, struct MajorityVotingBase.Tally tally, struct IDAO.Action[] actions, uint256 allowFailureMap) -``` - -| Input | Type | Description | -| :---------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `open` | `bool` | Whether the proposal is open or not. | -| `executed` | `bool` | Whether the proposal is executed or not. | -| `parameters` | `struct MajorityVotingBase.ProposalParameters` | The parameters of the proposal vote. | -| `tally` | `struct MajorityVotingBase.Tally` | The current tally of the proposal vote. | -| `actions` | `struct IDAO.Action[]` | The actions to be executed in the associated DAO after the proposal has passed. | -| `allowFailureMap` | `uint256` | The bit map representations of which actions are allowed to revert so tx still succeeds. | - -### external function updateVotingSettings - -Updates the voting settings. - -```solidity -function updateVotingSettings(struct MajorityVotingBase.VotingSettings _votingSettings) external virtual -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------------ | ------------------------ | -| `_votingSettings` | `struct MajorityVotingBase.VotingSettings` | The new voting settings. | - -### external function createProposal - -Creates a new majority voting proposal. - -```solidity -function createProposal(bytes _metadata, struct IDAO.Action[] _actions, uint256 _allowFailureMap, uint64 _startDate, uint64 _endDate, enum IMajorityVoting.VoteOption _voteOption, bool _tryEarlyExecution) external virtual returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_metadata` | `bytes` | The metadata of the proposal. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | Allows proposal to succeed even if an action reverts. Uses bitmap representation. If the bit at index `x` is 1, the tx succeeds even if the action at `x` failed. Passing 0 will be treated as atomic execution. | -| `_startDate` | `uint64` | The start date of the proposal vote. If 0, the current timestamp is used and the vote starts immediately. | -| `_endDate` | `uint64` | The end date of the proposal vote. If 0, `_startDate + minDuration` is used. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on proposal creation. | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### internal function \_vote - -Internal function to cast a vote. It assumes the queried vote exists. - -```solidity -function _vote(uint256 _proposalId, enum IMajorityVoting.VoteOption _voteOption, address _voter, bool _tryEarlyExecution) internal virtual -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on the proposal vote. | -| `_voter` | `address` | | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | - -### internal function \_execute - -Internal function to execute a vote. It assumes the queried proposal exists. - -```solidity -function _execute(uint256 _proposalId) internal virtual -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | - -### internal function \_canVote - -Internal function to check if a voter can vote. It assumes the queried proposal exists. - -```solidity -function _canVote(uint256 _proposalId, address _voter, enum IMajorityVoting.VoteOption _voteOption) internal view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | --------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voter` | `address` | The address of the voter to check. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | Whether the voter abstains, supports or opposes the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the given voter can vote on a certain proposal and `false` otherwise. | - -### internal function \_canExecute - -Internal function to check if a proposal can be executed. It assumes the queried proposal exists. - -```solidity -function _canExecute(uint256 _proposalId) internal view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | True if the proposal can be executed, false otherwise. | - -_Threshold and minimal values are compared with `>` and `>=` comparators, respectively._ - -### internal function \_isProposalOpen - -Internal function to check if a proposal vote is still open. - -```solidity -function _isProposalOpen(struct MajorityVotingBase.Proposal proposal_) internal view virtual returns (bool) -``` - -| Input | Type | Description | -| :---------- | ------------------------------------ | --------------------------------------------------- | -| `proposal_` | `struct MajorityVotingBase.Proposal` | The proposal struct. | -| **Output** | | -| `0` | `bool` | True if the proposal vote is open, false otherwise. | - -### internal function \_updateVotingSettings - -Internal function to update the plugin-wide proposal vote settings. - -```solidity -function _updateVotingSettings(struct MajorityVotingBase.VotingSettings _votingSettings) internal virtual -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------------ | ------------------------------------------------ | -| `_votingSettings` | `struct MajorityVotingBase.VotingSettings` | The voting settings to be validated and updated. | - -### internal function \_validateProposalDates - -Validates and returns the proposal vote dates. - -```solidity -function _validateProposalDates(uint64 _start, uint64 _end) internal view virtual returns (uint64 startDate, uint64 endDate) -``` - -| Input | Type | Description | -| :---------- | -------- | --------------------------------------------------------------------------------------------------------- | -| `_start` | `uint64` | The start date of the proposal vote. If 0, the current timestamp is used and the vote starts immediately. | -| `_end` | `uint64` | The end date of the proposal vote. If 0, `_start + minDuration` is used. | -| **Output** | | -| `startDate` | `uint64` | The validated start date of the proposal vote. | -| `endDate` | `uint64` | The validated end date of the proposal vote. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVoting.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVoting.md deleted file mode 100644 index 8e5cb9d9..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVoting.md +++ /dev/null @@ -1,162 +0,0 @@ -## Description - -The majority voting implementation using a list of member addresses. - -This contract inherits from `MajorityVotingBase` and implements the `IMajorityVoting` interface. - -## Implementation - -### internal variable ADDRESSLIST_VOTING_INTERFACE_ID - -The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. - -```solidity -bytes4 ADDRESSLIST_VOTING_INTERFACE_ID -``` - -### public variable UPDATE_ADDRESSES_PERMISSION_ID - -The ID of the permission required to call the `addAddresses` and `removeAddresses` functions. - -```solidity -bytes32 UPDATE_ADDRESSES_PERMISSION_ID -``` - -### external function initialize - -Initializes the component. - -```solidity -function initialize(contract IDAO _dao, struct MajorityVotingBase.VotingSettings _votingSettings, address[] _members) external -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------------ | ----------------------------------------- | -| `_dao` | `contract IDAO` | The IDAO interface of the associated DAO. | -| `_votingSettings` | `struct MajorityVotingBase.VotingSettings` | The voting settings. | -| `_members` | `address[]` | | - -_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### external function addAddresses - -Adds new members to the address list. - -```solidity -function addAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ------------------------------------- | -| `_members` | `address[]` | The addresses of members to be added. | - -_This function is used during the plugin initialization._ - -### external function removeAddresses - -Removes existing members from the address list. - -```solidity -function removeAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ------------------------------------------- | -| `_members` | `address[]` | The addresses of the members to be removed. | - -### public function totalVotingPower - -Returns the total voting power checkpointed for a specific block number. - -```solidity -function totalVotingPower(uint256 _blockNumber) public view returns (uint256) -``` - -| Input | Type | Description | -| :------------- | --------- | ----------------------- | -| `_blockNumber` | `uint256` | The block number. | -| **Output** | | -| `0` | `uint256` | The total voting power. | - -### external function createProposal - -Creates a new majority voting proposal. - -```solidity -function createProposal(bytes _metadata, struct IDAO.Action[] _actions, uint256 _allowFailureMap, uint64 _startDate, uint64 _endDate, enum IMajorityVoting.VoteOption _voteOption, bool _tryEarlyExecution) external returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_metadata` | `bytes` | The metadata of the proposal. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | Allows proposal to succeed even if an action reverts. Uses bitmap representation. If the bit at index `x` is 1, the tx succeeds even if the action at `x` failed. Passing 0 will be treated as atomic execution. | -| `_startDate` | `uint64` | The start date of the proposal vote. If 0, the current timestamp is used and the vote starts immediately. | -| `_endDate` | `uint64` | The end date of the proposal vote. If 0, `_startDate + minDuration` is used. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on proposal creation. | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### external function isMember - -Checks if an account is a member of the DAO. - -```solidity -function isMember(address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ----------------------------------------- | -| `_account` | `address` | The address of the account to be checked. | -| **Output** | | -| `0` | `bool` | Whether the account is a member or not. | - -_This function must be implemented in the plugin contract that introduces the members to the DAO._ - -### internal function \_vote - -Internal function to cast a vote. It assumes the queried vote exists. - -```solidity -function _vote(uint256 _proposalId, enum IMajorityVoting.VoteOption _voteOption, address _voter, bool _tryEarlyExecution) internal -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on the proposal vote. | -| `_voter` | `address` | | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | - -### internal function \_canVote - -Internal function to check if a voter can vote. It assumes the queried proposal exists. - -```solidity -function _canVote(uint256 _proposalId, address _account, enum IMajorityVoting.VoteOption _voteOption) internal view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | --------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | Whether the voter abstains, supports or opposes the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the given voter can vote on a certain proposal and `false` otherwise. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVotingSetup.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVotingSetup.md deleted file mode 100644 index 18580121..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/addresslist/AddresslistVotingSetup.md +++ /dev/null @@ -1,60 +0,0 @@ -## Description - -The setup contract of the `AddresslistVoting` plugin. - -## Implementation - -### public function constructor - -The contract constructor, that deploys the `AddresslistVoting` plugin logic contract. - -```solidity -constructor() public -``` - -### external function prepareInstallation - -Prepares the installation of a plugin. - -```solidity -function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the installing DAO. | -| `_data` | `bytes` | The bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file. | -| **Output** | | -| `plugin` | `address` | The address of the `Plugin` contract being prepared for installation. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUninstallation - -Prepares the uninstallation of a plugin. - -```solidity -function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external view returns (struct PermissionLib.MultiTargetPermission[] permissions) -``` - -| Input | Type | Description | -| :------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the uninstalling DAO. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUninstallation`. See above. | -| **Output** | | -| `permissions` | `struct 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. - -```solidity -function implementation() external view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------------------------- | -| `0` | `address` | The address of the plugin implementation contract. | - -_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVoting.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVoting.md deleted file mode 100644 index 232c5195..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVoting.md +++ /dev/null @@ -1,150 +0,0 @@ -## Description - -The majority voting implementation using an [OpenZeppelin `Votes`](https://docs.openzeppelin.com/contracts/4.x/api/governance#Votes) compatible governance token. - -This contract inherits from `MajorityVotingBase` and implements the `IMajorityVoting` interface. - -## Implementation - -### internal variable TOKEN_VOTING_INTERFACE_ID - -The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. - -```solidity -bytes4 TOKEN_VOTING_INTERFACE_ID -``` - -### error NoVotingPower - -Thrown if the voting power is zero - -```solidity -error NoVotingPower() -``` - -### external function initialize - -Initializes the component. - -```solidity -function initialize(contract IDAO _dao, struct MajorityVotingBase.VotingSettings _votingSettings, contract IVotesUpgradeable _token) external -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------------ | -------------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | The IDAO interface of the associated DAO. | -| `_votingSettings` | `struct MajorityVotingBase.VotingSettings` | The voting settings. | -| `_token` | `contract IVotesUpgradeable` | The [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token used for voting. | - -_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### public function getVotingToken - -getter function for the voting token. - -```solidity -function getVotingToken() public view returns (contract IVotesUpgradeable) -``` - -| Output | Type | Description | -| ------ | ---------------------------- | -------------------------- | -| `0` | `contract IVotesUpgradeable` | The token used for voting. | - -_public function also useful for registering interfaceId and for distinguishing from majority voting interface._ - -### public function totalVotingPower - -Returns the total voting power checkpointed for a specific block number. - -```solidity -function totalVotingPower(uint256 _blockNumber) public view returns (uint256) -``` - -| Input | Type | Description | -| :------------- | --------- | ----------------------- | -| `_blockNumber` | `uint256` | The block number. | -| **Output** | | -| `0` | `uint256` | The total voting power. | - -### external function createProposal - -Creates a new majority voting proposal. - -```solidity -function createProposal(bytes _metadata, struct IDAO.Action[] _actions, uint256 _allowFailureMap, uint64 _startDate, uint64 _endDate, enum IMajorityVoting.VoteOption _voteOption, bool _tryEarlyExecution) external returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_metadata` | `bytes` | The metadata of the proposal. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | Allows proposal to succeed even if an action reverts. Uses bitmap representation. If the bit at index `x` is 1, the tx succeeds even if the action at `x` failed. Passing 0 will be treated as atomic execution. | -| `_startDate` | `uint64` | The start date of the proposal vote. If 0, the current timestamp is used and the vote starts immediately. | -| `_endDate` | `uint64` | The end date of the proposal vote. If 0, `_startDate + minDuration` is used. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on proposal creation. | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### external function isMember - -Checks if an account is a member of the DAO. - -```solidity -function isMember(address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ----------------------------------------- | -| `_account` | `address` | The address of the account to be checked. | -| **Output** | | -| `0` | `bool` | Whether the account is a member or not. | - -_This function must be implemented in the plugin contract that introduces the members to the DAO._ - -### internal function \_vote - -Internal function to cast a vote. It assumes the queried vote exists. - -```solidity -function _vote(uint256 _proposalId, enum IMajorityVoting.VoteOption _voteOption, address _voter, bool _tryEarlyExecution) internal -``` - -| Input | Type | Description | -| :------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | The chosen vote option to be casted on the proposal vote. | -| `_voter` | `address` | | -| `_tryEarlyExecution` | `bool` | If `true`, early execution is tried after the vote cast. The call does not revert if early execution is not possible. | - -### internal function \_canVote - -Internal function to check if a voter can vote. It assumes the queried proposal exists. - -```solidity -function _canVote(uint256 _proposalId, address _account, enum IMajorityVoting.VoteOption _voteOption) internal view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------------------------------- | --------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | | -| `_voteOption` | `enum IMajorityVoting.VoteOption` | Whether the voter abstains, supports or opposes the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the given voter can vote on a certain proposal and `false` otherwise. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVotingSetup.md b/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVotingSetup.md deleted file mode 100644 index 753c1ec7..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/majority-voting/token/TokenVotingSetup.md +++ /dev/null @@ -1,127 +0,0 @@ -## Description - -The setup contract of the `TokenVoting` plugin. - -## Implementation - -### public variable governanceERC20Base - -The address of the `GovernanceERC20` base contract. - -```solidity -address governanceERC20Base -``` - -### public variable governanceWrappedERC20Base - -The address of the `GovernanceWrappedERC20` base contract. - -```solidity -address governanceWrappedERC20Base -``` - -### public struct TokenSettings - -```solidity -struct TokenSettings { - address addr; - string name; - string symbol; -} -``` - -### error TokenNotContract - -Thrown if token address is passed which is not a token. - -```solidity -error TokenNotContract(address token) -``` - -| Input | Type | Description | -| :------ | --------- | ----------------- | -| `token` | `address` | The token address | - -### error TokenNotERC20 - -Thrown if token address is not ERC20. - -```solidity -error TokenNotERC20(address token) -``` - -| Input | Type | Description | -| :------ | --------- | ----------------- | -| `token` | `address` | The token address | - -### error WrongHelpersArrayLength - -Thrown if passed helpers array is of wrong length. - -```solidity -error WrongHelpersArrayLength(uint256 length) -``` - -| Input | Type | Description | -| :------- | --------- | ----------------------------------- | -| `length` | `uint256` | The 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. - -```solidity -constructor(contract GovernanceERC20 _governanceERC20Base, contract GovernanceWrappedERC20 _governanceWrappedERC20Base) public -``` - -| Input | Type | Description | -| :---------------------------- | --------------------------------- | ----------------------------------------------------------------- | -| `_governanceERC20Base` | `contract GovernanceERC20` | The base `GovernanceERC20` contract to create clones from. | -| `_governanceWrappedERC20Base` | `contract GovernanceWrappedERC20` | The base `GovernanceWrappedERC20` contract to create clones from. | - -### external function prepareInstallation - -Prepares the installation of a plugin. - -```solidity -function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the installing DAO. | -| `_data` | `bytes` | The bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file. | -| **Output** | | -| `plugin` | `address` | The address of the `Plugin` contract being prepared for installation. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUninstallation - -Prepares the uninstallation of a plugin. - -```solidity -function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external view returns (struct PermissionLib.MultiTargetPermission[] permissions) -``` - -| Input | Type | Description | -| :------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the uninstalling DAO. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUninstallation`. See above. | -| **Output** | | -| `permissions` | `struct 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. - -```solidity -function implementation() external view virtual returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------------------------- | -| `0` | `address` | The address of the plugin implementation contract. | - -_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ - - diff --git a/docs/osx/03-reference-guide/plugins/governance/multisig/IMultisig.md b/docs/osx/03-reference-guide/plugins/governance/multisig/IMultisig.md deleted file mode 100644 index 53de876d..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/multisig/IMultisig.md +++ /dev/null @@ -1,105 +0,0 @@ -## Description - -An interface for an on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met. - -## Implementation - -### external function addAddresses - -Adds new members to the address list. Previously, it checks if the new address list length would be greater than `type(uint16).max`, the maximal number of approvals. - -```solidity -function addAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ----------------------------------------- | -| `_members` | `address[]` | The addresses of the members to be added. | - -### external function removeAddresses - -Removes existing members from the address list. Previously, it checks if the new address list length is at least as long as the minimum approvals parameter requires. Note that `minApprovals` is must be at least 1 so the address list cannot become empty. - -```solidity -function removeAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ------------------------------------------- | -| `_members` | `address[]` | The addresses of the members to be removed. | - -### external function approve - -Approves and, optionally, executes the proposal. - -```solidity -function approve(uint256 _proposalId, bool _tryExecution) external -``` - -| Input | Type | Description | -| :-------------- | --------- | ------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_tryExecution` | `bool` | If `true`, execution is tried after the approval cast. The call does not revert if execution is not possible. | - -### external function canApprove - -Checks if an account can participate on a proposal vote. This can be because the vote - -- was executed, or -- the voter is not listed. - -```solidity -function canApprove(uint256 _proposalId, address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------------------------------- | -| `_proposalId` | `uint256` | The proposal Id. | -| `_account` | `address` | The address of the user to check. | -| **Output** | | -| `0` | `bool` | Returns true if the account is allowed to vote. | - -_The function assumes the queried proposal exists._ - -### external function canExecute - -Checks if a proposal can be executed. - -```solidity -function canExecute(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal to be checked. | -| **Output** | | -| `0` | `bool` | True if the proposal can be executed, false otherwise. | - -### external function hasApproved - -Returns whether the account has approved the proposal. Note, that this does not check if the account is listed. - -```solidity -function hasApproved(uint256 _proposalId, address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | The account address to be checked. | -| **Output** | | -| `0` | `bool` | The vote option cast by a voter for a certain proposal. | - -### external function execute - -Executes a proposal. - -```solidity -function execute(uint256 _proposalId) external -``` - -| Input | Type | Description | -| :------------ | --------- | -------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/multisig/Multisig.md b/docs/osx/03-reference-guide/plugins/governance/multisig/Multisig.md deleted file mode 100644 index 21a78731..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/multisig/Multisig.md +++ /dev/null @@ -1,449 +0,0 @@ -## Description - -The on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met. - -## Implementation - -### public struct Proposal - -```solidity -struct Proposal { - bool executed; - uint16 approvals; - struct Multisig.ProposalParameters parameters; - mapping(address => bool) approvers; - struct IDAO.Action[] actions; - uint256 allowFailureMap; -} -``` - -### public struct ProposalParameters - -```solidity -struct ProposalParameters { - uint16 minApprovals; - uint64 snapshotBlock; - uint64 startDate; - uint64 endDate; -} -``` - -### public struct MultisigSettings - -```solidity -struct MultisigSettings { - bool onlyListed; - uint16 minApprovals; -} -``` - -### internal variable MULTISIG_INTERFACE_ID - -The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. - -```solidity -bytes4 MULTISIG_INTERFACE_ID -``` - -### public variable UPDATE_MULTISIG_SETTINGS_PERMISSION_ID - -The ID of the permission required to call the `addAddresses` and `removeAddresses` functions. - -```solidity -bytes32 UPDATE_MULTISIG_SETTINGS_PERMISSION_ID -``` - -### internal variable proposals - -A mapping between proposal IDs and proposal information. - -```solidity -mapping(uint256 => struct Multisig.Proposal) proposals -``` - -### public variable multisigSettings - -The current plugin settings. - -```solidity -struct Multisig.MultisigSettings multisigSettings -``` - -### public variable lastMultisigSettingsChange - -Keeps track at which block number the multisig settings have been changed the last time. - -```solidity -uint64 lastMultisigSettingsChange -``` - -_This variable prevents a proposal from being created in the same block in which the multisig settings change._ - -### error ProposalCreationForbidden - -Thrown when a sender is not allowed to create a proposal. - -```solidity -error ProposalCreationForbidden(address sender) -``` - -| Input | Type | Description | -| :------- | --------- | ------------------- | -| `sender` | `address` | The sender address. | - -### error ApprovalCastForbidden - -Thrown if an approver is not allowed to cast an approve. This can be because the proposal - -- is not open, -- was executed, or -- the approver is not on the address list - -```solidity -error ApprovalCastForbidden(uint256 proposalId, address sender) -``` - -| Input | Type | Description | -| :----------- | --------- | -------------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | -| `sender` | `address` | The address of the sender. | - -### error ProposalExecutionForbidden - -Thrown if the proposal execution is forbidden. - -```solidity -error ProposalExecutionForbidden(uint256 proposalId) -``` - -| Input | Type | Description | -| :----------- | --------- | ----------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | - -### error MinApprovalsOutOfBounds - -Thrown if the minimal approvals value is out of bounds (less than 1 or greater than the number of members in the address list). - -```solidity -error MinApprovalsOutOfBounds(uint16 limit, uint16 actual) -``` - -| Input | Type | Description | -| :------- | -------- | ------------------ | -| `limit` | `uint16` | The maximal value. | -| `actual` | `uint16` | The actual value. | - -### error AddresslistLengthOutOfBounds - -Thrown if the address list length is out of bounds. - -```solidity -error AddresslistLengthOutOfBounds(uint16 limit, uint256 actual) -``` - -| Input | Type | Description | -| :------- | --------- | ----------------- | -| `limit` | `uint16` | The limit value. | -| `actual` | `uint256` | The actual value. | - -### error DateOutOfBounds - -Thrown if a date is out of bounds. - -```solidity -error DateOutOfBounds(uint64 limit, uint64 actual) -``` - -| Input | Type | Description | -| :------- | -------- | ----------------- | -| `limit` | `uint64` | The limit value. | -| `actual` | `uint64` | The actual value. | - -### event Approved - -Emitted when a proposal is approve by an approver. - -```solidity -event Approved(uint256 proposalId, address approver) -``` - -| Input | Type | Description | -| :----------- | --------- | --------------------------------- | -| `proposalId` | `uint256` | The ID of the proposal. | -| `approver` | `address` | The approver casting the approve. | - -### event MultisigSettingsUpdated - -Emitted when the plugin settings are set. - -```solidity -event MultisigSettingsUpdated(bool onlyListed, uint16 minApprovals) -``` - -| Input | Type | Description | -| :------------- | -------- | ---------------------------------------------------------- | -| `onlyListed` | `bool` | Whether only listed addresses can create a proposal. | -| `minApprovals` | `uint16` | The minimum amount of approvals needed to pass a proposal. | - -### external function initialize - -Initializes Release 1, Build 2. - -```solidity -function initialize(contract IDAO _dao, address[] _members, struct Multisig.MultisigSettings _multisigSettings) external -``` - -| Input | Type | Description | -| :------------------ | ---------------------------------- | ------------------------------------------------- | -| `_dao` | `contract IDAO` | The IDAO interface of the associated DAO. | -| `_members` | `address[]` | The addresses of the initial members to be added. | -| `_multisigSettings` | `struct Multisig.MultisigSettings` | The multisig settings. | - -_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### external function addAddresses - -Adds new members to the address list. Previously, it checks if the new address list length would be greater than `type(uint16).max`, the maximal number of approvals. - -```solidity -function addAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ----------------------------------------- | -| `_members` | `address[]` | The addresses of the members to be added. | - -### external function removeAddresses - -Removes existing members from the address list. Previously, it checks if the new address list length is at least as long as the minimum approvals parameter requires. Note that `minApprovals` is must be at least 1 so the address list cannot become empty. - -```solidity -function removeAddresses(address[] _members) external -``` - -| Input | Type | Description | -| :--------- | ----------- | ------------------------------------------- | -| `_members` | `address[]` | The addresses of the members to be removed. | - -### external function updateMultisigSettings - -Updates the plugin settings. - -```solidity -function updateMultisigSettings(struct Multisig.MultisigSettings _multisigSettings) external -``` - -| Input | Type | Description | -| :------------------ | ---------------------------------- | ----------------- | -| `_multisigSettings` | `struct Multisig.MultisigSettings` | The new settings. | - -### external function createProposal - -Creates a new multisig proposal. - -```solidity -function createProposal(bytes _metadata, struct IDAO.Action[] _actions, uint256 _allowFailureMap, bool _approveProposal, bool _tryExecution, uint64 _startDate, uint64 _endDate) external returns (uint256 proposalId) -``` - -| Input | Type | Description | -| :----------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_metadata` | `bytes` | The metadata of the proposal. | -| `_actions` | `struct IDAO.Action[]` | The actions that will be executed after the proposal passes. | -| `_allowFailureMap` | `uint256` | A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | -| `_approveProposal` | `bool` | If `true`, the sender will approve the proposal. | -| `_tryExecution` | `bool` | If `true`, execution is tried after the vote cast. The call does not revert if early execution is not possible. | -| `_startDate` | `uint64` | The start date of the proposal. | -| `_endDate` | `uint64` | The end date of the proposal. | -| **Output** | | -| `proposalId` | `uint256` | The ID of the proposal. | - -### public function approve - -Approves and, optionally, executes the proposal. - -```solidity -function approve(uint256 _proposalId, bool _tryExecution) public -``` - -| Input | Type | Description | -| :-------------- | --------- | ------------------------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_tryExecution` | `bool` | If `true`, execution is tried after the approval cast. The call does not revert if execution is not possible. | - -### external function canApprove - -Checks if an account can participate on a proposal vote. This can be because the vote - -- was executed, or -- the voter is not listed. - -```solidity -function canApprove(uint256 _proposalId, address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------------------------------- | -| `_proposalId` | `uint256` | The proposal Id. | -| `_account` | `address` | The address of the user to check. | -| **Output** | | -| `0` | `bool` | Returns true if the account is allowed to vote. | - -_The function assumes the queried proposal exists._ - -### external function canExecute - -Checks if a proposal can be executed. - -```solidity -function canExecute(uint256 _proposalId) external view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------ | -| `_proposalId` | `uint256` | The ID of the proposal to be checked. | -| **Output** | | -| `0` | `bool` | True if the proposal can be executed, false otherwise. | - -### public function getProposal - -Returns all information for a proposal vote by its ID. - -```solidity -function getProposal(uint256 _proposalId) public view returns (bool executed, uint16 approvals, struct Multisig.ProposalParameters parameters, struct IDAO.Action[] actions, uint256 allowFailureMap) -``` - -| Input | Type | Description | -| :---------------- | ------------------------------------ | ------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `executed` | `bool` | Whether the proposal is executed or not. | -| `approvals` | `uint16` | The number of approvals casted. | -| `parameters` | `struct Multisig.ProposalParameters` | The parameters of the proposal vote. | -| `actions` | `struct IDAO.Action[]` | The actions to be executed in the associated DAO after the proposal has passed. | -| `allowFailureMap` | `uint256` | | - -### public function hasApproved - -Returns whether the account has approved the proposal. Note, that this does not check if the account is listed. - -```solidity -function hasApproved(uint256 _proposalId, address _account) public view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | ------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | The account address to be checked. | -| **Output** | | -| `0` | `bool` | The vote option cast by a voter for a certain proposal. | - -### public function execute - -Executes a proposal. - -```solidity -function execute(uint256 _proposalId) public -``` - -| Input | Type | Description | -| :------------ | --------- | -------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal to be executed. | - -### external function isMember - -Checks if an account is a member of the DAO. - -```solidity -function isMember(address _account) external view returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ----------------------------------------- | -| `_account` | `address` | The address of the account to be checked. | -| **Output** | | -| `0` | `bool` | Whether the account is a member or not. | - -_This function must be implemented in the plugin contract that introduces the members to the DAO._ - -### internal function \_execute - -Internal function to execute a vote. It assumes the queried proposal exists. - -```solidity -function _execute(uint256 _proposalId) internal -``` - -| Input | Type | Description | -| :------------ | --------- | ----------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | - -### internal function \_canApprove - -Internal function to check if an account can approve. It assumes the queried proposal exists. - -```solidity -function _canApprove(uint256 _proposalId, address _account) internal view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | -------------------------------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| `_account` | `address` | The account to check. | -| **Output** | | -| `0` | `bool` | Returns `true` if the given account can approve on a certain proposal and `false` otherwise. | - -### internal function \_canExecute - -Internal function to check if a proposal can be executed. It assumes the queried proposal exists. - -```solidity -function _canExecute(uint256 _proposalId) internal view returns (bool) -``` - -| Input | Type | Description | -| :------------ | --------- | --------------------------------------------------------------------- | -| `_proposalId` | `uint256` | The ID of the proposal. | -| **Output** | | -| `0` | `bool` | Returns `true` if the proposal can be executed and `false` otherwise. | - -### internal function \_isProposalOpen - -Internal function to check if a proposal vote is still open. - -```solidity -function _isProposalOpen(struct Multisig.Proposal proposal_) internal view returns (bool) -``` - -| Input | Type | Description | -| :---------- | -------------------------- | --------------------------------------------------- | -| `proposal_` | `struct Multisig.Proposal` | The proposal struct. | -| **Output** | | -| `0` | `bool` | True if the proposal vote is open, false otherwise. | - -### internal function \_updateMultisigSettings - -Internal function to update the plugin settings. - -```solidity -function _updateMultisigSettings(struct Multisig.MultisigSettings _multisigSettings) internal -``` - -| Input | Type | Description | -| :------------------ | ---------------------------------- | ----------------- | -| `_multisigSettings` | `struct Multisig.MultisigSettings` | The new settings. | - - diff --git a/docs/osx/03-reference-guide/plugins/governance/multisig/MultisigSetup.md b/docs/osx/03-reference-guide/plugins/governance/multisig/MultisigSetup.md deleted file mode 100644 index ebaa0ea1..00000000 --- a/docs/osx/03-reference-guide/plugins/governance/multisig/MultisigSetup.md +++ /dev/null @@ -1,66 +0,0 @@ -## Description - -The setup contract of the `Multisig` plugin. - -## Implementation - -### public function constructor - -The contract constructor, that deploys the `Multisig` plugin logic contract. - -```solidity -constructor() public -``` - -### external function prepareInstallation - -Prepares the installation of a plugin. - -```solidity -function prepareInstallation(address _dao, bytes _data) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -| Input | Type | Description | -| :------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the installing DAO. | -| `_data` | `bytes` | The bytes-encoded data containing the input parameters for the installation as specified in the plugin's build metadata JSON file. | -| **Output** | | -| `plugin` | `address` | The address of the `Plugin` contract being prepared for installation. | -| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | - -### external function prepareUpdate - -```solidity -function prepareUpdate(address _dao, uint16 _currentBuild, struct IPluginSetup.SetupPayload _payload) external pure returns (bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData) -``` - -### external function prepareUninstallation - -Prepares the uninstallation of a plugin. - -```solidity -function prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) external view returns (struct PermissionLib.MultiTargetPermission[] permissions) -``` - -| Input | Type | Description | -| :------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `_dao` | `address` | The address of the uninstalling DAO. | -| `_payload` | `struct IPluginSetup.SetupPayload` | The relevant data necessary for the `prepareUninstallation`. See above. | -| **Output** | | -| `permissions` | `struct 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. - -```solidity -function implementation() external view returns (address) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------------------------- | -| `0` | `address` | The address of the plugin implementation contract. | - -_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ - - diff --git a/docs/osx/03-reference-guide/plugins/utils/Addresslist.md b/docs/osx/03-reference-guide/plugins/utils/Addresslist.md deleted file mode 100644 index 4a79aa71..00000000 --- a/docs/osx/03-reference-guide/plugins/utils/Addresslist.md +++ /dev/null @@ -1,100 +0,0 @@ -## Description - -The majority voting implementation using a list of member addresses. - -This contract inherits from `MajorityVotingBase` and implements the `IMajorityVoting` interface. - -## Implementation - -### error InvalidAddresslistUpdate - -Thrown when the address list update is invalid, which can be caused by the addition of an existing member or removal of a non-existing member. - -```solidity -error InvalidAddresslistUpdate(address member) -``` - -| Input | Type | Description | -| :------- | --------- | ----------------------------------------------------- | -| `member` | `address` | The array of member addresses to be added or removed. | - -### public function isListedAtBlock - -Checks if an account is on the address list at a specific block number. - -```solidity -function isListedAtBlock(address _account, uint256 _blockNumber) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | --------- | ------------------------------------------------------------ | -| `_account` | `address` | The account address being checked. | -| `_blockNumber` | `uint256` | The block number. | -| **Output** | | -| `0` | `bool` | Whether the account is listed at the specified block number. | - -### public function isListed - -Checks if an account is currently on the address list. - -```solidity -function isListed(address _account) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :--------- | --------- | ---------------------------------------- | -| `_account` | `address` | The account address being checked. | -| **Output** | | -| `0` | `bool` | Whether the account is currently listed. | - -### public function addresslistLengthAtBlock - -Returns the length of the address list at a specific block number. - -```solidity -function addresslistLengthAtBlock(uint256 _blockNumber) public view virtual returns (uint256) -``` - -| Input | Type | Description | -| :------------- | --------- | ----------------------------------------------------------------------------------------------- | -| `_blockNumber` | `uint256` | The specific block to get the count from. If `0`, then the latest checkpoint value is returned. | -| **Output** | | -| `0` | `uint256` | The address list length at the specified block number. | - -### public function addresslistLength - -Returns the current length of the address list. - -```solidity -function addresslistLength() public view virtual returns (uint256) -``` - -| Output | Type | Description | -| ------ | --------- | -------------------------------- | -| `0` | `uint256` | The current address list length. | - -### internal function \_addAddresses - -Internal function to add new addresses to the address list. - -```solidity -function _addAddresses(address[] _newAddresses) internal virtual -``` - -| Input | Type | Description | -| :-------------- | ----------- | ------------------------------ | -| `_newAddresses` | `address[]` | The new addresses to be added. | - -### internal function \_removeAddresses - -Internal function to remove existing addresses from the address list. - -```solidity -function _removeAddresses(address[] _exitingAddresses) internal virtual -``` - -| Input | Type | Description | -| :------------------ | ----------- | ------------------------------------- | -| `_exitingAddresses` | `address[]` | The existing addresses to be removed. | - - diff --git a/docs/osx/03-reference-guide/plugins/utils/Ratio.md b/docs/osx/03-reference-guide/plugins/utils/Ratio.md deleted file mode 100644 index 16752cd5..00000000 --- a/docs/osx/03-reference-guide/plugins/utils/Ratio.md +++ /dev/null @@ -1,33 +0,0 @@ -### internal variable RATIO_BASE - -```solidity -uint256 RATIO_BASE -``` - -### error RatioOutOfBounds - -Thrown if a ratio value exceeds the maximal value of `10**6`. - -```solidity -error RatioOutOfBounds(uint256 limit, uint256 actual) -``` - -| Input | Type | Description | -| :------- | --------- | ------------------ | -| `limit` | `uint256` | The maximal value. | -| `actual` | `uint256` | The actual value. | - -### internal function \_applyRatioCeiled - -Applies a ratio to a value and ceils the remainder. - -```solidity -function _applyRatioCeiled(uint256 _value, uint256 _ratio) internal pure returns (uint256 result) -``` - -| Input | Type | Description | -| :--------- | --------- | ---------------------------------------------------- | -| `_value` | `uint256` | The value to which the ratio is applied. | -| `_ratio` | `uint256` | The ratio that must be in the interval `[0, 10**6]`. | -| **Output** | | -| `result` | `uint256` | The resulting value. | diff --git a/docs/osx/03-reference-guide/token/ERC20/IERC20MintableUpgradeable.md b/docs/osx/03-reference-guide/token/ERC20/IERC20MintableUpgradeable.md deleted file mode 100644 index 783ffd70..00000000 --- a/docs/osx/03-reference-guide/token/ERC20/IERC20MintableUpgradeable.md +++ /dev/null @@ -1,20 +0,0 @@ -## Description - -Interface to allow minting of [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens. - -## Implementation - -### external function mint - -Mints [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens for a receiving address. - -```solidity -function mint(address _to, uint256 _amount) external -``` - -| Input | Type | Description | -| :-------- | --------- | ---------------------- | -| `_to` | `address` | The receiving address. | -| `_amount` | `uint256` | The amount of tokens. | - - diff --git a/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceERC20.md b/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceERC20.md deleted file mode 100644 index 1916d0d1..00000000 --- a/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceERC20.md +++ /dev/null @@ -1,104 +0,0 @@ -## Description - -An [OpenZeppelin `Votes`](https://docs.openzeppelin.com/contracts/4.x/api/governance#Votes) compatible [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token that can be used for voting and is managed by a DAO. - -## Implementation - -### public variable MINT_PERMISSION_ID - -The permission identifier to mint new tokens - -```solidity -bytes32 MINT_PERMISSION_ID -``` - -### public struct MintSettings - -```solidity -struct MintSettings { - address[] receivers; - uint256[] amounts; -} -``` - -### error MintSettingsArrayLengthMismatch - -Thrown if the number of receivers and amounts specified in the mint settings do not match. - -```solidity -error MintSettingsArrayLengthMismatch(uint256 receiversArrayLength, uint256 amountsArrayLength) -``` - -| Input | Type | Description | -| :--------------------- | --------- | ------------------------------------ | -| `receiversArrayLength` | `uint256` | The length of the `receivers` array. | -| `amountsArrayLength` | `uint256` | The length of the `amounts` array. | - -### public function constructor - -Calls the initialize function. - -```solidity -constructor(contract IDAO _dao, string _name, string _symbol, struct GovernanceERC20.MintSettings _mintSettings) public -``` - -| Input | Type | Description | -| :-------------- | ------------------------------------- | ----------------------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | The managing DAO. | -| `_name` | `string` | The name of the [ERC-20](https://eips.ethereum.org/EIPS/eip-20) governance token. | -| `_symbol` | `string` | The symbol of the [ERC-20](https://eips.ethereum.org/EIPS/eip-20) governance token. | -| `_mintSettings` | `struct GovernanceERC20.MintSettings` | The token mint settings struct containing the `receivers` and `amounts`. | - -### public function initialize - -Initializes the contract and mints tokens to a list of receivers. - -```solidity -function initialize(contract IDAO _dao, string _name, string _symbol, struct GovernanceERC20.MintSettings _mintSettings) public -``` - -| Input | Type | Description | -| :-------------- | ------------------------------------- | ----------------------------------------------------------------------------------- | -| `_dao` | `contract IDAO` | The managing DAO. | -| `_name` | `string` | The name of the [ERC-20](https://eips.ethereum.org/EIPS/eip-20) governance token. | -| `_symbol` | `string` | The symbol of the [ERC-20](https://eips.ethereum.org/EIPS/eip-20) governance token. | -| `_mintSettings` | `struct GovernanceERC20.MintSettings` | The token mint settings struct containing the `receivers` and `amounts`. | - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### external function mint - -Mints tokens to an address. - -```solidity -function mint(address to, uint256 amount) external -``` - -| Input | Type | Description | -| :------- | --------- | ---------------------------------- | -| `to` | `address` | The address receiving the tokens. | -| `amount` | `uint256` | The amount of tokens to be minted. | - -### internal function \_afterTokenTransfer - -```solidity -function _afterTokenTransfer(address from, address to, uint256 amount) internal -``` - -\*Move voting power when tokens are transferred. - -Emits a {IVotes-DelegateVotesChanged} event.\* - - diff --git a/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceWrappedERC20.md b/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceWrappedERC20.md deleted file mode 100644 index 89b17bfa..00000000 --- a/docs/osx/03-reference-guide/token/ERC20/governance/GovernanceWrappedERC20.md +++ /dev/null @@ -1,116 +0,0 @@ -## Description - -Wraps an existing [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token by inheriting from `ERC20WrapperUpgradeable` and allows to use it for voting by inheriting from `ERC20VotesUpgradeable`. The latter is compatible with [OpenZeppelin's `Votes`](https://docs.openzeppelin.com/contracts/4.x/api/governance#Votes) interface. -The contract also supports meta transactions. To use an `amount` of underlying tokens for voting, the token owner has to - -1. call `approve` for the tokens to be used by this contract -2. call `depositFor` to wrap them, which safely transfers the underlying [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens to the contract and mints wrapped [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens. - To get the [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens back, the owner of the wrapped tokens can call `withdrawFor`, which burns the wrapped [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens and safely transfers the underlying tokens back to the owner. - -This contract intentionally has no public mint functionality because this is the responsibility of the underlying [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token contract. - -## Implementation - -### public function constructor - -Calls the initialize function. - -```solidity -constructor(contract IERC20Upgradeable _token, string _name, string _symbol) public -``` - -| Input | Type | Description | -| :-------- | ---------------------------- | --------------------------------------------------------------------- | -| `_token` | `contract IERC20Upgradeable` | The underlying [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token. | -| `_name` | `string` | The name of the wrapped token. | -| `_symbol` | `string` | The symbol of the wrapped token. | - -### public function initialize - -Initializes the contract. - -```solidity -function initialize(contract IERC20Upgradeable _token, string _name, string _symbol) public -``` - -| Input | Type | Description | -| :-------- | ---------------------------- | --------------------------------------------------------------------- | -| `_token` | `contract IERC20Upgradeable` | The underlying [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token. | -| `_name` | `string` | The name of the wrapped token. | -| `_symbol` | `string` | The symbol of the wrapped token. | - -### public function supportsInterface - -Checks if this or the parent contract supports an interface by its ID. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -| :------------- | -------- | --------------------------------------------- | -| `_interfaceId` | `bytes4` | The ID of the interface. | -| **Output** | | -| `0` | `bool` | Returns `true` if the interface is supported. | - -### public function decimals - -```solidity -function decimals() public view returns (uint8) -``` - -_Uses the `decimals` of the underlying [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token._ - -### public function depositFor - -Deposits an amount of underlying token and mints the corresponding number of wrapped tokens for a receiving address. - -```solidity -function depositFor(address account, uint256 amount) public returns (bool) -``` - -| Input | Type | Description | -| :-------- | --------- | ------------------------------------------------- | -| `account` | `address` | The address receiving the minted, wrapped tokens. | -| `amount` | `uint256` | The amount of tokens to deposit. | - -### public function withdrawTo - -Withdraws an amount of underlying tokens to a receiving address and burns the corresponding number of wrapped tokens. - -```solidity -function withdrawTo(address account, uint256 amount) public returns (bool) -``` - -| Input | Type | Description | -| :-------- | --------- | ------------------------------------------------------- | -| `account` | `address` | The address receiving the withdrawn, underlying tokens. | -| `amount` | `uint256` | The amount of underlying tokens to withdraw. | - -### internal function \_afterTokenTransfer - -```solidity -function _afterTokenTransfer(address from, address to, uint256 amount) internal -``` - -\*Move voting power when tokens are transferred. - -Emits a {IVotes-DelegateVotesChanged} event.\* - -### internal function \_mint - -```solidity -function _mint(address to, uint256 amount) internal -``` - -_Snapshots the totalSupply after it has been increased._ - -### internal function \_burn - -```solidity -function _burn(address account, uint256 amount) internal -``` - -_Snapshots the totalSupply after it has been decreased._ - - diff --git a/docs/osx/03-reference-guide/token/ERC20/governance/IGovernanceWrappedERC20.md b/docs/osx/03-reference-guide/token/ERC20/governance/IGovernanceWrappedERC20.md deleted file mode 100644 index f1a14aa3..00000000 --- a/docs/osx/03-reference-guide/token/ERC20/governance/IGovernanceWrappedERC20.md +++ /dev/null @@ -1,33 +0,0 @@ -## Description - -An interface for the token wrapping contract wrapping existing [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens. - -## Implementation - -### external function depositFor - -Deposits an amount of underlying token and mints the corresponding number of wrapped tokens for a receiving address. - -```solidity -function depositFor(address account, uint256 amount) external returns (bool) -``` - -| Input | Type | Description | -| :-------- | --------- | ------------------------------------------------- | -| `account` | `address` | The address receiving the minted, wrapped tokens. | -| `amount` | `uint256` | The amount of tokens to deposit. | - -### external function withdrawTo - -Withdraws an amount of underlying tokens to a receiving address and burns the corresponding number of wrapped tokens. - -```solidity -function withdrawTo(address account, uint256 amount) external returns (bool) -``` - -| Input | Type | Description | -| :-------- | --------- | ------------------------------------------------------- | -| `account` | `address` | The address receiving the withdrawn, underlying tokens. | -| `amount` | `uint256` | The amount of underlying tokens to withdraw. | - - diff --git a/docs/osx/03-reference-guide/utils/Proxy.md b/docs/osx/03-reference-guide/utils/Proxy.md deleted file mode 100644 index b77fb781..00000000 --- a/docs/osx/03-reference-guide/utils/Proxy.md +++ /dev/null @@ -1,16 +0,0 @@ -### internal function createERC1967Proxy - -Free function to create a [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy contract based on the passed base contract address. - -```solidity -function createERC1967Proxy(address _logic, bytes _data) internal returns (address) -``` - -| Input | Type | Description | -| :--------- | --------- | -------------------------------------------- | -| `_logic` | `address` | The base contract address. | -| `_data` | `bytes` | The constructor arguments for this contract. | -| **Output** | | -| `0` | `address` | The address of the proxy contract created. | - -_Initializes the upgradeable proxy with an initial implementation specified by \_logic. If \_data is non-empty, it’s used as data in a delegate call to \_logic. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor (see [OpenZeppelin ERC1967Proxy-constructor](https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Proxy-constructor-address-bytes-))._ diff --git a/docs/osx/03-reference-guide/utils/UncheckedMath.md b/docs/osx/03-reference-guide/utils/UncheckedMath.md deleted file mode 100644 index 991e3537..00000000 --- a/docs/osx/03-reference-guide/utils/UncheckedMath.md +++ /dev/null @@ -1,43 +0,0 @@ -### internal function \_uncheckedIncrement - -Increments an unsigned integer by one without checking the result for overflow errors (using safe math). - -```solidity -function _uncheckedIncrement(uint256 i) internal pure returns (uint256) -``` - -| Input | Type | Description | -| :--------- | --------- | ------------------------------ | -| `i` | `uint256` | The number to be incremented. | -| **Output** | | -| `0` | `uint256` | The number incremented by one. | - -### internal function \_uncheckedAdd - -Adds two unsigned integers without checking the result for overflow errors (using safe math). - -```solidity -function _uncheckedAdd(uint256 a, uint256 b) internal pure returns (uint256) -``` - -| Input | Type | Description | -| :--------- | --------- | ------------------- | -| `a` | `uint256` | The first summand. | -| `b` | `uint256` | The second summand. | -| **Output** | | -| `0` | `uint256` | The sum. | - -### internal function \_uncheckedSub - -Subtracts two unsigned integers without checking the result for overflow errors (using safe math). - -```solidity -function _uncheckedSub(uint256 a, uint256 b) internal pure returns (uint256) -``` - -| Input | Type | Description | -| :--------- | --------- | --------------- | -| `a` | `uint256` | The minuend. | -| `b` | `uint256` | The subtrahend. | -| **Output** | | -| `0` | `uint256` | The difference. | diff --git a/docs/osx/03-reference-guide/utils/protocol/IProtocolVersion.md b/docs/osx/03-reference-guide/utils/protocol/IProtocolVersion.md deleted file mode 100644 index d06628d3..00000000 --- a/docs/osx/03-reference-guide/utils/protocol/IProtocolVersion.md +++ /dev/null @@ -1,21 +0,0 @@ -## Description - -An interface defining the semantic Aragon OSx protocol version number. - -## Implementation - -### external function protocolVersion - -Returns the semantic Aragon OSx protocol version number that the implementing contract is associated with. - -```solidity -function protocolVersion() external view returns (uint8[3] _version) -``` - -| Output | Type | Description | -| ---------- | ---------- | -------------------------------------------------------- | -| `_version` | `uint8[3]` | Returns the semantic Aragon OSx protocol version number. | - -_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._ - - diff --git a/docs/osx/03-reference-guide/utils/protocol/ProtocolVersion.md b/docs/osx/03-reference-guide/utils/protocol/ProtocolVersion.md deleted file mode 100644 index afc6b3c1..00000000 --- a/docs/osx/03-reference-guide/utils/protocol/ProtocolVersion.md +++ /dev/null @@ -1,23 +0,0 @@ -## Description - -An abstract, stateless, non-upgradeable contract providing the current Aragon OSx protocol version number. - -Do not add any new variables to this contract that would shift down storage in the inheritance chain. - -## Implementation - -### public function protocolVersion - -Returns the semantic Aragon OSx protocol version number that the implementing contract is associated with. - -```solidity -function protocolVersion() public pure returns (uint8[3]) -``` - -| Output | Type | Description | -| ------ | ---------- | ----------- | -| `0` | `uint8[3]` | | - -_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._ - - diff --git a/docs/osx/03-reference-guide/utils/protocol/VersionComparisonLib.md b/docs/osx/03-reference-guide/utils/protocol/VersionComparisonLib.md deleted file mode 100644 index 7e8943de..00000000 --- a/docs/osx/03-reference-guide/utils/protocol/VersionComparisonLib.md +++ /dev/null @@ -1,95 +0,0 @@ -## Description - -## Implementation - -### internal function eq - -Equality comparator for two semantic version numbers. - -```solidity -function eq(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | -------------------------------------------- | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the two numbers are equal or not. | - -### internal function neq - -Inequality comparator for two semantic version numbers. - -```solidity -function neq(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | -------------------------------------------- | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the two numbers are inequal or not. | - -### internal function lt - -Less than comparator for two semantic version numbers. - -```solidity -function lt(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | --------------------------------------------------------------- | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the first number is less than the second number or not. | - -### internal function lte - -Less than or equal to comparator for two semantic version numbers. - -```solidity -function lte(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | --------------------------------------------------------------------------- | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the first number is less than or equal to the second number or not. | - -### internal function gt - -Greater than comparator for two semantic version numbers. - -```solidity -function gt(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | ------------------------------------------------------------------ | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the first number is greater than the second number or not. | - -### internal function gte - -Greater than or equal to comparator for two semantic version numbers. - -```solidity -function gte(uint8[3] lhs, uint8[3] rhs) internal pure returns (bool) -``` - -| Input | Type | Description | -| :--------- | ---------- | ------------------------------------------------------------------------------ | -| `lhs` | `uint8[3]` | The left-hand side semantic version number. | -| `rhs` | `uint8[3]` | The right-hand side semantic version number. | -| **Output** | | -| `0` | `bool` | Whether the first number is greater than or equal to the second number or not. | - -