From c23f5a001528455c027c557e26da4420e1cef033 Mon Sep 17 00:00:00 2001 From: echo Date: Tue, 6 Feb 2024 13:51:35 +0800 Subject: [PATCH] Remove `stakeWithPermit` function and its related interface. --- src/KTONStakingRewards.sol | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/KTONStakingRewards.sol b/src/KTONStakingRewards.sol index 02fa001..1b02a9b 100644 --- a/src/KTONStakingRewards.sol +++ b/src/KTONStakingRewards.sol @@ -20,7 +20,7 @@ contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, Reentr IERC20 public stakingToken; uint256 public periodFinish = 0; uint256 public rewardRate = 0; - uint256 public rewardsDuration = 60 days; + uint256 public rewardsDuration = 7200; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; @@ -76,18 +76,6 @@ contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, Reentr /* ========== MUTATIVE FUNCTIONS ========== */ - function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant updateReward(msg.sender) { - require(amount > 0, "Cannot stake 0"); - _totalSupply = _totalSupply.add(amount); - _balances[msg.sender] = _balances[msg.sender].add(amount); - - // permit - IUniswapV2ERC20(address(stakingToken)).permit(msg.sender, address(this), amount, deadline, v, r, s); - - stakingToken.safeTransferFrom(msg.sender, address(this), amount); - emit Staked(msg.sender, amount); - } - function stake(uint256 amount) external nonReentrant updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); _totalSupply = _totalSupply.add(amount); @@ -160,7 +148,3 @@ contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, Reentr event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); } - -interface IUniswapV2ERC20 { - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; -}