{
    "Function": "calc_token_amount_withdraw",
    "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/utils/Context.sol"
    ],
    "High-Level Calls": [
        "IConverter",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath"
    ],
    "Internal Calls": [
        "withdrawFee",
        "totalSupply",
        "balance"
    ],
    "Library Calls": [
        "mul",
        "mul",
        "div",
        "div"
    ],
    "Low-Level Calls": [],
    "Code": "function calc_token_amount_withdraw(uint _shares, address _output) external override view returns (uint) {\n        uint _withdrawFee = withdrawFee(_shares);\n        if (_withdrawFee > 0) {\n            _shares = _shares.mul(10000 - _withdrawFee).div(10000);\n        }\n        uint r = (balance().mul(_shares)).div(totalSupply());\n        if (_output == address(token3CRV)) {\n            return r;\n        }\n        return converter.calc_token_amount_withdraw(r, _output);\n    }"
}