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

Notify and transfer native token to KTON staker in one transaction #3

Merged
merged 2 commits into from
Feb 6, 2024
Merged
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
9 changes: 4 additions & 5 deletions src/KTONStakingRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ contract KTONStakingRewards is IStakingRewards, RewardsDistributionRecipient, Re

/* ========== CONSTRUCTOR ========== */

constructor(
address _rewardsDistribution,
address _stakingToken
) public {
constructor(address _rewardsDistribution, address _stakingToken) public {
stakingToken = IERC20(_stakingToken);
rewardsDistribution = _rewardsDistribution;
}
Expand Down Expand Up @@ -106,7 +103,9 @@ contract KTONStakingRewards is IStakingRewards, RewardsDistributionRecipient, Re

/* ========== RESTRICTED FUNCTIONS ========== */

function notifyRewardAmount(uint256 reward) external onlyRewardsDistribution updateReward(address(0)) {
function notifyRewardAmount() external payable onlyRewardsDistribution updateReward(address(0)) {
uint256 reward = msg.value;
require(reward >= rewardsDuration, "Provided reward too low");
if (block.timestamp >= periodFinish) {
rewardRate = reward.div(rewardsDuration);
} else {
Expand Down
Loading