The sell function incorrectly adjusts the payoutsTo_
by subtracting profitPerShare_ * _amountOfTokens + (_taxedeth * magnitude)
, which should only subtract profitPerShare_ * _amountOfTokens
. This error causes users' dividend calculations to be incorrect, potentially leading to negative payouts or loss of owed dividends.
Modify the payout adjustment to only subtract profitPerShare_ * _amountOfTokens
:
int256 _updatedPayouts = (int256)(profitPerShare_ * _amountOfTokens);
payoutsTo_[_customerAddress] -= _updatedPayouts;
Line 1088 – 1090