{
    "Function": "_depositToYield",
    "File": "contracts/SavingsAccount/SavingsAccount.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/utils/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol",
        "contracts/interfaces/ISavingsAccount.sol"
    ],
    "High-Level Calls": [
        "IYield",
        "IStrategyRegistry"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _depositToYield(\n        uint256 _amount,\n        address _token,\n        address _strategy\n    ) internal returns (uint256 _sharesReceived) {\n        require(IStrategyRegistry(strategyRegistry).registry(_strategy), 'SavingsAccount::deposit strategy do not exist');\n        uint256 _ethValue;\n\n        if (_token == address(0)) {\n            _ethValue = _amount;\n            require(msg.value == _amount, 'SavingsAccount::deposit ETH sent must be equal to amount');\n        }\n        _sharesReceived = IYield(_strategy).lockTokens{value: _ethValue}(msg.sender, _token, _amount);\n    }"
}