{
    "Function": "_transferInputTokens",
    "File": "contracts/NestedFactory.sol",
    "Parent Contracts": [
        "contracts/abstracts/MixinOperatorResolver.sol",
        "contracts/abstracts/OwnableProxyDelegation.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol",
        "contracts/interfaces/INestedFactory.sol"
    ],
    "High-Level Calls": [
        "IWETH",
        "NestedRecords",
        "SafeERC20",
        "NestedReserve",
        "IERC20",
        "IERC20"
    ],
    "Internal Calls": [
        "balance(address)",
        "require(bool,string)",
        "_msgSender",
        "require(bool,string)"
    ],
    "Library Calls": [
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function _transferInputTokens(\n        uint256 _nftId,\n        IERC20 _inputToken,\n        uint256 _inputTokenAmount,\n        bool _fromReserve\n    ) private returns (IERC20, uint256) {\n        if (address(_inputToken) == ETH) {\n            require(address(this).balance >= _inputTokenAmount, \"NF: INVALID_AMOUNT_IN\");\n            weth.deposit{ value: _inputTokenAmount }();\n            return (IERC20(address(weth)), _inputTokenAmount);\n        }\n\n        uint256 balanceBefore = _inputToken.balanceOf(address(this));\n        if (_fromReserve) {\n            require(\n                nestedRecords.getAssetHolding(_nftId, address(_inputToken)) >= _inputTokenAmount,\n                \"NF: INSUFFICIENT_AMOUNT_IN\"\n            );\n            // Get input from reserve\n            reserve.withdraw(IERC20(_inputToken), _inputTokenAmount);\n        } else {\n            _inputToken.safeTransferFrom(_msgSender(), address(this), _inputTokenAmount);\n        }\n        return (_inputToken, _inputToken.balanceOf(address(this)) - balanceBefore);\n    }"
}