Skip to content

Commit

Permalink
Adapted names (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik authored Feb 28, 2023
1 parent 096ce3a commit 8180a76
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Advanced Action 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 title="@aragon/osx-contracts/core/dao/DAO.sol"
function execute(
bytes32 _callId,
Action[] calldata _actions,
Expand All @@ -27,7 +27,7 @@ It offers two features that we will dive into in this article:

In our framework, actions are represented by a solidity struct:

```solidity title="@aragon/osx/core/dao/IDAO.sol"
```solidity title="@aragon/osx-contracts/core/dao/IDAO.sol"
/// @notice The action struct to be consumed by the DAO's `execute` function resulting in an external call.
/// @param to The address to call.
/// @param value The native token value to be sent with the call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Conditions
Permission conditions relay the decision if an authorized call is permitted to another contract.
This contract must implement the `IPermissionCondition` interface.

```solidity title="@aragon/osx/core/permission/IPermissionCondition.sol"
```solidity title="@aragon/osx-contracts/core/permission/IPermissionCondition.sol"
interface IPermissionCondition {
/// @notice This method is used to check if a call is permitted.
/// @param _where The address of the target contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Identifiers, permissions, and modifiers link everything together.

To differentiate between different permissions, permission **identifiers** are used that you will frequently find at the top of Aragon OSx contracts. They look something like this:

```solidity title="@aragon/osx/core/dao/DAO.sol"
```solidity title="@aragon/osx-contracts/core/dao/DAO.sol"
bytes32 public constant EXECUTE_PERMISSION_ID = keccak256("EXECUTE_PERMISSION");
```

### Permissions

A permission specifies an address `who` being allowed to call certain functions on a contract address `where`. In the `PermissionManager` contract, permissions are defined as the concatenation of the word `"PERMISSION"` with the `who` and `where` address, as well as the `bytes32` permission identifier `permissionId`.

```solidity title="@aragon/osx/core/permission/PermissionManager.sol"
```solidity title="@aragon/osx-contracts/core/permission/PermissionManager.sol"
function permissionHash(
address _where,
address _who,
Expand All @@ -41,7 +41,7 @@ function permissionHash(

This concatenated information is then stored as `keccak256` hashes inside a mapping like this one:

```solidity title="@aragon/osx/core/permission/PermissionManager.sol"
```solidity title="@aragon/osx-contracts/core/permission/PermissionManager.sol"
mapping(bytes32 => address) internal permissionsHashed;
```

Expand All @@ -53,7 +53,7 @@ Using **authorization modifiers** is how we make functions permissioned. Permiss

For example, one can call the `execute` function in the DAO when the address making the call has been granted the `EXECUTE_PERMISSION_ID` permission.

```solidity title="@aragon/osx/core/dao/DAO.sol"
```solidity title="@aragon/osx-contracts/core/dao/DAO.sol"
function execute(
bytes32 callId,
Action[] calldata _actions,
Expand All @@ -74,7 +74,7 @@ To manage permissions, the DAO contract has the `grant`, `revoke` and `grantWith
The `grant` and `revoke` functions are the main functions we use to manage permissions.
Both receive the `_permissionId` identifier of the permission and the `_where` and `_who` addresses as arguments.

```solidity title="@aragon/osx/core/permission/PermissionManager.sol"
```solidity title="@aragon/osx-contracts/core/permission/PermissionManager.sol"
function grant(
address _where,
address _who,
Expand All @@ -99,7 +99,7 @@ Exceptions are, again, the [DAO creation](../../02-framework/01-dao-creation/ind

Aragon OSx supports relaying the authorization of a function call to another contract inheriting from the `IPermissionCondition` interface. This works by granting the permission with the `grantWithCondition` function

```solidity title="@aragon/osx/core/permission/PermissionManager.sol"
```solidity title="@aragon/osx-contracts/core/permission/PermissionManager.sol"
function grantWithCondition(
address _where,
address _who,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To instantiate your implementation contract via Solidity's `new` keyword, you in
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol';
import {Plugin, IDAO} from '@aragon/osx-contracts/core/plugin/Plugin.sol';
contract SimpleAdmin is Plugin {
address public immutable admin;
Expand Down Expand Up @@ -59,7 +59,7 @@ To deploy your implementation contract via the [minimal clones pattern (ERC-1167
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {PluginCloneable, IDAO} from '@aragon/osx/core/plugin/PluginCloneable.sol';
import {PluginCloneable, IDAO} from '@aragon/osx-contracts/core/plugin/PluginCloneable.sol';
contract SimpleAdmin is PluginCloneable {
address public admin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Let's again start with the deployment and initialization. Here, it is simple bec
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol';
import {PluginSetup, IPluginSetup} from '@aragon/osx-contracts/framework/plugin/setup/PluginSetup.sol';
import {SimpleAdmin} from './SimpleAdmin.sol';
contract SimpleAdminSetup is PluginSetup {
Expand All @@ -63,7 +63,7 @@ The skeleton of our `SimpleAdminSetup` contract inheriting from `PluginSetup` lo
<summary><code>SimpleAdminSetup</code>: The Sekeleton</summary>

```solidity
import {PermissionLib} from '@aragon/osx/core/permissions/PermissionsLib.sol';
import {PermissionLib} from '@aragon/osx-contracts/core/permissions/PermissionsLib.sol';
contract SimpleAdminSetup is PluginSetup {
/// @notice The address of `SimpleAdmin` plugin logic contract to be cloned.
Expand Down Expand Up @@ -233,8 +233,8 @@ pragma solidity 0.8.17;
import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol';
import {PermissionLib} from '@aragon/osx/core/permissions/PermissionsLib.sol';
import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol';
import {PermissionLib} from '@aragon/osx-contracts/core/permissions/PermissionsLib.sol';
import {PluginSetup, IPluginSetup} from '@aragon/osx-contracts/framework/plugin/setup/PluginSetup.sol';
import {SimpleAdmin} from './SimpleAdmin.sol';
contract SimpleAdminSetup is PluginSetup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For the same reason you had to [initialize your non-upgradeable `PluginClonable`
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol';
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx-contracts/core/plugin/PluginUUPSUpgradeable.sol';
/// @title SimpleStorage v1.0
contract SimpleStorageBuild0 is PluginUUPSUpgradeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In build 0, we want to add an authorized `storeNumber` function to the contract
<summary><code>SimpleStorageBuild0</code></summary>

```solidity
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol';
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx-contracts/core/plugin/PluginUUPSUpgradeable.sol';
/// @title SimpleStorage v1.0
contract SimpleStorageBuild0 is PluginUUPSUpgradeable {
Expand Down Expand Up @@ -46,7 +46,7 @@ In build 1, we added a second storage variable `address public account;`. Additi
<summary><code>SimpleStorageBuild1</code></summary>

```solidity
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol';
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx-contracts/core/plugin/PluginUUPSUpgradeable.sol';
/// @title SimpleStorage v1.1
contract SimpleStorageBuild1 is PluginUUPSUpgradeable {
Expand Down Expand Up @@ -102,7 +102,7 @@ For build 2, we decided to introduce two separate permissions for the `storeNumb
<summary><code>SimpleStorageBuild2</code></summary>

```solidity
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol';
import {PluginUUPSUpgradeable, IDAO} '@aragon/osx-contracts/core/plugin/PluginUUPSUpgradeable.sol';
/// @title SimpleStorage v1.2
contract SimpleStorageBuild2 is PluginUUPSUpgradeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Now, we show the setup contracts associated with the 3 builds we have implemente
<summary><code>SimpleStorageBuild0</code></summary>

```solidity
import {PluginUUPSUpgradeable} from '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol';
import {PluginUUPSUpgradeable} from '@aragon/osx-contracts/core/plugin/PluginUUPSUpgradeable.sol';
/// @title SimpleStorage v1.0
contract SimpleStorageBuild0 is PluginUUPSUpgradeable {
Expand Down Expand Up @@ -40,8 +40,8 @@ For the first version, the setup is very similar to the [setup example for the n
<summary><code>SimpleStorageBuild0Setup</code></summary>

```solidity
import {PermissionLib} from '@aragon/osx/core/permissions/PermissionsLib.sol';
import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol';
import {PermissionLib} from '@aragon/osx-contracts/core/permissions/PermissionsLib.sol';
import {PluginSetup, IPluginSetup} from '@aragon/osx-contracts/framework/plugin/setup/PluginSetup.sol';
import {SimpleStorageBuild0} from './SimpleStorageBuild0.sol';
/// @title SimpleStorageSetup v1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To use the Aragon OSx contracts inside your project, import them with `yarn add
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol';
import {Plugin, IDAO} from '@aragon/osx-contracts/core/plugin/Plugin.sol';
contract GreeterPlugin is Plugin {
constructor(IDAO _dao) Plugin(_dao) {}
Expand All @@ -41,8 +41,8 @@ Next, you write a plugin setup contract:
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
import {PermissionLib} from '@aragon/osx/core/permissions/PermissionsLib.sol';
import {PluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol';
import {PermissionLib} from '@aragon/osx-contracts/core/permissions/PermissionsLib.sol';
import {PluginSetup} from '@aragon/osx-contracts/framework/plugin/setup/PluginSetup.sol';
import './MyPlugin.sol';
contract GreeterSetup is PluginSetup {
Expand Down

0 comments on commit 8180a76

Please sign in to comment.