#34995 [SC-Low] `mintDebt()` and `repayDebt()` should return `assets` and not `shares`
Description
Brief/Intro
Vulnerability Details
// Check the current debt of the debtor.
if (currentDebt[msg.sender] < assets) {
revert ExcessiveDebtRepayment(
msg.sender,
currentDebt[msg.sender],
assets
);
}
// Decrease the debt of the debtor.
currentDebt[msg.sender] -= assets;
emit DebtRepaid(msg.sender, currentDebt[msg.sender], assets, shares);
// Decrease the total debt.
totalDebt -= assets;
// Burn the shares from the debtor.
super._burn(msg.sender, shares);
return shares;
}Impact Details
Proof of Concept
Proof of Concept
Previous#35026 [SC-Low] `repayDebt` in stbtc returns a worng valueNext#34712 [SC-Medium] Malicious users can block repay debt transactions with no cost
Last updated
Was this helpful?