15,000 USDC
View results
Submission Details
Severity: low

health_factor assertion error if AMOUNT_COLLATERAL is 0.000011 ether

Summary

I set AMOUNT_COLLATERAL = web3.toWei(0.000011, "ether") in Conftest.py with a small amount in decimal, then there is a Assertion Error in tests/unit/test_dsce.py:226 and tests/unit/test_dsce.py:242:

assert health_factor == expected_health_factor
E assert 100000000000000909090 == 100000000000000000000

tests/unit/test_dsce.py:226: AssertionError
tests/unit/test_dsce.py:242: AssertionError

assert user_health_factor == 0.9 * 10**18
E assert 900000000000008181 == (0.9 * (10 ** 18))

Vulnerability Details

Impact

Tools Used

Brownie test

Recommendations

It's better to restrict the minimum ether users can put as collateral on the interface to avoid errors.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.