Skip to content

Commit

Permalink
Merge pull request #3 from darwinia-network/r
Browse files Browse the repository at this point in the history
Notify and transfer native token to KTON staker in one transaction
  • Loading branch information
hujw77 authored Feb 6, 2024
2 parents 0e58237 + a42a6f6 commit f3e0898
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit f3e0898

Please sign in to comment.