-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into f/add-dao-docs
- Loading branch information
Showing
49 changed files
with
2,884 additions
and
810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
collapsible: true | ||
collapsed: true | ||
label: Technical Reference | ||
link: null | ||
position: 6 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Description | ||
|
||
See https://eips.ethereum.org/EIPS/eip-4824 | ||
|
||
## Implementation | ||
|
||
### external function daoURI | ||
|
||
A distinct Uniform Resource Identifier (URI) pointing to a JSON object following the "EIP-4824 DAO JSON-LD Schema". This JSON file splits into four URIs: membersURI, proposalsURI, activityLogURI, and governanceURI. The membersURI should point to a JSON file that conforms to the "EIP-4824 Members JSON-LD Schema". The proposalsURI should point to a JSON file that conforms to the "EIP-4824 Proposals JSON-LD Schema". The activityLogURI should point to a JSON file that conforms to the "EIP-4824 Activity Log JSON-LD Schema". The governanceURI should point to a flatfile, normatively a .md file. Each of the JSON files named above can be statically hosted or dynamically-generated. | ||
|
||
```solidity | ||
function daoURI() external view returns (string _daoURI) | ||
``` | ||
|
||
| Output | Type | Description | | ||
| --------- | -------- | ------------ | | ||
| `_daoURI` | `string` | The DAO URI. | | ||
|
||
<!--CONTRACT_END--> |
404 changes: 404 additions & 0 deletions
404
docs/advanced/technical-reference/core/permission/PermissionManager.md
Large diffs are not rendered by default.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
docs/advanced/technical-reference/core/utils/CallbackHandler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
## Description | ||
|
||
This contract handles callbacks by registering a magic number together with the callback function's selector. It provides the `_handleCallback` function that inheriting contracts have to call inside their `fallback()` function (`_handleCallback(msg.callbackSelector, msg.data)`). This allows to adaptively register ERC standards (e.g., [ERC-721](https://eips.ethereum.org/EIPS/eip-721), [ERC-1115](https://eips.ethereum.org/EIPS/eip-1155), or future versions of [ERC-165](https://eips.ethereum.org/EIPS/eip-165)) and returning the required magic numbers for the associated callback functions for the inheriting contract so that it doesn't need to be upgraded. | ||
|
||
This callback handling functionality is intented to be used by executor contracts (i.e., `DAO.sol`). | ||
|
||
## Implementation | ||
|
||
### internal variable callbackMagicNumbers | ||
|
||
A mapping between callback function selectors and magic return numbers. | ||
|
||
```solidity | ||
mapping(bytes4 => bytes4) callbackMagicNumbers | ||
``` | ||
|
||
### internal variable UNREGISTERED_CALLBACK | ||
|
||
The magic number refering to unregistered callbacks. | ||
|
||
```solidity | ||
bytes4 UNREGISTERED_CALLBACK | ||
``` | ||
|
||
### error UnkownCallback | ||
|
||
Thrown if the callback function is not registered. | ||
|
||
```solidity | ||
error UnkownCallback(bytes4 callbackSelector, bytes4 magicNumber) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :----------------- | -------- | --------------------------------------------------------------------- | | ||
| `callbackSelector` | `bytes4` | The selector of the callback function. | | ||
| `magicNumber` | `bytes4` | The magic number to be registered for the callback function selector. | | ||
|
||
### event CallbackReceived | ||
|
||
Emitted when `_handleCallback` is called. | ||
|
||
```solidity | ||
event CallbackReceived(address sender, bytes4 sig, bytes data) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :------- | --------- | ------------------------ | | ||
| `sender` | `address` | Who called the callback. | | ||
| `sig` | `bytes4` | The function signature. | | ||
| `data` | `bytes` | The calldata. | | ||
|
||
### internal function \_handleCallback | ||
|
||
Handles callbacks to adaptively support ERC standards. | ||
|
||
```solidity | ||
function _handleCallback(bytes4 _callbackSelector, bytes _data) internal virtual returns (bytes4) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :------------------ | -------- | ------------------------------------------------------------------------------ | | ||
| `_callbackSelector` | `bytes4` | The function selector of the callback function. | | ||
| `_data` | `bytes` | The calldata. | | ||
| **Output** | | | ||
| `0` | `bytes4` | The magic number registered for the function selector triggering the fallback. | | ||
|
||
_This function is supposed to be called via `_handleCallback(msg.sig, msg.data)` in the `fallback()` function of the inheriting contract._ | ||
|
||
### internal function \_registerCallback | ||
|
||
Registers a magic number for a callback function selector. | ||
|
||
```solidity | ||
function _registerCallback(bytes4 _callbackSelector, bytes4 _magicNumber) internal virtual | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :------------------ | -------- | --------------------------------------------------------------------- | | ||
| `_callbackSelector` | `bytes4` | The selector of the callback function. | | ||
| `_magicNumber` | `bytes4` | The magic number to be registered for the callback function selector. | | ||
|
||
<!--CONTRACT_END--> |
123 changes: 123 additions & 0 deletions
123
docs/advanced/technical-reference/framework/dao/DAOFactory.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
## Description | ||
|
||
This contract is used to create a DAO. | ||
|
||
## Implementation | ||
|
||
### public variable daoBase | ||
|
||
The DAO base contract, to be used for creating new `DAO`s via `createERC1967Proxy` function. | ||
|
||
```solidity | ||
address daoBase | ||
``` | ||
|
||
### public variable daoRegistry | ||
|
||
The DAO registry listing the `DAO` contracts created via this contract. | ||
|
||
```solidity | ||
contract DAORegistry daoRegistry | ||
``` | ||
|
||
### public variable pluginSetupProcessor | ||
|
||
The plugin setup processor for installing plugins on the newly created `DAO`s. | ||
|
||
```solidity | ||
contract PluginSetupProcessor pluginSetupProcessor | ||
``` | ||
|
||
### public struct DAOSettings | ||
|
||
```solidity | ||
struct DAOSettings { | ||
address trustedForwarder; | ||
string daoURI; | ||
string subdomain; | ||
bytes metadata; | ||
} | ||
``` | ||
|
||
### public struct PluginSettings | ||
|
||
```solidity | ||
struct PluginSettings { | ||
struct PluginSetupRef pluginSetupRef; | ||
bytes data; | ||
} | ||
``` | ||
|
||
### error NoPluginProvided | ||
|
||
Thrown if `PluginSettings` array is empty, and no plugin is provided. | ||
|
||
```solidity | ||
error NoPluginProvided() | ||
``` | ||
|
||
### public function constructor | ||
|
||
The constructor setting the registry and plugin setup processor and creating the base contracts for the factory. | ||
|
||
```solidity | ||
constructor(contract DAORegistry _registry, contract PluginSetupProcessor _pluginSetupProcessor) public | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :---------------------- | ------------------------------- | ------------------------------------------------- | | ||
| `_registry` | `contract DAORegistry` | The DAO registry to register the DAO by its name. | | ||
| `_pluginSetupProcessor` | `contract PluginSetupProcessor` | The address of PluginSetupProcessor. | | ||
|
||
### 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 createDao | ||
|
||
Creates a new DAO, registers it on the DAO registry, and installs a list of plugins via the plugin setup processor. | ||
|
||
```solidity | ||
function createDao(struct DAOFactory.DAOSettings _daoSettings, struct DAOFactory.PluginSettings[] _pluginSettings) external returns (contract DAO createdDao) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :---------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------- | | ||
| `_daoSettings` | `struct DAOFactory.DAOSettings` | The DAO settings to be set during the DAO initialization. | | ||
| `_pluginSettings` | `struct DAOFactory.PluginSettings[]` | The array containing references to plugins and their settings to be installed after the DAO has been created. | | ||
|
||
### internal function \_createDAO | ||
|
||
Deploys a new DAO `ERC1967` proxy, and initialize it with this contract as the intial owner. | ||
|
||
```solidity | ||
function _createDAO(struct DAOFactory.DAOSettings _daoSettings) internal returns (contract DAO dao) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :------------- | ------------------------------- | -------------------------------------------------------------------- | | ||
| `_daoSettings` | `struct DAOFactory.DAOSettings` | The trusted forwarder, name and metadata hash of the DAO it creates. | | ||
|
||
### internal function \_setDAOPermissions | ||
|
||
Sets the required permissions for the new DAO. | ||
|
||
```solidity | ||
function _setDAOPermissions(contract DAO _dao) internal | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :----- | -------------- | ------------------------------ | | ||
| `_dao` | `contract DAO` | The DAO instance just created. | | ||
|
||
<!--CONTRACT_END--> |
82 changes: 82 additions & 0 deletions
82
docs/advanced/technical-reference/framework/dao/DAORegistry.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
## Description | ||
|
||
This contract provides the possibility to register a DAO. | ||
|
||
## Implementation | ||
|
||
### public variable REGISTER_DAO_PERMISSION_ID | ||
|
||
The ID of the permission required to call the `register` function. | ||
|
||
```solidity | ||
bytes32 REGISTER_DAO_PERMISSION_ID | ||
``` | ||
|
||
### public variable subdomainRegistrar | ||
|
||
The ENS subdomain registrar registering the DAO subdomains. | ||
|
||
```solidity | ||
contract ENSSubdomainRegistrar subdomainRegistrar | ||
``` | ||
|
||
### error InvalidDaoSubdomain | ||
|
||
Thrown if the DAO subdomain doesn't match the regex `[0-9a-z\-]` | ||
|
||
```solidity | ||
error InvalidDaoSubdomain(string subdomain) | ||
``` | ||
|
||
### event DAORegistered | ||
|
||
Emitted when a new DAO is registered. | ||
|
||
```solidity | ||
event DAORegistered(address dao, address creator, string subdomain) | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :---------- | --------- | -------------------------------- | | ||
| `dao` | `address` | The address of the DAO contract. | | ||
| `creator` | `address` | The address of the creator. | | ||
| `subdomain` | `string` | The DAO subdomain. | | ||
|
||
### public function constructor | ||
|
||
```solidity | ||
constructor() public | ||
``` | ||
|
||
_Used to disallow initializing the implementation contract by an attacker for extra safety._ | ||
|
||
### external function initialize | ||
|
||
Initializes the contract. | ||
|
||
```solidity | ||
function initialize(contract IDAO _managingDao, contract ENSSubdomainRegistrar _subdomainRegistrar) external | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :-------------------- | -------------------------------- | --------------------------------------------------------------------- | | ||
| `_managingDao` | `contract IDAO` | the managing DAO address. | | ||
| `_subdomainRegistrar` | `contract ENSSubdomainRegistrar` | The `ENSSubdomainRegistrar` where `ENS` subdomain will be registered. | | ||
|
||
### external function register | ||
|
||
Registers a DAO by its address. If a non-empty subdomain name is provided that is not taken already, the DAO becomes the owner of the ENS name. | ||
|
||
```solidity | ||
function register(contract IDAO dao, address creator, string subdomain) external | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :---------- | --------------- | -------------------------------- | | ||
| `dao` | `contract IDAO` | The address of the DAO contract. | | ||
| `creator` | `address` | The address of the creator. | | ||
| `subdomain` | `string` | The DAO subdomain. | | ||
|
||
_A subdomain is unique within the Aragon DAO framework and can get stored here._ | ||
|
||
<!--CONTRACT_END--> |
35 changes: 35 additions & 0 deletions
35
docs/advanced/technical-reference/framework/plugin/repo/IPluginRepo.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Description | ||
|
||
The interface required for a plugin repository. | ||
|
||
## Implementation | ||
|
||
### external function updateReleaseMetadata | ||
|
||
Updates the metadata for release with content `@fromHex(_releaseMetadata)`. | ||
|
||
```solidity | ||
function updateReleaseMetadata(uint8 _release, bytes _releaseMetadata) external | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :----------------- | ------- | ------------------------- | | ||
| `_release` | `uint8` | The release number. | | ||
| `_releaseMetadata` | `bytes` | The release metadata URI. | | ||
|
||
### external function createVersion | ||
|
||
Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided `PluginSetup` contract address and metadata. | ||
|
||
```solidity | ||
function createVersion(uint8 _release, address _pluginSetupAddress, bytes _buildMetadata, bytes _releaseMetadata) external | ||
``` | ||
|
||
| Input | Type | Description | | ||
| :-------------------- | --------- | ----------------------------------------- | | ||
| `_release` | `uint8` | The release number. | | ||
| `_pluginSetupAddress` | `address` | The address of the plugin setup contract. | | ||
| `_buildMetadata` | `bytes` | The build metadata URI. | | ||
| `_releaseMetadata` | `bytes` | The release metadata URI. | | ||
|
||
<!--CONTRACT_END--> |
Oops, something went wrong.