# Compound Proposal 65
## Objective
Correct the amounts of over-accrued COMP due to the bug in Proposal 62 and fully restore the functionality of COMP rewards.
## Justification
[Proposal 62](https://compound.finance/governance/proposals/62) introduced a bug in the COMP distribution logic that allowed users borrowing certain assets to claim more than their intended share of COMP.
[Proposal 64](https://compound.finance/governance/proposals/64) patched the bug introduced in Proposal 62 and disabled COMP claiming for users active in the affected markets (cSUSHI, cMKR, cYFI, cAAVE, cTUSD, and cSAI).
## Details
Now that proposal 64 has been executed, we're able to compile a definite list of users who have over-accrued COMP along with the exact amounts they over-accrued.
This proposal contains that exact list and calls a newly introduced one-off function - fixBadAccruals - to correct the over-accrued COMP. This function behaves the following way:
- If the user's amount of accrued COMP is greater than the amount they over-accrued, the amount over-accrued is subtracted from their accrued amount (compAccrued).
- If the user's amount of accrued COMP is less than the amount they over-accrued (i.e. they successfully claimed more COMP than they should have), their accrued amount (compAccrued) is set to 0 and the difference (i.e. what they owe the protocol) is saved to compReceivable. This new storage variable is only used for record-keeping at the moment.
- An event - CompReceivableUpdated - is emitted when compReceivable is updated.
- An event - CompAccruedAdjusted - is emitted when this function updates compAccrued.
Note: Record-keeping for the users who _successfully claimed more COMP than they should have and then subsequently returned the funds_ will have to be updated in a different proposal.
Since this proposal corrects all of the amounts of over-accrued COMP, the functionality of claimComp has been restored for all users.
Upon execution of this proposal, Compound protocol will return to its fully functioning state.
## Verification
Everyone is encouraged to verify that the list of users along with their over-accrued amounts exactly matches the output of [the script](https://github.com/TylerEther/compound-tools/blob/main/scripts/proposal-62-bug/find-affected-accounts.js) used to create this list.
## Review
This proposal has only been thoroughly reviewed by myself, so I urge everyone to also thoroughly review this proposal before voting on it.
The proposal has been simulated from a fork of mainnet at block #13380217. The simulation passes with the proposal behaving exactly as expected.
## Credits
TylerEther (me)
## References
- [Forums - Proposal 65 discussion](https://www.comp.xyz/t/proposal-65-correct-over-accrued-comp/2428)
- [Forums - Proposal 64 analysis](https://www.comp.xyz/t/analysis-of-proposal-64/2384/2?u=tylerether)
- [Proposal simulation](https://github.com/TylerEther/compound-protocol/blob/fix-bad-comp-accruals/spec/sim/0065-correct-bad-comp-accruals/hypothetical_mainnet_upgrade.scen)
- [Compound tools repository](https://github.com/TylerEther/compound-tools) hosting the [script used to create the list of affected users and their over-accrued amounts](https://github.com/TylerEther/compound-tools/blob/main/scripts/proposal-62-bug/find-affected-accounts.js)
- [Comptroller - Etherscan code](https://etherscan.io/address/0xBafE01ff935C7305907c33BF824352eE5979B526#code)