Mumbai Testnet

Contract

0x1ac412E02f4B541dD872297c7F634c4CC7C615b7

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Init Campaign314349662023-01-26 15:42:55427 days ago1674747775IN
0x1ac412E0...CC7C615b7
0 MATIC0.00057162.42500001

Latest 1 internal transaction

Parent Txn Hash Block From To Value
314349462023-01-26 15:42:13427 days ago1674747733  Contract Creation0 MATIC
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xf79769DA...e724c4EB5
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
RollStakingRewards

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : RollStakingRewards.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import "./openzeppelin/utils/ReentrancyGuard.sol";
import "./openzeppelin/math/Math.sol";
import "./openzeppelin/token/ERC20/IERC20.sol";
import "./openzeppelin/math/SafeMath.sol";
import "./openzeppelin/utils/Address.sol";
import "./openzeppelin/token/ERC20/SafeERC20.sol";

import "./RollRewardsDistributionRecipient.sol";
import "./TokenWrapper.sol";

contract RollStakingRewards is
	RollRewardsDistributionRecipient,
	TokenWrapper,
	ReentrancyGuard
{
	using SafeMath for uint256;
	using SafeERC20 for IERC20;
	/* ========== STATE VARIABLES ========== */

	struct TokenRewardData {
		uint256 rewardRate;
		uint256 rewardPerTokenStored;
	}

	address[] public rewardTokensAddresses;
	mapping(address => TokenRewardData) public rewardTokens;
	mapping(address => mapping(address => uint256))
		public userRewardPerTokenPaid;
	mapping(address => mapping(address => uint256)) public rewards;
	mapping(address => uint256) public freeTokens;

	/* ========== GLOBAL STATE VARIABLES ==========  */

	uint256 public periodStart;
	uint256 public periodFinish;
	uint256 public rewardsDuration;

	uint256 public lastUpdateTime;
	uint256 public immutable tokenDecimals;

	uint256 public lastUnstake;

	/* ========== CONSTRUCTOR ========== */

	constructor(
		address _owner,
		address _rewardsDistribution,
		address[] memory _rewardTokens,
		address _stakingToken,
		address _registry
	) RollOwned(_owner, _registry) {
		for (uint256 i = 0; i < _rewardTokens.length; i++) {
			rewardTokensAddresses.push(_rewardTokens[i]);
			rewardTokens[_rewardTokens[i]] = TokenRewardData(0, 0);
		}
		token = IERC20(_stakingToken);
		tokenDecimals = token.decimals();
		rewardsDistribution = _rewardsDistribution;
	}

	/* ========== VIEWS ========== */

	function lastTimeRewardApplicable() public view returns (uint256) {
		uint256 n = Math.min(block.timestamp, periodFinish);
		return Math.max(n, periodStart);
	}

	function isValidRewardToken(address _token) public view returns (bool) {
		for (uint256 i = 0; i < rewardTokensAddresses.length; i++)
			if (_token == address(rewardTokensAddresses[i])) return true;
		return false;
	}

	function rewardPerToken(address _token) public view returns (uint256) {
		TokenRewardData storage data = rewardTokens[_token];
		if (_totalSupply == 0 || block.timestamp < periodStart) {
			return data.rewardPerTokenStored;
		}

		return
			data.rewardPerTokenStored.add(
				lastTimeRewardApplicable()
					.sub(lastUpdateTime)
					.mul(data.rewardRate)
					.mul(10**tokenDecimals)
					.div(totalSupply())
			);
	}

	function earned(address _account, address _token)
		public
		view
		returns (uint256)
	{
		return
			balanceOf(_account)
				.mul(
					rewardPerToken(_token).sub(
						userRewardPerTokenPaid[_token][_account]
					)
				)
				.div(10**tokenDecimals)
				.add(rewards[_token][_account]);
	}

	function getRewardForDuration(address _token)
		public
		view
		returns (uint256)
	{
		TokenRewardData storage data = rewardTokens[_token];
		return data.rewardRate.mul(rewardsDuration);
	}

	function getFreeTokenAmount(address _token) public view returns (uint256) {
		if (block.timestamp <= periodStart) return 0;
		if (lastUnstake > Math.min(periodFinish, block.timestamp))
			return freeTokens[_token];

		uint256 leftover = 0;
		if (super.totalSupply() == 0) {
			uint256 remaining = Math.min(periodFinish, block.timestamp).sub(
				lastUnstake
			);
			TokenRewardData storage data = rewardTokens[_token];
			leftover = remaining.mul(data.rewardRate);
		}
		return freeTokens[_token].add(leftover);
	}

	/* ========== MUTATIVE FUNCTIONS ========== */
	function moveFreeTokenToCreator() internal {
		uint256 from = Math.max(lastUnstake, periodStart);
		uint256 to = Math.min(block.timestamp, periodFinish);
		if (from >= to) return;
		if (super.totalSupply() == 0) {
			uint256 remaining = to.sub(from);
			for (uint256 i = 0; i < rewardTokensAddresses.length; i++) {
				TokenRewardData storage data = rewardTokens[
					rewardTokensAddresses[i]
				];
				uint256 leftover = remaining.mul(data.rewardRate);
				freeTokens[rewardTokensAddresses[i]] = freeTokens[
					rewardTokensAddresses[i]
				].add(leftover);
			}
		}
		lastUnstake = Math.max(block.timestamp, lastUnstake);
	}

	function stake(uint256 amount)
		public
		override
		nonReentrant
		notPaused
		updateReward(msg.sender)
	{
		require(amount > 0, "Cannot stake 0");
		moveFreeTokenToCreator();
		super.stake(amount);
		emit Staked(msg.sender, amount);
	}

	function withdraw(uint256 amount)
		public
		override
		nonReentrant
		updateReward(msg.sender)
	{
		require(amount > 0, "Cannot withdraw 0");
		moveFreeTokenToCreator();
		super.withdraw(amount);
		emit Withdrawn(msg.sender, amount);
	}

	function getReward() public nonReentrant updateReward(msg.sender) {
		for (uint256 i = 0; i < rewardTokensAddresses.length; i++) {
			uint256 reward = rewards[address(rewardTokensAddresses[i])][
				msg.sender
			];
			if (reward > 0) {
				rewards[address(rewardTokensAddresses[i])][msg.sender] = 0;
				IERC20(rewardTokensAddresses[i]).safeTransfer(
					msg.sender,
					reward
				);
				emit RewardPaid(
					msg.sender,
					address(rewardTokensAddresses[i]),
					reward
				);
			}
		}
	}

	function exit() external {
		withdraw(_balances[msg.sender]);
		getReward();
	}

	/* ========== RESTRICTED FUNCTIONS ========== */

	/* issues with adding multiple tokens
	 * Either we leave them and there will be wasted gas for expired rewards or
	 * we remove a token from the array and prevent anyone from claiming if they forgot to do so
	 * An announcement may be given a week prior from removing a secondary reward token.
	 * this would keep calls as efficient as possible.
	 */
	function notifyRewardAmount(
		uint256[] calldata _rewards,
		address[] calldata _tokens
	) internal {
		require(
			_rewards.length == _tokens.length &&
				rewardTokensAddresses.length == _tokens.length,
			"RollStakingRewards: Amount of rewards not matching reward token count."
		);
		for (uint256 i = 0; i < _tokens.length; i++) {
			uint256 balance = 0;
			TokenRewardData storage data = rewardTokens[_tokens[i]];

			data.rewardRate = _rewards[i].div(rewardsDuration);

			//==============================
			// transfer the tokens
			IERC20 _token = IERC20(_tokens[i]);
			uint256 previousBalance = _token.balanceOf(address(this));
			_token.safeTransferFrom(msg.sender, address(this), _rewards[i]);
			uint256 afterBalance = _token.balanceOf(address(this));
			require(
				afterBalance.sub(previousBalance) >= _rewards[i],
				"LM: no enough tokens"
			);
			uint256 leftover = _rewards[i].sub(
				data.rewardRate.mul(rewardsDuration)
			);
			freeTokens[_tokens[i]] = freeTokens[_tokens[i]].add(leftover);

			balance = _rewards[i];
			//==============================
			require(
				data.rewardRate <= balance.div(rewardsDuration),
				"RollStakingRewards: Provided reward too high"
			);
			emit RewardAdded(_rewards[i], _tokens[i]);
		}
		lastUpdateTime = periodStart;
		periodFinish = periodStart.add(rewardsDuration);
	}

	function setRewardsDuration(uint256 _periodStart, uint256 _rewardsDuration)
		internal
	{
		require(
			block.timestamp > periodFinish,
			"RollStakingRewards: Previous rewards period must be complete before changing the duration for the new period"
		);
		require(
			block.timestamp < _periodStart,
			"RollStakingRewards: Start must be a future date"
		);

		// if is not the first campaing let's reset reaward balances
		if (periodStart > 0) {
			claimFreeTokensImpl();
		}

		periodStart = _periodStart;
		periodFinish = 0;
		lastUpdateTime = periodStart;
		lastUnstake = periodStart;
		rewardsDuration = _rewardsDuration;
		emit RewardDurationUpdated(periodStart, rewardsDuration);
	}

	function initCampaign(
		uint256 _periodStart,
		uint256 _rewardsDuration,
		uint256[] calldata _rewards,
		address[] calldata _tokens
	) external onlyOwner updateReward(address(0)) lazyUpdateReward(address(0)) {
		setRewardsDuration(_periodStart, _rewardsDuration);
		notifyRewardAmount(_rewards, _tokens);
	}

	function claimFreeTokensImpl() internal {
		require(
			block.timestamp > periodFinish,
			"RollStakingRewards: Previous rewards period must be complete before claim"
		);

		// check if there's some pending calculation
		moveFreeTokenToCreator();

		// do the transfer
		for (uint256 i = 0; i < rewardTokensAddresses.length; i++) {
			address rewardTokenAddr = rewardTokensAddresses[i];
			uint256 freeTokenAmount = freeTokens[rewardTokenAddr];
			freeTokens[rewardTokenAddr] = 0;
			if (freeTokenAmount > 0) {
				IERC20 _token = IERC20(rewardTokenAddr);
				_token.safeTransfer(msg.sender, freeTokenAmount);
			}
		}

		emit FreeTokensClaimed(periodStart, rewardsDuration);
	}

	function claimFreeTokens() external onlyOwner {
		claimFreeTokensImpl();
	}

	/* ========== MODIFIERS ========== */
	modifier lazyUpdateReward(address _account) {
		_;
		updateRewardImpl(_account);
	}

	modifier updateReward(address _account) {
		updateRewardImpl(_account);
		_;
	}

	function updateRewardImpl(address _account) internal {
		for (uint256 i = 0; i < rewardTokensAddresses.length; i++) {
			TokenRewardData storage data = rewardTokens[
				rewardTokensAddresses[i]
			];
			data.rewardPerTokenStored = rewardPerToken(
				rewardTokensAddresses[i]
			);
		}
		lastUpdateTime = lastTimeRewardApplicable();
		if (_account != address(0)) {
			for (uint256 i = 0; i < rewardTokensAddresses.length; i++) {
				TokenRewardData storage data = rewardTokens[
					rewardTokensAddresses[i]
				];

				rewards[rewardTokensAddresses[i]][_account] = earned(
					_account,
					rewardTokensAddresses[i]
				);
				userRewardPerTokenPaid[rewardTokensAddresses[i]][
					_account
				] = data.rewardPerTokenStored;
			}
		}
	}

	event RewardAdded(uint256 reward, address indexed token);
	event Staked(address indexed user, uint256 amount);
	event Withdrawn(address indexed user, uint256 amount);
	event RewardPaid(
		address indexed user,
		address indexed token,
		uint256 reward
	);
	event RewardDurationUpdated(uint256 newStart, uint256 newDuration);
	event FreeTokensClaimed(uint256 newStart, uint256 newDuration);
}

File 2 of 12 : ReentrancyGuard.sol
// 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() {
		_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;
	}
}

File 3 of 12 : Math.sol
// 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);
    }
}

File 4 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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);

	function decimals() external view returns (uint8);

	/**
	 * @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
	);
}

File 5 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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;
	}
}

File 6 of 12 : Address.sol
// 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);
            }
        }
    }
}

File 7 of 12 : SafeERC20.sol
// 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");
        }
    }
}

File 8 of 12 : RollRewardsDistributionRecipient.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import "./RollPausable.sol";

// https://docs.synthetix.io/contracts/RewardsDistributionRecipient
abstract contract RollRewardsDistributionRecipient is RollPausable {
	address public rewardsDistribution;

	modifier onlyRewardsDistribution() {
		_onlyRewardsDistribution();
		_;
	}

	function _onlyRewardsDistribution() private view {
		require(
			msg.sender == rewardsDistribution,
			"Caller is not RewardsDistribution contract"
		);
	}

	function setRewardsDistribution(address _rewardsDistribution)
		external
		onlyOwner
	{
		require(_rewardsDistribution != address(0), "Invalid address");
		rewardsDistribution = _rewardsDistribution;
	}
}

File 9 of 12 : TokenWrapper.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import "./openzeppelin/token/ERC20/IERC20.sol";
import "./openzeppelin/math/SafeMath.sol";
import "./openzeppelin/token/ERC20/SafeERC20.sol";

contract TokenWrapper {
	using SafeMath for uint256;
	using SafeERC20 for IERC20;

	IERC20 public token;

	uint256 internal _totalSupply;
	mapping(address => uint256) internal _balances;

	function totalSupply() public view returns (uint256) {
		return _totalSupply;
	}

	function balanceOf(address account) public view returns (uint256) {
		return _balances[account];
	}

	function stake(uint256 amount) public virtual {
		_totalSupply = _totalSupply.add(amount);
		_balances[msg.sender] = _balances[msg.sender].add(amount);
		token.safeTransferFrom(msg.sender, address(this), amount);
	}

	function withdraw(uint256 amount) public virtual {
		_totalSupply = _totalSupply.sub(amount);
		_balances[msg.sender] = _balances[msg.sender].sub(amount);
		token.safeTransfer(msg.sender, amount);
	}
}

File 10 of 12 : RollPausable.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import "./RollOwned.sol";

// https://docs.synthetix.io/contracts/Pausable
abstract contract RollPausable is RollOwned {
	uint256 public lastPauseTime;
	bool public paused;

	constructor() {
		// This contract is abstract, and thus cannot be instantiated directly
		require(owner != address(0), "Owner must be set");
		// Paused will be false, and lastPauseTime will be 0 upon initialisation
	}

	/**
	 * @notice Change the paused state of the contract
	 * @dev Only the contract owner may call this.
	 */
	function setPaused(bool _paused) external onlyOwner {
		// Ensure we're actually changing the state before we do anything
		if (_paused == paused) {
			return;
		}

		// Set our paused state.
		paused = _paused;

		// If applicable, set the last pause time.
		if (_paused) {
			lastPauseTime = block.timestamp;
		}

		// Let everyone know that our pause state has changed.
		emit PauseChanged(_paused);
	}

	event PauseChanged(bool isPaused);

	modifier notPaused {
		_notPaused();
		_;
	}

	function _notPaused() private view {
		require(
			!paused,
			"This action cannot be performed while the contract is paused"
		);
	}
}

File 11 of 12 : RollOwned.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import "./StakingRegistry.sol";

// https://docs.synthetix.io/contracts/Owned
abstract contract RollOwned {
	address public owner;
	address public nominatedOwner;
	IStakingRegistry public immutable registry;

	constructor(address _owner, address _registry) {
		require(_owner != address(0), "Owner address cannot be 0");
		owner = _owner;
		registry = IStakingRegistry(_registry);
		emit OwnerChanged(address(0), _owner);
	}

	function nominateNewOwner(address _owner) external onlyOwner {
		nominatedOwner = _owner;
		emit OwnerNominated(_owner);
	}

	function acceptOwnership() external {
		require(
			msg.sender == nominatedOwner,
			"You must be nominated before you can accept ownership"
		);
		emit OwnerChanged(owner, nominatedOwner);
		registry.assignOwnerToContract(address(this), nominatedOwner, owner);
		owner = nominatedOwner;
		nominatedOwner = address(0);
	}

	modifier onlyOwner {
		_onlyOwner();
		_;
	}

	function _onlyOwner() private view {
		require(
			msg.sender == owner,
			"Only the contract owner may perform this action"
		);
	}

	event OwnerNominated(address newOwner);
	event OwnerChanged(address oldOwner, address newOwner);
}

File 12 of 12 : StakingRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

interface IStakingRegistry {
	function setCaller(address _caller, bool _value) external;

	function assignOwnerToContract(
		address _stakingContract,
		address _owner,
		address _previousOwner
	) external;
}

contract StakingRegistry is IStakingRegistry {
	address public controller;

	mapping(address => bool) public authorisedCallers;
	mapping(address => address) public contractToOwner;
	mapping(address => address[]) public ownerToContracts;
	uint256 public contractsCount;
	mapping(uint256 => address) public indexToContract;

	constructor() {
		controller = msg.sender;
	}

	event NewStakingContractOwner(
		address indexed stakingContract,
		address indexed newOwner,
		address indexed previousOwner
	);

	event ControllerUpdated(address indexed newController);

	event CallerUpdated(address indexed newCaller, bool newValue);

	modifier onlyController() {
		_onlyController();
		_;
	}

	function _onlyController() private view {
		require(msg.sender == controller, "StakingRegistry: Not controller.");
	}

	modifier onlyCaller() {
		_onlyCaller();
		_;
	}

	function transferOwnership(address newOwner) public onlyCaller {
		authorisedCallers[newOwner] = true;
		authorisedCallers[msg.sender] = false;
		emit CallerUpdated(newOwner, true);
	}

	function _onlyCaller() private view {
		require(
			authorisedCallers[msg.sender] || msg.sender == controller,
			"StakingRegistry: Unauthorised caller."
		);
	}

	function contractCountPerOwner(address _owner)
		external
		view
		returns (uint256)
	{
		return ownerToContracts[_owner].length;
	}

	function setController(address _newController) public onlyController {
		require(_newController != address(0), "Invalid address");
		controller = _newController;
		emit ControllerUpdated(controller);
	}

	function setCaller(address _caller, bool _value)
		public
		override
		onlyCaller
	{
		authorisedCallers[_caller] = _value;
		emit CallerUpdated(_caller, _value);
	}

	function assignOwnerToContract(
		address _stakingContract,
		address _owner,
		address _previousOwner
	) public override onlyCaller {
		require(
			contractToOwner[_stakingContract] == _previousOwner,
			"Registry: previous owner is not owner of staking contract."
		);
		if (_previousOwner != address(0)) {
			address[] storage prevOwnerContracts = ownerToContracts[
				_previousOwner
			];
			(uint256 oldIndex, bool exists) = getIndexArray(
				prevOwnerContracts,
				_stakingContract
			);
			if (exists) {
				prevOwnerContracts[oldIndex] = prevOwnerContracts[
					prevOwnerContracts.length - 1
				];
				prevOwnerContracts.pop();
			}
		}
		uint256 index = ownerToContracts[_owner].length;
		contractToOwner[_stakingContract] = _owner;
		ownerToContracts[_owner].push(_stakingContract);
		indexToContract[contractsCount++] = _stakingContract;
		emit NewStakingContractOwner(_stakingContract, _owner, _previousOwner);
	}

	function getIndexArray(address[] memory _array, address value)
		public
		pure
		returns (uint256, bool)
	{
		for (uint256 i = 0; i < _array.length; i++)
			if (value == _array[i]) return (i, true);
		return (0, false);
	}

	function getContractsCount() public view returns (uint256) {
		return contractsCount;
	}

	function getContracts() public view returns (uint256, address[] memory) {
		address[] memory contracts = new address[](contractsCount);

		for (uint256 i = 0; i < contractsCount; i++) {
			contracts[i] = indexToContract[i];
		}
		return (contractsCount, contracts);
	}
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address[]","name":"_rewardTokens","type":"address[]"},{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_registry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"FreeTokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","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":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFreeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freeTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getFreeTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_periodStart","type":"uint256"},{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"},{"internalType":"uint256[]","name":"_rewards","type":"uint256[]"},{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"initCampaign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"isValidRewardToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPauseTime","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":"lastUnstake","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":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IStakingRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardTokens","outputs":[{"internalType":"uint256","name":"rewardRate","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenStored","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokensAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"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":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"}],"name":"setRewardsDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"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"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061021c5760003560e01c806379ba509711610125578063e70b9e27116100ad578063f12297771161007c578063f12297771461098f578063f14d2181146109e7578063f5ab16cc146109f1578063f7fb429714610a50578063fc0c546a14610a6e5761021c565b8063e70b9e27146108d1578063e9fad8ee14610949578063ebe2b12b14610953578063eda4e6d6146109715761021c565b806391b4ded9116100f457806391b4ded9146107b7578063a694fc3a146107d5578063bcd1101414610803578063c8f33c911461085b578063d4770539146108795761021c565b806379ba5097146107275780637b1039991461073157806380faa57d146107655780638da5cb5b146107835761021c565b80633b97e856116101a85780634eedafb8116101775780634eedafb8146105ab57806353a47bb7146106035780635c975abb146106375780637035ab981461065757806370a08231146106cf5761021c565b80633b97e856146104f55780633c6444bc146105135780633d18b9121461056d5780633fc6df6e146105775761021c565b806318160ddd116101ef57806318160ddd146103cf57806319762143146103ed578063211dc32d146104315780632e1a7d4d146104a9578063386a9525146104d75761021c565b806303fd7378146102215780630b63b114146103035780631627540c1461035b57806316c38b3c1461039f575b600080fd5b6103016004803603608081101561023757600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561026857600080fd5b82018360208201111561027a57600080fd5b8035906020019184602083028401116401000000008311171561029c57600080fd5b9091929391929390803590602001906401000000008111156102bd57600080fd5b8201836020820111156102cf57600080fd5b803590602001918460208302840111640100000000831117156102f157600080fd5b9091929391929390505050610aa2565b005b6103456004803603602081101561031957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae0565b6040518082815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af8565b005b6103cd600480360360208110156103b557600080fd5b81019080803515159060200190929190505050610b91565b005b6103d7610c1e565b6040518082815260200191505060405180910390f35b61042f6004803603602081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c28565b005b6104936004803603604081101561044757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d17565b6040518082815260200191505060405180910390f35b6104d5600480360360208110156104bf57600080fd5b8101908080359060200190929190505050610e95565b005b6104df611001565b6040518082815260200191505060405180910390f35b6104fd611007565b6040518082815260200191505060405180910390f35b6105556004803603602081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102b565b60405180821515815260200191505060405180910390f35b6105756110cd565b005b61057f6113fb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105d7600480360360208110156105c157600080fd5b8101908080359060200190929190505050611421565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61060b611460565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61063f611486565b60405180821515815260200191505060405180910390f35b6106b96004803603604081101561066d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611499565b6040518082815260200191505060405180910390f35b610711600480360360208110156106e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114be565b6040518082815260200191505060405180910390f35b61072f611507565b005b61073961181f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076d611843565b6040518082815260200191505060405180910390f35b61078b611866565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107bf61188a565b6040518082815260200191505060405180910390f35b610801600480360360208110156107eb57600080fd5b8101908080359060200190929190505050611890565b005b6108456004803603602081101561081957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a04565b6040518082815260200191505060405180910390f35b610863611a69565b6040518082815260200191505060405180910390f35b6108bb6004803603602081101561088f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a6f565b6040518082815260200191505060405180910390f35b610933600480360360408110156108e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bce565b6040518082815260200191505060405180910390f35b610951611bf3565b005b61095b611c45565b6040518082815260200191505060405180910390f35b610979611c4b565b6040518082815260200191505060405180910390f35b6109d1600480360360208110156109a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c51565b6040518082815260200191505060405180910390f35b6109ef611d58565b005b610a3360048036036020811015610a0757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d6a565b604051808381526020018281526020019250505060405180910390f35b610a58611d8e565b6040518082815260200191505060405180910390f35b610a76611d94565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610aaa611dba565b6000610ab581611e60565b6000610ac188886121d4565b610acd86868686612309565b610ad681611e60565b5050505050505050565b600c6020528060005260406000206000915090505481565b610b00611dba565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b610b99611dba565b600360009054906101000a900460ff1615158115151415610bb957610c1b565b80600360006101000a81548160ff0219169083151502179055508015610be157426002819055505b7f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec58160405180821515815260200191505060405180910390a15b50565b6000600554905090565b610c30611dba565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b80600360016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e8d600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e7f7f0000000000000000000000000000000000000000000000000000000000000012600a0a610e71610e5a600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4c89611c51565b6128e990919063ffffffff16565b610e63896114be565b61296c90919063ffffffff16565b6129f290919063ffffffff16565b612a7b90919063ffffffff16565b905092915050565b60026007541415610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260078190555033610f2081611e60565b60008211610f96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b610f9e612b03565b610fa782612d2b565b3373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5836040518082815260200191505060405180910390a250600160078190555050565b600f5481565b7f000000000000000000000000000000000000000000000000000000000000001281565b600080600090505b6008805490508110156110c2576008818154811061104d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110b55760019150506110c8565b8080600101915050611033565b50600090505b919050565b60026007541415611146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026007819055503361115881611e60565b60005b6008805490508110156113ef576000600b60006008848154811061117b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156113e1576000600b60006008858154811061123c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113443382600885815481106112f457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612e2b9092919063ffffffff16565b6008828154811061135157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e836040518082815260200191505060405180910390a35b50808060010191505061115b565b50506001600781905550565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6008818154811061143157600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900460ff1681565b600a602052816000526040600020602052806000526040600020600091509150505481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806136816035913960400191505060405180910390fd5b7fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a17f000000000000000000000000518e305bd346031e92fdbca312ecca538597ccb273ffffffffffffffffffffffffffffffffffffffff16635faa4ea630600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b15801561176157600080fd5b505af1158015611775573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f000000000000000000000000518e305bd346031e92fdbca312ecca538597ccb281565b60008061185242600e54612ecd565b905061186081600d54612ee6565b91505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60026007541415611909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600781905550611919612f00565b3361192381611e60565b60008211611999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b6119a1612b03565b6119aa82612f68565b3373ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d836040518082815260200191505060405180910390a250600160078190555050565b600080600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611a61600f54826000015461296c90919063ffffffff16565b915050919050565b60105481565b6000600d544211611a835760009050611bc9565b611a8f600e5442612ecd565b6011541115611adf57600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611bc9565b600080611aea610c1e565b1415611b73576000611b12601154611b04600e5442612ecd565b6128e990919063ffffffff16565b90506000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611b6e81600001548361296c90919063ffffffff16565b925050505b611bc581600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7b90919063ffffffff16565b9150505b919050565b600b602052816000526040600020602052806000526040600020600091509150505481565b611c3b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e95565b611c436110cd565b565b600e5481565b600d5481565b600080600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006005541480611ca75750600d5442105b15611cb9578060010154915050611d53565b611d4f611d3c611cc7610c1e565b611d2e7f0000000000000000000000000000000000000000000000000000000000000012600a0a611d208660000154611d12601054611d04611843565b6128e990919063ffffffff16565b61296c90919063ffffffff16565b61296c90919063ffffffff16565b6129f290919063ffffffff16565b8260010154612a7b90919063ffffffff16565b9150505b919050565b611d60611dba565b611d6861306a565b565b60096020528060005260406000206000915090508060000154908060010154905082565b60115481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613806602f913960400191505060405180910390fd5b565b60005b600880549050811015611f405760006009600060088481548110611e8357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611f2a60088381548110611efa57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611c51565b8160010181905550508080600101915050611e63565b50611f49611843565b601081905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146121d15760005b6008805490508110156121cf5760006009600060088481548110611fa657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061204e836008848154811061201e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d17565b600b60006008858154811061205f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060010154600a60006008858154811061211b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550508080600101915050611f86565b505b50565b600e54421161222e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252606c81526020018061370b606c913960800191505060405180910390fd5b814210612286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806136b6602f913960400191505060405180910390fd5b6000600d54111561229a5761229961306a565b5b81600d819055506000600e81905550600d54601081905550600d5460118190555080600f819055507fd269d0dbc289846806634662863de5a6d54167723c67b859adc51a6704518310600d54600f54604051808381526020018281526020019250505060405180910390a15050565b8181905084849050148015612325575081819050600880549050145b61237a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001806137c06046913960600191505060405180910390fd5b60005b828290508110156128bc576000806009600086868681811061239b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061241b600f5488888681811061240657fe5b905060200201356129f290919063ffffffff16565b8160000181905550600085858581811061243157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156124b957600080fd5b505afa1580156124cd573d6000803e3d6000fd5b505050506040513d60208110156124e357600080fd5b8101908080519060200190929190505050905061253533308b8b8981811061250757fe5b905060200201358573ffffffffffffffffffffffffffffffffffffffff16613231909392919063ffffffff16565b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561259e57600080fd5b505afa1580156125b2573d6000803e3d6000fd5b505050506040513d60208110156125c857600080fd5b810190808051906020019092919050505090508989878181106125e757fe5b9050602002013561260183836128e990919063ffffffff16565b1015612675576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4c4d3a206e6f20656e6f75676820746f6b656e7300000000000000000000000081525060200191505060405180910390fd5b60006126b4612693600f54876000015461296c90919063ffffffff16565b8c8c8a81811061269f57fe5b905060200201356128e990919063ffffffff16565b905061273081600c60008c8c8c8181106126ca57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7b90919063ffffffff16565b600c60008b8b8b81811061274057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508a8a888181106127a757fe5b9050602002013595506127c5600f54876129f290919063ffffffff16565b85600001541115612821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613835602c913960400191505060405180910390fd5b88888881811061282d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ffb5edb6eb340a01f6a67189edc978df97841c43752c212fc85995ea2300176358c8c8a81811061288d57fe5b905060200201356040518082815260200191505060405180910390a2505050505050808060010191505061237d565b50600d546010819055506128dd600f54600d54612a7b90919063ffffffff16565b600e8190555050505050565b600082821115612961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b60008083141561297f57600090506129ec565b600082840290508284828161299057fe5b04146129e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806138616021913960400191505060405180910390fd5b809150505b92915050565b6000808211612a69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612a7257fe5b04905092915050565b600080828401905083811015612af9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612b13601154600d54612ee6565b90506000612b2342600e54612ecd565b9050808210612b33575050612d29565b6000612b3d610c1e565b1415612d14576000612b5883836128e990919063ffffffff16565b905060005b600880549050811015612d115760006009600060088481548110612b7d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000612bfd82600001548561296c90919063ffffffff16565b9050612c8881600c600060088781548110612c1457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7b90919063ffffffff16565b600c600060088681548110612c9957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050508080600101915050612b5d565b50505b612d2042601154612ee6565b60118190555050505b565b612d40816005546128e990919063ffffffff16565b600581905550612d9881600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128e990919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e283382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612e2b9092919063ffffffff16565b50565b612ec88363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506132f2565b505050565b6000818310612edc5781612ede565b825b905092915050565b600081831015612ef65781612ef8565b825b905092915050565b600360009054906101000a900460ff1615612f66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c815260200180613882603c913960400191505060405180910390fd5b565b612f7d81600554612a7b90919063ffffffff16565b600581905550612fd581600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7b90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613067333083600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613231909392919063ffffffff16565b50565b600e5442116130c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806137776049913960600191505060405180910390fd5b6130cc612b03565b60005b6008805490508110156131eb576000600882815481106130eb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008111156131dc5760008290506131da33838373ffffffffffffffffffffffffffffffffffffffff16612e2b9092919063ffffffff16565b505b505080806001019150506130cf565b507fbd8ea354abe47c91571f53d8d841d7784ee707d0898fbc7b17c8c78a630c66b0600d54600f54604051808381526020018281526020019250505060405180910390a1565b6132ec846323b872dd60e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506132f2565b50505050565b6000613354826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166133e19092919063ffffffff16565b90506000815111156133dc5780806020019051602081101561337557600080fd5b81019080805190602001909291905050506133db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806138be602a913960400191505060405180910390fd5b5b505050565b60606133f084846000856133f9565b90509392505050565b606082471015613454576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806136e56026913960400191505060405180910390fd5b61345d856135a1565b6134cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061351e57805182526020820191506020810190506020830392506134fb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613580576040519150601f19603f3d011682016040523d82523d6000602084013e613585565b606091505b50915091506135958282866135b4565b92505050949350505050565b600080823b905060008111915050919050565b606083156135c457829050613679565b6000835111156135d75782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561363e578082015181840152602081019050613623565b50505050905090810190601f16801561366b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e657273686970526f6c6c5374616b696e67526577617264733a205374617274206d7573742062652061206675747572652064617465416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c526f6c6c5374616b696e67526577617264733a2050726576696f7573207265776172647320706572696f64206d75737420626520636f6d706c657465206265666f7265206368616e67696e6720746865206475726174696f6e20666f7220746865206e657720706572696f64526f6c6c5374616b696e67526577617264733a2050726576696f7573207265776172647320706572696f64206d75737420626520636f6d706c657465206265666f726520636c61696d526f6c6c5374616b696e67526577617264733a20416d6f756e74206f662072657761726473206e6f74206d61746368696e672072657761726420746f6b656e20636f756e742e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e526f6c6c5374616b696e67526577617264733a2050726f76696465642072657761726420746f6f2068696768536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e7472616374206973207061757365645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208862e3561e959de5544f83f759db548e96819b1d365b453a669a807fb8e3b82464736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.