Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration test for rewards manager #31

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contracts/core/RewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ contract RewardsManager is IRewardsManager, Initializable, UUPSUpgradeable, Acce
maxTotalSupply = _maxTotalSupply;
}

/// @inheritdoc IRewardsManager
function changeToken(address token_) external onlyRole(Roles.CHANGE_TOKEN_ROLE) {
address previousToken = token;
token = token_;
emit TokenChanged(previousToken, token);
}

/// @inheritdoc IRewardsManager
function claimRewardByEpoch(uint16 epoch) external {
address sender = _msgSender();
Expand Down
15 changes: 15 additions & 0 deletions contracts/interfaces/IRewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ pragma solidity ^0.8.17;
* @notice
*/
interface IRewardsManager {
/**
* @dev Emitted when the token changes
*
* @param previousToken the previous token
* @param newToken the new token
*/
event TokenChanged(address previousToken, address newToken);

/* @notice Change token
*
* @param token
*
*/
function changeToken(address token) external;

/*
* Allows a staker to claim their rewards for a specific epoch.
* @param {uint16} epoch - The epoch number for which rewards are being claimed.
Expand Down
Loading