Skip to content

Commit

Permalink
unused comments
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Oct 31, 2024
1 parent b1969cc commit 1f0faed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/src/MajorityVotingBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ abstract contract MajorityVotingBase is
/// @notice The ID of the permission required to call the `createProposal` functions.
bytes32 public constant CREATE_PROPOSAL_PERMISSION_ID = keccak256("CREATE_PROPOSAL_PERMISSION");

/// @notice The ID of the permission required to call the `execute` functions.
/// @notice The ID of the permission required to call the `execute` function.
bytes32 public constant EXECUTE_PROPOSAL_PERMISSION_ID =
keccak256("EXECUTE_PROPOSAL_PERMISSION");

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/src/TokenVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ contract TokenVoting is IMembership, MajorityVotingBase {

if (
_canExecute(_proposalId) &&
dao().hasPermission(address(this), _voter, EXECUTE_PROPOSAL_PERMISSION_ID, msg.data)
dao().hasPermission(address(this), _voter, EXECUTE_PROPOSAL_PERMISSION_ID, _msgData())
) {
_execute(_proposalId);
}
Expand Down
12 changes: 8 additions & 4 deletions packages/contracts/src/TokenVotingSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ contract TokenVotingSetup is PluginUpgradeableSetup {
/// @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 `execute` function.
bytes32 internal constant EXECUTE_PROPOSAL_PERMISSION_ID =
keccak256("EXECUTE_PROPOSAL_PERMISSION");

/// @notice A special address encoding permissions that are valid for any address `who` or `where`.
address internal constant ANY_ADDR = address(type(uint160).max);

Expand Down Expand Up @@ -203,7 +207,7 @@ contract TokenVotingSetup is PluginUpgradeableSetup {
permissions[2] = PermissionLib.MultiTargetPermission(
PermissionLib.Operation.GrantWithCondition,
plugin,
ANY_ADDR, // ANY_ADDR
ANY_ADDR,
preparedSetupData.helpers[0], // VotingPowerCondition
TokenVoting(IMPLEMENTATION).CREATE_PROPOSAL_PERMISSION_ID()
);
Expand All @@ -229,7 +233,7 @@ contract TokenVotingSetup is PluginUpgradeableSetup {
where: plugin,
who: ANY_ADDR,
condition: PermissionLib.NO_CONDITION,
permissionId: TokenVoting(IMPLEMENTATION).EXECUTE_PROPOSAL_PERMISSION_ID()
permissionId: EXECUTE_PROPOSAL_PERMISSION_ID
});

if (tokenSettings.addr == address(0)) {
Expand Down Expand Up @@ -301,7 +305,7 @@ contract TokenVotingSetup is PluginUpgradeableSetup {
where: _payload.plugin,
who: ANY_ADDR,
condition: PermissionLib.NO_CONDITION,
permissionId: TokenVoting(IMPLEMENTATION).EXECUTE_PROPOSAL_PERMISSION_ID()
permissionId: EXECUTE_PROPOSAL_PERMISSION_ID
});

preparedSetupData.permissions = permissions;
Expand Down Expand Up @@ -366,7 +370,7 @@ contract TokenVotingSetup is PluginUpgradeableSetup {
where: _payload.plugin,
who: ANY_ADDR,
condition: PermissionLib.NO_CONDITION,
permissionId: TokenVoting(IMPLEMENTATION).EXECUTE_PROPOSAL_PERMISSION_ID()
permissionId: EXECUTE_PROPOSAL_PERMISSION_ID
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/10_unit-testing/11_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ describe('TokenVoting', function () {
.withArgs(id);
});

it.only('can not execute even if participation and support are met when caller does not have permission', async () => {
it('can not execute even if participation and support are met when caller does not have permission', async () => {
const {
alice,
bob,
Expand Down

0 comments on commit 1f0faed

Please sign in to comment.