文件 1 的 7:Address.sol
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 7:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 7:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 4 的 7:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 5 的 7:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 6 的 7:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 7 的 7:StakingPoolV3Flat.sol
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract StakingPoolV3Flat is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
struct UserInfo {
bool isAdded;
address addr;
uint256 totalAmount;
uint256 nextDepositId;
}
struct DepositInfo {
uint256 amount;
uint256 lockFrom;
uint256 lockTo;
uint256 rewardDebt;
uint256 rewardPending;
}
uint256 private constant _PRECISION_FACTOR = 1e12;
IERC20 public rewardToken;
IERC20 public stakedToken;
mapping(address => UserInfo) public userInfos;
address[] public userList;
mapping(address => mapping(uint256 => DepositInfo)) public depositInfos;
uint256 public rewardPerSecond;
uint256 public startTime;
uint256 public endTime;
uint256 public lastRewardTime;
uint256 public accTokenPerShare;
uint256 public totalStakingTokens;
uint256 public totalRewardTokens;
uint256 public freezeStartTime;
uint256 public freezeEndTime;
uint256 public poolLimitPerUser;
uint256 public minDepositAmount;
uint256 public lockDuration;
mapping(address => mapping(address => bool)) public delegators;
event EDeposit(address indexed user, uint256 amount, uint256 depositId);
event EWithdraw(address indexed user, uint256 amount, uint256 depositId);
event EAddRewardTokens(address indexed user, uint256 amount);
constructor(
IERC20 _stakedToken,
IERC20 _rewardToken,
uint256 _rewardPerSecond,
uint256 _startTime,
uint256 _endTime,
uint256 _lockDuration
) {
stakedToken = _stakedToken;
rewardToken = _rewardToken;
rewardPerSecond = _rewardPerSecond;
startTime = _startTime;
endTime = _endTime;
lockDuration = _lockDuration;
lastRewardTime = startTime;
}
function isFrozen() public view returns (bool) {
return block.timestamp >= freezeStartTime && block.timestamp <= freezeEndTime;
}
function pendingReward(address _user, uint256 _depositId) external view returns (uint256) {
DepositInfo memory deposit = depositInfos[_user][_depositId];
uint256 adjustedTokenPerShare = accTokenPerShare;
if (block.timestamp > lastRewardTime && totalStakingTokens != 0) {
uint256 multiplier = _getMultiplier(lastRewardTime, block.timestamp);
uint256 tokenReward = multiplier * rewardPerSecond;
adjustedTokenPerShare += ((tokenReward * _PRECISION_FACTOR) / totalStakingTokens);
}
return
deposit.rewardPending + (((deposit.amount * adjustedTokenPerShare) / _PRECISION_FACTOR) - deposit.rewardDebt);
}
function getUserListLength() external view returns (uint) {
return userList.length;
}
function getUsersPaging(
uint _offset,
uint _limit
) external view returns (UserInfo[] memory users, uint nextOffset, uint total) {
uint totalUsers = userList.length;
if (_limit == 0) {
_limit = 1;
}
if (_limit > totalUsers - _offset) {
_limit = totalUsers - _offset;
}
UserInfo[] memory values = new UserInfo[](_limit);
for (uint i = 0; i < _limit; i++) {
values[i] = userInfos[userList[_offset + i]];
}
return (values, _offset + _limit, totalUsers);
}
function depositTokens(uint256 _amount) external nonReentrant {
require(block.timestamp >= startTime && block.timestamp <= endTime, "Invalid time");
require(!isFrozen(), "Deposit is frozen");
require(_amount > 0, "Invalid amount");
address sender_ = _msgSender();
UserInfo storage user = userInfos[sender_];
require(_amount + user.totalAmount >= minDepositAmount, "User amount below minimum");
if (poolLimitPerUser > 0) {
require(_amount + user.totalAmount <= poolLimitPerUser, "User amount above limit");
}
_updatePool();
if (!user.isAdded) {
user.isAdded = true;
user.addr = sender_;
userList.push(sender_);
}
DepositInfo storage deposit = depositInfos[sender_][user.nextDepositId++];
if (deposit.amount > 0) {
deposit.rewardPending += ((deposit.amount * accTokenPerShare) / _PRECISION_FACTOR) - deposit.rewardDebt;
}
uint256 previousBalance_ = stakedToken.balanceOf(address(this));
stakedToken.safeTransferFrom(sender_, address(this), _amount);
uint256 newBalance_ = stakedToken.balanceOf(address(this));
uint256 addedAmount_ = newBalance_ - previousBalance_;
user.totalAmount += addedAmount_;
totalStakingTokens += addedAmount_;
deposit.amount += addedAmount_;
deposit.lockFrom = block.timestamp;
deposit.lockTo = block.timestamp + lockDuration;
deposit.rewardDebt = (deposit.amount * accTokenPerShare) / _PRECISION_FACTOR;
emit EDeposit(sender_, addedAmount_, user.nextDepositId - 1);
}
function withdrawTokens(address _staker, uint256 _amount, uint256 _depositId) external nonReentrant {
require(!isFrozen(), "Withdraw is frozen");
require(_amount > 0, "Invalid amount");
address trigger_ = _msgSender();
if (trigger_ != _staker) {
require(delegators[_staker][trigger_], "Invalid user");
}
DepositInfo storage deposit = depositInfos[_staker][_depositId];
require(deposit.amount >= _amount, "Amount to withdraw too high");
require(block.timestamp >= deposit.lockTo, "Invalid time to withdraw");
_updatePool();
deposit.rewardPending += ((deposit.amount * accTokenPerShare) / _PRECISION_FACTOR) - deposit.rewardDebt;
uint256 pending = deposit.rewardPending;
if (pending > 0) {
deposit.rewardPending = 0;
_safeRewardTransfer(trigger_, pending);
}
UserInfo storage user = userInfos[_staker];
user.totalAmount -= _amount;
totalStakingTokens -= _amount;
deposit.amount -= _amount;
stakedToken.safeTransfer(trigger_, _amount);
deposit.rewardDebt = (deposit.amount * accTokenPerShare) / _PRECISION_FACTOR;
emit EWithdraw(_staker, _amount, _depositId);
}
function setDelegators(address _delegator, bool _status) external nonReentrant {
delegators[_msgSender()][_delegator] = _status;
}
function setLockDuration(uint256 _duration) external onlyOwner {
lockDuration = _duration;
}
function addRewardTokens(uint256 _amount) external onlyOwner {
uint256 previousBalance_ = rewardToken.balanceOf(address(this));
rewardToken.safeTransferFrom(msg.sender, address(this), _amount);
uint256 newBalance_ = rewardToken.balanceOf(address(this));
uint256 addedAmount_ = newBalance_ - previousBalance_;
totalRewardTokens += addedAmount_;
emit EAddRewardTokens(msg.sender, addedAmount_);
}
function correctRewardTokens(uint256 _amount) external onlyOwner {
totalRewardTokens = _amount;
}
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner {
require(_tokenAddress != address(stakedToken), "Cannot be staked token");
require(_tokenAddress != address(rewardToken), "Cannot be reward token");
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
}
function stopReward() external onlyOwner {
endTime = block.timestamp;
}
function stopFreeze() external onlyOwner {
freezeStartTime = 0;
freezeEndTime = 0;
}
function setRewardPerSecond(uint256 _rewardPerSecond) external onlyOwner {
_updatePool();
rewardPerSecond = _rewardPerSecond;
}
function setStartAndEndTimes(uint256 _startTime, uint256 _endTime) external onlyOwner {
require(block.timestamp > endTime, "Pool has started");
require(_startTime < _endTime, "Invalid start and end block");
endTime = _endTime;
if (_startTime > block.timestamp) {
startTime = _startTime;
lastRewardTime = startTime;
}
}
function setFreezaTimes(uint256 _freezeStartTime, uint256 _freezeEndTime) external onlyOwner {
require(_freezeStartTime < _freezeEndTime, "Invalid start and end time");
require(block.timestamp < _freezeStartTime, "Invalid start and current");
freezeStartTime = _freezeStartTime;
freezeEndTime = _freezeEndTime;
}
function setPoolLimitPerUser(uint256 _poolLimitPerUser) external onlyOwner {
poolLimitPerUser = _poolLimitPerUser;
}
function setMinDepositAmount(uint256 _minDepositAmount) external onlyOwner {
minDepositAmount = _minDepositAmount;
}
function safeWithdrawReward(uint256 _amount) external onlyOwner {
totalRewardTokens -= _amount;
rewardToken.safeTransfer(msg.sender, _amount);
}
function emergencyWithdrawTokens(address _token, address _to, uint256 _amount) external onlyOwner {
IERC20(_token).safeTransfer(_to, _amount);
}
function _updatePool() private {
if (block.timestamp <= lastRewardTime) {
return;
}
if (totalStakingTokens == 0) {
lastRewardTime = block.timestamp;
return;
}
uint256 multiplier = _getMultiplier(lastRewardTime, block.timestamp);
uint256 tokenReward = multiplier * rewardPerSecond;
accTokenPerShare += (tokenReward * _PRECISION_FACTOR) / totalStakingTokens;
lastRewardTime = block.timestamp;
}
function _getMultiplier(uint256 _from, uint256 _to) private view returns (uint256) {
if (_to <= endTime) {
return _to - _from;
} else if (_from >= endTime) {
return 0;
} else {
return endTime - _from;
}
}
function _safeRewardTransfer(address _to, uint256 _amount) private {
uint256 rewardTokenBal = totalRewardTokens;
if (_amount > rewardTokenBal) {
totalRewardTokens -= rewardTokenBal;
rewardToken.safeTransfer(_to, rewardTokenBal);
} else {
totalRewardTokens -= _amount;
rewardToken.safeTransfer(_to, _amount);
}
}
}
{
"compilationTarget": {
"src/active/stakingpool/StakingPoolV3Flat.sol": "StakingPoolV3Flat"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"contract IERC20","name":"_stakedToken","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"uint256","name":"_lockDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EAddRewardTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"EDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"EWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addRewardTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"correctRewardTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"delegators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositInfos","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockFrom","type":"uint256"},{"internalType":"uint256","name":"lockTo","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"rewardPending","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyWithdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getUsersPaging","outputs":[{"components":[{"internalType":"bool","name":"isAdded","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"nextDepositId","type":"uint256"}],"internalType":"struct StakingPoolV3Flat.UserInfo[]","name":"users","type":"tuple[]"},{"internalType":"uint256","name":"nextOffset","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDepositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_depositId","type":"uint256"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLimitPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"recoverWrongTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"safeWithdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setDelegators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_freezeStartTime","type":"uint256"},{"internalType":"uint256","name":"_freezeEndTime","type":"uint256"}],"name":"setFreezaTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDepositAmount","type":"uint256"}],"name":"setMinDepositAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"}],"name":"setPoolLimitPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"}],"name":"setRewardPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setStartAndEndTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopFreeze","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakingTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfos","outputs":[{"internalType":"bool","name":"isAdded","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"nextDepositId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"userList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_depositId","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]