gas

Not respecting the Checks-Effects-Interactions pattern that can be a place fo...

Reward

Total

24.49 USDC

Selected
24.49 USDC
Selected Submission

Not respecting the Checks-Effects-Interactions pattern that can be a place for bugs

Severity

Low Risk

Summary

Potential Reentrancy Attack: Even though the contract uses a reentrancy guard, it's crucial to ensure that all external calls are at the end of the function (the Checks-Effects-Interactions pattern). In the liquidate function, the _redeemCollateral function (which makes an external call) is followed by _burnDsc which alters the state. This could potentially lead to a reentrancy attack.

Vulnerability Details

Impact

Tools Used

chaingpt

Recommendations

Swap the order of _redeemCollateral and _burnDsc on the liquidate function