Submitted by TresDelinquentes, also found by 0xA5DF, 3docSec, and Pechenite
Calling Partys rageQuit() with a zero-balance ERC20 disregards the minWithdrawAmounts array, resulting in the loss of user tokens without compensation.
Consider the following scenario illustrating the issue:
In PartyGovernanceNFT#rageQuit() the withdrawl amount for each ERC20 is calculated as follows:
Where:
However, if the token is an ERC20 for which the Party does not have any remaining balance, withdrawAmounts[i] would be equal to 0.
This means the following check would not be executed at all:
Since the check for the minimum withdrawal amount is within the if statement, it is never executed when amount is equal to 0, leading to unintended NFT loss.
To ensure that the BelowMinWithdrawAmountError check is performed even when amount is equal to 0, amount > 0 must be replaced with amount >= 0 in the rageQuit() function. Heres the modified code snippet:
Invalid Validation
gzeon (judge) commented:
0xble (Party) confirmed
