Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Nov 17, 2024
1 parent ae4d566 commit 6450d3e
Show file tree
Hide file tree
Showing 96 changed files with 5,991 additions and 12,529 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.multiRootWorkspaceName": "developer-portal"
}
30 changes: 0 additions & 30 deletions components/osx/01-how-it-works/02-framework/index.md

This file was deleted.

29 changes: 0 additions & 29 deletions components/osx/01-how-it-works/index.md

This file was deleted.

6 changes: 4 additions & 2 deletions components/osx/antora.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: ROOT
title: Home
name: osx
title: OSX
version: ~
nav:
- modules/ROOT/nav.adoc
51 changes: 51 additions & 0 deletions components/osx/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
* xref:index.adoc[Overview]
* xref:how-it-works/index.adoc[How it works]
** xref:how-it-works/core/index.adoc[Smart Contracts]
*** xref:how-it-works/core/dao/index.adoc[DAO]
**** xref:how-it-works/core/dao/actions.adoc[Advanced DAO Actions]
*** xref:how-it-works/core/permissions/index.adoc[Permissions]
**** xref:how-it-works/core/permissions/conditions.adoc[Permission Conditions]
*** xref:how-it-works/core/plugins/index.adoc[Plugins]
** xref:how-it-works/framework/index.adoc[Framework]
*** xref:how-it-works/framework/dao-creation/index.adoc[Creating a DAO]
*** xref:how-it-works/framework/plugin-management/index.adoc[Plugins]
**** xref:how-it-works/framework/plugin-management/plugin-repo/index.adoc[Plugin Repositories]
***** xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc[Publishing a Plugin]
**** xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[Installing Plugins]
***** xref:how-it-works/framework/plugin-management/plugin-setup/security-risk-mitigation.adoc[Plugin Security and Risks]

*** xref:how-it-works/framework/ens-names.adoc[ENS Names]
** xref:how-it-works/framework-dao.adoc[Protocol Governance]
* xref:how-to-guides/index.adoc[Tutorials]
** xref:how-to-guides/dao/index.adoc[Operating a DAO]
*** xref:how-to-guides/dao/best-practices.adoc[Best Practices]
*** xref:how-to-guides/dao/action-execution.adoc[Executing Actions on behalf of the DAO]
*** xref:how-to-guides/dao/protocol-upgrades.adoc[Upgrade your DAO to future Aragon OSX versions]
*** xref:how-to-guides/dao/managing-plugins.adoc[Managing your DAO's Plugins]
** xref:how-to-guides/plugin-development/index.adoc[Developing a Plugin]
*** xref:how-to-guides/plugin-development/best-practices.adoc[Before Starting]
*** xref:how-to-guides/plugin-development/plugin-types.adoc[Choosing The Plugin Type]
*** xref:how-to-guides/plugin-development/non-upgradeable-plugin/index.adoc[Non-Upgradeable Plugins]
**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/initialization.adoc[Initialization]
**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/implementation.adoc[Plugin Implementation Contract]
**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/setup.adoc[Plugin Setup Contract]
*** xref:how-to-guides/plugin-development/upgradeable-plugin/index.adoc[Upgradeable Plugins]
**** xref:how-to-guides/plugin-development/upgradeable-plugin/initialization.adoc[Initialization]
**** xref:how-to-guides/plugin-development/upgradeable-plugin/implementation.adoc[Plugin Implementation Contract]
**** xref:how-to-guides/plugin-development/upgradeable-plugin/setup.adoc[Plugin Setup Contract]
**** xref:how-to-guides/plugin-development/upgradeable-plugin/subsequent-builds.adoc[Subsequent Builds]
**** xref:how-to-guides/plugin-development/upgradeable-plugin/updating-versions.adoc[Upgrade a DAO Plugin]
*** xref:how-to-guides/plugin-development/governance-plugins/index.adoc[Governance Plugins]
**** xref:how-to-guides/plugin-development/governance-plugins/proposals.adoc[Proposal]
**** xref:how-to-guides/plugin-development/governance-plugins/membership.adoc[Membership]
*** xref:how-to-guides/plugin-development/meta-tx-plugins.adoc[Meta Transactions]
*** xref:how-to-guides/plugin-development/publication/index.adoc[Publication of your plugin into Aragon OSx]
**** xref:how-to-guides/plugin-development/publication/versioning.adoc[New Plugin Version]
**** xref:how-to-guides/plugin-development/publication/metadata.adoc[Plugin Metadata]

Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
title: Advanced DAO Actions
---
= Advanced DAO Actions

## A Deep Dive into Actions and Execution
=== A Deep Dive into Actions and Execution

The DAO's `execute` function is part of the `DAO.sol` contract and has the following function header:

```solidity title="@aragon/osx/core/dao/DAO.sol"
```solidity
function execute(
bytes32 _callId,
Action[] calldata _actions,
uint256 _allowFailureMap
)
external
override
auth(address(this), EXECUTE_PERMISSION_ID)
returns (bytes[] memory execResults, uint256 failureMap)
bytes32 _callId,
Action[] calldata _actions,
uint256 _allowFailureMap
)
external
override
auth(address(this), EXECUTE_PERMISSION_ID)
returns (bytes[] memory execResults, uint256 failureMap)
```

It offers two features that we will dive into in this article:
Expand Down Expand Up @@ -46,13 +44,13 @@ Actions can be

- external services (e.g. Uniswap, Compound, etc.)
- Aragon OSx plugins (e.g., the DAO can be a member of a multisig installed in another DAO),
- Aragon OSx protocol infrastructure (e.g., to [setup a plugin](../../02-framework/02-plugin-management/02-plugin-setup/index.md))
- Aragon OSx protocol infrastructure (e.g., to xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[setup a plugin]).

- transfers of native tokens

#### Example: Calling the wETH Contract

We have an Aragon DAO deployed on the Goerli testnet. Now, we want to wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the [Goerli WETH contract](https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract) deployed on the address `0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6`. The corresponding `Action` and `execute` function call look as follows:
We have an Aragon DAO deployed on the Goerli testnet. Now, we want to wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the link:https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract[Goerli WETH contract] deployed on the address `0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6`. The corresponding `Action` and `execute` function call look as follows:

```solidity

Expand All @@ -68,7 +66,7 @@ dao().execute({_callId: '', _actions: actions, _allowFailureMap: 0});

```

For the `execute` call to work, the caller must have the required [`EXECUTE_PERMISSION_ID` permission](../02-permissions/index.md) on the DAO contract.
For the `execute` call to work, the caller must have the required xref:how-it-works/core/permissions/index.adoc[`EXECUTE_PERMISSION_ID` permission] on the DAO contract.

### The Action Array

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: DAO
---
= DAO

## The DAO Contract: The Identity and Basis of Your Organization
=== The DAO Contract: The Identity and Basis of Your Organization

In this section, you will learn about the core functionality of every Aragon OSx DAO.

Expand All @@ -12,51 +10,44 @@ The `DAO` contract is the identity and basis of your organization. It is the add

The most important and basic functionality of your DAO is the **execution of arbitrary actions**, which allows you to execute the DAO's own functions as well as interacting with the rest of the world, i.e., calling methods in other contracts and sending assets to other addresses.

:::note
Typically, actions are scheduled in a proposal in a governance [plugin installed to your DAO](../03-plugins/index.md).
:::
NOTE: Typically, actions are scheduled in a proposal in a governance - xref:how-it-works/core/plugins/index.adoc[plugin installed to your DAO]

Multiple `Action` structs can be put into one `Action[]` array and executed in a single transaction via the `execute` function. To learn more about actions and advanced features of the DAO executor, visit the [A Deep Dive Into Actions](./01-actions.md) section.
Multiple `Action` structs can be put into one `Action[]` array and executed in a single transaction via the `execute` function. To learn more about actions and advanced features of the DAO executor, visit the xref:how-it-works/core/dao/actions.adoc[A Deep Dive Into Actions].

### 2. Asset Management

The DAO provides basic **asset management** functionality to deposit, withdraw, and keep track of

- native
- [ERC-20 (Token Standard)](https://eips.ethereum.org/EIPS/eip-20),
- [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721), and
- [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155)
- link:https://eips.ethereum.org/EIPS/eip-20[ERC-20 (Token Standard)]
- link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)], and
- link:https://eips.ethereum.org/EIPS/eip-1155[ERC-1155 (Multi Token Standard)]

tokens in the treasury.
In the future, more advanced asset management and finance functionality can be added to your DAO in the form of [plugins](../03-plugins/index.md).
In the future, more advanced asset management and finance functionality can be added to your DAO in the form of xref:how-it-works/core/plugins/index.adoc[plugins].

### 3. Upgradeability

Your DAO contract has the ability to be upgraded to a newer version (see [Upgrade your DAO](../../../02-how-to-guides/01-dao/03-protocol-upgrades.md)) if a new version of Aragon OSx is released in the future. These upgrades allow your DAO to smoothly transition to a new protocol version unlocking new features.
Your DAO contract has the ability to be upgraded to a newer version (see xref:how-to-guides/dao/protocol-upgrades.adoc[Upgrade your DAO]) if a new version of Aragon OSx is released in the future. These upgrades allow your DAO to smoothly transition to a new protocol version unlocking new features.

<!-- Add a subsection explaining how to upgrade your dao -->

### 4. Callback Handling

To interact with the DAO, external contracts might require certain callback functions to be present.
Examples are the `onERC721Received` and `onERC1155Received` / `onERC1155BatchReceived` functions required by the [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721) and [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155) tokens.
Examples are the `onERC721Received` and `onERC1155Received` / `onERC1155BatchReceived` functions required by the link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)] and link:https://eips.ethereum.org/EIPS/eip-1155[ERC-1155 (Multi Token Standard)] tokens.
Our `CallbackHandler` allows to register the required callback responses dynamically so that the DAO contract does not need to be upgraded.

<!-- Add a subsection explaining how to register callbacks -->

### 5. Signature Validation

Currently, externally owned accounts (EOAs) can sign messages with their associated private keys, but contracts cannot.
An exemplary use case is a decentralized exchange with an off-chain order book, where buy/sell orders are signed messages.
To accept such a request, both, the external service provider and caller need to follow a standard with which the signed message of the caller can be validated.

By supporting the [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) standard, your DAO can validate signatures via its `isValidSignature` function that forwards the call to a signature validator contract.

<!-- Add a subsection explaining how signature validation works -->
By supporting the link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)], your DAO can validate signatures via its `isValidSignature` function that forwards the call to a signature validator contract.

### 6. Permission Management

Lastly, it is essential that only the right entities (e.g., the DAO itself or trusted addresses) have permission to use the above-mentioned functionalities. This is why Aragon OSx DAOs contain a flexible and battle-tested **permission manager** being able to assign permissions for the above functionalities to specific addresses.
Although possible, the permissions to execute arbitrary actions or upgrade the DAO should not be given to EOAs as this poses a security risk to the organization if the account is compromised or acts adversarial. Instead, the permissions for the above-mentioned functionalities are better restricted to the `DAO` contract itself and triggered through governance [plugins](../03-plugins/index.md) that you can install on your DAO.
Although possible, the permissions to execute arbitrary actions or upgrade the DAO should not be given to EOAs as this poses a security risk to the organization if the account is compromised or acts adversarial. Instead, the permissions for the above-mentioned functionalities are better restricted to the `DAO` contract itself and triggered through governance xref:how-it-works/core/plugins/index.adoc[plugins] that you can install on your DAO.

To learn more, visit the [permission manager](../02-permissions/index.md) section.
To learn more, visit the xref:how-it-works/core/permissions/index.adoc[permission manager] section.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
title: The Smart Contracts behind DAOs
sidebar_label: Smart Contracts
---
= The Smart Contracts behind DAOs

## The Contracts Constituting Your DAO
=== The Contracts Constituting Your DAO

In a nutshell, your Aragon OSx DAO consists of three pieces:

Expand All @@ -27,19 +24,13 @@ In a nutshell, your Aragon OSx DAO consists of three pieces:

The underlying smart contracts constitute **the core contracts** of the Aragon OSx DAO framework.

<div class="center-column">
image::../../../_/images/optimized-svg/plugins/dao-plugin.drawio.svg[align="center"]

![Schematic depiction of the interaction between the DAO, the PermissionManager, and a Plugin contract.](/optimized-svg/plugins/dao-plugin.drawio.svg)

<p class="caption">
An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The <code>DAO</code> contract in blue containing the <code>PermissionManager</code> in red, respectively, as well as two <code>Plugin</code> contracts in green.
Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract.
</p>

</div>
An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The `DAO` contract in blue containing the `PermissionManager` in red, respectively, as well as two `Plugin` contracts in green.
Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract.

In the upcoming sections, you will learn about each of them in more depth.

- [The DAO Contract: The Identity and Basis of Your Organization](./01-dao/index.md)
- [Permissions: Managing Your DAO](./02-permissions/index.md)
- [Plugins: Customizing your DAO](./03-plugins/index.md)
- xref:how-it-works/core/dao/index.adoc[The DAO Contract: The Identity and Basis of Your Organization]
- xref:how-it-works/core/permissions/index.adoc[Permissions: Managing Your DAO]
- xref:how-it-works/core/plugins/index.adoc[Plugins: Customizing your DAO]
Loading

0 comments on commit 6450d3e

Please sign in to comment.