Skip to content

Commit

Permalink
chore: add migrate function for WooSimpleRewarder (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmer1in authored Sep 11, 2024
1 parent 7335d6e commit 36fce46
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions contracts/WooSimpleRewarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ contract WooSimpleRewarder is IRewarder, Ownable, ReentrancyGuard {
}
}

/// @notice For migrate to new WooSimpleRewarder only
/// @param _users array of user address
/// @param _weAmounts array of user weToken amount they deposited to MasterChef
function migrateUserAmounts(address[] memory _users, uint256[] memory _weAmounts) external onlyOwner {
uint256 length = _users.length;
unchecked {
for (uint256 i = 0; i < length; i++) {
UserInfo storage user = userInfo[_users[i]];
user.amount = _weAmounts[i];
}
}
}

/// @notice In case rewarder is stopped before emissions finished,
/// @notice this function allows withdrawal of remaining tokens.
function emergencyWithdraw() public onlyOwner {
Expand Down

0 comments on commit 36fce46

Please sign in to comment.