Skip to content

Commit

Permalink
Last touches
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Dec 5, 2024
1 parent 719d5ef commit 007b599
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/EmergencyMultisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,17 @@ contract EmergencyMultisig is IEmergencyMultisig, PluginUUPSUpgradeable, Proposa

// This internally calls `isListedAtBlock`.
// If not listed or resolved, it returns address(0)
(address _resolvedOwner, address _resolvedVoter) =
(address _owner, address _agent) =
multisigSettings.signerList.resolveEncryptionAccountAtBlock(_approver, proposal_.parameters.snapshotBlock);
if (_resolvedOwner == address(0) || _resolvedVoter == address(0)) {
if (_owner == address(0) || _agent == address(0)) {
// Not listedAtBlock() nor appointed by a listed owner
return false;
} else if (_approver != _resolvedVoter) {
// Only the voter account can vote (owners who appointed, can't)
} else if (_approver != _agent) {
// Only the agent can vote (owners who appointed, can't)
return false;
}

if (proposal_.approvers[_resolvedOwner]) {
if (proposal_.approvers[_owner]) {
// The account already approved
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Multisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,17 @@ contract Multisig is IMultisig, PluginUUPSUpgradeable, ProposalUpgradeable {

// This internally calls `isListedAtBlock`.
// If not listed or resolved, it returns address(0)
(address _resolvedOwner, address _resolvedVoter) =
(address _owner, address _agent) =
multisigSettings.signerList.resolveEncryptionAccountAtBlock(_approver, proposal_.parameters.snapshotBlock);
if (_resolvedOwner == address(0) || _resolvedVoter == address(0)) {
if (_owner == address(0) || _agent == address(0)) {
// Not listedAtBlock() nor appointed by a listed owner
return false;
} else if (_approver != _resolvedVoter) {
// Only the voter account can vote (owners who appointed, can't)
} else if (_approver != _agent) {
// Only the agent can vote (owners who appointed, can't)
return false;
}

if (proposal_.approvers[_resolvedOwner]) {
if (proposal_.approvers[_owner]) {
// The account already approved
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/SignerList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ contract SignerList is ISignerList, Addresslist, ERC165Upgradeable, DaoAuthoriza
function resolveEncryptionAccountAtBlock(address _address, uint256 _blockNumber)
public
view
returns (address _owner, address _voter)
returns (address _owner, address _agent)
{
if (isListedAtBlock(_address, _blockNumber)) {
// The owner + the voter
// The owner + the agent
return (_address, settings.encryptionRegistry.getAppointedAgent(_address));
}

address _appointer = settings.encryptionRegistry.appointerOf(_address);
if (this.isListedAtBlock(_appointer, _blockNumber)) {
// The appointed wallet votes
// The appointed agent votes
return (_appointer, _address);
}

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IEmergencyMultisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface IEmergencyMultisig {

/// @notice Checks if an account can participate on a proposal vote. This can be because the vote
/// - was executed, or
/// - the voter is not listed.
/// - the approver is not listed or appointed.
/// @param _proposalId The proposal Id.
/// @param _account The address of the user to check.
/// @return Returns true if the account is allowed to vote.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IMultisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface IMultisig {

/// @notice Checks if an account can participate on a proposal vote. This can be because the vote
/// - was executed, or
/// - the voter is not listed.
/// - the approver is not listed or appointed.
/// @param _proposalId The proposal Id.
/// @param _account The address of the user to check.
/// @return Returns true if the account is allowed to vote.
Expand Down

0 comments on commit 007b599

Please sign in to comment.