{
    "Function": "pendingReward",
    "File": "contracts/farming/LPFarming.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "IERC20"
    ],
    "Internal Calls": [
        "_blockNumber",
        "_normalizeBlockNumber"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function pendingReward(uint256 _pid, address _user)\n        external\n        view\n        returns (uint256)\n    {\n        PoolInfo storage pool = poolInfo[_pid];\n        UserInfo storage user = userInfo[_pid][_user];\n        uint256 accRewardPerShare = pool.accRewardPerShare;\n        uint256 blockNumber = _blockNumber();\n        //normalizing the pool's `lastRewardBlock` ensures that no rewards are distributed by staking outside of an epoch\n        uint256 lastRewardBlock = _normalizeBlockNumber(pool.lastRewardBlock);\n        uint256 lpSupply = pool.lpToken.balanceOf(address(this));\n        //if blockNumber is greater than the pool's `lastRewardBlock` the pool's `accRewardPerShare` is outdated,\n        //we need to calculate the up to date amount to return an accurate reward value\n        if (blockNumber > lastRewardBlock && lpSupply != 0) {\n            uint256 reward = ((blockNumber - lastRewardBlock) *\n                epoch.rewardPerBlock *\n                1e36 *\n                pool.allocPoint) / totalAllocPoint;\n            accRewardPerShare += reward / lpSupply;\n        }\n        return\n            //rewards that the user had already accumulated but not claimed\n            userRewards[_user] +\n            //subtracting the user's `lastAccRewardPerShare` from the pool's `accRewardPerShare` results in the amount of rewards per share\n            //the pool has accumulated since the user's last claim, multiplying it by the user's shares results in the amount of new rewards claimable\n            //by the user\n            (user.amount * (accRewardPerShare - user.lastAccRewardPerShare)) /\n            1e36;\n    }"
}