-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'shah/ogn-rewards-source' into shah/migrator-rebased
- Loading branch information
Showing
3 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import {Governable} from "./Governable.sol"; | |
import {Initializable} from "./upgrades/Initializable.sol"; | ||
import "OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol"; | ||
|
||
contract OGNRewardsSource is Governable, Initializable { | ||
contract FixedRateRewardsSource is Governable, Initializable { | ||
error UnauthorizedCaller(); | ||
error InvalidRewardRate(); | ||
|
||
|
@@ -14,7 +14,7 @@ contract OGNRewardsSource is Governable, Initializable { | |
event RewardsPerSecondChanged(uint256 newRPS, uint256 oldRPS); | ||
event RewardCollected(uint256 amountCollected); | ||
|
||
address public immutable ogn; | ||
address public immutable rewardToken; | ||
|
||
address public strategistAddr; | ||
|
||
|
@@ -39,8 +39,8 @@ contract OGNRewardsSource is Governable, Initializable { | |
_; | ||
} | ||
|
||
constructor(address _ogn) { | ||
ogn = _ogn; | ||
constructor(address _rewardToken) { | ||
rewardToken = _rewardToken; | ||
} | ||
|
||
/// @dev Initialize the proxy implementation | ||
|
@@ -82,7 +82,7 @@ contract OGNRewardsSource is Governable, Initializable { | |
|
||
// Intentionally skipping balance check to save some gas | ||
// since `transfer` anyway would fail in case of low balance | ||
IERC20(ogn).transfer(_target, rewardAmount); | ||
IERC20(rewardToken).transfer(_target, rewardAmount); | ||
} | ||
} | ||
|
||
|
@@ -126,13 +126,13 @@ contract OGNRewardsSource is Governable, Initializable { | |
} | ||
|
||
/// @dev Set the rate of reward emission | ||
/// @param _rewardsPerSecond Amount of OGN to distribute per second | ||
/// @param _rewardsPerSecond Amount of rewardToken to distribute per second | ||
function setRewardsPerSecond(uint256 _rewardsPerSecond) external onlyGovernorOrStrategist { | ||
_setRewardsPerSecond(_rewardsPerSecond); | ||
} | ||
|
||
/// @dev Set the rate of reward emission | ||
/// @param _rewardsPerSecond Amount of OGN to distribute per second | ||
/// @param _rewardsPerSecond Amount of rewardToken to distribute per second | ||
function _setRewardsPerSecond(uint256 _rewardsPerSecond) internal { | ||
if (_rewardsPerSecond > type(uint192).max) { | ||
revert InvalidRewardRate(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters