Skip to content

Commit

Permalink
treasury: Make consistent checks for isTranscoder
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Sep 19, 2023
1 parent ea92c07 commit 7153787
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/treasury/GovernorCountingOverridable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ abstract contract GovernorCountingOverridable is Initializable, GovernorUpgradea
return _weight - _voter.deductions;
}

address delegatesDelegate = votes().delegatedAt(delegate, timepoint);
bool delegateIsTranscoder = delegate == delegatesDelegate;
if (!delegateIsTranscoder) {
// do not override votes of non-self-bonding accounts since those don't get their voting power from the sum
// of delegations to them, so the override logic doesn't apply.
return _weight;
}

// this is a delegator, so add a deduction to the delegated transcoder
ProposalVoterState storage delegateVoter = _tally.voters[delegate];
delegateVoter.deductions += _weight;
Expand Down

0 comments on commit 7153787

Please sign in to comment.