#42532 [SC-High] Compound function in MoneyBrinter can lead to loss of yield
Description
Summary
Vulnerability Details
struct VaultRedeemParams {
address vault;
address receiver;
uint256 shares;
uint256 minAssets; // front-running protection!!
}
struct KodiakVaultStakingParams {
address kodiakVault;
uint256 amount0Max;
uint256 amount1Max;
uint256 amount0Min;
uint256 amount1Min;
uint256 amountSharesMin;
address receiver;
}
struct SingleTokenSwap {
uint256 inputAmount;
uint256 outputQuote;
uint256 outputMin;
address executor;
bytes path;
}
function claimRewardsInToken0(
uint256 amountToWithdraw,
IZapper.SingleTokenSwap calldata swapData,
IZapper.KodiakVaultUnstakingParams calldata unstakeParams,
IZapper.VaultRedeemParams calldata redeemParams
) external nonReentrant {
_updateRewards(msg.sender);
IZapper.VaultRedeemParams memory updatedRedeemParams = _verifyAndPrepareClaim(amountToWithdraw, redeemParams);
IERC20(redeemParams.vault).approve(address(zapper), amountToWithdraw);
@> uint256 receivedAmount = zapper.zapOutToToken0(msg.sender, swapData, unstakeParams, updatedRedeemParams);
emit Claimed(msg.sender, receivedAmount);
}Impact
Proof of Concept
Proof of Concept
Previous#42527 [SC-Critical] Critical Balance/Supply Desynchronization Leading to Protocol Insolvency and Loss of User FundsNext#42538 [SC-Insight] Incorrect value in events emitted in StakeV2
Was this helpful?