-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: new multisig version #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also could generally add FuncDocs to the Solidity contracts.. but this maybe should be done within another PR to keep a narrow scope of changes here :-)
permissions[1] = PermissionLib.MultiTargetPermission( | ||
PermissionLib.Operation.Revoke, | ||
_payload.plugin, | ||
_dao, | ||
PermissionLib.NO_CONDITION, | ||
UPGRADE_PLUGIN_PERMISSION_ID | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from v1.3
the UPGRADE_PLUGIN_PERMISSION_ID
is not being granted to the DAO, so it doesn’t need to be revoked when uninstalling.
It is already being revoked when upgrading from a previous version
Co-authored-by: Jør∂¡ <[email protected]>
Co-authored-by: Jør∂¡ <[email protected]>
Co-authored-by: Jør∂¡ <[email protected]>
add metadata support
@@ -69,15 +74,21 @@ contract Multisig is | |||
|
|||
/// @notice The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. | |||
bytes4 internal constant MULTISIG_INTERFACE_ID = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this the old interface, I would make it clear by the name.
The new interface is checked via the interface ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not the old one, but in the new code, the IProposal
createProposal
function was added.
Note that this createProposal
function is not needed on the current interface id because it belong to IProposal
packages/contracts/src/Multisig.sol
Outdated
Action[] calldata _actions, | ||
bytes memory _metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated above, createProposal
generating the same proposal ID twice for the same data can be a problem for certain cases.
Adding startDate
might solve this issue, although my recommendation would be for having a nonce salted with the chain ID and the plugin's address
packages/contracts/src/Multisig.sol
Outdated
_actions: _actions, | ||
_allowFailureMap: _allowFailureMap | ||
}); | ||
proposalId = createProposalId(_actions, _metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I need to submit a recurring proposal each week with identical actions and description?
- If I wanted to automate the resubmission from a contract of my own, I wouldn't be able to
- I would be forced to append garbage bytes to the metadata URI and corrupt the UI trying to fetch it
Recommendation:
- Add the
startDate
as a salt parameter - Consider having random and unique proposal ID's unless there's a major reason for strong determinism
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved in aragon/osx-commons#106
packages/contracts/src/Multisig.sol
Outdated
} | ||
|
||
/// @inheritdoc IProposal | ||
function createProposalParamsABI() external pure override returns (string memory) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not sold on the interface name...
Thinking of createProposalDataABI()
, customProposalParamsABI()
or similar.
Otherwise it sounds as if createProposal()
had to have these exact params, instead of talking about data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we ended up agreeing on customProposalParamsABI
aragon/osx-commons#106
/// @notice The ID of the permission required to call the `upgradeToAndCall` function. | ||
bytes32 internal constant UPGRADE_PLUGIN_PERMISSION_ID = keccak256("UPGRADE_PLUGIN_PERMISSION"); | ||
|
||
/// @notice The ID of the permission required to call the `setTargetConfig` function. | ||
bytes32 public constant SET_TARGET_CONFIG_PERMISSION_ID = | ||
keccak256("SET_TARGET_CONFIG_PERMISSION"); | ||
|
||
/// @notice The ID of the permission required to call the `updateMetadata` function. | ||
bytes32 public constant UPDATE_METADATA_PERMISSION_ID = keccak256("UPDATE_METADATA_PERMISSION"); | ||
|
||
/// @notice The ID of the permission required to call the `updateMultisigSettings` function. | ||
bytes32 public constant UPDATE_MULTISIG_SETTINGS_PERMISSION_ID = | ||
keccak256("UPDATE_MULTISIG_SETTINGS_PERMISSION"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with other plugins, these constants might be better moved as file level constants, living on the lib (osx-common) package
permissions[1] = PermissionLib.MultiTargetPermission( | ||
PermissionLib.Operation.GrantWithCondition, | ||
_payload.plugin, | ||
address(type(uint160).max), // ANY_ADDR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ANY_ADDR should be imported from PermissionLib
, rather than hardcoded
@@ -55,10 +82,9 @@ contract MultisigSetup is PluginUpgradeableSetup { | |||
where: plugin, | |||
who: _dao, | |||
condition: PermissionLib.NO_CONDITION, | |||
permissionId: Multisig(IMPLEMENTATION).UPDATE_MULTISIG_SETTINGS_PERMISSION_ID() | |||
permissionId: UPDATE_MULTISIG_SETTINGS_PERMISSION_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not importing this from a plugin level library?
@@ -67,7 +93,34 @@ contract MultisigSetup is PluginUpgradeableSetup { | |||
permissionId: EXECUTE_PERMISSION_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not importing these from OSx common > Executor?
plugin, | ||
address(type(uint160).max), // ANY_ADDR | ||
listedCheckCondition, | ||
Multisig(IMPLEMENTATION).CREATE_PROPOSAL_PERMISSION_ID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a file level import from an internal library, rather than calling external instances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, even when this has not been the pattern so far, I would support your proposal, unless we find a problem with doing it this way
permissionId: SET_TARGET_CONFIG_PERMISSION_ID | ||
}); | ||
|
||
permissions[4] = PermissionLib.MultiTargetPermission({ | ||
operation: PermissionLib.Operation.Grant, | ||
where: plugin, | ||
who: _dao, | ||
condition: PermissionLib.NO_CONDITION, | ||
permissionId: UPDATE_METADATA_PERMISSION_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above:
- file level import from OSx common > IPlugin
- file level import from OSx common > IMetadataExtension
* fix contracts and test * change * createproposal id include actions * rename
…execute permission
Feature/has succeeded
Description
A couple of things remaining: ???
Task ID: OS-1482, OS-1450
Checklist:
CHANGELOG.md
file in the root folder.