58728 sc medium when the strategy is at a loss the assets cannot be withdrawn
Description
Brief/Intro
Vulnerability Details
/v3-poc/src/AlchemistAllocator.sol:46
46: /// @notice When deallocating total amounts,
47: /// consider using IMYTStrategy(address(strategy)).previewAdjustedWithdraw(amount)
48: /// as the amount to be passed in for `amount`
49: /// to estimate the correct amount that can be fully withdrawn,
50: /// accounting for losses due to slippage, protocol fees, and rounding differences
51: function deallocate(address adapter, uint256 amount) external {
52: require(msg.sender == admin || operators[msg.sender], "PD");
53: bytes32 id = IMYTStrategy(adapter).adapterId();
54: uint256 absoluteCap = vault.absoluteCap(id);
55: uint256 relativeCap = vault.relativeCap(id);
56: // FIXME get this from the StrategyClassificationProxy for the respective risk class
57: uint256 daoTarget = type(uint256).max;
58: uint256 adjusted = absoluteCap < relativeCap ? absoluteCap : relativeCap;
59: if (msg.sender != admin) {
60: // caller is operator
61: adjusted = adjusted < daoTarget ? adjusted : daoTarget;
62: }
63: // pass the old allocation to the adapter
64: bytes memory oldAllocation = abi.encode(vault.allocation(id));
65: vault.deallocate(adapter, oldAllocation, amount);
66: }Impact Details
References
Recommendation
Proof of Concept
Proof of Concept
Previous56498 sc low reserve drainage due to incorrect balance measurementNext58524 sc high when liquidating there are cases where the fee is not paid to the liquidator
Was this helpful?