Submitted by minhquanym, also found by cccz and hansfriese
Contract SwingTraderManager has a totalProfit variable. It keeps track of total profit swing traders made during sellMalt(). However, the logic for accounting is wrong so it will not have the correct value. As the results, it can affect other contracts that integrate with SwingTraderManager and use this totalProfit variable.
https://github.com/code-423n4/2023-02-malt/blob/700f9b468f9cf8c9c5cffaa1eba1b8dea40503f9/contracts/StabilityPod/SwingTraderManager.sol#L252-L258
Function sellMalt() has a dust check before returning result. totalProfit should be updated before this check as it returns the value immediately without updating totalProfit.
Updating totalProfit before the dust check in function sellMalt().
0xScotch (Malt) confirmed
