---
# System prepended metadata

title: Baal template redeploy pomo

---

# Baal template redeploy pomo

## Problem:

In the latest contract deploy there was a bug in how quorum was calculated. To calculate a yes vote quorum both loot and shares where being figured into the total. Loot should not be included here because loot is not used in voting and this throws off the calculation and can even make it impossible to reach quorum. h/t @typyo for first discovering this 

## Details:
In every proposal there are several things that are looked at to determine if a proposal action is 'ok to execute'. Besides checking if a proposal passed (more yes votes that no votes), it also checks for a "minimum retention percent" and a yes vote quorum

**minimum retention percent** - this is a percent of the current total loot and shares against a snapshot of total loot and shares taken at proposal voting. If people ragequit (burn) shares during a proposal the total shares decreases and this means any financial action that is taken will dilute the remaining members more. A DAO can configure this value so that if enough people ragequit the proposal will hit that retention value and fail. It is a safeguard that says, for example, if 30% of the members ragequit during a proposal do not execute it.

**yes vote quorum** - Some DAOs may have this which requires some % of members to vote yes for a proposal to pass. So in this case even if there are more yes votes than no votes if this quorum is not met during voting the proposal will not be executed. This can be used to require some minimum engagement by members/delegates, can also be used to block proposals that are voted on only by very low stake members/delegates.

A contract review noticed that yes vote quorum was going against the current total shares in the DAO. This is not totally accurate because total shares may change during a proposal, (people ragequit or new shares are added). To fix this a snapshot of total shares should be taken when voting starts (sponsoring) for a proposal.

The bug was introduced by me when the snapshot that was being used for min retention was used also for quorum (min retention snapshot being total loot and shares, not just shares). 

## Fix:
a new snapshot of only the total shares at voting is used instead of the loot/shares snapshot that was being used for min retention.

https://github.com/HausDAO/Baal/pull/95

**How can we avoid a mistake like this in the future?**
This was  a part of a large set of minor fixes and optimizations that went in after the last contract review. the negative implications of this optimization was not seen in any reviews of the PR.
In the future PRs should be smaller so they can have a better and more thoughtful review.

## Fallout
No funds are locked up or in trouble with this bug but it can make a DAO have strange/broken behavior around quorums. there are at least 2(non test) DAOs that where affected by this. 
One of them wanted to update to the latest version and had made a proposal to do so. the proposal was able to be canceled so funds will not be added to this new dao, and a new one can be made to the newest fixed deploy. This resulted in wasted time and gas around deploying a new dao and making the transfer funds proposals.
The second one has already upgraded but currently does not use loot or quorum so the bug does not directly effect use at this time.
Both of these daos will need to upgrade to the newest template. Both DAOs have been informed of this and I'll help them through the process of upgrades/fixes.

> Note these early DAOs have been really helpful in us refining our processes and flows, giving great feedback and have had a great outlook on experimentation

Any other DAO summoned before December 27th should upgrade to the latest version.