From 3212c08bc26756ffc1d31829c4033252b6744c8f Mon Sep 17 00:00:00 2001 From: Michael Heuer <20623991+Michael-A-Heuer@users.noreply.github.com> Date: Mon, 24 Oct 2022 18:10:36 +0200 Subject: [PATCH] Update master (#20) * Update core docs by commit b956631 (#19) Co-authored-by: Michael-A-Heuer * Update core docs by commit cfcaad4 (#21) Co-authored-by: mathewmeconry Co-authored-by: Mathias Scherer Co-authored-by: Aragon One Autobot <60001447+arabot-1@users.noreply.github.com> Co-authored-by: Michael-A-Heuer Co-authored-by: mathewmeconry --- .../core/component/Component.md | 46 ---- .../core/component/DAOPermissioned.md | 57 ----- .../core/component/DaoAuthorizable.md | 58 ----- .../core/component/MetaTxComponent.md | 69 ----- .../core/erc1271/ERC1271.md | 36 --- .../core/erc165/AdaptiveERC165.md | 120 --------- .../03-reference-guide/core/erc165/ERC165.md | 26 -- .../core/permission/BulkPermissionsLib.md | 39 --- .../03-reference-guide/core/plugin/IPlugin.md | 22 ++ .../03-reference-guide/core/plugin/Plugin.md | 40 +++ .../core/plugin/PluginCloneable.md | 40 +++ .../core/plugin/PluginUUPSUpgradeable.md | 78 ++++++ .../plugin/PluginConstants.md | 16 -- .../plugin/PluginFactoryBase.md | 61 ----- .../plugin/PluginManager.md | 237 ------------------ .../examples/count/CounterV1PluginManager.md | 87 ------- .../examples/count/CounterV2PluginManager.md | 136 ---------- .../registry/AragonPluginRegistry.md | 52 ---- .../03-reference-guide/utils/AppStorage.md | 40 --- .../utils/PluginERC1967Proxy.md | 23 -- .../03-reference-guide/utils/UUPSProxy.md | 13 - 21 files changed, 180 insertions(+), 1116 deletions(-) delete mode 100644 docs/core/03-reference-guide/core/component/Component.md delete mode 100644 docs/core/03-reference-guide/core/component/DAOPermissioned.md delete mode 100644 docs/core/03-reference-guide/core/component/DaoAuthorizable.md delete mode 100644 docs/core/03-reference-guide/core/component/MetaTxComponent.md delete mode 100644 docs/core/03-reference-guide/core/erc1271/ERC1271.md delete mode 100644 docs/core/03-reference-guide/core/erc165/AdaptiveERC165.md delete mode 100644 docs/core/03-reference-guide/core/erc165/ERC165.md delete mode 100644 docs/core/03-reference-guide/core/permission/BulkPermissionsLib.md create mode 100644 docs/core/03-reference-guide/core/plugin/IPlugin.md create mode 100644 docs/core/03-reference-guide/core/plugin/Plugin.md create mode 100644 docs/core/03-reference-guide/core/plugin/PluginCloneable.md create mode 100644 docs/core/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md delete mode 100644 docs/core/03-reference-guide/plugin/PluginConstants.md delete mode 100644 docs/core/03-reference-guide/plugin/PluginFactoryBase.md delete mode 100644 docs/core/03-reference-guide/plugin/PluginManager.md delete mode 100644 docs/core/03-reference-guide/plugin/examples/count/CounterV1PluginManager.md delete mode 100644 docs/core/03-reference-guide/plugin/examples/count/CounterV2PluginManager.md delete mode 100644 docs/core/03-reference-guide/registry/AragonPluginRegistry.md delete mode 100644 docs/core/03-reference-guide/utils/AppStorage.md delete mode 100644 docs/core/03-reference-guide/utils/PluginERC1967Proxy.md delete mode 100644 docs/core/03-reference-guide/utils/UUPSProxy.md diff --git a/docs/core/03-reference-guide/core/component/Component.md b/docs/core/03-reference-guide/core/component/Component.md deleted file mode 100644 index df78ba09..00000000 --- a/docs/core/03-reference-guide/core/component/Component.md +++ /dev/null @@ -1,46 +0,0 @@ -## Aragon Core - -### contract `Component` - -The base component in the Aragon App DAO framework. - -#### public variable `UPGRADE_PERMISSION_ID` - -The ID of the permission required to call the `_authorizeUpgrade` function. - -```solidity -bytes32 UPGRADE_PERMISSION_ID -``` - -#### internal function `__Component_init` - -Initializes the DAO by storing the associated DAO and registering the contract's [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID. - -```solidity -function __Component_init(contract IDAO _dao) internal virtual -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | contract IDAO | The associated DAO address. | - -*This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822).* - -#### internal function `_authorizeUpgrade` - -Internal method authorizing the upgrade of the contract via the [upgradeabilty 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_PERMISSION_ID` permission.* - -#### external function `fallback` - -```solidity -fallback() external -``` - -*Fallback to handle future versions of the [ERC-165](https://eips.ethereum.org/EIPS/eip-165) standard.* - diff --git a/docs/core/03-reference-guide/core/component/DAOPermissioned.md b/docs/core/03-reference-guide/core/component/DAOPermissioned.md deleted file mode 100644 index ecee1f45..00000000 --- a/docs/core/03-reference-guide/core/component/DAOPermissioned.md +++ /dev/null @@ -1,57 +0,0 @@ -## Aragon Core - -### contract `DAOPermissioned` - -An abstract contract providing a meta transaction compatible modifier to make functions permissioned through an associated DAO. -This contract provides an `auth` modifier that can be applied to functions in inheriting contracts. The permission to call these functions is managed by the associated DAO. - -_Make sure to call `__DAOPermissioned_init` during initialization of the inheriting contract. -This contract is compatible with meta transactions through OZ's `ContextUpgradeable`._ - -#### internal variable `dao` - -The associated DAO managing the permissions of inheriting contracts. - -```solidity -contract IDAO dao -``` - -#### error `DAOPermissionMissing` - -Thrown if a permission is missing. - -```solidity -error DAOPermissionMissing(address dao, address here, address where, address who, bytes32 permissionID) -``` - -| Input | Type | Description | -| :----------- | ------- | ----------------------------------------------------- | -| dao | address | The associated DAO. | -| here | address | The context in which the authorization reverted. | -| where | address | The contract requiring the permission. | -| who | address | The address (EOA or contract) missing the permission. | -| permissionID | bytes32 | The permission identifier. | - -#### internal function `__DAOPermissioned_init` - -Initializes the contract by setting the associated DAO. - -```solidity -function __DAOPermissioned_init(contract IDAO _dao) internal virtual -``` - -| Input | Type | Description | -| :---- | ------------- | --------------------------- | -| \_dao | contract IDAO | The associated DAO address. | - -#### internal modifier `auth` - -A modifier to be used to check permissions on a target contract via the associated DAO. - -```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/core/03-reference-guide/core/component/DaoAuthorizable.md b/docs/core/03-reference-guide/core/component/DaoAuthorizable.md deleted file mode 100644 index 0a69e0fc..00000000 --- a/docs/core/03-reference-guide/core/component/DaoAuthorizable.md +++ /dev/null @@ -1,58 +0,0 @@ -## Aragon Core - -### contract `DaoAuthorizable` - -An abstract contract providing a meta transaction compatible modifier to authorize function calls through an associated DAO. -This contract provides an `auth` modifier that can be applied to functions in inheriting contracts. The permission to call these functions is managed by the associated DAO. - -*Make sure to call `__DaoAuthorizable_init` during initialization of the inheriting contract. - This contract is compatible with meta transactions through OZ's `ContextUpgradable`.* - -#### internal variable `dao` - -The associated DAO managing the permissions of inheriting contracts. - -```solidity -contract IDAO dao -``` - -#### error `DaoUnauthorized` - -Thrown if a call is unauthorized in the associated DAO. - -```solidity -error DaoUnauthorized(address dao, address here, address where, address who, bytes32 permissionId) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| dao | address | The associated DAO. | -| here | address | The context in which the authorization reverted. | -| where | address | The contract requiring the permission. | -| who | address | The address (EOA or contract) missing the permission. | -| permissionId | bytes32 | The permission identifier. | - -#### internal function `__DaoAuthorizable_init` - -Initializes the contract by setting the associated DAO. - -```solidity -function __DaoAuthorizable_init(contract IDAO _dao) internal virtual -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | contract IDAO | The associated DAO address. | - -#### internal modifier `auth` - -A modifier to be used to check permissions on a target contract via the associated DAO. - -```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/core/03-reference-guide/core/component/MetaTxComponent.md b/docs/core/03-reference-guide/core/component/MetaTxComponent.md deleted file mode 100644 index 214b40c0..00000000 --- a/docs/core/03-reference-guide/core/component/MetaTxComponent.md +++ /dev/null @@ -1,69 +0,0 @@ -## Aragon Core - -### contract `MetaTxComponent` - -Specialized base component in the Aragon App DAO framework supporting meta transactions. - -#### public variable `SET_TRUSTED_FORWARDER_PERMISSION_ID` - -The ID of the permission required to call the `setTrustedForwarder` function. - -```solidity -bytes32 SET_TRUSTED_FORWARDER_PERMISSION_ID -``` - -#### event `TrustedForwarderSet` - -Emitted when the trusted forwarder is set. - -```solidity -event TrustedForwarderSet(address trustedForwarder) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| trustedForwarder | address | The trusted forwarder address. | - -#### internal function `__MetaTxComponent_init` - -Initializes the contract by initializing the underlying `Component`, registering the contract's [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and setting the trusted forwarder. - -```solidity -function __MetaTxComponent_init(contract IDAO _dao, address _trustedForwarder) internal virtual -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | contract IDAO | The associated DAO address. | -| _trustedForwarder | address | The address of the trusted forwarder verifying the meta transactions. | - -*This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822).* - -#### internal function `_msgSender` - -Overrides '_msgSender()' from 'Component'->'ContextUpgradeable' with that of 'BaseRelayRecipient'. - -```solidity -function _msgSender() internal view returns (address) -``` - -#### internal function `_msgData` - -Overrides '_msgData()' from 'Component'->'ContextUpgradeable' with that of 'BaseRelayRecipient'. - -```solidity -function _msgData() internal view returns (bytes) -``` - -#### public function `setTrustedForwarder` - -Setter for the trusted forwarder verifying the meta transaction. - -```solidity -function setTrustedForwarder(address _trustedForwarder) public virtual -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _trustedForwarder | address | The trusted forwarder address. | - diff --git a/docs/core/03-reference-guide/core/erc1271/ERC1271.md b/docs/core/03-reference-guide/core/erc1271/ERC1271.md deleted file mode 100644 index 7214105b..00000000 --- a/docs/core/03-reference-guide/core/erc1271/ERC1271.md +++ /dev/null @@ -1,36 +0,0 @@ -## Aragon Core - -### contract `ERC1271` - -Abstract base class for the - -*see https://eips.ethereum.org/EIPS/eip-1271* - -#### internal variable `MAGICVALUE` - -The magic value being returned if the signature is valid (obtained from `bytes4(keccak256("isValidSignature(bytes32,bytes)")`) - -```solidity -bytes4 MAGICVALUE -``` - -#### external function `isValidSignature` - -Checks whether a signature is valid for the provided data. - -```solidity -function isValidSignature(bytes32 _hash, bytes _signature) external view virtual returns (bytes4 magicValue) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _hash | bytes32 | The keccak256 hash of arbitrary length data signed on the behalf of address(this). | -| _signature | bytes | Signature byte array associated with `_data`. | -| **Output** | | -| magicValue | bytes4 | Returns the `bytes4` magic value `0x1626ba7e` if the signature is valid. | - -*According to [EIP-1271](https://eips.ethereum.org/EIPS/eip-1271) it -MUST return the bytes4 magic value 0x1626ba7e when function passes, -MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5), and -MUST allow external calls.* - diff --git a/docs/core/03-reference-guide/core/erc165/AdaptiveERC165.md b/docs/core/03-reference-guide/core/erc165/AdaptiveERC165.md deleted file mode 100644 index c27366b8..00000000 --- a/docs/core/03-reference-guide/core/erc165/AdaptiveERC165.md +++ /dev/null @@ -1,120 +0,0 @@ -## Aragon Core - -### contract `AdaptiveERC165` - -#### internal variable `standardSupported` - -ERC165 interface ID -> whether it is supported - -```solidity -mapping(bytes4 => bool) standardSupported -``` - -#### internal variable `callbackMagicNumbers` - -Callback function signature -> magic number to return - -```solidity -mapping(bytes4 => bytes32) callbackMagicNumbers -``` - -#### internal variable `UNREGISTERED_CALLBACK` - -```solidity -bytes32 UNREGISTERED_CALLBACK -``` - -#### error `AdapERC165UnkownCallback` - -```solidity -error AdapERC165UnkownCallback(bytes32 magicNumber) -``` - -#### event `StandardRegistered` - -Emmitted when a new standard is registred and assigned to `interfaceId` - -```solidity -event StandardRegistered(bytes4 interfaceId) -``` - -#### event `CallbackRegistered` - -Emmitted when a callback is registered - -```solidity -event CallbackRegistered(bytes4 sig, bytes4 magicNumber) -``` - -#### event `CallbackReceived` - -Emmitted when a callback is received - -```solidity -event CallbackReceived(bytes4 sig, bytes data) -``` - -#### public function `supportsInterface` - -Checks if the contract supports a specific interface or not - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _interfaceId | bytes4 | The identifier of the interface to check for | - -#### internal function `_handleCallback` - -Handles callbacks to support future versions of the ERC165 or similar without upgrading the contracts. - -```solidity -function _handleCallback(bytes4 _sig, bytes _data) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _sig | bytes4 | The function signature of the called method (msg.sig) | -| _data | bytes | The data resp. arguments passed to the method | - -#### internal function `_registerStandardAndCallback` - -Registers a standard and also callback - -```solidity -function _registerStandardAndCallback(bytes4 _interfaceId, bytes4 _callbackSig, bytes4 _magicNumber) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _interfaceId | bytes4 | The identifier of the interface to check for | -| _callbackSig | bytes4 | The function signature of the called method (msg.sig) | -| _magicNumber | bytes4 | The magic number to be registered for the function signature | - -#### internal function `_registerStandard` - -Registers a standard resp. interface type - -```solidity -function _registerStandard(bytes4 _interfaceId) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _interfaceId | bytes4 | The identifier of the interface to check for | - -#### internal function `_registerCallback` - -Registers a callback - -```solidity -function _registerCallback(bytes4 _callbackSig, bytes4 _magicNumber) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _callbackSig | bytes4 | The function signature of the called method (msg.sig) | -| _magicNumber | bytes4 | The magic number to be registered for the function signature | - diff --git a/docs/core/03-reference-guide/core/erc165/ERC165.md b/docs/core/03-reference-guide/core/erc165/ERC165.md deleted file mode 100644 index 9be6ec2d..00000000 --- a/docs/core/03-reference-guide/core/erc165/ERC165.md +++ /dev/null @@ -1,26 +0,0 @@ -## Aragon Core - -### contract `ERC165` - -#### internal variable `ERC165_INTERFACE_ID` - -The interface ID of the `supportsInterface` function. - -```solidity -bytes4 ERC165_INTERFACE_ID -``` - -#### public function `supportsInterface` - -Virtual method to query if a contract supports a certain interface defaulting to the `ERC165_INTERFACE_ID` if it is not overridden. - -```solidity -function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _interfaceId | bytes4 | The interface identifier as specified in ERC-165 being queried. | -| **Output** | | -| [0] | bool | True if the inheriting contract implements the requested interface, false otherwise. | - diff --git a/docs/core/03-reference-guide/core/permission/BulkPermissionsLib.md b/docs/core/03-reference-guide/core/permission/BulkPermissionsLib.md deleted file mode 100644 index 08f59f79..00000000 --- a/docs/core/03-reference-guide/core/permission/BulkPermissionsLib.md +++ /dev/null @@ -1,39 +0,0 @@ -## Aragon Core - -### contract `BulkPermissionsLib` - -A library containing objects for bulk permission processing. - -#### enum `Operation` - -```solidity -enum Operation { - Grant, - Revoke, - Freeze, - GrantWithOracle -} -``` - -#### public struct `ItemSingleTarget` - -```solidity -struct ItemSingleTarget { - enum BulkPermissionsLib.Operation operation; - address who; - bytes32 permissionId; -} -``` - -#### public struct `ItemMultiTarget` - -```solidity -struct ItemMultiTarget { - enum BulkPermissionsLib.Operation operation; - address where; - address who; - address oracle; - bytes32 permissionId; -} -``` - diff --git a/docs/core/03-reference-guide/core/plugin/IPlugin.md b/docs/core/03-reference-guide/core/plugin/IPlugin.md new file mode 100644 index 00000000..cf9b8139 --- /dev/null +++ b/docs/core/03-reference-guide/core/plugin/IPlugin.md @@ -0,0 +1,22 @@ +## Aragon Core + +### contract `IPlugin` + +#### 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/core/03-reference-guide/core/plugin/Plugin.md b/docs/core/03-reference-guide/core/plugin/Plugin.md new file mode 100644 index 00000000..2e40e4fb --- /dev/null +++ b/docs/core/03-reference-guide/core/plugin/Plugin.md @@ -0,0 +1,40 @@ +## Aragon Core + +### contract `Plugin` + +An abstract, non-upgradeable inherit from when creating a plugin being deployed via the `new` keyword. + +#### 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 interace. | +| **Output** | | +| [0] | bool | bool Returns true if the interface is supported. | + diff --git a/docs/core/03-reference-guide/core/plugin/PluginCloneable.md b/docs/core/03-reference-guide/core/plugin/PluginCloneable.md new file mode 100644 index 00000000..4ce2e197 --- /dev/null +++ b/docs/core/03-reference-guide/core/plugin/PluginCloneable.md @@ -0,0 +1,40 @@ +## Aragon Core + +### contract `PluginCloneable` + +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)). + +#### 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 interace. | +| **Output** | | +| [0] | bool | bool Returns true if the interface is supported. | + diff --git a/docs/core/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md b/docs/core/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md new file mode 100644 index 00000000..eb6ed336 --- /dev/null +++ b/docs/core/03-reference-guide/core/plugin/PluginUUPSUpgradeable.md @@ -0,0 +1,78 @@ +## Aragon Core + +### contract `PluginUUPSUpgradeable` + +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)). + +#### 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 interace. | +| **Output** | | +| [0] | bool | bool Returns true if the interface is supported. | + +#### public function `getImplementationAddress` + +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 getImplementationAddress() public view returns (address implementation) +``` + +| Output | Type | Description | +| ------ | ---- | ----------- | +| implementation | address | The address of the implementation contract. | + +#### internal function `_authorizeUpgrade` + +Internal method authorizing the upgrade of the contract via the [upgradeabilty 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.* + +#### private variable `__gap` + +This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain (see [OpenZepplins guide about storage gaps](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps)). + +```solidity +uint256[50] __gap +``` + diff --git a/docs/core/03-reference-guide/plugin/PluginConstants.md b/docs/core/03-reference-guide/plugin/PluginConstants.md deleted file mode 100644 index 8326177c..00000000 --- a/docs/core/03-reference-guide/plugin/PluginConstants.md +++ /dev/null @@ -1,16 +0,0 @@ -## Aragon Core - -### contract `PluginConstants` - -#### public variable `DAO_PLACEHOLDER` - -```solidity -uint256 DAO_PLACEHOLDER -``` - -#### public variable `PLUGIN_PLACEHOLDER` - -```solidity -uint256 PLUGIN_PLACEHOLDER -``` - diff --git a/docs/core/03-reference-guide/plugin/PluginFactoryBase.md b/docs/core/03-reference-guide/plugin/PluginFactoryBase.md deleted file mode 100644 index 12c862fe..00000000 --- a/docs/core/03-reference-guide/plugin/PluginFactoryBase.md +++ /dev/null @@ -1,61 +0,0 @@ -## Aragon Core - -### contract `PluginFactoryIDs` - -A library to share the interface ID of the abstract `PluginFactoryBase` contract. - -#### public variable `PLUGIN_FACTORY_INTERFACE_ID` - -The interface ID of the `PluginFactoryBase` contract. - -```solidity -bytes4 PLUGIN_FACTORY_INTERFACE_ID -``` - -### contract `PluginFactoryBase` - -The abstract base contract for plugin factories to inherit from. - -#### internal variable `basePluginAddress` - -The base plugin address to clone from. - -```solidity -address basePluginAddress -``` - -#### internal function `constructor` - -Initializes the plugin factory by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID. - -```solidity -constructor() internal -``` - -#### external function `deploy` - -Deploys a plugin. - -```solidity -function deploy(address _dao, bytes _params) external virtual returns (address pluginAddress) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | address | The address of the DAO where the plugin will be installed. | -| _params | bytes | The encoded paramaters needed for the plugin deployment. | -| **Output** | | -| pluginAddress | address | The the address of the deployed plugin. | - -#### external function `getBasePluginAddress` - -Retruns the address of the base plugin. - -```solidity -function getBasePluginAddress() external view returns (address) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | address | address The the address of the base plugin. | - diff --git a/docs/core/03-reference-guide/plugin/PluginManager.md b/docs/core/03-reference-guide/plugin/PluginManager.md deleted file mode 100644 index dc3dc6cf..00000000 --- a/docs/core/03-reference-guide/plugin/PluginManager.md +++ /dev/null @@ -1,237 +0,0 @@ -## Aragon Core - -### contract `PluginManager` - -NOTE: This is an untested code and should NOT be used in production. -Abstract Plugin Factory that dev's have to inherit from for their factories. - -#### public variable `PLUGIN_MANAGER_INTERFACE_ID` - -```solidity -bytes4 PLUGIN_MANAGER_INTERFACE_ID -``` - -#### public struct `RequestedPermission` - -```solidity -struct RequestedPermission { - enum BulkPermissionsLib.Operation op; - uint256 where; - bool isWhereAddress; - uint256 who; - bool isWhoAddress; - address oracle; - bytes32 permissionId; -} -``` - -#### internal function `buildPermission` - -creates Permission struct - -```solidity -function buildPermission(enum BulkPermissionsLib.Operation op, uint256 where, uint256 who, address oracle, bytes32 permissionId) internal pure returns (struct PluginManager.RequestedPermission) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| op | enum BulkPermissionsLib.Operation | Whether grants, revokes, freezes... | -| where | uint256 | index from the dev's deployed addresses array where permission will be set. | -| who | uint256 | index from the dev's deployed addresses array | -| oracle | address | | -| permissionId | bytes32 | permissionId that will be set | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission | Permission The final permission struct | - -#### internal function `buildPermission` - -creates Permission struct - -```solidity -function buildPermission(enum BulkPermissionsLib.Operation op, address where, address who, address oracle, bytes32 permissionId) internal pure returns (struct PluginManager.RequestedPermission) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| op | enum BulkPermissionsLib.Operation | Whether grants, revokes, freezes... | -| where | address | Address where permission will be granted. | -| who | address | Address who will have the permission. | -| oracle | address | | -| permissionId | bytes32 | permissionId that will be set | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission | Permission The final permission struct | - -#### internal function `buildPermission` - -creates Permission struct - -```solidity -function buildPermission(enum BulkPermissionsLib.Operation op, uint256 where, address who, address oracle, bytes32 permissionId) internal pure returns (struct PluginManager.RequestedPermission) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| op | enum BulkPermissionsLib.Operation | Whether grants, revokes, freezes... | -| where | uint256 | index from the dev's deployed addresses array where permission will be set. | -| who | address | Address who will have the permission. | -| oracle | address | | -| permissionId | bytes32 | permissionId that will be set | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission | Permission The final permission struct | - -#### internal function `buildPermission` - -creates Permission struct - -```solidity -function buildPermission(enum BulkPermissionsLib.Operation op, address where, uint256 who, address oracle, bytes32 permissionId) internal pure returns (struct PluginManager.RequestedPermission) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| op | enum BulkPermissionsLib.Operation | Whether grants, revokes, freezes... | -| where | address | Address who will have the permission. | -| who | uint256 | index from the dev's deployed addresses array that will have permission. | -| oracle | address | | -| permissionId | bytes32 | permissionId that will be set | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission | Permission The final permission struct | - -#### internal function `createProxy` - -helper function to deploy Custom ERC1967Proxy that includes dao slot on it. - -```solidity -function createProxy(address dao, address logic, bytes init) internal returns (address) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| dao | address | dao address | -| logic | address | the base contract address proxy has to delegate calls to. | -| init | bytes | the initialization data(function selector + encoded data) | -| **Output** | | -| [0] | address | address of the proxy. | - -#### internal function `upgrade` - -helper function to deploy Custom ERC1967Proxy that includes dao slot on it. - -```solidity -function upgrade(address proxy, address logic, bytes init) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| proxy | address | proxy address | -| logic | address | the base contract address proxy has to delegate calls to. | -| init | bytes | the initialization data(function selector + encoded data) | - -#### external function `deploy` - -the function dev has to override/implement for the plugin deployment. - -```solidity -function deploy(address dao, bytes data) external virtual returns (address plugin, address[] relatedContracts) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| dao | address | dao address where plugin will be installed to in the end. | -| data | bytes | the ABI encoded data that deploy needs for its work. | -| **Output** | | -| plugin | address | the plugin address | -| **Output** | | -| relatedContracts | address[] | array of helper contract addresses that dev deploys beforehand the plugin. | - -#### external function `update` - -the function dev has to override/implement for the plugin update. - -```solidity -function update(address proxy, uint16[3] oldVersion, bytes data) external virtual returns (address[] relatedContracts) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| proxy | address | proxy address | -| oldVersion | uint16[3] | the version plugin is updating from. | -| data | bytes | the other data that deploy needs. | -| **Output** | | -| relatedContracts | address[] | array of helper contract addresses that dev deploys to do some work before plugin update. | - -#### public function `getImplementationAddress` - -the plugin's base implementation address proxies need to delegate calls. - -```solidity -function getImplementationAddress() public view virtual returns (address) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | address | address of the base contract address. | - -#### external function `deployABI` - -the ABI in string format that deploy function needs to use. - -```solidity -function deployABI() external view virtual returns (string) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | string | ABI in string format. | - -#### external function `updateABI` - -The ABI in string format that update function needs to use. - -```solidity -function updateABI() external view virtual returns (string) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | string | ABI in string format. | - -*Not required to be overriden as there might be no update at all by dev.* - -#### external function `getInstallPermissions` - -the view function called by UI to detect the permissions that will be applied before installing the plugin. - -```solidity -function getInstallPermissions(bytes data) external view virtual returns (struct PluginManager.RequestedPermission[], string[]) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| data | bytes | the exact same data that is passed to the deploy function. | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission[] | Permissions the permission struct array that contain all the permissions that should be set. | -| **Output** | | -| [1] | string[] | array of strings(names of helper contracts). This corresponds to the relatedContracts. | - -*This corresponds to the permissions for installing the plugin.* - -#### external function `getUpdatePermissions` - -the view function called by UI to detect the permissions that will be applied before updating the plugin. - -```solidity -function getUpdatePermissions(uint16[3] oldVersion, bytes data) external virtual returns (struct PluginManager.RequestedPermission[], string[]) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| oldVersion | uint16[3] | the version plugin is updating from. | -| data | bytes | the exact same data that is passed to the update function. | -| **Output** | | -| [0] | struct PluginManager.RequestedPermission[] | Permissions the permissions struct array that contain all the permissions that should be set. | -| **Output** | | -| [1] | string[] | array of strings(names of helper contracts). This corresponds to the relatedContracts. | - -*This corresponds to the permissions for updating the plugin.* - diff --git a/docs/core/03-reference-guide/plugin/examples/count/CounterV1PluginManager.md b/docs/core/03-reference-guide/plugin/examples/count/CounterV1PluginManager.md deleted file mode 100644 index 29b7396d..00000000 --- a/docs/core/03-reference-guide/plugin/examples/count/CounterV1PluginManager.md +++ /dev/null @@ -1,87 +0,0 @@ -## Aragon Core - -### contract `CounterV1PluginManager` - -#### private variable `multiplyHelperBase` - -```solidity -contract MultiplyHelper multiplyHelperBase -``` - -#### private variable `counterBase` - -```solidity -contract CounterV1 counterBase -``` - -#### private variable `NO_ORACLE` - -```solidity -address NO_ORACLE -``` - -#### public function `constructor` - -```solidity -constructor() public -``` - -#### external function `deploy` - -the function dev has to override/implement for the plugin deployment. - -```solidity -function deploy(address dao, bytes data) external virtual returns (address plugin, address[] relatedContracts) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| dao | address | dao address where plugin will be installed to in the end. | -| data | bytes | the ABI encoded data that deploy needs for its work. | -| **Output** | | -| plugin | address | the plugin address | -| **Output** | | -| relatedContracts | address[] | array of helper contract addresses that dev deploys beforehand the plugin. | - -#### external function `getInstallPermissions` - -the view function called by UI to detect the permissions that will be applied before installing the plugin. - -```solidity -function getInstallPermissions(bytes data) external view virtual returns (struct PluginManager.RequestedPermission[] permissions, string[] helperNames) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| data | bytes | the exact same data that is passed to the deploy function. | -| **Output** | | -| permissions | struct PluginManager.RequestedPermission[] | Permissions the permission struct array that contain all the permissions that should be set. | -| **Output** | | -| helperNames | string[] | array of strings(names of helper contracts). This corresponds to the relatedContracts. | - -*This corresponds to the permissions for installing the plugin.* - -#### public function `getImplementationAddress` - -the plugin's base implementation address proxies need to delegate calls. - -```solidity -function getImplementationAddress() public view virtual returns (address) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | address | address of the base contract address. | - -#### external function `deployABI` - -the ABI in string format that deploy function needs to use. - -```solidity -function deployABI() external view virtual returns (string) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | string | ABI in string format. | - diff --git a/docs/core/03-reference-guide/plugin/examples/count/CounterV2PluginManager.md b/docs/core/03-reference-guide/plugin/examples/count/CounterV2PluginManager.md deleted file mode 100644 index a901a989..00000000 --- a/docs/core/03-reference-guide/plugin/examples/count/CounterV2PluginManager.md +++ /dev/null @@ -1,136 +0,0 @@ -## Aragon Core - -### contract `CounterV2PluginManager` - -#### private variable `multiplyHelperBase` - -```solidity -contract MultiplyHelper multiplyHelperBase -``` - -#### private variable `counterBase` - -```solidity -contract CounterV2 counterBase -``` - -#### private variable `NO_ORACLE` - -```solidity -address NO_ORACLE -``` - -#### public function `constructor` - -```solidity -constructor(contract MultiplyHelper _helper) public -``` - -#### external function `deploy` - -the function dev has to override/implement for the plugin deployment. - -```solidity -function deploy(address dao, bytes data) external virtual returns (address plugin, address[] relatedContracts) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| dao | address | dao address where plugin will be installed to in the end. | -| data | bytes | the ABI encoded data that deploy needs for its work. | -| **Output** | | -| plugin | address | the plugin address | -| **Output** | | -| relatedContracts | address[] | array of helper contract addresses that dev deploys beforehand the plugin. | - -#### external function `update` - -the function dev has to override/implement for the plugin update. - -```solidity -function update(address proxy, uint16[3] oldVersion, bytes data) external virtual returns (address[] relatedContracts) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| proxy | address | proxy address | -| oldVersion | uint16[3] | the version plugin is updating from. | -| data | bytes | the other data that deploy needs. | -| **Output** | | -| relatedContracts | address[] | array of helper contract addresses that dev deploys to do some work before plugin update. | - -#### external function `getInstallPermissions` - -the view function called by UI to detect the permissions that will be applied before installing the plugin. - -```solidity -function getInstallPermissions(bytes data) external view virtual returns (struct PluginManager.RequestedPermission[] permissions, string[] helperNames) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| data | bytes | the exact same data that is passed to the deploy function. | -| **Output** | | -| permissions | struct PluginManager.RequestedPermission[] | Permissions the permission struct array that contain all the permissions that should be set. | -| **Output** | | -| helperNames | string[] | array of strings(names of helper contracts). This corresponds to the relatedContracts. | - -*This corresponds to the permissions for installing the plugin.* - -#### external function `getUpdatePermissions` - -the view function called by UI to detect the permissions that will be applied before updating the plugin. - -```solidity -function getUpdatePermissions(uint16[3] oldVersion, bytes data) external view virtual returns (struct PluginManager.RequestedPermission[] permissions, string[]) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| oldVersion | uint16[3] | the version plugin is updating from. | -| data | bytes | the exact same data that is passed to the update function. | -| **Output** | | -| permissions | struct PluginManager.RequestedPermission[] | Permissions the permissions struct array that contain all the permissions that should be set. | -| **Output** | | -| [1] | string[] | array of strings(names of helper contracts). This corresponds to the relatedContracts. | - -*This corresponds to the permissions for updating the plugin.* - -#### public function `getImplementationAddress` - -the plugin's base implementation address proxies need to delegate calls. - -```solidity -function getImplementationAddress() public view virtual returns (address) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | address | address of the base contract address. | - -#### external function `deployABI` - -the ABI in string format that deploy function needs to use. - -```solidity -function deployABI() external view virtual returns (string) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | string | ABI in string format. | - -#### external function `updateABI` - -The ABI in string format that update function needs to use. - -```solidity -function updateABI() external view virtual returns (string) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | string | ABI in string format. | - -*Not required to be overriden as there might be no update at all by dev.* - diff --git a/docs/core/03-reference-guide/registry/AragonPluginRegistry.md b/docs/core/03-reference-guide/registry/AragonPluginRegistry.md deleted file mode 100644 index 28e3f041..00000000 --- a/docs/core/03-reference-guide/registry/AragonPluginRegistry.md +++ /dev/null @@ -1,52 +0,0 @@ -## Aragon Core - -### contract `AragonPluginRegistry` - -This contract maintains an address-based registery of plugin repositories in the Aragon App DAO framework. - -#### public variable `REGISTER_PERMISSION_ID` - -The ID of the permission required to call the `register` function. - -```solidity -bytes32 REGISTER_PERMISSION_ID -``` - -#### event `PluginRepoRegistered` - -Emitted if a new plugin repository is registered. - -```solidity -event PluginRepoRegistered(string name, address pluginRepo) -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| name | string | The name of the plugin repository. | -| pluginRepo | address | The address of the plugin repository. | - -#### public function `initialize` - -Initializes the contract by setting calling the `InterfaceBasedRegistry` base class initialize method. - -```solidity -function initialize(contract IDAO _dao) public -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | contract IDAO | The address of the managing DAO. | - -#### external function `register` - -Registers a plugin repository with a name and address. - -```solidity -function register(string name, address registrant) external -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| name | string | The name of the PluginRepo. | -| registrant | address | The address of the PluginRepo contract. | - diff --git a/docs/core/03-reference-guide/utils/AppStorage.md b/docs/core/03-reference-guide/utils/AppStorage.md deleted file mode 100644 index e233c8fa..00000000 --- a/docs/core/03-reference-guide/utils/AppStorage.md +++ /dev/null @@ -1,40 +0,0 @@ -## Aragon Core - -### contract `AppStorage` - -Core storage that stores information at very specific slots. - -#### internal variable `DAO_POSITION` - -The position in storage in which the contract address fulfilling the `IDAO` interface is stored - -```solidity -bytes32 DAO_POSITION -``` - -*bytes32 internal constant DAO_POSITION = keccak256("core.storage.dao");* - -#### public function `dao` - -Gets the`IDAO` contract being stored in the `DAO_POSITION` storage slot. - -```solidity -function dao() public view returns (contract IDAO) -``` - -| Output | Type | Description | -| ------ | ---- | ----------- | -| [0] | contract IDAO | The `IDAO` contract. | - -#### internal function `setDAO` - -Stores the`IDAO` contract in the `DAO_POSITION` storage slot. - -```solidity -function setDAO(address _dao) internal -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | address | The address of the `IDAO` contract to be stored. | - diff --git a/docs/core/03-reference-guide/utils/PluginERC1967Proxy.md b/docs/core/03-reference-guide/utils/PluginERC1967Proxy.md deleted file mode 100644 index 240d8992..00000000 --- a/docs/core/03-reference-guide/utils/PluginERC1967Proxy.md +++ /dev/null @@ -1,23 +0,0 @@ -## Aragon Core - -### contract `PluginERC1967Proxy` - -This contract provides an [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) compatible proxy contract delegating calls to the implementation address. - -*This proxy doesn't include the upgradability logic and assumes that implementation contracts are `UUPSUpgradable`. -If you want the proxy to contain upgrade logic, you have to use `TransparentUpgradableProxy`.* - -#### public function `constructor` - -The constructor initializing the [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy and setting the `IDAO` address if specified. - -```solidity -constructor(address _dao, address _logic, bytes _data) public -``` - -| Input | Type | Description | -|:----- | ---- | ----------- | -| _dao | address | The DAO address to be stored. | -| _logic | address | The address of the logic contract containing the proxy is pointing to. @ param _data The data being passed in a delegatecall to `_logic` to initialize the storage (see [OZs `ERC1967Proxy.sol` docs](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/ERC1967/ERC1967Proxy.sol)) | -| _data | bytes | | - diff --git a/docs/core/03-reference-guide/utils/UUPSProxy.md b/docs/core/03-reference-guide/utils/UUPSProxy.md deleted file mode 100644 index f6379393..00000000 --- a/docs/core/03-reference-guide/utils/UUPSProxy.md +++ /dev/null @@ -1,13 +0,0 @@ -## Aragon Core - -### contract `UUPSProxy` - -This contract is only meant to be used for deploy purposes. -TODO: Need to be fully tested, and decide to use the second address param as admin address. - -#### public function `constructor` - -```solidity -constructor(address _logic, address, bytes _data) public payable -``` -