56347 sc insight burn contains redundant calculations
Description
Brief/Intro
Vulnerability Details
function burn(uint256 amount, uint256 recipientId) external returns (uint256) {
...
_accounts[recipientId].collateralBalance -= convertDebtTokensToYield(credit) * protocolFee / BPS;
TokenUtils.safeTransfer(myt, protocolFeeReceiver, convertDebtTokensToYield(credit) * protocolFee / BPS);
_mytSharesDeposited -= convertDebtTokensToYield(credit) * protocolFee / BPS;
...
}Impact Details
References
Proof of Concept
Previous57138 sc critical protocol subsidizes repayment fees during liquidationNext56561 sc insight fee amount is recomputed multiple times when the initial value has already been cached
Was this helpful?