diff --git a/.gitignore b/.gitignore index d1a0991..23a3f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ packages/subgraph/deploy-output.txt packages/subgraph/subgraph.yaml packages/subgraph/tests/.latest.json packages/subgraph/tests/helpers/extended-schema.ts + +*.bkp diff --git a/README.md b/README.md index 4f47f03..26fb143 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,34 @@ The current repository provides the plugins necessary to cover two use cases: - Space plugin - Personal Space Admin plugin +### Standard Space + +In standard spaces, _members_ can create proposals while _editors_ can vote whether they should pass. Proposals eventually approved can be executed by anyone and this will make the DAO call the predefined proposal actions. + +The most typical case will be telling the Space Plugin to emit the event of a proposal being processed. + + + +The Main Voting Plugin can also pass proposals that change its own settings. + + + +To add new members, the Member Access Plugin allows anyone to request the permission. Editors can approve or reject it. + + + +### Personal Space + +Personal spaces are a simplified version, where anyone defined as editor can immediatelly execute proposals. Typically to edit the contents of a space. + + + +### Plugin Upgrader + +There's an optional case, where a predefined address can execute the actions to upgrade a plugin to the latest published version. + + + ## Global lifecycle ### Space genesis diff --git a/img/Geo Diagrams.drawio b/img/Geo Diagrams.drawio new file mode 100644 index 0000000..0a3ec45 --- /dev/null +++ b/img/Geo Diagrams.drawio @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/img/personal-1.svg b/img/personal-1.svg new file mode 100644 index 0000000..c8e5414 --- /dev/null +++ b/img/personal-1.svg @@ -0,0 +1,4 @@ + + + +
DAO
DAO
Personal Space
Admin Plugin
Personal Space...
Space Plugin
Space Plugin
Execute Proposal
Execute Proposal
Execute actions
Execute actions
Process Geo proposal
Accept subspace
Reject subspace
Process Geo proposal...
Emit events
Emit events
Text is not SVG - cannot display
\ No newline at end of file diff --git a/img/std-1.svg b/img/std-1.svg new file mode 100644 index 0000000..53cb7af --- /dev/null +++ b/img/std-1.svg @@ -0,0 +1,4 @@ + + + +
DAO
DAO
Main Voting
Plugin
Main Voting...
Space Plugin
Space Plugin
Create Proposal
Vote
Execute
Create Proposal...
Execute actions
Execute actions
Process Geo proposal
Accept subspace
Reject subspace
Process Geo proposal...
Emit events
Emit events
Text is not SVG - cannot display
\ No newline at end of file diff --git a/img/std-2.svg b/img/std-2.svg new file mode 100644 index 0000000..48726ad --- /dev/null +++ b/img/std-2.svg @@ -0,0 +1,4 @@ + + + +
DAO
DAO
Main Voting
Plugin
Main Voting...
Create Proposal
Vote
Execute
Create Proposal...
Execute actions
Execute actions
Update voting settings
Add addresses
Remove addresses
Update voting settings...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/img/std-3.svg b/img/std-3.svg new file mode 100644 index 0000000..929ab2f --- /dev/null +++ b/img/std-3.svg @@ -0,0 +1,4 @@ + + + +
DAO
DAO
Member Access Plugin
Member Access Plugin
Main Voting
Plugin
Main Voting...
Propose add/remove member
Propose add/remove editor
Approve
Reject
Propose add/remove member...
Execute actions
(condition)
Execute actions...
Is editor?
Editor count?
Is editor?...
Grant / Revoke
Grant / Revoke
Text is not SVG - cannot display
\ No newline at end of file diff --git a/img/upgrader-1.svg b/img/upgrader-1.svg new file mode 100644 index 0000000..3a6d0fa --- /dev/null +++ b/img/upgrader-1.svg @@ -0,0 +1,4 @@ + + + +
DAO
DAO
Plugin upgrader
address
Plugin upgrader...
Plugin Setup
Processor
Plugin Setup...
Grant permission to PSP
Call applyUpdate()
Revoke permission to PSP
Grant permission to PSP...
Execute actions
(condition)
Execute actions...
2) Apply update
2) Apply update
1) Grant
3) Revoke
1) Grant...
Upgrade plugins
Upgrade plugins
Text is not SVG - cannot display
\ No newline at end of file diff --git a/packages/contracts/src/MemberAccessPlugin.sol b/packages/contracts/src/MemberAccessPlugin.sol index 939e41b..48d1e42 100644 --- a/packages/contracts/src/MemberAccessPlugin.sol +++ b/packages/contracts/src/MemberAccessPlugin.sol @@ -28,14 +28,14 @@ contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgrade bytes32 public constant UPDATE_MULTISIG_SETTINGS_PERMISSION_ID = keccak256("UPDATE_MULTISIG_SETTINGS_PERMISSION"); - /// @notice The minimum amount of approvals required for proposals created by a non-editor - uint16 internal constant MIN_APPROVALS_NON_EDITOR = uint16(1); + /// @notice The minimum total amount of approvals required for proposals created by a non-editor + uint16 internal constant MIN_APPROVALS_WHEN_CREATED_BY_NON_EDITOR = uint16(1); - /// @notice The minimum amount of approvals required for proposals created by an editor (single) - uint16 internal constant MIN_APPROVALS_EDITOR_SINGLE = uint16(1); + /// @notice The minimum total amount of approvals required for proposals created by an editor (single) + uint16 internal constant MIN_APPROVALS_WHEN_CREATED_BY_SINGLE_EDITOR = uint16(1); - /// @notice The minimum amount of approvals required for proposals created by an editor (multiple) - uint16 internal constant MIN_APPROVALS_EDITOR_MANY = uint16(2); + /// @notice The minimum total amount of approvals required for proposals created by an editor (multiple) + uint16 internal constant MIN_APPROVALS_WHEN_CREATED_BY_EDITOR_OF_MANY = uint16(2); /// @notice A container for proposal-related information. /// @param executed Whether the proposal is executed or not. @@ -223,15 +223,15 @@ contract MemberAccessPlugin is IMultisig, PluginUUPSUpgradeable, ProposalUpgrade if (isEditor(_msgSender())) { if (multisigSettings.mainVotingPlugin.addresslistLength() < 2) { - proposal_.parameters.minApprovals = MIN_APPROVALS_EDITOR_SINGLE; + proposal_.parameters.minApprovals = MIN_APPROVALS_WHEN_CREATED_BY_SINGLE_EDITOR; } else { - proposal_.parameters.minApprovals = MIN_APPROVALS_EDITOR_MANY; + proposal_.parameters.minApprovals = MIN_APPROVALS_WHEN_CREATED_BY_EDITOR_OF_MANY; } // If the creator is an editor, we assume that the editor approves approve(proposalId, false); } else { - proposal_.parameters.minApprovals = MIN_APPROVALS_NON_EDITOR; + proposal_.parameters.minApprovals = MIN_APPROVALS_WHEN_CREATED_BY_NON_EDITOR; } }