{
    "Function": "deposit",
    "File": "contracts/mocks/yVault/yVault.sol",
    "Parent Contracts": [
        "contracts/mocks/yVault/yVault.sol",
        "contracts/mocks/yVault/yVault.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "SafeMath",
        "SafeERC20",
        "ERC20",
        "SafeMath",
        "ERC20"
    ],
    "Internal Calls": [
        "balance",
        "_mint",
        "totalSupply",
        "totalSupply"
    ],
    "Library Calls": [
        "safeTransferFrom",
        "sub",
        "div",
        "mul"
    ],
    "Low-Level Calls": [],
    "Code": "function deposit(uint256 _amount) public {\n        uint256 _pool = balance();\n        uint256 _before = token.balanceOf(address(this));\n        token.safeTransferFrom(msg.sender, address(this), _amount);\n        uint256 _after = token.balanceOf(address(this));\n        _amount = _after.sub(_before); // Additional check for deflationary tokens\n        uint256 shares = 0;\n        if (totalSupply() == 0) {\n            shares = _amount;\n        } else {\n            shares = (_amount.mul(totalSupply())).div(_pool);\n        }\n        _mint(msg.sender, shares);\n    }"
}