文件 1 的 11:Address.sol
pragma solidity >=0.6.2 <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 _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 的 11:Context.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
文件 3 的 11:IERC20.sol
pragma solidity >=0.6.0 <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 的 11:IStakingRewards.sol
pragma solidity =0.7.6;
interface IStakingRewards {
function lastTimeRewardApplicable() external view returns (uint256);
function rewardPerToken() external view returns (uint256, uint256);
function earned(address account) external view returns (uint256, uint256);
function getRewardForDuration() external view returns (uint256, uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function stake(uint256 amount) external payable;
function withdraw(uint256 amount) external;
function getReward(uint256 rewardsTokenID) external;
function exit() external;
}
文件 5 的 11:Math.sol
pragma solidity >=0.6.0 <0.8.0;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
文件 6 的 11:Ownable.sol
pragma solidity >=0.6.0 <0.8.0;
import "../GSN/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
文件 7 的 11:ReentrancyGuard.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 8 的 11:RewardsDistributionRecipient.sol
pragma solidity =0.7.6;
abstract contract RewardsDistributionRecipient {
address public rewardsDistribution;
function notifyRewardAmount(uint256 rewardDPX, uint256 rewardRDPX) external virtual;
modifier onlyRewardsDistribution() {
require(msg.sender == rewardsDistribution, 'Caller is not RewardsDistribution contract');
_;
}
}
文件 9 的 11:SafeERC20.sol
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
library SafeERC20 {
using SafeMath for uint256;
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).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_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");
}
}
}
文件 10 的 11:SafeMath.sol
pragma solidity >=0.6.0 <0.8.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
文件 11 的 11:StakingRewards.sol
pragma solidity =0.7.6;
import '@openzeppelin/contracts/math/Math.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import './interfaces/IStakingRewards.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import './RewardsDistributionRecipient.sol';
contract StakingRewards is RewardsDistributionRecipient, ReentrancyGuard, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public rewardsTokenDPX;
IERC20 public rewardsTokenRDPX;
IERC20 public stakingToken;
uint256 public boost = 0;
uint256 public periodFinish = 0;
uint256 public boostedFinish = 0;
uint256 public rewardRateDPX = 0;
uint256 public rewardRateRDPX = 0;
uint256 public rewardsDuration;
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStoredDPX;
uint256 public rewardPerTokenStoredRDPX;
uint256 public boostedTimePeriod;
uint256 public id;
mapping(address => uint256) public userDPXRewardPerTokenPaid;
mapping(address => uint256) public userRDPXRewardPerTokenPaid;
mapping(address => uint256) public rewardsDPX;
mapping(address => uint256) public rewardsRDPX;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
constructor(
address _rewardsDistribution,
address _rewardsTokenDPX,
address _rewardsTokenRDPX,
address _stakingToken,
uint256 _rewardsDuration,
uint256 _boostedTimePeriod,
uint256 _boost,
uint256 _id
) Ownable() {
rewardsTokenDPX = IERC20(_rewardsTokenDPX);
rewardsTokenRDPX = IERC20(_rewardsTokenRDPX);
stakingToken = IERC20(_stakingToken);
rewardsDistribution = _rewardsDistribution;
rewardsDuration = _rewardsDuration;
boostedTimePeriod = _boostedTimePeriod;
boost = _boost;
id = _id;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function lastTimeRewardApplicable() public view returns (uint256) {
uint256 timeApp = Math.min(block.timestamp, periodFinish);
return timeApp;
}
function rewardPerToken() public view returns (uint256, uint256) {
if (_totalSupply == 0) {
uint256 perTokenRateDPX = rewardPerTokenStoredDPX;
uint256 perTokenRateRDPX = rewardPerTokenStoredRDPX;
return (perTokenRateDPX, perTokenRateRDPX);
}
if (block.timestamp < boostedFinish) {
uint256 perTokenRateDPX =
rewardPerTokenStoredDPX.add(
lastTimeRewardApplicable()
.sub(lastUpdateTime)
.mul(rewardRateDPX.mul(boost))
.mul(1e18)
.div(_totalSupply)
);
uint256 perTokenRateRDPX =
rewardPerTokenStoredRDPX.add(
lastTimeRewardApplicable()
.sub(lastUpdateTime)
.mul(rewardRateRDPX.mul(boost))
.mul(1e18)
.div(_totalSupply)
);
return (perTokenRateDPX, perTokenRateRDPX);
} else {
if (lastUpdateTime < boostedFinish) {
uint256 perTokenRateDPX =
rewardPerTokenStoredDPX
.add(
boostedFinish.sub(lastUpdateTime).mul(rewardRateDPX.mul(boost)).mul(1e18).div(
_totalSupply
)
)
.add(
lastTimeRewardApplicable().sub(boostedFinish).mul(rewardRateDPX).mul(1e18).div(
_totalSupply
)
);
uint256 perTokenRateRDPX =
rewardPerTokenStoredRDPX
.add(
boostedFinish.sub(lastUpdateTime).mul(rewardRateRDPX.mul(boost)).mul(1e18).div(
_totalSupply
)
)
.add(
lastTimeRewardApplicable().sub(boostedFinish).mul(rewardRateRDPX).mul(1e18).div(
_totalSupply
)
);
return (perTokenRateDPX, perTokenRateRDPX);
} else {
uint256 perTokenRateDPX =
rewardPerTokenStoredDPX.add(
lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRateDPX).mul(1e18).div(
_totalSupply
)
);
uint256 perTokenRateRDPX =
rewardPerTokenStoredRDPX.add(
lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRateRDPX).mul(1e18).div(
_totalSupply
)
);
return (perTokenRateDPX, perTokenRateRDPX);
}
}
}
function earned(address account)
public
view
returns (uint256 DPXtokensEarned, uint256 RDPXtokensEarned)
{
uint256 perTokenRateDPX;
uint256 perTokenRateRDPX;
(perTokenRateDPX, perTokenRateRDPX) = rewardPerToken();
DPXtokensEarned = _balances[account]
.mul(perTokenRateDPX.sub(userDPXRewardPerTokenPaid[account]))
.div(1e18)
.add(rewardsDPX[account]);
RDPXtokensEarned = _balances[account]
.mul(perTokenRateRDPX.sub(userRDPXRewardPerTokenPaid[account]))
.div(1e18)
.add(rewardsRDPX[account]);
}
function stakeWithPermit(
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant updateReward(msg.sender) {
require(amount > 0, 'Cannot stake 0');
_totalSupply = _totalSupply.add(amount);
_balances[msg.sender] = _balances[msg.sender].add(amount);
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 payable nonReentrant updateReward(msg.sender) {
require(amount > 0, 'Cannot stake 0');
_totalSupply = _totalSupply.add(amount);
_balances[msg.sender] = _balances[msg.sender].add(amount);
stakingToken.safeTransferFrom(msg.sender, address(this), amount);
emit Staked(msg.sender, amount);
}
function withdraw(uint256 amount) public nonReentrant updateReward(msg.sender) {
require(amount > 0, 'Cannot withdraw 0');
require(amount <= _balances[msg.sender], 'Insufficent balance');
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
stakingToken.safeTransfer(msg.sender, amount);
emit Withdrawn(msg.sender, amount);
}
function withdrawRewardTokens(uint256 amountDPX, uint256 amountRDPX)
public
onlyOwner
returns (uint256, uint256)
{
address OwnerAddress = owner();
if (OwnerAddress == msg.sender) {
IERC20(rewardsTokenDPX).safeTransfer(OwnerAddress, amountDPX);
IERC20(rewardsTokenRDPX).safeTransfer(OwnerAddress, amountRDPX);
}
return (amountDPX, amountRDPX);
}
function compound() public nonReentrant updateReward(msg.sender) {
uint256 rewardDPX = rewardsDPX[msg.sender];
require(rewardDPX > 0, 'stake address not found');
require(rewardsTokenDPX == stakingToken, "Can't stake the reward token.");
rewardsDPX[msg.sender] = 0;
_totalSupply = _totalSupply.add(rewardDPX);
_balances[msg.sender] = _balances[msg.sender].add(rewardDPX);
emit RewardCompounded(msg.sender, rewardDPX);
}
function getReward(uint256 rewardsTokenID) public nonReentrant updateReward(msg.sender) {
if (rewardsTokenID == 0) {
uint256 rewardDPX = rewardsDPX[msg.sender];
require(rewardDPX > 0, 'can not withdraw 0 DPX reward');
rewardsDPX[msg.sender] = 0;
rewardsTokenDPX.safeTransfer(msg.sender, rewardDPX);
emit RewardPaid(msg.sender, rewardDPX);
} else if (rewardsTokenID == 1) {
uint256 rewardRDPX = rewardsRDPX[msg.sender];
require(rewardRDPX > 0, 'can not withdraw 0 RDPX reward');
rewardsRDPX[msg.sender] = 0;
rewardsTokenRDPX.safeTransfer(msg.sender, rewardRDPX);
emit RewardPaid(msg.sender, rewardRDPX);
} else {
uint256 rewardDPX = rewardsDPX[msg.sender];
uint256 rewardRDPX = rewardsRDPX[msg.sender];
if (rewardDPX > 0) {
rewardsDPX[msg.sender] = 0;
rewardsTokenDPX.safeTransfer(msg.sender, rewardDPX);
}
if (rewardRDPX > 0) {
rewardsRDPX[msg.sender] = 0;
rewardsTokenRDPX.safeTransfer(msg.sender, rewardRDPX);
}
emit RewardPaid(msg.sender, rewardDPX);
emit RewardPaid(msg.sender, rewardRDPX);
}
}
function exit() external {
getReward(2);
withdraw(_balances[msg.sender]);
}
function notifyRewardAmount(uint256 rewardDPX, uint256 rewardRDPX)
external
override
onlyRewardsDistribution
setReward(address(0))
{
if (periodFinish == 0) {
rewardRateDPX = rewardDPX.div(rewardsDuration.add(boostedTimePeriod));
rewardRateRDPX = rewardRDPX.div(rewardsDuration.add(boostedTimePeriod));
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp.add(rewardsDuration);
boostedFinish = block.timestamp.add(boostedTimePeriod);
} else {
uint256 remaining = periodFinish.sub(block.timestamp);
uint256 leftoverDPX = remaining.mul(rewardRateDPX);
uint256 leftoverRDPX = remaining.mul(rewardRateRDPX);
rewardRateDPX = rewardDPX.add(leftoverDPX).div(rewardsDuration);
rewardRateRDPX = rewardRDPX.add(leftoverRDPX).div(rewardsDuration);
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp.add(rewardsDuration);
}
emit RewardAdded(rewardDPX, rewardRDPX);
}
modifier setReward(address account) {
(rewardPerTokenStoredDPX, rewardPerTokenStoredRDPX) = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
(rewardsDPX[account], rewardsRDPX[account]) = earned(account);
userDPXRewardPerTokenPaid[account] = rewardPerTokenStoredDPX;
userRDPXRewardPerTokenPaid[account] = rewardPerTokenStoredRDPX;
}
_;
}
modifier updateReward(address account) {
(rewardPerTokenStoredDPX, rewardPerTokenStoredRDPX) = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
(rewardsDPX[account], rewardsRDPX[account]) = earned(account);
userDPXRewardPerTokenPaid[account] = rewardPerTokenStoredDPX;
userRDPXRewardPerTokenPaid[account] = rewardPerTokenStoredRDPX;
}
_;
}
event RewardUpdated(uint256 rewardDPX, uint256 rewardRDPX);
event RewardAdded(uint256 rewardDPX, uint256 rewardRDPX);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardCompounded(address indexed user, uint256 rewardDPX);
}
interface IUniswapV2ERC20 {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
{
"compilationTarget": {
"contracts/StakingRewards.sol": "StakingRewards"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsTokenDPX","type":"address"},{"internalType":"address","name":"_rewardsTokenRDPX","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"},{"internalType":"uint256","name":"_boostedTimePeriod","type":"uint256"},{"internalType":"uint256","name":"_boost","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardDPX","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardRDPX","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardDPX","type":"uint256"}],"name":"RewardCompounded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardDPX","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardRDPX","type":"uint256"}],"name":"RewardUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boostedFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boostedTimePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"compound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"DPXtokensEarned","type":"uint256"},{"internalType":"uint256","name":"RDPXtokensEarned","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardsTokenID","type":"uint256"}],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardDPX","type":"uint256"},{"internalType":"uint256","name":"rewardRDPX","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStoredDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStoredRDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRateDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRateRDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsRDPX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsTokenDPX","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsTokenRDPX","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"stakeWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","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":"userDPXRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRDPXRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountDPX","type":"uint256"},{"internalType":"uint256","name":"amountRDPX","type":"uint256"}],"name":"withdrawRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]