# pointsSum.slope Not Updated After Nominee Removal and Votes Revocation

removeNominee and revokeRemovedNomineeVotingPower fail to decrement pointsSum.slope, corrupting VoteWeighting's global slope accounting and inflating declared voting weight sums.

- Payout: Audit contest
- Severity: high
- Program: Olas
- Found by: Aymen0909
- Disclosed: 2024-08-06
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-05-olas-findings/issues/36
- Library page: https://bugbountylibrary.com/r/c4%3A2024-05-olas%3AH-01
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:governance

**Target:** VoteWeighting.sol governance contract (Solidity)
**Root cause:** removeNominee updates pointsSum.bias but not pointsSum.slope, and revokeRemovedNomineeVotingPower also omits the slope decrement, so the removed nominee's slope persists in the global sum used by _getSum checkpoints.
**Steps:**
1. Call `voteForNomineeWeights` to give a nominee a nonzero slope, updating `pointsSum[nextTime].slope`.
2. Owner calls `removeNominee(account, chainId)`: `pointsWeight[nomineeHash][nextTime].bias = 0` and `pointsSum[nextTime].bias = oldSum - oldWeight`, but `pointsSum[nextTime].slope` is untouched.
3. Optionally users call `revokeRemovedNomineeVotingPower`; slope is still not decremented from `pointsSum`.
4. Later `_getSum()` iterates weeks using `dBias = pt.slope * WEEK`, decaying bias with the inflated slope, so declared sum diverges from actual sum of weights.
**How found:** Code review of the vote-weighting accounting: noticed voteForNomineeWeights updates both bias and slope for pointsSum, while removeNominee/revokeRemovedNomineeVotingPower only update bias, leaving slope stale.
**Insight:** When a contract maintains parallel bias/slope checkpoint arrays, audit every mutation path (add, remove, revoke) for symmetry — a missing slope decrement silently corrupts all future decay checkpoints.

