{
    "Function": "_deposit",
    "File": "contracts/legacy/MetaVault.sol",
    "Parent Contracts": [
        "contracts/legacy/IMetaVault.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol",
        "node_modules/@openzeppelin/contracts/GSN/Context.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "SafeMath",
        "IVaultManager",
        "IERC20",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath"
    ],
    "Internal Calls": [
        "_mint",
        "earn",
        "totalSupply",
        "totalSupply"
    ],
    "Library Calls": [
        "add",
        "mul",
        "mul",
        "sub",
        "div",
        "div"
    ],
    "Low-Level Calls": [],
    "Code": "function _deposit(address _mintTo, uint _pool, uint _amount) internal returns (uint _shares) {\n        if (address(vaultManager) != address(0)) {\n            // expected 0.1% of deposits go into an insurance fund (or auto-compounding if called by controller) in-case of negative profits to protect withdrawals\n            // it is updated by governance (community vote)\n            uint _insuranceFee = vaultManager.insuranceFee();\n            if (_insuranceFee > 0) {\n                uint _insurance = _amount.mul(_insuranceFee).div(10000);\n                _amount = _amount.sub(_insurance);\n                insurance = insurance.add(_insurance);\n            }\n        }\n\n        if (totalSupply() == 0) {\n            _shares = _amount;\n        } else {\n            _shares = (_amount.mul(totalSupply())).div(_pool);\n        }\n        if (_shares > 0) {\n            if (token3CRV.balanceOf(address(this)) > earnLowerlimit) {\n                earn();\n            }\n            _mint(_mintTo, _shares);\n        }\n    }"
}