```\n   function onReward(uint _pid, address _user, address _to, uint, uint _amt) external override onlyParent nonReentrant {\n      PoolInfo memory pool = updatePool(_pid);\n         if (pool.lastRewardTime == 0) return;\n            UserInfo storage user = userInfo[_pid][_user];\n            uint pending;\n         if (user.amount > 0) {\n              pending = ((user.amount * pool.accRewardPerShare) / ACC_TOKEN_PRECISION) - user.rewardDebt;\n      rewardToken.safeTransfer(_to, pending);\n         }\n         user.amount = _amt;\n         user.rewardDebt = (_amt * pool.accRewardPerShare) / \n            ACC_TOKEN_PRECISION;\n      emit LogOnReward(_user, _pid, pending, _to);\n      }\n```\n