From 20898c5e4f38c7720f84a2c7393ede0e690655a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8r=E2=88=82=C2=A1?= <4456749@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:42:05 +0000 Subject: [PATCH] Addressing internal feedback, round 2 --- README.md | 6 ++-- package.json | 1 - packages/contracts/package.json | 5 ++-- packages/contracts/src/MainVotingPlugin.sol | 4 +-- packages/contracts/src/MemberAccessPlugin.sol | 28 +++++++++++-------- .../src/PersonalSpaceAdminPlugin.sol | 2 +- .../src/PersonalSpaceAdminPluginSetup.sol | 2 +- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 96503ed..b0c1542 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/package.json b/package.json index c4be9d7..7034c6e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "name": "@aragon/osx-plugin-template-hardhat", "license": "AGPL-3.0-or-later", "private": true, "workspaces": { diff --git a/packages/contracts/package.json b/packages/contracts/package.json index ccdc35c..b28e3f1 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -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": [ diff --git a/packages/contracts/src/MainVotingPlugin.sol b/packages/contracts/src/MainVotingPlugin.sol index ba0e63c..1e6e739 100644 --- a/packages/contracts/src/MainVotingPlugin.sol +++ b/packages/contracts/src/MainVotingPlugin.sol @@ -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 { @@ -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; } diff --git a/packages/contracts/src/MemberAccessPlugin.sol b/packages/contracts/src/MemberAccessPlugin.sol index d2d779a..bd22e29 100644 --- a/packages/contracts/src/MemberAccessPlugin.sol +++ b/packages/contracts/src/MemberAccessPlugin.sol @@ -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; @@ -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 + ) ) }); @@ -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 + ) ) }); @@ -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; } diff --git a/packages/contracts/src/PersonalSpaceAdminPlugin.sol b/packages/contracts/src/PersonalSpaceAdminPlugin.sol index 239db95..a0acd10 100644 --- a/packages/contracts/src/PersonalSpaceAdminPlugin.sol +++ b/packages/contracts/src/PersonalSpaceAdminPlugin.sol @@ -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; diff --git a/packages/contracts/src/PersonalSpaceAdminPluginSetup.sol b/packages/contracts/src/PersonalSpaceAdminPluginSetup.sol index cbe3302..640519e 100644 --- a/packages/contracts/src/PersonalSpaceAdminPluginSetup.sol +++ b/packages/contracts/src/PersonalSpaceAdminPluginSetup.sol @@ -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;