Skip to content
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

Redundant logic in ThresholdResponse multisigs #677

Closed
0xekez opened this issue Mar 11, 2022 · 0 comments · Fixed by #783
Closed

Redundant logic in ThresholdResponse multisigs #677

0xekez opened this issue Mar 11, 2022 · 0 comments · Fixed by #783
Assignees

Comments

@0xekez
Copy link
Contributor

0xekez commented Mar 11, 2022

The logic for determining if a proposal is passed for a multisig with a ThresholdResponse includes an option for considering a expired proposal as passed:

if self.expires.is_expired(block) {
// If expired, we compare Yes votes against the total number of votes (minus abstain).
let opinions = self.votes.total() - self.votes.abstain;
self.votes.yes >= votes_needed(opinions, threshold)

That condition will never be reached though as the proposal's status is only updated on a vote. It is impossible to vote on an expired proposal so there will never be an update_status call which will flip such a proposal to Status::Passed.

It is only possible to execute a passed proposal which has been set to passed via a call to update_status:

if prop.status != Status::Passed {
return Err(ContractError::WrongExecuteStatus {});
}

Open to thoughts here. Seems to me that logic should either be removed or the status check should call prop.current_status() instead of using the one in storage.

@maurolacy maurolacy self-assigned this Aug 18, 2022
@maurolacy maurolacy changed the title Redundant logic in ThresholdResponse multisigs. Redundant logic in ThresholdResponse multisigs Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants