Closed code423n4 closed 2 years ago
Dravee
Division by 0
While there's a check that _totalLiquidity >= _lockedAmount, there isn't one for _totalLiquidity != 0 (and _lockedAmount can be 0): https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PremiumModels/BondingPremium.sol#L70
_totalLiquidity >= _lockedAmount
_totalLiquidity != 0
_lockedAmount
VS Code
Check that the value isn't 0
similar issue https://github.com/code-423n4/2022-01-insure-findings/issues/287
Handle
Dravee
Vulnerability details
Impact
Division by 0
Proof of Concept
While there's a check that
_totalLiquidity >= _lockedAmount
, there isn't one for_totalLiquidity != 0
(and_lockedAmount
can be 0): https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PremiumModels/BondingPremium.sol#L70Tools Used
VS Code
Recommended Mitigation Steps
Check that the value isn't 0