{
    "Function": "deposit",
    "File": "contracts/routers/BatchDepositRouter.sol",
    "Parent Contracts": [
        "contracts/routers/StrategyRouter.sol",
        "contracts/helpers/StrategyTypes.sol",
        "contracts/interfaces/IStrategyRouter.sol"
    ],
    "High-Level Calls": [
        "IStrategyController",
        "SafeMath",
        "SafeMath",
        "SafeERC20",
        "StrategyLibrary",
        "IStrategy",
        "IOracle",
        "IStrategy"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "onlyController",
        "abi.decode()"
    ],
    "Library Calls": [
        "mul",
        "div",
        "getExpectedTokenValue",
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function deposit(address strategy, bytes calldata data)\n        external\n        override\n        onlyController\n    {\n        require(IStrategy(strategy).debt().length == 0, \"Cannot batch deposit debt\");\n        IOracle oracle = controller.oracle();\n        (address depositor, uint256 amount) =\n            abi.decode(data, (address, uint256));\n        address[] memory strategyItems = IStrategy(strategy).items();\n        for (uint256 i; i < strategyItems.length; i++) {\n          address token = strategyItems[i];\n          uint256 expectedValue =\n              uint256(StrategyLibrary.getExpectedTokenValue(amount, strategy, token));\n          if (expectedValue > 0)\n              IERC20(token).safeTransferFrom(\n                  depositor,\n                  strategy,\n                  expectedValue.mul(10**18).div(uint256(oracle.estimateItem(10**18, token)))\n              );\n        }\n    }"
}