58322 sc low incorrect emit due to wrong ordering of wethbalancebefore calculation
Description
Brief/Intro
Vulnerability Details
vault.withdraw(amount, address(this), address(this));
// @audit `wethBalanceBefore` is calculated after withdrawal
uint256 wethBalanceBefore = TokenUtils.safeBalanceOf(address(weth), address(this));
uint256 wethBalanceAfter = TokenUtils.safeBalanceOf(address(weth), address(this));
uint256 wethRedeemed = wethBalanceAfter - wethBalanceBefore;
if (wethRedeemed < amount) {
emit StrategyDeallocationLoss("Strategy deallocation loss.", amount, wethRedeemed);
}Impact Details
References
Proof of Concept
Proof Of Concept
Previous58306 sc critical repayment fee not adjusted for insufficient collateralNext57516 sc low arbitrary external call in zeroxswapverifier leads to theft of unclaimed yield
Was this helpful?