Caused DoS by division 0 as a denominator
Found by: @Tomosuke0930
Vulnerability Detail
In the _getValueChangeAndFunding(), the value of pools[PoolType.FLOAT][0].value is used as a denominator.
In solidity, if you divide with 0 as the denominator, the transaction returns revert.
This value is a value to show the liquidity of the float pool and this value is updated after _getValueChangeAndFunding is called.
Therefore, when the pools[PoolType.FLOAT][0].value is 0, the updateSystemStateUsingValidatedOracleRoundIds() can return revert and this function can’t execute because there is no way to update the pools[PoolType.FLOAT][0].value
Impact
Protocol teams need to deploy the new MarketCore.sol again to solve this issue.
neila
medium
Caused DoS by division 0 as a denominator
Summary
Caused DoS by division 0 as a denominator Found by: @Tomosuke0930
Vulnerability Detail
In the
_getValueChangeAndFunding()
, the value ofpools[PoolType.FLOAT][0].value
is used as a denominator.In solidity, if you divide with 0 as the denominator, the transaction returns revert.
This value is a value to show the liquidity of the float pool and this value is updated after
_getValueChangeAndFunding
is called.Therefore, when the
pools[PoolType.FLOAT][0].value
is 0, theupdateSystemStateUsingValidatedOracleRoundIds()
can return revert and this function can’t execute because there is no way to update thepools[PoolType.FLOAT][0].value
Impact
Protocol teams need to deploy the new
MarketCore.sol
again to solve this issue.Code Snippet
Tool used
Manual Review
Recommendation
Set the initial value of
pools[PoolType.FLOAT][0].value
to a non-zero value like UniswapV2#mintDuplicate of #8