QVBaseStrategy does not update poolAmount value after distributing tokens
QVBaseStrategy does not update poolAmount value after distributing tokens
Vulnerability Detail
Depositing/funding the pool increases the poolAmount variable and the token balance of the contract
but distributing tokens transfers the tokens to recipients and decreases the amount of tokens in the strategy/pool
yet the poolAmount variable is not adjusted:
vagrant
high
QVBaseStrategy does not update poolAmount value after distributing tokens
QVBaseStrategy does not update poolAmount value after distributing tokens
Vulnerability Detail
Depositing/funding the pool increases the poolAmount variable and the token balance of the contract but distributing tokens transfers the tokens to recipients and decreases the amount of tokens in the strategy/pool yet the poolAmount variable is not adjusted:
Impact
QVBaseStrategy uses poolAmount to calculate how much it will distribute in _getPayout():
Not adjusting the poolAmount after distributing will lead to incorrect calculation of following distributions
Code Snippet
https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/qv-base/QVBaseStrategy.sol#L436-L465
Tool used
Manual Review
Recommendation
adjust the poolAmount in QVBaseStrategy#_distribute()