-
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
Build 1.2 new changes #18
Conversation
packages/contracts/src/Admin.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.
Same as for multisig
aragon#19 (comment)
@@ -20,8 +22,7 @@ contract Admin is IMembership, PluginCloneable, ProposalUpgradeable { | |||
using SafeCastUpgradeable for uint256; | |||
|
|||
/// @notice The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract. | |||
bytes4 internal constant ADMIN_INTERFACE_ID = | |||
this.initialize.selector ^ this.executeProposal.selector; | |||
bytes4 internal constant ADMIN_INTERFACE_ID = this.executeProposal.selector; |
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 for multisig
aragon#19 (review)
This interface is now deprecated
packages/contracts/src/Admin.sol
Outdated
} | ||
|
||
/// @inheritdoc IProposal | ||
/// @dev Admin doesn't allow creating a proposal, so we return empty string. |
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.
Is this applicable?
@@ -67,19 +118,33 @@ contract Admin is IMembership, PluginCloneable, ProposalUpgradeable { | |||
// of 0 requires every action to not revert. | |||
function executeProposal( |
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.
function executeProposal( | |
/// @dev This function is deprecated, as createProposal achieves the same effect | |
function executeProposal( |
(address admin, PluginCloneable.TargetConfig memory targetConfig) = abi.decode( | ||
_data, | ||
(address, PluginCloneable.TargetConfig) | ||
); |
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 multisig. Let's encode and decode data using a standard mechanism:
/// @dev This method is required to support [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167). | ||
function initialize(IDAO _dao) external initializer { | ||
function initialize(IDAO _dao, TargetConfig calldata _targetConfig) external initializer { | ||
__PluginCloneable_init(_dao); | ||
|
||
_setTargetConfig(_targetConfig); | ||
|
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.
Shouldn't we use reintializer(n)
here, and then create another function for initializing from other versions?
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.
Admin is non-upgradeable but cloneable, so no..
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.
true
The PR introduces the several changes:
ADMIN_INTERFACE_ID
changed as it no longer includes theinitialize
's selector.osx-commons
's IProposal.PluginCloneable
- i.e allowing targets to be set with eithercall
ordelegatecall
operation types.SET_TARGET_CONFIG_PERMISSION_ID
to the dao to reduce gas costs. Most of the time, admin needs its target to bedao
and stay that way.