58771 sc high incorrect tracking of total deposited yield tokens mytsharesdeposited in liquidation and force repayment paths
Description
Brief/Intro
Vulnerability Details
uint256 protocolFeeTotal = creditToYield * protocolFee / BPS;
emit ForceRepay(accountId, amount, creditToYield, protocolFeeTotal);
if (account.collateralBalance > protocolFeeTotal) {
account.collateralBalance -= protocolFeeTotal;
// Transfer the protocol fee to the protocol fee receiver
TokenUtils.safeTransfer(myt, protocolFeeReceiver, protocolFeeTotal); // <-- Missing: _mytSharesDeposited -= protocolFeeTotal;
}
if (creditToYield > 0) {
// Transfer the repaid tokens from the account to the transmuter.
TokenUtils.safeTransfer(myt, address(transmuter), creditToYield); // <-- Missing: _mytSharesDeposited -= creditToYield;
}
return creditToYield;
} Impact Details
References
Proof of Concept
Proof of Concept
Previous57740 sc high eulereth strategy will have weth locked in the strategy contractNext58334 sc medium incorrect function selectors
Was this helpful?