The function redeem_collateral_for_dsc
appears to be designed to facilitate the redemption of collateral in exchange for burning a specified amount of debt-stabilized cryptocurrency (DSC). Here's a detailed breakdown of its purpose and functionality:
The main objective of this function is to allow users to redeem their collateral by burning a specified amount of DSC. This helps manage the user's debt and maintain the stability of the system.
The function not follow the CEI pattern. The check for the health factor is at the end of function self._revert_if_health_factor_is_broken(msg.sender)
The function does not follow the Check-Effects-Interactions (CEI) pattern and the _redeem_collateral
function can be used for a reentrancy attack. All tokens from the protocol can be stolen.
manual review
Please fallow the CEI pattern:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.