[M-09] QVSimpleStrategy contract: removing pool allocators will not remove their votes
QVSimpleStrategy contract: removing pool allocators will not remove their votes.
Vulnerability Detail
In QVSimpleStrategy strategy contract: funds accepted recipients are receiving funds based on the votes they got from the accepted allocators (pool managers).
Then when the funds are distributed; each accepted recipient will receive payment proportional to the total number of votes they received:
function _getPayout(address _recipientId, bytes memory)
internal
view
virtual
override
returns (PayoutSummary memory)
{
Recipient memory recipient = recipients[_recipientId];
// Calculate the payout amount based on the percentage of total votes
uint256 amount;
if (!paidOut[_recipientId] && totalRecipientVotes != 0) {
amount = poolAmount * recipient.totalVotesReceived / totalRecipientVotes;
}
return PayoutSummary(recipient.recipientAddress, amount);
}
But allocators can be removed by the pool admin via Allo::removePoolManager; and when doing so, the votes that were given by the removed allocator will still be counted.
Impact
If a recipient got votes from removed allocators; they will be getting more funds upon distribution due to the counting of the invalid votes of the removed allocators.
hals
medium
[M-09]
QVSimpleStrategy
contract: removing pool allocators will not remove their votesQVSimpleStrategy
contract: removing pool allocators will not remove their votes.Vulnerability Detail
In
QVSimpleStrategy
strategy contract: funds accepted recipients are receiving funds based on the votes they got from the accepted allocators (pool managers).Then when the funds are distributed; each accepted recipient will receive payment proportional to the total number of votes they received:
QVBaseStrategy::_getPayout function
But allocators can be removed by the pool admin via
Allo::removePoolManager
; and when doing so, the votes that were given by the removed allocator will still be counted.Impact
If a recipient got votes from removed allocators; they will be getting more funds upon distribution due to the counting of the invalid votes of the removed allocators.
Code Snippet
QVBaseStrategy::_qv_allocate function
QVBaseStrategy::_distribute function/ L448-L449
QVBaseStrategy::_distribute function/ L456
QVBaseStrategy::_getPayout function
Allo::removePoolManager function
Tool used
Manual Review
Recommendation
Add a mechanism to remove/invalidate removed allocator votes so that it would't be counted when calculating the recipient distributed payment.