Missing maltDataLab.trackReserveRatio()
in some cases after swingTrader.sellMalt()
#320
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
Based on the context,
maltDataLab.trackReserveRatio()
should be called once a market buy/sell is made.However, in
_distributeSupply()
whenswingAmount >= tradeSize
, after a market sell, the function returned withoutmaltDataLab.trackReserveRatio()
.https://github.com/code-423n4/2021-11-malt/blob/c3a204a2c0f7c653c6c2dda9f4563fd1dc1cecf3/src/contracts/StabilizerNode.sol#L145-L174
https://github.com/code-423n4/2021-11-malt/blob/c3a204a2c0f7c653c6c2dda9f4563fd1dc1cecf3/src/contracts/StabilizerNode.sol#L211-L246
Recommendation
Consider moving
maltDataLab.trackReserveRatio()
from_distributeSupply()
,_startAuction()
tostabilize()
before L173.The text was updated successfully, but these errors were encountered: