Closed code423n4 closed 1 year ago
0xScotch marked the issue as sponsor disputed
This is the desired behaviour. There should only be one active stabilization strategy at any given time. If an auction is running then the swing trader should not trigger until that auction is complete.
Picodes marked the issue as unsatisfactory: Invalid
It makes sense to not buyMalt
until the auction has ended to wait to see the effect of the auction.
Lines of code
https://github.com/code-423n4/2023-02-malt/blob/main/contracts/StabilityPod/StabilizerNode.sol#L178-L182 https://github.com/code-423n4/2023-02-malt/blob/main/contracts/StabilityPod/StabilizerNode.sol#L303-L306 https://github.com/code-423n4/2023-02-malt/blob/main/contracts/StabilityPod/StabilizerNode.sol#L336-L371
Vulnerability details
Impact
An early check logic in
StabilizerNode.stabilize
prevents possible stabilization.Proof of Concept
In
StabilizerNode.stabilize
, there is an early check logic forexchangeRate
and auction state. If_shouldAdjustSupply
returns false,stabilize
will end without any more process.In
StabilizerNode._shouldAdjustSupply
, whenexchangeRate
is less than lower price, we need to buy some malt to increase the malt price. It assumes to use auction in this case and checked if auction is not started so it can start an auction.But in some cases the protocol don't use auction and use
swingTraderManager.buyMalt
only.So when
stabilize
and_triggerSwingTrader
usesswingTraderManager.buyMalt
instead of auction,stabilize
logic can work without considering auction state, even when current auction is live, but the early check ofstabilize
blocks this opportunity.Tools Used
Manual Review
Recommended Mitigation Steps
Do auction exist check only when starts an auction really.