Check for liquidation in value() #76
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
gpersoon
Vulnerability details
Impact
The function value() of OverlayV1OVLCollateral.sol doesn't explicitly check for liquidated positions.
However because oiShares and debt are set to 0 during liquidation the resulting value will still be 0.
It seems more logical to check for liquidation in the beginning of the function and immediately return 0.
This saves gas for the situation where the function value() is called from another smart contract.
Proof of Concept
https://github.com/code-423n4/2021-11-overlay/blob/914bed22f190ebe7088194453bab08c424c3f70c/contracts/collateral/OverlayV1OVLCollateral.sol#L424-L448
Tools Used
Recommended Mitigation Steps
Add something like the following to function value():
The text was updated successfully, but these errors were encountered: