Skip to content

Commit

Permalink
Addressing internal feedback, round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jør∂¡ committed Nov 17, 2023
1 parent 04dcd62 commit 20898c5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ The current repository provides the plugins necessary to cover two use cases:
- Calling `approve()` makes the proposal succeed
- Calling `reject()` cancels the proposal
3. A succeeded proposal is executed automatically
- This makes the DAO call `grant()` on itself to grant the `MEMBERSHIP_PERMISSION` to the intended address
- This makes the DAO call `grant()` on itself to grant the `MEMBER_PERMISSION_ID` to the intended address

### Creating proposals for a space

1. An editor or a wallet with the `MEMBERSHIP_PERMISSION` granted, creates a proposal
1. An editor or a wallet with the `MEMBER_PERMISSION_ID` granted, creates a proposal
2. Editors can vote on it for a predefined amount of time
3. If the proposal exceeds the required quorum and support, the proposal succeeds
4. Succeeded proposals can be executed by anyone
Expand Down Expand Up @@ -243,7 +243,7 @@ Inherited:

### Member Access plugin

Provides a simple way for any address to request membership on a space. It is a adapted version of Aragon's [Multisig plugin](https://github.com/aragon/osx/blob/develop/packages/contracts/src/plugins/governance/multisig/Multisig.sol). It creates a proposal to grant `MEMBERSHIP_PERMISSION` to an address on the main voting plugin and Editors can approve or reject it. Once approved, the permission allows to create proposals on the other plugin.
Provides a simple way for any address to request membership on a space. It is a adapted version of Aragon's [Multisig plugin](https://github.com/aragon/osx/blob/develop/packages/contracts/src/plugins/governance/multisig/Multisig.sol). It creates a proposal to grant `MEMBER_PERMISSION_ID` to an address on the main voting plugin and Editors can approve or reject it. Once approved, the permission allows to create proposals on the other plugin.

#### Methods

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "@aragon/osx-plugin-template-hardhat",
"license": "AGPL-3.0-or-later",
"private": true,
"workspaces": {
Expand Down
5 changes: 2 additions & 3 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
"dependencies": {
"@aragon/osx": "^1.3.0-rc0.1",
"@aragon/osx-ethers": "^1.3.0-rc0.1",
"@ensdomains/ens-contracts": "0.0.20",
"@openzeppelin/contracts": "^4.8.2",
"@openzeppelin/contracts-upgradeable": "^4.8.2",
"@openzeppelin/contracts": "^4.9.3",
"@openzeppelin/contracts-upgradeable": "^4.9.3",
"@openzeppelin/hardhat-upgrades": "^1.27.0"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/src/MainVotingPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bytes4 constant MAIN_SPACE_VOTING_INTERFACE_ID = MainVotingPlugin.initialize.sel
MainVotingPlugin.isEditor.selector;

/// @title MainVotingPlugin
/// @author Aragon Association - 2021-2023.
/// @author Aragon - 2023
/// @notice The majority voting implementation using a list of member addresses.
/// @dev This contract inherits from `MajorityVotingBase` and implements the `IMajorityVoting` interface.
contract MainVotingPlugin is IMembership, Addresslist, MajorityVotingBase {
Expand Down Expand Up @@ -274,5 +274,5 @@ contract MainVotingPlugin is IMembership, Addresslist, MajorityVotingBase {
/// @dev This empty reserved space is put in place to allow future versions to add new
/// variables without shifting down storage in the inheritance chain.
/// https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private __gap;
uint256[49] private __gap;
}
28 changes: 16 additions & 12 deletions packages/contracts/src/MemberAccessPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bytes4 constant MEMBER_ACCESS_INTERFACE_ID = MemberAccessPlugin.initialize.selec
MemberAccessPlugin.getProposal.selector;

/// @title Multisig - Release 1, Build 1
/// @author Aragon Association - 2022-2023
/// @author Aragon - 2023
/// @notice The on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met.
contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgradeable {
using SafeCastUpgradeable for uint256;
Expand Down Expand Up @@ -253,11 +253,13 @@ contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgrade
_actions[0] = IDAO.Action({
to: address(dao()),
value: 0,
data: abi.encodeWithSelector(
PermissionManager.grant.selector, // grant()
address(multisigSettings.mainVotingPlugin), // where
_proposedMember, // who
MEMBER_PERMISSION_ID // permission ID
data: abi.encodeCall(
PermissionManager.grant,
(
address(multisigSettings.mainVotingPlugin), // where
_proposedMember, // who
MEMBER_PERMISSION_ID // permission ID
)
)
});

Expand All @@ -282,11 +284,13 @@ contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgrade
_actions[0] = IDAO.Action({
to: address(dao()),
value: 0,
data: abi.encodeWithSelector(
PermissionManager.revoke.selector, // revoke()
address(multisigSettings.mainVotingPlugin), // where
_proposedMember, // who
MEMBER_PERMISSION_ID // permission ID
data: abi.encodeCall(
PermissionManager.revoke,
(
address(multisigSettings.mainVotingPlugin), // where
_proposedMember, // who
MEMBER_PERMISSION_ID // permission ID
)
)
});

Expand Down Expand Up @@ -489,5 +493,5 @@ contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgrade
/// @dev This empty reserved space is put in place to allow future versions to add new
/// variables without shifting down storage in the inheritance chain.
/// https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private __gap;
uint256[47] private __gap;
}
2 changes: 1 addition & 1 deletion packages/contracts/src/PersonalSpaceAdminPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";
import {EDITOR_PERMISSION_ID, MEMBER_PERMISSION_ID} from "./constants.sol";

/// @title PersonalSpaceAdminPlugin
/// @author Aragon Association - 2022-2023
/// @author Aragon - 2023
/// @notice The admin governance plugin giving execution permission on the DAO to a single address.
contract PersonalSpaceAdminPlugin is PluginCloneable, ProposalUpgradeable {
using SafeCastUpgradeable for uint256;
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/src/PersonalSpaceAdminPluginSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {PersonalSpaceAdminPlugin} from "./PersonalSpaceAdminPlugin.sol";
import {EDITOR_PERMISSION_ID} from "./constants.sol";

/// @title PersonalSpaceAdminPluginSetup
/// @author Aragon Association - 2022-2023
/// @author Aragon - 2023
/// @notice The setup contract of the `PersonalSpaceAdminPlugin` plugin.
contract PersonalSpaceAdminPluginSetup is PluginSetup {
using Clones for address;
Expand Down

0 comments on commit 20898c5

Please sign in to comment.