{
    "Function": "withdraw",
    "File": "contracts/StakingRewards.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "SafeERC20",
        "MasterChef",
        "MasterChef"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "nonReentrant",
        "updateReward"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function withdraw(uint256 amount)\n        public\n        nonReentrant\n        updateReward(msg.sender)\n    {\n        require(amount > 0, \"Cannot withdraw 0\");\n        _totalSupply -= amount;\n        _balances[msg.sender] -= amount;\n        stakingToken.safeTransfer(msg.sender, amount);\n        uint256 pid = masterChef.pid(address(stakingToken));\n        masterChef.withdraw(msg.sender, pid, amount);\n        emit Withdrawn(msg.sender, amount);\n    }"
}