#42033 [SC-Insight] MoneyBrinter contract does not consider farm's pausing status
Description
Brief/Intro
Vulnerability Details
function depositFor(address account, uint256 amount)
public
override
{
super.depositFor(account, amount);
ICommunalFarm(farm).withdrawLockedAll();
uint256 balance = IERC20(getUnderlyingAddress()).balanceOf(address(this));
IERC20(getUnderlyingAddress()).safeApprove(farm, 0);
IERC20(getUnderlyingAddress()).safeApprove(farm, balance);
ICommunalFarm(farm).stakeLocked(balance, 0);
}
function withdrawTo(address account, uint256 amount)
public
override
{
ICommunalFarm(farm).withdrawLockedAll();
super.withdrawTo(account, amount);
uint256 balance = IERC20(getUnderlyingAddress()).balanceOf(address(this));
IERC20(getUnderlyingAddress()).safeApprove(farm, 0);
IERC20(getUnderlyingAddress()).safeApprove(farm, balance);
ICommunalFarm(farm).stakeLocked(balance, 0);
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#42020 [SC-Critical] Inaccurate calculation in `accumulatedDeptRewardsYeet()` causes double counting of vesting tokens as excess, leading to permanent loss of user fundsNext#42039 [SC-High] When calling `StakeV2::claimRewardsInNative()` surplus $YEET are send to the StakeV2 contract instead of the user
Was this helpful?