Uh oh!
There was an error while loading. Please reload this page.
[C02] Rewards pay out incorrectly when the service provider has a pending “decrease stake” request - #548
[C02] Rewards pay out incorrectly when the service provider has a pending “decrease stake” request#548hareeshnagaraj wants to merge 5 commits into
Conversation
hareeshnagaraj
commented
Jun 23, 2020
- Directly return rewards after mint operation occurs in ClaimsManager, eliminate potential for miscalculated totalRewards when decrease is pending
Interestingly enough, we already have a test case to cover reward distribution when a decrease stake request is pending. However this was passing due to what seems like a coincidence. Example: (assume no delegators) sp1Stake - 100, sp1LockedUp - 50 Rewards - 1,000 Inside validateClaimRewards: totalLockedUp - 50 In claimReward (after validateClaimRewards) So how did our final balance still come out correctly? totalActiveFunds = 50 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hareeshnagaraj
commented
Jun 25, 2020
follow-up - is this really a critical vulnerability if insolvency is not possible per the above example? because the final calculation is based on a skewed base value for spFactory balance (decreased by the same amount of increase in totalRewards), final state in spFactory is exactly right. |