Judge has assessed an item in Issue #11 as 2 risk. The relevant finding follows:
[Low-01] SwingTraderManager.totalProfit may be updated incorrectly
Impact
In SwingTraderManager.sellMalt, when amountSold + dustThreshold >= maxAmount, the function will return directly and will not update totalProfit, which will cause totalProfit to update incorrectly
Judge has assessed an item in Issue #11 as 2 risk. The relevant finding follows:
[Low-01] SwingTraderManager.totalProfit may be updated incorrectly Impact In SwingTraderManager.sellMalt, when amountSold + dustThreshold >= maxAmount, the function will return directly and will not update totalProfit, which will cause totalProfit to update incorrectly
Proof of Concept https://github.com/code-423n4/2023-02-malt/blob/700f9b468f9cf8c9c5cffaa1eba1b8dea40503f9/contracts/StabilityPod/SwingTraderManager.sol#L251-L259
Recommended Mitigation Steps Change to
totalProfit += profit;
if (amountSold + dustThreshold >= maxAmount) { return maxAmount; }
totalProfit += profit;