    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();
        }

        // Check if deposit exceeds the maximum allowed per wallet
        uint256 maxDepositLocal = getMaxDeposit();
        if (maxDepositLocal > 0) {
            uint256 depositInAssets = (balanceOf(msg.sender) * _ONE) / tokenPerAsset();
            uint256 newBalance = assets + depositInAssets;
            if (newBalance > maxDepositLocal) revert MaxDepositReached();
        }

@>      uint256 deployedAmount = _deploy(assets);

        // Calculate shares to mint
@>      shares = total.toBase(deployedAmount, false);

        // Prevent inflation attack for the first deposit
        if (total.base == 0 && shares < _MINIMUM_SHARE_BALANCE) {
            revert InvalidShareBalance();
        }

        // Mint shares to the receiver
        _mint(receiver, shares);

        // Emit deposit event
        emit Deposit(msg.sender, receiver, assets, shares);
    }
    function _redeemInternal(
        uint256 shares,
        address receiver,
        address holder,
        bool shouldRedeemETH
    ) private returns (uint256 retAmount) {
        if (shares == 0) revert InvalidAmount();
        if (receiver == address(0)) revert InvalidReceiver();
        if (balanceOf(holder) < shares) revert NotEnoughBalanceToWithdraw();

        // Transfer shares to the contract if sender is not the holder
        if (msg.sender != holder) {
            if (allowance(holder, msg.sender) < shares) revert NoAllowance();
            transferFrom(holder, msg.sender, shares);
        }

        // Calculate the amount to withdraw based on shares
        uint256 withdrawAmount = (shares * totalAssets()) / totalSupply();
        if (withdrawAmount == 0) revert NoAssetsToWithdraw();

@>      uint256 amount = _undeploy(withdrawAmount);
        uint256 fee = 0;
        uint256 remainingShares = totalSupply() - shares;

        // Ensure a minimum number of shares are maintained to prevent ratio distortion
        if (remainingShares < _MINIMUM_SHARE_BALANCE && remainingShares != 0) {
            revert InvalidShareBalance();
        }

@>      _burn(msg.sender, shares);

        // Calculate and handle withdrawal fees
        if (getWithdrawalFee() != 0 && getFeeReceiver() != address(0)) {
            fee = amount.mulDivUp(getWithdrawalFee(), PERCENTAGE_PRECISION);

            if (shouldRedeemETH && _asset() == wETHA()) {
                unwrapETH(amount);
                payable(receiver).sendValue(amount - fee);
                payable(getFeeReceiver()).sendValue(fee);
            } else {
                IERC20Upgradeable(_asset()).transfer(receiver, amount - fee);
                IERC20Upgradeable(_asset()).transfer(getFeeReceiver(), fee);
            }
        } else {
            if (shouldRedeemETH) {
                unwrapETH(amount);
                payable(receiver).sendValue(amount);
            } else {
                IERC20Upgradeable(_asset()).transfer(receiver, amount);
            }
        }

        emit Withdraw(msg.sender, receiver, holder, amount - fee, shares);
        retAmount = amount - fee;
    }
    function _deploy(uint256 assets) internal virtual override returns (uint256 deployedAmount) {
        // Approve the strategy to spend assets
        IERC20Upgradeable(_strategyAsset).safeApprove(address(_strategy), assets);
        // Deploy assets via the strategy
        deployedAmount = _strategy.deploy(assets); // Calls the deploy function of the strategy
    }

    function _undeploy(uint256 assets) internal virtual override returns (uint256 retAmount) {
        retAmount = _strategy.undeploy(assets); // Calls the undeploy function of the strategy
    }

    function _totalAssets() internal view virtual override returns (uint256 amount) {
        amount = _strategy.totalAssets(); // Calls the totalAssets function of the strategy
    }
    /**
     * @inheritdoc StrategySupplyBase
     */
    function _deploy(uint256 amount) internal override returns (uint256) {
        return _vault.deposit(amount, address(this));
    }

    /**
     * @inheritdoc StrategySupplyBase
     */
    function _undeploy(uint256 amount) internal override returns (uint256) {
        return _vault.withdraw(amount, address(this), address(this));
    }

    /**
     * @inheritdoc StrategySupplyBase
     */
    function _getBalance() internal view override returns (uint256) {
        return _vault.balanceOf(address(this));
    }
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract ERC4626Mock is ERC4626 {
    constructor(IERC20 asset_) ERC4626(asset_) ERC20("Mock Vault", "MV") {
    }
}
    function _deploy(uint256 amount) internal override returns (uint256) {
-       return _vault.deposit(amount, address(this));
+      _vault.deposit(amount, address(this));
+      return amount;
    }

    /**
     * @inheritdoc StrategySupplyBase
     */
    function _undeploy(uint256 amount) internal override returns (uint256) {
-       return _vault.withdraw(amount, address(this), address(this));
+       _vault.withdraw(amount, address(this), address(this));
+       return amount;
    }

    /**
     * @inheritdoc StrategySupplyBase
     */
    function _getBalance() internal view override returns (uint256) {
-       return _vault.balanceOf(address(this));
+       return _vault.convertToAssets(_vault.balanceOf(address(this)));
    }
