15,000 USDC
View results
Submission Details
Severity: gas
Valid

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

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

Support

FAQs

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