15,000 USDC
View results
Submission Details
Severity: low

tests/unit/test_dsce.py:310: AssertionError

Summary

The assert conditions failed when I try to liquidate 1000000 ETH in unit test in test_dsce.py in brownie framework,

testing def test_user_still_has_some_eth_after_liquidation(liquidated_dsce, account):
assert (
expected_user_collateral_value_in_usd - 1000
<= user_collateral_value_in_usd
<= expected_user_collateral_value_in_usd + 1000
)
E assert (7000000000000000010000010 - 1000) <= 7000000000000000000000020

AMOUNT_COLLATERAL = web3.toWei(1000000, "ether")
AMOUNT_DSC_TO_MINT = web3.toWei(101000000, "ether")
COLLATERAL_TO_COVER = web3.toWei(2
1000000, "ether")
LIQUIDATION_THRESHOLD = 50

Vulnerability Details

expected_user_collateral_value_in_usd is a bit different from the user_collateral_value_in_usd from the account.

Impact

Tools Used

brownie unit test

Recommendations

Set a maximum amount of ETH to liquidate one time might be safer.
This unit test passed with I test with 1 eth instead of a big amount.

Support

FAQs

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