Skip to content

Commit

Permalink
fix: update natspec of IMajorityVoting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekard0 committed Nov 11, 2024
1 parent ae135e7 commit 89f34a9
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 200 deletions.
25 changes: 13 additions & 12 deletions packages/contracts/src/IMajorityVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity ^0.8.8;

/// @title IMajorityVoting
/// @author Aragon X - 2022-2023
/// @author Aragon X - 2022-2024
/// @notice The interface of majority voting plugin.
/// @custom:security-contact [email protected]
interface IMajorityVoting {
Expand Down Expand Up @@ -36,7 +36,7 @@ interface IMajorityVoting {
/// @return The support threshold parameter.
function supportThreshold() external view returns (uint32);

/// @notice Returns the min approval value stored configured.
/// @notice Returns the configured minimum approval value.
/// @return The minimal approval value.
function minApproval() external view returns (uint256);

Expand All @@ -46,33 +46,33 @@ interface IMajorityVoting {

/// @notice Checks if the support value defined as:
/// $$\texttt{support} = \frac{N_\text{yes}}{N_\text{yes}+N_\text{no}}$$
/// for a proposal vote is greater than the support threshold.
/// for a proposal is greater than the support threshold.
/// @param _proposalId The ID of the proposal.
/// @return Returns `true` if the support is greater than the support threshold and `false` otherwise.
function isSupportThresholdReached(uint256 _proposalId) external view returns (bool);

/// @notice Checks if the worst-case support value defined as:
/// $$\texttt{worstCaseSupport} = \frac{N_\text{yes}}{ N_\text{total}-N_\text{abstain}}$$
/// for a proposal vote is greater than the support threshold.
/// for a proposal is greater than the support threshold.
/// @param _proposalId The ID of the proposal.
/// @return Returns `true` if the worst-case support is greater than the support threshold and `false` otherwise.
function isSupportThresholdReachedEarly(uint256 _proposalId) external view returns (bool);

/// @notice Checks if the participation value defined as:
/// $$\texttt{participation} = \frac{N_\text{yes}+N_\text{no}+N_\text{abstain}}{N_\text{total}}$$
/// for a proposal vote is greater or equal than the minimum participation value.
/// for a proposal is greater or equal than the minimum participation value.
/// @param _proposalId The ID of the proposal.
/// @return Returns `true` if the participation is greater than the minimum participation and `false` otherwise.
/// @return Returns `true` if the participation is greater or equal than the minimum participation and `false` otherwise.

Check failure on line 65 in packages/contracts/src/IMajorityVoting.sol

View workflow job for this annotation

GitHub Actions / checks

Line length must be no more than 120 but current length is 125
function isMinParticipationReached(uint256 _proposalId) external view returns (bool);

/// @notice Checks if the min approval value defined as:
///$$\texttt{minApproval} = \frac{N_\text{yes}}{N_\text{total}}$$
/// for a proposal vote is greater or equal than the minimum approval value.
/// for a proposal is greater or equal than the minimum approval value.
/// @param _proposalId The ID of the proposal.
/// @return Returns `true` if the participation is greater than the minimum participation and `false` otherwise.
/// @return Returns `true` if the approvals is greater or equal than the minimum approval and `false` otherwise.
function isMinApprovalReached(uint256 _proposalId) external view returns (bool);

/// @notice Checks if an account can participate on a proposal vote. This can be because the vote
/// @notice Checks if an account can participate on a proposal. This can be because the vote
/// - has not started,
/// - has ended,
/// - was executed, or
Expand All @@ -81,7 +81,7 @@ interface IMajorityVoting {
/// @param _account The account address to be checked.
/// @param _voteOption Whether the voter abstains, supports or opposes the proposal.
/// @return Returns true if the account is allowed to vote.
/// @dev The function assumes the queried proposal exists.
/// @dev Reverts if the proposal with the given `_proposalId` does not exist.
function canVote(
uint256 _proposalId,
address _account,
Expand All @@ -93,7 +93,7 @@ interface IMajorityVoting {
/// @return True if the proposal can be executed, false otherwise.
function canExecute(uint256 _proposalId) external view returns (bool);

/// @notice Votes for a vote option and, optionally, executes the proposal.
/// @notice Votes on a proposal and, optionally, executes the proposal.
/// @dev `_voteOption`, 1 -> abstain, 2 -> yes, 3 -> no
/// @param _proposalId The ID of the proposal.
/// @param _voteOption The chosen vote option.
Expand All @@ -106,10 +106,11 @@ interface IMajorityVoting {
function execute(uint256 _proposalId) external;

/// @notice Returns whether the account has voted for the proposal.
/// Note, that this does not check if the account has voting power.
/// @param _proposalId The ID of the proposal.
/// @param _account The account address to be checked.
/// @return The vote option cast by a voter for a certain proposal.
/// @dev May return `none` if the `_proposalId` do not exist,
/// or the `_account` does not have voting power.
function getVoteOption(
uint256 _proposalId,
address _account
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/src/MajorityVotingBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {IMajorityVoting} from "./IMajorityVoting.sol";
/* solhint-enable max-line-length */

/// @title MajorityVotingBase
/// @author Aragon X - 2022-2023
/// @author Aragon X - 2022-2024
/// @notice The abstract implementation of majority voting plugins.
///
/// ### Parameterization
Expand Down Expand Up @@ -243,8 +243,8 @@ abstract contract MajorityVotingBase is
/// @notice The struct storing the voting settings.
VotingSettings private votingSettings;

/// @notice The minimal ratio of yes votes needed for a proposal succeed.
/// @dev is not on the VotingSettings for compatibility reasons.
/// @notice The minimum ratio of yes votes needed for a proposal to succeed.
/// @dev Not included in VotingSettings for compatibility reasons.
uint256 private minApprovals; // added in v1.3

/// @notice Thrown if a date is out of bounds.
Expand Down
Loading

0 comments on commit 89f34a9

Please sign in to comment.