From 235ab1869f08368fb3ee5e263a95ddf7640a1ae8 Mon Sep 17 00:00:00 2001 From: AlienTornadosaurusHex <> Date: Thu, 22 Jun 2023 18:46:52 +0000 Subject: [PATCH] Add setReward function back to TornadoStakingRewards Signed-off-by: AlienTornadosaurusHex <> --- src/v2/TornadoStakingRewards.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/v2/TornadoStakingRewards.sol b/src/v2/TornadoStakingRewards.sol index f954eb4..c7f2256 100644 --- a/src/v2/TornadoStakingRewards.sol +++ b/src/v2/TornadoStakingRewards.sol @@ -119,6 +119,21 @@ contract TornadoStakingRewards is Initializable, EnsResolve { accumulatedRewards[account] = accumulatedRewards[account].add(claimed); } + /** + * @notice This function should allow governance to directly set accumulated rewards amount for an account + * @dev IMPORTANT FUNCTION: + * Do NOT use to update rewards in normal cases, see `updateRewardsOnLockedBalanceChange` function + * for this purposes. This function should be used only for fix bugs with rewards. + * You need to replenish Staking contract with TORN, if you increase staker rewards + * amount with this function, or withdraw TORN from Staking contract, if staker rewards decreased. + * @param account address of account to set rewards amount + * @param amount expected account accumulated rewards balance + * + */ + function setReward(address account, uint256 amount) external onlyGovernance { + accumulatedRewards[account] = amount; + } + /** * @notice This function should allow governance rescue tokens from the staking rewards contract */