More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 3,948 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Exit | 21546601 | 17 days ago | IN | 0 ETH | 0.00096725 | ||||
Get Reward | 21546586 | 17 days ago | IN | 0 ETH | 0.00077653 | ||||
Exit | 21498578 | 23 days ago | IN | 0 ETH | 0.00030829 | ||||
Exit | 21465347 | 28 days ago | IN | 0 ETH | 0.00078498 | ||||
Exit | 21426193 | 33 days ago | IN | 0 ETH | 0.00095804 | ||||
Exit | 21407709 | 36 days ago | IN | 0 ETH | 0.00063461 | ||||
Exit | 21187179 | 67 days ago | IN | 0 ETH | 0.00277472 | ||||
Exit | 21140893 | 73 days ago | IN | 0 ETH | 0.0007014 | ||||
Get Reward | 21140888 | 73 days ago | IN | 0 ETH | 0.00057599 | ||||
Exit | 20881918 | 109 days ago | IN | 0 ETH | 0.00044759 | ||||
Exit | 20509083 | 161 days ago | IN | 0 ETH | 0.00008789 | ||||
Get Reward | 20509081 | 161 days ago | IN | 0 ETH | 0.00006715 | ||||
Exit | 20022542 | 229 days ago | IN | 0 ETH | 0.00116808 | ||||
Exit | 19916679 | 244 days ago | IN | 0 ETH | 0.00135086 | ||||
Exit | 19695366 | 275 days ago | IN | 0 ETH | 0.00071646 | ||||
Get Reward | 19695360 | 275 days ago | IN | 0 ETH | 0.00061729 | ||||
Exit | 19606423 | 288 days ago | IN | 0 ETH | 0.00169419 | ||||
Exit | 19606174 | 288 days ago | IN | 0 ETH | 0.00185629 | ||||
Exit | 19574506 | 292 days ago | IN | 0 ETH | 0.00202002 | ||||
Get Reward | 19574491 | 292 days ago | IN | 0 ETH | 0.00160138 | ||||
Exit | 19516738 | 300 days ago | IN | 0 ETH | 0.00187953 | ||||
Exit | 19353181 | 323 days ago | IN | 0 ETH | 0.00705808 | ||||
Get Reward | 19345434 | 324 days ago | IN | 0 ETH | 0.00373754 | ||||
Get Reward | 19018629 | 370 days ago | IN | 0 ETH | 0.00178505 | ||||
Exit | 19005724 | 372 days ago | IN | 0 ETH | 0.00361508 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
StakingRewards
Compiler Version
v0.7.4+commit.3f05b770
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Ownable.sol"; import "./RewardsDistributionRecipient.sol"; import "../interfaces/IEmergency.sol"; import "../interfaces/IEIP2612.sol"; import "../interfaces/IStakingRewards.sol"; contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, ReentrancyGuard, IEmergency { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public rewardsToken; IERC20 public stakingToken; uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public rewardsDuration; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; uint256 private _totalSupply; mapping(address => uint256) private _balances; address public emergencyRecipient; constructor( address _emergencyRecipient, address _rewardsDistribution, address _rewardsToken, address _stakingToken, uint256 _rewardsDuration ) { require(_rewardsDuration > 0, "rewards duration is 0"); emergencyRecipient = _emergencyRecipient; rewardsToken = IERC20(_rewardsToken); stakingToken = IERC20(_stakingToken); rewardsDistribution = _rewardsDistribution; rewardsDuration = _rewardsDuration; } function totalSupply() external override view returns (uint256) { return _totalSupply; } function balanceOf(address account) external override view returns (uint256) { return _balances[account]; } function lastTimeRewardApplicable() public override view returns (uint256) { return Math.min(block.timestamp, periodFinish); } function rewardPerToken() public override view returns (uint256) { if (_totalSupply == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(_totalSupply) ); } function earned(address account) public override view returns (uint256) { return _balances[account].mul(rewardPerToken().sub(userRewardPerTokenPaid[account])).div(1e18).add(rewards[account]); } function getRewardForDuration() external override view returns (uint256) { return rewardRate.mul(rewardsDuration); } 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 IEIP2612(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 override 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 override nonReentrant updateReward(msg.sender) { require(amount > 0, "cannot withdraw 0"); _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); stakingToken.safeTransfer(msg.sender, amount); emit Withdrawn(msg.sender, amount); } function getReward() public nonReentrant override updateReward(msg.sender) { uint256 reward = rewards[msg.sender]; if (reward > 0) { rewards[msg.sender] = 0; rewardsToken.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); } } function exit() external override { withdraw(_balances[msg.sender]); getReward(); } function emergencyWithdraw(IERC20 token) external override { require(address(token) != address(rewardsToken) && address(token) != address(stakingToken), "forbidden token"); token.transfer(emergencyRecipient, token.balanceOf(address(this))); } function notifyRewardAmount(uint256 reward) external override onlyRewardsDistribution updateReward(address(0)) { if (block.timestamp >= periodFinish) { rewardRate = reward.div(rewardsDuration); } else { uint256 remaining = periodFinish.sub(block.timestamp); uint256 leftover = remaining.mul(rewardRate); rewardRate = reward.add(leftover).div(rewardsDuration); } // Ensure the provided reward amount is not more than the balance in the contract. // This keeps the reward rate in the right range, preventing overflows due to // very high values of rewardRate in the earned and rewardsPerToken functions; // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow. uint256 balance = rewardsToken.balanceOf(address(this)); require(rewardRate <= balance.div(rewardsDuration), "provided reward too high"); lastUpdateTime = block.timestamp; periodFinish = block.timestamp.add(rewardsDuration); emit RewardAdded(reward); } modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ 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)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length 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)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ 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; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; abstract contract Ownable { address public owner; address public nominatedOwner; constructor(address _owner) { owner = _owner; } function acceptOwnership() external { require(msg.sender == nominatedOwner, "not nominated"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } function renounceOwnership() external onlyOwner { emit OwnerChanged(owner, address(0)); owner = address(0); } function nominateNewOwner(address newOwner) external onlyOwner { nominatedOwner = newOwner; emit OwnerNominated(newOwner); } modifier onlyOwner { require(msg.sender == owner, "not owner"); _; } event OwnerNominated(address indexed newOwner); event OwnerChanged(address indexed oldOwner, address indexed newOwner); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; abstract contract RewardsDistributionRecipient { address public rewardsDistribution; function notifyRewardAmount(uint256 reward) external virtual; modifier onlyRewardsDistribution() { require(msg.sender == rewardsDistribution, "not rewards distribution"); _; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IEmergency { function emergencyWithdraw(IERC20 token) external ; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IEIP2612 is IERC20 { function DOMAIN_SEPARATOR() external view returns (bytes32); function nonces(address owner) external view returns (uint256); function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event RewardAdded(uint256 reward); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ 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"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ 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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(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 { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_emergencyRecipient","type":"address"},{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","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":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":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","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":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","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":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","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":"nonpayable","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":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526000600455600060055534801561001a57600080fd5b5060405161171b38038061171b833981810160405260a081101561003d57600080fd5b5080516020820151604083015160608401516080909401516001805592939192909190806100b2576040805162461bcd60e51b815260206004820152601560248201527f72657761726473206475726174696f6e20697320300000000000000000000000604482015290519081900360640190fd5b600d80546001600160a01b039687166001600160a01b0319918216179091556002805494871694821694909417909355600380549286169284169290921790915560008054939094169290911691909117909155600655611603806101186000396000f3fe608060405234801561001057600080fd5b50600436106101975760003560e01c80637b0a47ee116100e3578063cd3daf9d1161008c578063e9fad8ee11610066578063e9fad8ee14610349578063ebe2b12b14610351578063ecd9ba821461035957610197565b8063cd3daf9d14610331578063d1af0c7d14610339578063df136d651461034157610197565b8063a694fc3a116100bd578063a694fc3a14610304578063be9ee11f14610321578063c8f33c911461032957610197565b80637b0a47ee146102ce57806380faa57d146102d65780638b876347146102de57610197565b80633c6b16ab116101455780636ff1c9bc1161011f5780636ff1c9bc1461027a57806370a08231146102a057806372f702f3146102c657610197565b80633c6b16ab146102315780633d18b9121461024e5780633fc6df6e1461025657610197565b80631c1f78eb116101765780631c1f78eb146102025780632e1a7d4d1461020a578063386a95251461022957610197565b80628cc2621461019c5780630700037d146101d457806318160ddd146101fa575b600080fd5b6101c2600480360360208110156101b257600080fd5b50356001600160a01b0316610391565b60408051918252519081900360200190f35b6101c2600480360360208110156101ea57600080fd5b50356001600160a01b031661040f565b6101c2610421565b6101c2610428565b6102276004803603602081101561022057600080fd5b5035610446565b005b6101c26105e7565b6102276004803603602081101561024757600080fd5b50356105ed565b610227610836565b61025e61096c565b604080516001600160a01b039092168252519081900360200190f35b6102276004803603602081101561029057600080fd5b50356001600160a01b031661097b565b6101c2600480360360208110156102b657600080fd5b50356001600160a01b0316610b0f565b61025e610b2a565b6101c2610b39565b6101c2610b3f565b6101c2600480360360208110156102f457600080fd5b50356001600160a01b0316610b4d565b6102276004803603602081101561031a57600080fd5b5035610b5f565b61025e610d01565b6101c2610d10565b6101c2610d16565b61025e610d64565b6101c2610d73565b610227610d79565b6101c2610d9c565b610227600480360360a081101561036f57600080fd5b5080359060208101359060ff6040820135169060608101359060800135610da2565b6001600160a01b0381166000908152600a60209081526040808320546009909252822054610409919061040390670de0b6b3a7640000906103fd906103de906103d8610d16565b90610fec565b6001600160a01b0388166000908152600c602052604090205490611049565b906110a9565b90611110565b92915050565b600a6020526000908152604090205481565b600b545b90565b600061044160065460055461104990919063ffffffff16565b905090565b6002600154141561049e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336104ac610d16565b6008556104b7610b3f565b6007556001600160a01b038116156104fe576104d281610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610553576040805162461bcd60e51b815260206004820152601160248201527f63616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b600b546105609083610fec565b600b55336000908152600c602052604090205461057d9083610fec565b336000818152600c60205260409020919091556003546105a9916001600160a01b03909116908461116a565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505060018055565b60065481565b6000546001600160a01b0316331461064c576040805162461bcd60e51b815260206004820152601860248201527f6e6f74207265776172647320646973747269627574696f6e0000000000000000604482015290519081900360640190fd5b6000610656610d16565b600855610661610b3f565b6007556001600160a01b038116156106a85761067c81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106c7576006546106bf9083906110a9565b60055561070a565b6004546000906106d79042610fec565b905060006106f06005548361104990919063ffffffff16565b600654909150610704906103fd8684611110565b60055550505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561075557600080fd5b505afa158015610769573d6000803e3d6000fd5b505050506040513d602081101561077f57600080fd5b50516006549091506107929082906110a9565b60055411156107e8576040805162461bcd60e51b815260206004820152601860248201527f70726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b4260078190556006546107fb9190611110565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b6002600154141561088e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553361089c610d16565b6008556108a7610b3f565b6007556001600160a01b038116156108ee576108c281610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a6020526040902054801561096457336000818152600a602052604081205560025461092d916001600160a01b03909116908361116a565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505060018055565b6000546001600160a01b031681565b6002546001600160a01b038281169116148015906109a757506003546001600160a01b03828116911614155b6109f8576040805162461bcd60e51b815260206004820152600f60248201527f666f7262696464656e20746f6b656e0000000000000000000000000000000000604482015290519081900360640190fd5b600d54604080516370a0823160e01b815230600482015290516001600160a01b038085169363a9059cbb9391169184916370a08231916024808301926020929190829003018186803b158015610a4d57600080fd5b505afa158015610a61573d6000803e3d6000fd5b505050506040513d6020811015610a7757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610ae057600080fd5b505af1158015610af4573d6000803e3d6000fd5b505050506040513d6020811015610b0a57600080fd5b505050565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b6000610441426004546111ea565b60096020526000908152604090205481565b60026001541415610bb7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533610bc5610d16565b600855610bd0610b3f565b6007556001600160a01b03811615610c1757610beb81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610c6c576040805162461bcd60e51b815260206004820152600e60248201527f63616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610c799083611110565b600b55336000908152600c6020526040902054610c969083611110565b336000818152600c6020526040902091909155600354610cc3916001600160a01b03909116903085611200565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505060018055565b600d546001600160a01b031681565b60075481565b6000600b5460001415610d2c5750600854610425565b610441610d5b600b546103fd670de0b6b3a7640000610d55600554610d556007546103d8610b3f565b90611049565b60085490611110565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610d9290610446565b610d9a610836565b565b60045481565b60026001541415610dfa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533610e08610d16565b600855610e13610b3f565b6007556001600160a01b03811615610e5a57610e2e81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008611610eaf576040805162461bcd60e51b815260206004820152600e60248201527f63616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610ebc9087611110565b600b55336000908152600c6020526040902054610ed99087611110565b336000818152600c60205260408082209390935560035483517fd505accf0000000000000000000000000000000000000000000000000000000081526004810193909352306024840152604483018a90526064830189905260ff8816608484015260a4830187905260c4830186905292516001600160a01b039093169263d505accf9260e480820193929182900301818387803b158015610f7957600080fd5b505af1158015610f8d573d6000803e3d6000fd5b5050600354610faa92506001600160a01b03169050333089611200565b60408051878152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250506001805550505050565b600082821115611043576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261105857506000610409565b8282028284828161106557fe5b04146110a25760405162461bcd60e51b81526004018080602001828103825260218152602001806115836021913960400191505060405180910390fd5b9392505050565b60008082116110ff576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161110857fe5b049392505050565b6000828201838110156110a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b0a90849061128e565b60008183106111f957816110a2565b5090919050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905261128890859061128e565b50505050565b60606112e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661133f9092919063ffffffff16565b805190915015610b0a5780806020019051602081101561130257600080fd5b5051610b0a5760405162461bcd60e51b815260040180806020018281038252602a8152602001806115a4602a913960400191505060405180910390fd5b606061134e8484600085611356565b949350505050565b6060824710156113975760405162461bcd60e51b815260040180806020018281038252602681526020018061155d6026913960400191505060405180910390fd5b6113a0856114b2565b6113f1576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106114305780518252601f199092019160209182019101611411565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611492576040519150601f19603f3d011682016040523d82523d6000602084013e611497565b606091505b50915091506114a78282866114b8565b979650505050505050565b3b151590565b606083156114c75750816110a2565b8251156114d75782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611521578181015183820152602001611509565b50505050905090810190601f16801561154e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122047ea4c962ee6e4ea74c6aacda22c531e8a2da129b0ead35b2d1060921647a5d764736f6c6343000704003300000000000000000000000063ef071b8a69c52a88dca4a844286aeff195129f0000000000000000000000009afc226dc049b99342ad6774eeb08bfa2f8744650000000000000000000000000000000000095413afc295d19edeb1ad7b71c9520000000000000000000000007924a818013f39cf800f5589ff1f1f0def54f31f000000000000000000000000000000000000000000000000000000000049d400
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101975760003560e01c80637b0a47ee116100e3578063cd3daf9d1161008c578063e9fad8ee11610066578063e9fad8ee14610349578063ebe2b12b14610351578063ecd9ba821461035957610197565b8063cd3daf9d14610331578063d1af0c7d14610339578063df136d651461034157610197565b8063a694fc3a116100bd578063a694fc3a14610304578063be9ee11f14610321578063c8f33c911461032957610197565b80637b0a47ee146102ce57806380faa57d146102d65780638b876347146102de57610197565b80633c6b16ab116101455780636ff1c9bc1161011f5780636ff1c9bc1461027a57806370a08231146102a057806372f702f3146102c657610197565b80633c6b16ab146102315780633d18b9121461024e5780633fc6df6e1461025657610197565b80631c1f78eb116101765780631c1f78eb146102025780632e1a7d4d1461020a578063386a95251461022957610197565b80628cc2621461019c5780630700037d146101d457806318160ddd146101fa575b600080fd5b6101c2600480360360208110156101b257600080fd5b50356001600160a01b0316610391565b60408051918252519081900360200190f35b6101c2600480360360208110156101ea57600080fd5b50356001600160a01b031661040f565b6101c2610421565b6101c2610428565b6102276004803603602081101561022057600080fd5b5035610446565b005b6101c26105e7565b6102276004803603602081101561024757600080fd5b50356105ed565b610227610836565b61025e61096c565b604080516001600160a01b039092168252519081900360200190f35b6102276004803603602081101561029057600080fd5b50356001600160a01b031661097b565b6101c2600480360360208110156102b657600080fd5b50356001600160a01b0316610b0f565b61025e610b2a565b6101c2610b39565b6101c2610b3f565b6101c2600480360360208110156102f457600080fd5b50356001600160a01b0316610b4d565b6102276004803603602081101561031a57600080fd5b5035610b5f565b61025e610d01565b6101c2610d10565b6101c2610d16565b61025e610d64565b6101c2610d73565b610227610d79565b6101c2610d9c565b610227600480360360a081101561036f57600080fd5b5080359060208101359060ff6040820135169060608101359060800135610da2565b6001600160a01b0381166000908152600a60209081526040808320546009909252822054610409919061040390670de0b6b3a7640000906103fd906103de906103d8610d16565b90610fec565b6001600160a01b0388166000908152600c602052604090205490611049565b906110a9565b90611110565b92915050565b600a6020526000908152604090205481565b600b545b90565b600061044160065460055461104990919063ffffffff16565b905090565b6002600154141561049e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336104ac610d16565b6008556104b7610b3f565b6007556001600160a01b038116156104fe576104d281610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610553576040805162461bcd60e51b815260206004820152601160248201527f63616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b600b546105609083610fec565b600b55336000908152600c602052604090205461057d9083610fec565b336000818152600c60205260409020919091556003546105a9916001600160a01b03909116908461116a565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505060018055565b60065481565b6000546001600160a01b0316331461064c576040805162461bcd60e51b815260206004820152601860248201527f6e6f74207265776172647320646973747269627574696f6e0000000000000000604482015290519081900360640190fd5b6000610656610d16565b600855610661610b3f565b6007556001600160a01b038116156106a85761067c81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106c7576006546106bf9083906110a9565b60055561070a565b6004546000906106d79042610fec565b905060006106f06005548361104990919063ffffffff16565b600654909150610704906103fd8684611110565b60055550505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561075557600080fd5b505afa158015610769573d6000803e3d6000fd5b505050506040513d602081101561077f57600080fd5b50516006549091506107929082906110a9565b60055411156107e8576040805162461bcd60e51b815260206004820152601860248201527f70726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b4260078190556006546107fb9190611110565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b6002600154141561088e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553361089c610d16565b6008556108a7610b3f565b6007556001600160a01b038116156108ee576108c281610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a6020526040902054801561096457336000818152600a602052604081205560025461092d916001600160a01b03909116908361116a565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505060018055565b6000546001600160a01b031681565b6002546001600160a01b038281169116148015906109a757506003546001600160a01b03828116911614155b6109f8576040805162461bcd60e51b815260206004820152600f60248201527f666f7262696464656e20746f6b656e0000000000000000000000000000000000604482015290519081900360640190fd5b600d54604080516370a0823160e01b815230600482015290516001600160a01b038085169363a9059cbb9391169184916370a08231916024808301926020929190829003018186803b158015610a4d57600080fd5b505afa158015610a61573d6000803e3d6000fd5b505050506040513d6020811015610a7757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610ae057600080fd5b505af1158015610af4573d6000803e3d6000fd5b505050506040513d6020811015610b0a57600080fd5b505050565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b6000610441426004546111ea565b60096020526000908152604090205481565b60026001541415610bb7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533610bc5610d16565b600855610bd0610b3f565b6007556001600160a01b03811615610c1757610beb81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610c6c576040805162461bcd60e51b815260206004820152600e60248201527f63616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610c799083611110565b600b55336000908152600c6020526040902054610c969083611110565b336000818152600c6020526040902091909155600354610cc3916001600160a01b03909116903085611200565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505060018055565b600d546001600160a01b031681565b60075481565b6000600b5460001415610d2c5750600854610425565b610441610d5b600b546103fd670de0b6b3a7640000610d55600554610d556007546103d8610b3f565b90611049565b60085490611110565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610d9290610446565b610d9a610836565b565b60045481565b60026001541415610dfa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533610e08610d16565b600855610e13610b3f565b6007556001600160a01b03811615610e5a57610e2e81610391565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008611610eaf576040805162461bcd60e51b815260206004820152600e60248201527f63616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610ebc9087611110565b600b55336000908152600c6020526040902054610ed99087611110565b336000818152600c60205260408082209390935560035483517fd505accf0000000000000000000000000000000000000000000000000000000081526004810193909352306024840152604483018a90526064830189905260ff8816608484015260a4830187905260c4830186905292516001600160a01b039093169263d505accf9260e480820193929182900301818387803b158015610f7957600080fd5b505af1158015610f8d573d6000803e3d6000fd5b5050600354610faa92506001600160a01b03169050333089611200565b60408051878152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250506001805550505050565b600082821115611043576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261105857506000610409565b8282028284828161106557fe5b04146110a25760405162461bcd60e51b81526004018080602001828103825260218152602001806115836021913960400191505060405180910390fd5b9392505050565b60008082116110ff576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161110857fe5b049392505050565b6000828201838110156110a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b0a90849061128e565b60008183106111f957816110a2565b5090919050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905261128890859061128e565b50505050565b60606112e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661133f9092919063ffffffff16565b805190915015610b0a5780806020019051602081101561130257600080fd5b5051610b0a5760405162461bcd60e51b815260040180806020018281038252602a8152602001806115a4602a913960400191505060405180910390fd5b606061134e8484600085611356565b949350505050565b6060824710156113975760405162461bcd60e51b815260040180806020018281038252602681526020018061155d6026913960400191505060405180910390fd5b6113a0856114b2565b6113f1576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106114305780518252601f199092019160209182019101611411565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611492576040519150601f19603f3d011682016040523d82523d6000602084013e611497565b606091505b50915091506114a78282866114b8565b979650505050505050565b3b151590565b606083156114c75750816110a2565b8251156114d75782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611521578181015183820152602001611509565b50505050905090810190601f16801561154e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122047ea4c962ee6e4ea74c6aacda22c531e8a2da129b0ead35b2d1060921647a5d764736f6c63430007040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000063ef071b8a69c52a88dca4a844286aeff195129f0000000000000000000000009afc226dc049b99342ad6774eeb08bfa2f8744650000000000000000000000000000000000095413afc295d19edeb1ad7b71c9520000000000000000000000007924a818013f39cf800f5589ff1f1f0def54f31f000000000000000000000000000000000000000000000000000000000049d400
-----Decoded View---------------
Arg [0] : _emergencyRecipient (address): 0x63Ef071b8A69C52a88dCA4A844286Aeff195129F
Arg [1] : _rewardsDistribution (address): 0x9aFc226Dc049B99342Ad6774Eeb08BfA2F874465
Arg [2] : _rewardsToken (address): 0x0000000000095413afC295d19EDeb1Ad7B71c952
Arg [3] : _stakingToken (address): 0x7924a818013f39cf800F5589fF1f1f0DEF54F31F
Arg [4] : _rewardsDuration (uint256): 4838400
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000063ef071b8a69c52a88dca4a844286aeff195129f
Arg [1] : 0000000000000000000000009afc226dc049b99342ad6774eeb08bfa2f874465
Arg [2] : 0000000000000000000000000000000000095413afc295d19edeb1ad7b71c952
Arg [3] : 0000000000000000000000007924a818013f39cf800f5589ff1f1f0def54f31f
Arg [4] : 000000000000000000000000000000000000000000000000000000000049d400
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.