LOW severity: [STAKE-8] flashloanOsTokenShares should be validated as non-zero before the flashloan. **Severity:** Low

**Path:** src/leverage/LeverageStrategy.sol#L165-L178

**Description:** In the `deposit()` function, there's a check that returns without executing the flashloan if `leverageOsTokenShares == 0`. However, the `flashloanOsTokenShares` variable, calculated by...

Vulnerable code:
uint256 flashloanOsTokenShares = _getFlashloanOsTokenShares(vault, leverageOsTokenShares);

function deposit(address vault, uint256 osTokenShares) external {
    if (osTokenShares == 0) revert Errors.InvalidShares();

    // fetch strategy proxy
    (address proxy,) = _getOrCreateStrategyProxy(vault, msg.sender);
    if (isStrategyProxyExiting[proxy]) revert Errors.ExitRequestNotProcessed();

    // transfer osToken shares from user to the proxy
    IStrategyProxy(proxy).execute(
        address(_osToken), abi.encodeWithSelector(_osToken.transferFrom.selector, msg.sender, proxy, osTokenShares)
    );

    // fetch vault state and lending protocol state
    (uint256 stakedAssets, uint256 mintedOsTokenShares) = _getVaultState(vault, proxy);
    (uint256 borrowedAssets, uint256 suppliedOsTokenShares) = _getBorrowState(proxy);

    // check whether any of the positions exist
    uint256 leverageOsTokenShares = osTokenShares;
    if (stakedAssets != 0 || mintedOsTokenShares != 0 || borrowedAssets != 0 || suppliedOsTokenShares != 0) {
        // supply osToken shares to the lending protocol
        _supplyOsTokenShares(proxy, osTokenShares);
        suppliedOsTokenShares += osTokenShares;

        // borrow max amount of assets from the lending protocol
        uint256 maxBorrowAssets =
            Math.mulDiv(_osTokenVaultController.convertToAssets(suppliedOsTokenShares), _getBorrowLtv(), _wad);
        if (borrowedAssets >= maxBorrowAssets) {
            // nothing to borrow
            emit Deposited(vault, msg.sender, osTokenShares, 0);
            return;
        }
        uint256 assetsToBorrow;
        unchecked {
            // cannot underflow because maxBorrowAssets > borrowedAssets
            assetsToBorrow = maxBorrowAssets - borrowedAssets;
        }
        _borrowAssets(proxy, assetsToBorrow);

        // mint max possible osToken shares
        leverageOsTokenShares = _mintOsTokenShares(vault, proxy, assetsToBorrow, type(uint256).max);
        if (leverageOsTokenShares == 0) {
            // no osToken shares to leverage
            emit Deposited(vault, msg.sender, osTokenShares, 0);
            return;
        }
    }

    // calculate flash loaned osToken shares
    uint256 flashloanOsTokenShares = _getFlashloanOsTokenShares(vault, leverageOsTokenShares);

    // execute flashloan
    _osTokenFlashLoans.flashLoan(
        address(this), flashloanOsTokenShares, abi.encode(FlashloanAction.Deposit, vault, proxy)
    );

    // emit event
    emit Deposited(vault, msg.sender, osTokenShares, flashloanOsTokenShares);
}

// mint max possible osToken shares
      leverageOsTokenShares = _mintOsTokenShares(vault, proxy, assetsToBorrow, type(uint256).max);
  }

  // calculate flash loaned osToken shares
  uint256 flashloanOsTokenShares = _getFlashloanOsTokenShares(vault, leverageOsTokenShares);
  
  if (flashloanOsTokenShares == 0) {
      // no osToken shares to leverage
      emit Deposited(vault, msg.sender, osTokenShares, 0);
      return;
  }
  // execute flashloan
  _osTokenFlashLoans.flashLoan(
      address(this), flashloanOsTokenShares, abi.encode(FlashloanAction.Deposit, vault, proxy)
  );