ETH Price: $3,386.79 (-2.10%)
Gas: 4 Gwei

Contract

0x04f439c341221Da7AE086b6F585e4Cd7a7E54622
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040155447542022-09-16 7:39:11677 days ago1663313951IN
 Create: RewardEthToken
0 ETH0.0210536.33371826

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardEthToken

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 5000000 runs

Other Settings:
default evmVersion
File 1 of 24 : RewardEthToken.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/SafeCastUpgradeable.sol";
import "../presets/OwnablePausableUpgradeable.sol";
import "../interfaces/IStakedEthToken.sol";
import "../interfaces/IRewardEthToken.sol";
import "../interfaces/IMerkleDistributor.sol";
import "../interfaces/IOracles.sol";
import "../interfaces/IFeesEscrow.sol";
import "./ERC20PermitUpgradeable.sol";

/**
 * @title RewardEthToken
 *
 * @dev RewardEthToken contract stores pool reward tokens.
 * If deploying contract for the first time, the `initialize` function should replace the `upgrade` function.
 */
contract RewardEthToken is IRewardEthToken, OwnablePausableUpgradeable, ERC20PermitUpgradeable {
    using SafeMathUpgradeable for uint256;
    using SafeCastUpgradeable for uint256;

    // @dev Address of the StakedEthToken contract.
    IStakedEthToken private stakedEthToken;

    // @dev Address of the Oracles contract.
    address private oracles;

    // @dev Maps account address to its reward checkpoint.
    mapping(address => Checkpoint) public override checkpoints;

    // @dev Address where protocol fee will be paid.
    address public override protocolFeeRecipient;

    // @dev Protocol percentage fee.
    uint256 public override protocolFee;

    // @dev Total amount of rewards.
    uint128 public override totalRewards;

    // @dev Reward per token for user reward calculation.
    uint128 public override rewardPerToken;

    // @dev Last rewards update block number by oracles.
    uint256 public override lastUpdateBlockNumber;

    // @dev Address of the MerkleDistributor contract.
    address public override merkleDistributor;

    // @dev Maps account address to whether rewards are distributed through the merkle distributor.
    mapping(address => bool) public override rewardsDisabled;

    // @dev Address of the FeesEscrow contract.
    IFeesEscrow private feesEscrow;

    /**
     * @dev See {IRewardEthToken-setRewardsDisabled}.
     */
    function setRewardsDisabled(address account, bool isDisabled) external override {
        require(msg.sender == address(stakedEthToken), "RewardEthToken: access denied");
        require(rewardsDisabled[account] != isDisabled, "RewardEthToken: value did not change");

        uint128 _rewardPerToken = rewardPerToken;
        checkpoints[account] = Checkpoint({
            reward: _balanceOf(account, _rewardPerToken).toUint128(),
            rewardPerToken: _rewardPerToken
        });

        rewardsDisabled[account] = isDisabled;
        emit RewardsToggled(account, isDisabled);
    }

    /**
     * @dev See {IRewardEthToken-setProtocolFeeRecipient}.
     */
    function setProtocolFeeRecipient(address recipient) external override onlyAdmin {
        // can be address(0) to distribute fee through the Merkle Distributor
        protocolFeeRecipient = recipient;
        emit ProtocolFeeRecipientUpdated(recipient);
    }

    /**
     * @dev See {IRewardEthToken-setProtocolFee}.
     */
    function setProtocolFee(uint256 _protocolFee) external override onlyAdmin {
        require(_protocolFee < 1e4, "RewardEthToken: invalid protocol fee");
        protocolFee = _protocolFee;
        emit ProtocolFeeUpdated(_protocolFee);
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() external view override returns (uint256) {
        return totalRewards;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) external view override returns (uint256) {
        return _balanceOf(account, rewardPerToken);
    }

    function _balanceOf(address account, uint256 _rewardPerToken) internal view returns (uint256) {
        Checkpoint memory cp = checkpoints[account];

        // skip calculating period reward when it has not changed or when the rewards are disabled
        if (_rewardPerToken == cp.rewardPerToken || rewardsDisabled[account]) return cp.reward;

        uint256 stakedEthAmount;
        if (account == address(0)) {
            // fetch merkle distributor current principal
            stakedEthAmount = stakedEthToken.distributorPrincipal();
        } else {
            stakedEthAmount = stakedEthToken.balanceOf(account);
        }
        if (stakedEthAmount == 0) return cp.reward;

        // return checkpoint reward + current reward
        return _calculateNewReward(cp.reward, stakedEthAmount, _rewardPerToken.sub(cp.rewardPerToken));
    }

    /**
     * @dev See {ERC20-_transfer}.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal override whenNotPaused {
        require(sender != address(0), "RewardEthToken: invalid sender");
        require(recipient != address(0), "RewardEthToken: invalid receiver");
        require(block.number > lastUpdateBlockNumber, "RewardEthToken: cannot transfer during rewards update");

        uint128 _rewardPerToken = rewardPerToken; // gas savings
        checkpoints[sender] = Checkpoint({
            reward: _balanceOf(sender, _rewardPerToken).sub(amount).toUint128(),
            rewardPerToken: _rewardPerToken
        });
        checkpoints[recipient] = Checkpoint({
            reward: _balanceOf(recipient, _rewardPerToken).add(amount).toUint128(),
            rewardPerToken: _rewardPerToken
        });

        emit Transfer(sender, recipient, amount);
    }

    /**
     * @dev See {IRewardEthToken-updateRewardCheckpoint}.
     */
    function updateRewardCheckpoint(address account) public override returns (bool accRewardsDisabled) {
        accRewardsDisabled = rewardsDisabled[account];
        if (!accRewardsDisabled) _updateRewardCheckpoint(account, rewardPerToken);
    }

    function _updateRewardCheckpoint(address account, uint128 newRewardPerToken) internal {
        Checkpoint memory cp = checkpoints[account];
        if (newRewardPerToken == cp.rewardPerToken) return;

        uint256 stakedEthAmount;
        if (account == address(0)) {
            // fetch merkle distributor current principal
            stakedEthAmount = stakedEthToken.distributorPrincipal();
        } else {
            stakedEthAmount = stakedEthToken.balanceOf(account);
        }
        if (stakedEthAmount == 0) {
            checkpoints[account] = Checkpoint({
                reward: cp.reward,
                rewardPerToken: newRewardPerToken
            });
        } else {
            uint256 periodRewardPerToken = uint256(newRewardPerToken).sub(cp.rewardPerToken);
            checkpoints[account] = Checkpoint({
                reward: _calculateNewReward(cp.reward, stakedEthAmount, periodRewardPerToken).toUint128(),
                rewardPerToken: newRewardPerToken
            });
        }
    }

    function _calculateNewReward(
        uint256 currentReward,
        uint256 stakedEthAmount,
        uint256 periodRewardPerToken
    )
        internal pure returns (uint256)
    {
        return currentReward.add(stakedEthAmount.mul(periodRewardPerToken).div(1e18));
    }

    /**
     * @dev See {IRewardEthToken-updateRewardCheckpoints}.
     */
    function updateRewardCheckpoints(address account1, address account2) public override returns (bool rewardsDisabled1, bool rewardsDisabled2) {
        rewardsDisabled1 = rewardsDisabled[account1];
        rewardsDisabled2 = rewardsDisabled[account2];
        if (!rewardsDisabled1 || !rewardsDisabled2) {
            uint128 newRewardPerToken = rewardPerToken;
            if (!rewardsDisabled1) _updateRewardCheckpoint(account1, newRewardPerToken);
            if (!rewardsDisabled2) _updateRewardCheckpoint(account2, newRewardPerToken);
        }
    }

    /**
     * @dev See {IRewardEthToken-updateTotalRewards}.
     */
    function updateTotalRewards(uint256 newTotalRewards) external override {
        require(msg.sender == oracles, "RewardEthToken: access denied");

        newTotalRewards = newTotalRewards.add(feesEscrow.transferToPool());
        uint256 periodRewards = newTotalRewards.sub(totalRewards);
        if (periodRewards == 0) {
            lastUpdateBlockNumber = block.number;
            emit RewardsUpdated(0, newTotalRewards, rewardPerToken, 0, 0);
            return;
        }

        // calculate protocol reward and new reward per token amount
        uint256 protocolReward = periodRewards.mul(protocolFee).div(1e4);
        uint256 prevRewardPerToken = rewardPerToken;
        uint256 newRewardPerToken = prevRewardPerToken.add(periodRewards.sub(protocolReward).mul(1e18).div(stakedEthToken.totalDeposits()));
        uint128 newRewardPerToken128 = newRewardPerToken.toUint128();

        // store previous distributor rewards for period reward calculation
        uint256 prevDistributorBalance = _balanceOf(address(0), prevRewardPerToken);

        // update total rewards and new reward per token
        (totalRewards, rewardPerToken) = (newTotalRewards.toUint128(), newRewardPerToken128);

        uint256 newDistributorBalance = _balanceOf(address(0), newRewardPerToken);
        address _protocolFeeRecipient = protocolFeeRecipient;
        if (_protocolFeeRecipient == address(0) && protocolReward > 0) {
            // add protocol reward to the merkle distributor
            newDistributorBalance = newDistributorBalance.add(protocolReward);
        } else if (protocolReward > 0) {
            // update fee recipient's checkpoint and add its period reward
            checkpoints[_protocolFeeRecipient] = Checkpoint({
                reward: _balanceOf(_protocolFeeRecipient, newRewardPerToken).add(protocolReward).toUint128(),
                rewardPerToken: newRewardPerToken128
            });
        }

        // update distributor's checkpoint
        if (newDistributorBalance != prevDistributorBalance) {
            checkpoints[address(0)] = Checkpoint({
                reward: newDistributorBalance.toUint128(),
                rewardPerToken: newRewardPerToken128
            });
        }

        lastUpdateBlockNumber = block.number;
        emit RewardsUpdated(
            periodRewards,
            newTotalRewards,
            newRewardPerToken,
            newDistributorBalance.sub(prevDistributorBalance),
            _protocolFeeRecipient == address(0) ? protocolReward: 0
        );
    }

    /**
     * @dev See {IRewardEthToken-claim}.
     */
    function claim(address account, uint256 amount) external override {
        require(msg.sender == merkleDistributor, "RewardEthToken: access denied");
        require(account != address(0), "RewardEthToken: invalid account");

        // update checkpoints, transfer amount from distributor to account
        uint128 _rewardPerToken = rewardPerToken;
        checkpoints[address(0)] = Checkpoint({
            reward: _balanceOf(address(0), _rewardPerToken).sub(amount).toUint128(),
            rewardPerToken: _rewardPerToken
        });
        checkpoints[account] = Checkpoint({
            reward: _balanceOf(account, _rewardPerToken).add(amount).toUint128(),
            rewardPerToken: _rewardPerToken
        });
        emit Transfer(address(0), account, amount);
    }
}

File 2 of 24 : SafeMathUpgradeable.sol
// 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 SafeMathUpgradeable {
    /**
     * @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 3 of 24 : SafeCastUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCastUpgradeable {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 4 of 24 : OwnablePausableUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "../interfaces/IOwnablePausable.sol";

/**
 * @title OwnablePausableUpgradeable
 *
 * @dev Bundles Access Control, Pausable and Upgradeable contracts in one.
 *
 */
abstract contract OwnablePausableUpgradeable is IOwnablePausable, PausableUpgradeable, AccessControlUpgradeable {
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    /**
    * @dev Modifier for checking whether the caller is an admin.
    */
    modifier onlyAdmin() {
        require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "OwnablePausable: access denied");
        _;
    }

    /**
    * @dev Modifier for checking whether the caller is a pauser.
    */
    modifier onlyPauser() {
        require(hasRole(PAUSER_ROLE, msg.sender), "OwnablePausable: access denied");
        _;
    }

    // solhint-disable-next-line func-name-mixedcase
    function __OwnablePausableUpgradeable_init(address _admin) internal initializer {
        __Context_init_unchained();
        __AccessControl_init_unchained();
        __Pausable_init_unchained();
        __OwnablePausableUpgradeable_init_unchained(_admin);
    }

    /**
     * @dev Grants `DEFAULT_ADMIN_ROLE`, `PAUSER_ROLE` to the admin account.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __OwnablePausableUpgradeable_init_unchained(address _admin) internal initializer {
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        _setupRole(PAUSER_ROLE, _admin);
    }

    /**
     * @dev See {IOwnablePausable-isAdmin}.
     */
    function isAdmin(address _account) external override view returns (bool) {
        return hasRole(DEFAULT_ADMIN_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-addAdmin}.
     */
    function addAdmin(address _account) external override {
        grantRole(DEFAULT_ADMIN_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-removeAdmin}.
     */
    function removeAdmin(address _account) external override {
        revokeRole(DEFAULT_ADMIN_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-isPauser}.
     */
    function isPauser(address _account) external override view returns (bool) {
        return hasRole(PAUSER_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-addPauser}.
     */
    function addPauser(address _account) external override {
        grantRole(PAUSER_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-removePauser}.
     */
    function removePauser(address _account) external override {
        revokeRole(PAUSER_ROLE, _account);
    }

    /**
     * @dev See {IOwnablePausable-pause}.
     */
    function pause() external override onlyPauser {
        _pause();
    }

    /**
     * @dev See {IOwnablePausable-unpause}.
     */
    function unpause() external override onlyPauser {
        _unpause();
    }
}

File 5 of 24 : IStakedEthToken.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

/**
 * @dev Interface of the StakedEthToken contract.
 */
interface IStakedEthToken is IERC20Upgradeable {
    /**
    * @dev Function for retrieving the total deposits amount.
    */
    function totalDeposits() external view returns (uint256);

    /**
    * @dev Function for retrieving the principal amount of the distributor.
    */
    function distributorPrincipal() external view returns (uint256);

    /**
    * @dev Function for toggling rewards for the account.
    * @param account - address of the account.
    * @param isDisabled - whether to disable account's rewards distribution.
    */
    function toggleRewards(address account, bool isDisabled) external;

    /**
    * @dev Function for creating `amount` tokens and assigning them to `account`.
    * Can only be called by Pool contract.
    * @param account - address of the account to assign tokens to.
    * @param amount - amount of tokens to assign.
    */
    function mint(address account, uint256 amount) external;
}

File 6 of 24 : IRewardEthToken.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./IFeesEscrow.sol";

/**
 * @dev Interface of the RewardEthToken contract.
 */
interface IRewardEthToken is IERC20Upgradeable {
    /**
    * @dev Structure for storing information about user reward checkpoint.
    * @param rewardPerToken - user reward per token.
    * @param reward - user reward checkpoint.
    */
    struct Checkpoint {
        uint128 reward;
        uint128 rewardPerToken;
    }

    /**
    * @dev Event for tracking updated protocol fee recipient.
    * @param recipient - address of the new fee recipient.
    */
    event ProtocolFeeRecipientUpdated(address recipient);

    /**
    * @dev Event for tracking updated protocol fee.
    * @param protocolFee - new protocol fee.
    */
    event ProtocolFeeUpdated(uint256 protocolFee);

    /**
    * @dev Event for tracking whether rewards distribution through merkle distributor is enabled/disabled.
    * @param account - address of the account.
    * @param isDisabled - whether rewards distribution is disabled.
    */
    event RewardsToggled(address indexed account, bool isDisabled);

    /**
    * @dev Event for tracking rewards update by oracles.
    * @param periodRewards - rewards since the last update.
    * @param totalRewards - total amount of rewards.
    * @param rewardPerToken - calculated reward per token for account reward calculation.
    * @param distributorReward - distributor reward.
    * @param protocolReward - protocol reward.
    */
    event RewardsUpdated(
        uint256 periodRewards,
        uint256 totalRewards,
        uint256 rewardPerToken,
        uint256 distributorReward,
        uint256 protocolReward
    );

    /**
    * @dev Function for getting the address of the merkle distributor.
    */
    function merkleDistributor() external view returns (address);

    /**
    * @dev Function for getting the address of the protocol fee recipient.
    */
    function protocolFeeRecipient() external view returns (address);

    /**
    * @dev Function for changing the protocol fee recipient's address.
    * @param recipient - new protocol fee recipient's address.
    */
    function setProtocolFeeRecipient(address recipient) external;

    /**
    * @dev Function for getting protocol fee. The percentage fee users pay from their reward for using the pool service.
    */
    function protocolFee() external view returns (uint256);

    /**
    * @dev Function for changing the protocol fee.
    * @param _protocolFee - new protocol fee. Must be less than 10000 (100.00%).
    */
    function setProtocolFee(uint256 _protocolFee) external;

    /**
    * @dev Function for retrieving the total rewards amount.
    */
    function totalRewards() external view returns (uint128);

    /**
    * @dev Function for retrieving the last total rewards update block number.
    */
    function lastUpdateBlockNumber() external view returns (uint256);

    /**
    * @dev Function for retrieving current reward per token used for account reward calculation.
    */
    function rewardPerToken() external view returns (uint128);

    /**
    * @dev Function for setting whether rewards are disabled for the account.
    * Can only be called by the `StakedEthToken` contract.
    * @param account - address of the account to disable rewards for.
    * @param isDisabled - whether the rewards will be disabled.
    */
    function setRewardsDisabled(address account, bool isDisabled) external;

    /**
    * @dev Function for retrieving account's current checkpoint.
    * @param account - address of the account to retrieve the checkpoint for.
    */
    function checkpoints(address account) external view returns (uint128, uint128);

    /**
    * @dev Function for checking whether account's reward will be distributed through the merkle distributor.
    * @param account - address of the account.
    */
    function rewardsDisabled(address account) external view returns (bool);

    /**
    * @dev Function for updating account's reward checkpoint.
    * @param account - address of the account to update the reward checkpoint for.
    */
    function updateRewardCheckpoint(address account) external returns (bool);

    /**
    * @dev Function for updating reward checkpoints for two accounts simultaneously (for gas savings).
    * @param account1 - address of the first account to update the reward checkpoint for.
    * @param account2 - address of the second account to update the reward checkpoint for.
    */
    function updateRewardCheckpoints(address account1, address account2) external returns (bool, bool);

    /**
    * @dev Function for updating validators total rewards.
    * Can only be called by Oracles contract.
    * @param newTotalRewards - new total rewards.
    */
    function updateTotalRewards(uint256 newTotalRewards) external;

    /**
    * @dev Function for claiming rETH2 from the merkle distribution.
    * Can only be called by MerkleDistributor contract.
    * @param account - address of the account the tokens will be assigned to.
    * @param amount - amount of tokens to assign to the account.
    */
    function claim(address account, uint256 amount) external;
}

File 7 of 24 : IMerkleDistributor.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./IOracles.sol";

/**
 * @dev Interface of the MerkleDistributor contract.
 * Allows anyone to claim a token if they exist in a merkle root.
 */
interface IMerkleDistributor {
    /**
    * @dev Event for tracking merkle root updates.
    * @param sender - address of the new transaction sender.
    * @param merkleRoot - new merkle root hash.
    * @param merkleProofs - link to the merkle proofs.
    */
    event MerkleRootUpdated(
        address indexed sender,
        bytes32 indexed merkleRoot,
        string merkleProofs
    );

    /**
    * @dev Event for tracking periodic tokens distributions.
    * @param from - address to transfer the tokens from.
    * @param token - address of the token.
    * @param beneficiary - address of the beneficiary, the allocation is added to.
    * @param amount - amount of tokens to distribute.
    * @param startBlock - start block of the tokens distribution.
    * @param endBlock - end block of the tokens distribution.
    */
    event PeriodicDistributionAdded(
        address indexed from,
        address indexed token,
        address indexed beneficiary,
        uint256 amount,
        uint256 startBlock,
        uint256 endBlock
    );

    /**
    * @dev Event for tracking one time tokens distributions.
    * @param from - address to transfer the tokens from.
    * @param origin - predefined origin address to label the distribution.
    * @param token - address of the token.
    * @param amount - amount of tokens to distribute.
    * @param rewardsLink - link to the file where rewards are stored.
    */
    event OneTimeDistributionAdded(
        address indexed from,
        address indexed origin,
        address indexed token,
        uint256 amount,
        string rewardsLink
    );

    /**
    * @dev Event for tracking tokens' claims.
    * @param account - the address of the user that has claimed the tokens.
    * @param index - the index of the user that has claimed the tokens.
    * @param tokens - list of token addresses the user got amounts in.
    * @param amounts - list of user token amounts.
    */
    event Claimed(address indexed account, uint256 index, address[] tokens, uint256[] amounts);

    /**
    * @dev Function for getting the current merkle root.
    */
    function merkleRoot() external view returns (bytes32);

    /**
    * @dev Function for getting the RewardEthToken contract address.
    */
    function rewardEthToken() external view returns (address);

    /**
    * @dev Function for getting the Oracles contract address.
    */
    function oracles() external view returns (IOracles);

    /**
    * @dev Function for retrieving the last total merkle root update block number.
    */
    function lastUpdateBlockNumber() external view returns (uint256);

    /**
    * @dev Function for upgrading the MerkleDistributor contract. The `initialize` function must be defined
    * if deploying contract for the first time that will initialize the state variables above.
    * @param _oracles - address of the Oracles contract.
    */
    function upgrade(address _oracles) external;

    /**
    * @dev Function for checking the claimed bit map.
    * @param _merkleRoot - the merkle root hash.
    * @param _wordIndex - the word index of te bit map.
    */
    function claimedBitMap(bytes32 _merkleRoot, uint256 _wordIndex) external view returns (uint256);

    /**
    * @dev Function for changing the merkle root. Can only be called by `Oracles` contract.
    * @param newMerkleRoot - new merkle root hash.
    * @param merkleProofs - URL to the merkle proofs.
    */
    function setMerkleRoot(bytes32 newMerkleRoot, string calldata merkleProofs) external;

    /**
    * @dev Function for distributing tokens periodically for the number of blocks.
    * @param from - address of the account to transfer the tokens from.
    * @param token - address of the token.
    * @param beneficiary - address of the beneficiary.
    * @param amount - amount of tokens to distribute.
    * @param durationInBlocks - duration in blocks when the token distribution should be stopped.
    */
    function distributePeriodically(
        address from,
        address token,
        address beneficiary,
        uint256 amount,
        uint256 durationInBlocks
    ) external;

    /**
    * @dev Function for distributing tokens one time.
    * @param from - address of the account to transfer the tokens from.
    * @param origin - predefined origin address to label the distribution.
    * @param token - address of the token.
    * @param amount - amount of tokens to distribute.
    * @param rewardsLink - link to the file where rewards for the accounts are stored.
    */
    function distributeOneTime(
        address from,
        address origin,
        address token,
        uint256 amount,
        string calldata rewardsLink
    ) external;

    /**
    * @dev Function for checking whether the tokens were already claimed.
    * @param index - the index of the user that is part of the merkle root.
    */
    function isClaimed(uint256 index) external view returns (bool);

    /**
    * @dev Function for claiming the given amount of tokens to the account address.
    * Reverts if the inputs are invalid or the oracles are currently updating the merkle root.
    * @param index - the index of the user that is part of the merkle root.
    * @param account - the address of the user that is part of the merkle root.
    * @param tokens - list of the token addresses.
    * @param amounts - list of token amounts.
    * @param merkleProof - an array of hashes to verify whether the user is part of the merkle root.
    */
    function claim(
        uint256 index,
        address account,
        address[] calldata tokens,
        uint256[] calldata amounts,
        bytes32[] calldata merkleProof
    ) external;
}

File 8 of 24 : IOracles.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

import "./IPoolValidators.sol";
pragma abicoder v2;

/**
 * @dev Interface of the Oracles contract.
 */
interface IOracles {
    /**
    * @dev Event for tracking oracle rewards votes.
    * @param sender - address of the transaction sender.
    * @param oracle - address of the account which submitted vote.
    * @param nonce - current nonce.
    * @param totalRewards - submitted value of total rewards.
    * @param activatedValidators - submitted amount of activated validators.
    */
    event RewardsVoteSubmitted(
        address indexed sender,
        address indexed oracle,
        uint256 nonce,
        uint256 totalRewards,
        uint256 activatedValidators
    );

    /**
    * @dev Event for tracking oracle merkle root votes.
    * @param sender - address of the transaction sender.
    * @param oracle - address of the account which submitted vote.
    * @param nonce - current nonce.
    * @param merkleRoot - new merkle root.
    * @param merkleProofs - link to the merkle proofs.
    */
    event MerkleRootVoteSubmitted(
        address indexed sender,
        address indexed oracle,
        uint256 nonce,
        bytes32 indexed merkleRoot,
        string merkleProofs
    );

    /**
    * @dev Event for tracking validators registration vote.
    * @param sender - address of the transaction sender.
    * @param oracles - addresses of the signed oracles.
    * @param nonce - validators registration nonce.
    */
    event RegisterValidatorsVoteSubmitted(
        address indexed sender,
        address[] oracles,
        uint256 nonce
    );

    /**
    * @dev Event for tracking new or updates oracles.
    * @param oracle - address of new or updated oracle.
    */
    event OracleAdded(address indexed oracle);

    /**
    * @dev Event for tracking removed oracles.
    * @param oracle - address of removed oracle.
    */
    event OracleRemoved(address indexed oracle);

    /**
    * @dev Function for checking whether an account has an oracle role.
    * @param account - account to check.
    */
    function isOracle(address account) external view returns (bool);

    /**
    * @dev Function for checking whether the oracles are currently voting for new merkle root.
    */
    function isMerkleRootVoting() external view returns (bool);

    /**
    * @dev Function for retrieving current rewards nonce.
    */
    function currentRewardsNonce() external view returns (uint256);

    /**
    * @dev Function for retrieving current validators nonce.
    */
    function currentValidatorsNonce() external view returns (uint256);

    /**
    * @dev Function for adding an oracle role to the account.
    * Can only be called by an account with an admin role.
    * @param account - account to assign an oracle role to.
    */
    function addOracle(address account) external;

    /**
    * @dev Function for removing an oracle role from the account.
    * Can only be called by an account with an admin role.
    * @param account - account to remove an oracle role from.
    */
    function removeOracle(address account) external;

    /**
    * @dev Function for submitting oracle vote for total rewards.
    * The quorum of signatures over the same data is required to submit the new value.
    * @param totalRewards - voted total rewards.
    * @param activatedValidators - voted amount of activated validators.
    * @param signatures - oracles' signatures.
    */
    function submitRewards(
        uint256 totalRewards,
        uint256 activatedValidators,
        bytes[] calldata signatures
    ) external;

    /**
    * @dev Function for submitting new merkle root.
    * The quorum of signatures over the same data is required to submit the new value.
    * @param merkleRoot - hash of the new merkle root.
    * @param merkleProofs - link to the merkle proofs.
    * @param signatures - oracles' signatures.
    */
    function submitMerkleRoot(
        bytes32 merkleRoot,
        string calldata merkleProofs,
        bytes[] calldata signatures
    ) external;

    /**
    * @dev Function for submitting registrations of the new validators.
    * The quorum of signatures over the same data is required to register.
    * @param depositData - an array of deposit data to register.
    * @param merkleProofs - an array of hashes to verify whether the every deposit data is part of the merkle root.
    * @param validatorsDepositRoot - validators deposit root to protect from malicious operators.
    * @param signatures - oracles' signatures.
    */
    function registerValidators(
        IPoolValidators.DepositData[] calldata depositData,
        bytes32[][] calldata merkleProofs,
        bytes32 validatorsDepositRoot,
        bytes[] calldata signatures
    ) external;
}

File 9 of 24 : IFeesEscrow.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

/**
 * @dev Interface of the FeesEscrow contract.
 */
interface IFeesEscrow {
    /**
    * @dev Event for tracking fees withdrawals to Pool contract.
    * @param amount - the number of fees.
    */
    event FeesTransferred(uint256 amount);

    /**
    * @dev Function is used to transfer accumulated rewards to Pool contract.
    * Can only be executed by the RewardEthToken contract.
    */
    function transferToPool() external returns (uint256);
}

File 10 of 24 : ERC20PermitUpgradeable.sol
// SPDX-License-Identifier: MIT
// Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/drafts/ERC20PermitUpgradeable.sol

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/drafts/IERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/cryptography/ECDSAUpgradeable.sol";
import "./ERC20Upgradeable.sol";

/**
 * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * _Available since v3.4._
 */
abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {
    using CountersUpgradeable for CountersUpgradeable.Counter;

    mapping (address => CountersUpgradeable.Counter) private _nonces;

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private _PERMIT_TYPEHASH;

    /**
     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the ERC20 token name.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __ERC20Permit_init(string memory name) internal initializer {
        __EIP712_init_unchained(name, "1");
        __ERC20Permit_init_unchained();
    }

    // solhint-disable-next-line func-name-mixedcase
    function __ERC20Permit_init_unchained() internal initializer {
        _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    }

    /**
     * @dev See {IERC20Permit-permit}.
     */
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp <= deadline, "ERC20Permit: expired deadline");

        bytes32 structHash = keccak256(
            abi.encode(
                _PERMIT_TYPEHASH,
                owner,
                spender,
                value,
                _nonces[owner].current(),
                deadline
            )
        );

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSAUpgradeable.recover(hash, v, r, s);
        require(signer == owner, "ERC20Permit: invalid signature");

        _nonces[owner].increment();
        _approve(owner, spender, value);
    }

    /**
     * @dev See {IERC20Permit-nonces}.
     */
    function nonces(address owner) public view override returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view override returns (bytes32) {
        return _domainSeparatorV4();
    }
    uint256[49] private __gap;
}

File 11 of 24 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/EnumerableSetUpgradeable.sol";
import "../utils/AddressUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable {
    function __AccessControl_init() internal initializer {
        __Context_init_unchained();
        __AccessControl_init_unchained();
    }

    function __AccessControl_init_unchained() internal initializer {
    }
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
    using AddressUpgradeable for address;

    struct RoleData {
        EnumerableSetUpgradeable.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
    uint256[49] private __gap;
}

File 12 of 24 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ContextUpgradeable.sol";
import "../proxy/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal initializer {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal initializer {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
    uint256[49] private __gap;
}

File 13 of 24 : IOwnablePausable.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;

/**
 * @dev Interface of the OwnablePausableUpgradeable and OwnablePausable contracts.
 */
interface IOwnablePausable {
    /**
    * @dev Function for checking whether an account has an admin role.
    * @param _account - account to check.
    */
    function isAdmin(address _account) external view returns (bool);

    /**
    * @dev Function for assigning an admin role to the account.
    * Can only be called by an account with an admin role.
    * @param _account - account to assign an admin role to.
    */
    function addAdmin(address _account) external;

    /**
    * @dev Function for removing an admin role from the account.
    * Can only be called by an account with an admin role.
    * @param _account - account to remove an admin role from.
    */
    function removeAdmin(address _account) external;

    /**
    * @dev Function for checking whether an account has a pauser role.
    * @param _account - account to check.
    */
    function isPauser(address _account) external view returns (bool);

    /**
    * @dev Function for adding a pauser role to the account.
    * Can only be called by an account with an admin role.
    * @param _account - account to assign a pauser role to.
    */
    function addPauser(address _account) external;

    /**
    * @dev Function for removing a pauser role from the account.
    * Can only be called by an account with an admin role.
    * @param _account - account to remove a pauser role from.
    */
    function removePauser(address _account) external;

    /**
    * @dev Function for pausing the contract.
    */
    function pause() external;

    /**
    * @dev Function for unpausing the contract.
    */
    function unpause() external;
}

File 14 of 24 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 15 of 24 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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);
    }

    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 16 of 24 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}

File 17 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 18 of 24 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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);
}

File 19 of 24 : IPoolValidators.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.7.5;
pragma abicoder v2;

/**
 * @dev Interface of the PoolValidators contract.
 */
interface IPoolValidators {
    /**
    * @dev Structure for storing operator data.
    * @param depositDataMerkleRoot - validators deposit data merkle root.
    * @param committed - defines whether operator has committed its readiness to host validators.
    */
    struct Operator {
        bytes32 depositDataMerkleRoot;
        bool committed;
    }

    /**
    * @dev Structure for passing information about the validator deposit data.
    * @param operator - address of the operator.
    * @param withdrawalCredentials - withdrawal credentials used for generating the deposit data.
    * @param depositDataRoot - hash tree root of the deposit data, generated by the operator.
    * @param publicKey - BLS public key of the validator, generated by the operator.
    * @param signature - BLS signature of the validator, generated by the operator.
    */
    struct DepositData {
        address operator;
        bytes32 withdrawalCredentials;
        bytes32 depositDataRoot;
        bytes publicKey;
        bytes signature;
    }

    /**
    * @dev Event for tracking new operators.
    * @param operator - address of the operator.
    * @param depositDataMerkleRoot - validators deposit data merkle root.
    * @param depositDataMerkleProofs - validators deposit data merkle proofs.
    */
    event OperatorAdded(
        address indexed operator,
        bytes32 indexed depositDataMerkleRoot,
        string depositDataMerkleProofs
    );

    /**
    * @dev Event for tracking operator's commitments.
    * @param operator - address of the operator that expressed its readiness to host validators.
    */
    event OperatorCommitted(address indexed operator);

    /**
    * @dev Event for tracking operators' removals.
    * @param sender - address of the transaction sender.
    * @param operator - address of the operator.
    */
    event OperatorRemoved(
        address indexed sender,
        address indexed operator
    );

    /**
    * @dev Constructor for initializing the PoolValidators contract.
    * @param _admin - address of the contract admin.
    * @param _pool - address of the Pool contract.
    * @param _oracles - address of the Oracles contract.
    */
    function initialize(address _admin, address _pool, address _oracles) external;

    /**
    * @dev Function for retrieving the operator.
    * @param _operator - address of the operator to retrieve the data for.
    */
    function getOperator(address _operator) external view returns (bytes32, bool);

    /**
    * @dev Function for checking whether validator is registered.
    * @param validatorId - hash of the validator public key to receive the status for.
    */
    function isValidatorRegistered(bytes32 validatorId) external view returns (bool);

    /**
    * @dev Function for adding new operator.
    * @param _operator - address of the operator to add or update.
    * @param depositDataMerkleRoot - validators deposit data merkle root.
    * @param depositDataMerkleProofs - validators deposit data merkle proofs.
    */
    function addOperator(
        address _operator,
        bytes32 depositDataMerkleRoot,
        string calldata depositDataMerkleProofs
    ) external;

    /**
    * @dev Function for committing operator. Must be called by the operator address
    * specified through the `addOperator` function call.
    */
    function commitOperator() external;

    /**
    * @dev Function for removing operator. Can be called either by operator or admin.
    * @param _operator - address of the operator to remove.
    */
    function removeOperator(address _operator) external;

    /**
    * @dev Function for registering the validator.
    * @param depositData - deposit data of the validator.
    * @param merkleProof - an array of hashes to verify whether the deposit data is part of the merkle root.
    */
    function registerValidator(DepositData calldata depositData, bytes32[] calldata merkleProof) external;
}

File 20 of 24 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../math/SafeMathUpgradeable.sol";

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library CountersUpgradeable {
    using SafeMathUpgradeable for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

File 21 of 24 : IERC20PermitUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20PermitUpgradeable {
    /**
     * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
     * given `owner`'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 22 of 24 : EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712Upgradeable is Initializable {
    /* solhint-disable var-name-mixedcase */
    bytes32 private _HASHED_NAME;
    bytes32 private _HASHED_VERSION;
    bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    function __EIP712_init(string memory name, string memory version) internal initializer {
        __EIP712_init_unchained(name, version);
    }

    function __EIP712_init_unchained(string memory name, string memory version) internal initializer {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());
    }

    function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) {
        return keccak256(
            abi.encode(
                typeHash,
                name,
                version,
                _getChainId(),
                address(this)
            )
        );
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash));
    }

    function _getChainId() private view returns (uint256 chainId) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        // solhint-disable-next-line no-inline-assembly
        assembly {
            chainId := chainid()
        }
    }

    /**
     * @dev The hash of the name parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712NameHash() internal virtual view returns (bytes32) {
        return _HASHED_NAME;
    }

    /**
     * @dev The hash of the version parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712VersionHash() internal virtual view returns (bytes32) {
        return _HASHED_VERSION;
    }
    uint256[50] private __gap;
}

File 23 of 24 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

File 24 of 24 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/token/ERC20/ERC20Upgradeable.sol

pragma solidity 0.7.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";


/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
abstract contract ERC20Upgradeable is Initializable, IERC20Upgradeable {
    using SafeMathUpgradeable for uint256;

    mapping (address => mapping (address => uint256)) private _allowances;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __ERC20_init(string memory name_, string memory symbol_) internal initializer {
        __ERC20_init_unchained(name_, symbol_);
    }

    // solhint-disable-next-line func-name-mixedcase
    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][msg.sender];
        if (sender != msg.sender && currentAllowance != uint256(-1)) {
            _approve(sender, msg.sender, currentAllowance.sub(amount));
        }
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual;

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    uint256[44] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"ProtocolFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"}],"name":"ProtocolFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isDisabled","type":"bool"}],"name":"RewardsToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"periodRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"distributorReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolReward","type":"uint256"}],"name":"RewardsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"checkpoints","outputs":[{"internalType":"uint128","name":"reward","type":"uint128"},{"internalType":"uint128","name":"rewardPerToken","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isPauser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","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":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removePauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"setProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isDisabled","type":"bool"}],"name":"setRewardsDisabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewards","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"updateRewardCheckpoint","outputs":[{"internalType":"bool","name":"accRewardsDisabled","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account1","type":"address"},{"internalType":"address","name":"account2","type":"address"}],"name":"updateRewardCheckpoints","outputs":[{"internalType":"bool","name":"rewardsDisabled1","type":"bool"},{"internalType":"bool","name":"rewardsDisabled2","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTotalRewards","type":"uint256"}],"name":"updateTotalRewards","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50613b7e806100206000396000f3fe608060405234801561001057600080fd5b50600436106103155760003560e01c806370480275116101a7578063aad3ec96116100ee578063d547741f11610097578063e521cb9211610071578063e521cb9214610b02578063e63ab1e914610b35578063f4537f7814610b3d57610315565b8063d547741f14610a1a578063dbb51d6e14610a53578063dd62ed3e14610ac757610315565b8063ca15c873116100c8578063ca15c87314610997578063cd3daf9d146109b4578063d505accf146109bc57610315565b8063aad3ec961461094e578063b0e21e8a14610987578063b4c6e4161461098f57610315565b80639010d07c11610150578063a217fddf1161012a578063a217fddf146108d4578063a457c2d7146108dc578063a9059cbb1461091557610315565b80639010d07c1461087057806391d148541461089357806395d89b41146108cc57610315565b80637ecebe00116101815780637ecebe001461080257806382dc1ec4146108355780638456cb591461086857610315565b8063704802751461077f57806370a08231146107b2578063787dce3d146107e557610315565b80633644e5151161026b5780635bbb860d1161021457806364df049e116101ee57806364df049e146106e05780636a9ecedb146107115780636b2c0f551461074c57610315565b80635bbb860d146106885780635bdc6d7e146106a55780635c975abb146106d857610315565b80633b0c9d90116102455780633b0c9d90146105f75780633f4ba83a1461064d57806346fbf68e1461065557610315565b80633644e5151461057d57806336568abe1461058557806339509351146105be57610315565b806318160ddd116102cd57806324d7806c116102a757806324d7806c146104f35780632f2ff15d14610526578063313ce5671461055f57610315565b806318160ddd1461047957806323b872dd14610493578063248a9ca3146104d657610315565b8063095ea7b3116102fe578063095ea7b3146103de5780630e15561a146104175780631785f53c1461044457610315565b806301ba793b1461031a57806306fdde0314610361575b600080fd5b61034d6004803603602081101561033057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b45565b604080519115158252519081900360200190f35b610369610bae565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103a357818101518382015260200161038b565b50505050905090810190601f1680156103d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61034d600480360360408110156103f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610c62565b61041f610c79565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104776004803603602081101561045a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c92565b005b610481610ca0565b60408051918252519081900360200190f35b61034d600480360360608110156104a957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610cb9565b610481600480360360208110156104ec57600080fd5b5035610d4b565b61034d6004803603602081101561050957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610d60565b6104776004803603604081101561053c57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610d6c565b610567610df2565b6040805160ff9092168252519081900360200190f35b610481610dfb565b6104776004803603604081101561059b57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610e0a565b61034d600480360360408110156105d457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e9f565b6106326004803603604081101561060d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610ee2565b60408051921515835290151560208301528051918290030190f35b610477610f7b565b61034d6004803603602081101561066b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661101a565b6104776004803603602081101561069e57600080fd5b5035611046565b61034d600480360360208110156106bb57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611609565b61034d61161f565b6106e8611628565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104776004803603604081101561072757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001351515611645565b6104776004803603602081101561076257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661189b565b6104776004803603602081101561079557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118c5565b610481600480360360208110156107c857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118d0565b610477600480360360208110156107fb57600080fd5b5035611908565b6104816004803603602081101561081857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611a14565b6104776004803603602081101561084b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611a42565b610477611a6c565b6106e86004803603604081101561088657600080fd5b5080359060200135611b09565b61034d600480360360408110156108a957600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611b28565b610369611b40565b610481611bbf565b61034d600480360360408110156108f257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611bc4565b61034d6004803603604081101561092b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611c07565b6104776004803603604081101561096457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611c14565b610481611ef8565b610481611eff565b610481600480360360208110156109ad57600080fd5b5035611f06565b61041f611f1d565b610477600480360360e08110156109d257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611f4a565b61047760048036036040811015610a3057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff1661217c565b610a8660048036036020811015610a6957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166121ef565b60405180836fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61048160048036036040811015610add57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661222c565b61047760048036036020811015610b1857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612264565b610481612354565b6106e8612378565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610136602052604090205460ff1680610ba95761013354610ba990839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612395565b919050565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c585780601f10610c2d57610100808354040283529160200191610c58565b820191906000526020600020905b815481529060010190602001808311610c3b57829003601f168201915b5050505050905090565b6000610c6f33848461271e565b5060015b92915050565b610133546fffffffffffffffffffffffffffffffff1681565b610c9d60008261217c565b50565b610133546fffffffffffffffffffffffffffffffff1690565b6000610cc6848484612865565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610d2757507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610d4057610d408533610d3b8487612c0d565b61271e565b506001949350505050565b60009081526065602052604090206002015490565b6000610c738183611b28565b600082815260656020526040902060020154610d8f90610d8a612c84565b611b28565b610de4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f81526020018061396c602f913960400191505060405180910390fd5b610dee8282612c88565b5050565b609a5460ff1690565b6000610e05612d0b565b905090565b610e12612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613b1a602f913960400191505060405180910390fd5b610dee8282612d46565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610c6f918590610d3b9086612dc9565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610136602052604080822054928416825290205460ff9182169116811580610f25575080155b15610f74576101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1682610f6357610f638582612395565b81610f7257610f728482612395565b505b9250929050565b610fa57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611b28565b61101057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611018612e3d565b565b6000610c737f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a83611b28565b61012f5473ffffffffffffffffffffffffffffffffffffffff1633146110cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b61013754604080517ffe110116000000000000000000000000000000000000000000000000000000008152905161116f9273ffffffffffffffffffffffffffffffffffffffff169163fe1101169160048083019260209291908290030181600087803b15801561113c57600080fd5b505af1158015611150573d6000803e3d6000fd5b505050506040513d602081101561116657600080fd5b50518290612dc9565b610133549091506000906111969083906fffffffffffffffffffffffffffffffff16612c0d565b90508061122257436101345561013354604080516000808252602082018690527001000000000000000000000000000000009093046fffffffffffffffffffffffffffffffff1681830152606081018390526080810192909252517fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd79160a0908290030190a150610c9d565b60006112466127106112406101325485612f2b90919063ffffffff16565b90612f9e565b6101335461012e54604080517f7d88209700000000000000000000000000000000000000000000000000000000815290519394507001000000000000000000000000000000009092046fffffffffffffffffffffffffffffffff169260009261133a926113339273ffffffffffffffffffffffffffffffffffffffff90911691637d882097916004808301926020929190829003018186803b1580156112eb57600080fd5b505afa1580156112ff573d6000803e3d6000fd5b505050506040513d602081101561131557600080fd5b5051611240670de0b6b3a764000061132d8989612c0d565b90612f2b565b8390612dc9565b905060006113478261301f565b9050600061135660008561308e565b90506113618761301f565b61013380547fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff918216700100000000000000000000000000000000878416021716921691909117905560006113c7818561308e565b6101315490915073ffffffffffffffffffffffffffffffffffffffff16801580156113f25750600087115b15611408576114018288612dc9565b91506114c7565b86156114c75760405180604001604052806114356114308a61142a868b61308e565b90612dc9565b61301f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff841660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317161790555b82821461157c5760405180604001604052806114e28461301f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015260008052610130825282517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805494909301518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317169190911790555b43610134557fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd7888a876115af8688612c0d565b73ffffffffffffffffffffffffffffffffffffffff8616156115d25760006115d4565b8b5b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190a1505050505050505050565b6101366020526000908152604090205460ff1681565b60335460ff1690565b6101315473ffffffffffffffffffffffffffffffffffffffff1681565b61012e5473ffffffffffffffffffffffffffffffffffffffff1633146116cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152610136602052604090205460ff1615158115151415611752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613ad26024913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080611796611430868561308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925561013683529083902080548615157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911681179091558351908152925190927fef7566603852520a8be81b2924311bce365c73c01809a279f86ed6c6f69f824992908290030190a2505050565b610c9d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a8261217c565b610c9d600082610d6c565b61013354600090610c7390839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661308e565b611913600033611b28565b61197e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b61271081106119d8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613af66024913960400191505060405180910390fd5b6101328190556040805182815290517fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de409181900360200190a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb60205260408120610c739061331e565b610c9d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610d6c565b611a967f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611b28565b611b0157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611018613322565b6000828152606560205260408120611b2190836133ea565b9392505050565b6000828152606560205260408120611b2190836133f6565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c585780601f10610c2d57610100808354040283529160200191610c58565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610c6f918590610d3b9086612c0d565b6000610c6f338484612865565b6101355473ffffffffffffffffffffffffffffffffffffffff163314611c9b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216611d1d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526577617264457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080611d6c61143085611d6660008761308e565b90612c0d565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905260008052610130835283517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805495909401517fffffffffffffffffffffffffffffffff00000000000000000000000000000000909516908316178216700100000000000000000000000000000000949092169390930217905560408051808201909152908190611e299061143090869061142a90899061308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925583518681529351909391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b6101325481565b6101345481565b6000818152606560205260408120610c7390613418565b6101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1681565b83421115611fb957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc5488888861200860fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061331e565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061208b82613423565b9050600061209b8287878761348a565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461213757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb6020526040902061216590613678565b6121708a8a8a61271e565b50505050505050505050565b60008281526065602052604090206002015461219a90610d8a612c84565b610e95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180613a3b6030913960400191505060405180910390fd5b610130602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b61226f600033611b28565b6122da57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610131805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d9181900360200190a150565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101355473ffffffffffffffffffffffffffffffffffffffff1681565b61239d613932565b5073ffffffffffffffffffffffffffffffffffffffff8216600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff80821684527001000000000000000000000000000000009091048116918301829052831614156124125750610dee565b600073ffffffffffffffffffffffffffffffffffffffff84166124cb5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561249857600080fd5b505afa1580156124ac573d6000803e3d6000fd5b505050506040513d60208110156124c257600080fd5b5051905061256e565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561253f57600080fd5b505afa158015612553573d6000803e3d6000fd5b505050506040513d602081101561256957600080fd5b505190505b806126175760408051808201825283516fffffffffffffffffffffffffffffffff9081168252858116602080840191825273ffffffffffffffffffffffffffffffffffffffff89166000908152610130909152939093209151825493518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716919091179055612718565b600061265483602001516fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff16612c0d90919063ffffffff16565b9050604051806040016040528061268561143086600001516fffffffffffffffffffffffffffffffff168686613681565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff881660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716179055505b50505050565b73ffffffffffffffffffffffffffffffffffffffff831661278a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613aae6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166127f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061399b6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b61286d61161f565b156128d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831661295b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f526577617264457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166129dd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b610134544311612a38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806139bd6035913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080612a8061143085611d66898761308e565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905273ffffffffffffffffffffffffffffffffffffffff8816600090815261013084526040908190208551815496909501518416700100000000000000000000000000000000029484167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909616959095179092169290921790925581518083019092528190612b3a9061143090869061142a90899061308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff8681166000818152610130855260409081902086518154978701517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090981690861617851670010000000000000000000000000000000097909516969096029390931790945581518681529151908816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a350505050565b600082821115612c7e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b6000828152606560205260409020612ca090826136ab565b15610dee57612cad612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e057f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612d396136cd565b612d416136d3565b6136d9565b6000828152606560205260409020612d5e9082613748565b15610dee57612d6b612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015611b2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b612e4561161f565b612eb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612f01612c84565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b600082612f3a57506000610c73565b82820282848281612f4757fe5b0414611b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613a8d6021913960400191505060405180910390fd5b600080821161300e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161301757fe5b049392505050565b6000700100000000000000000000000000000000821061308a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806139f26027913960400191505060405180910390fd5b5090565b6000613098613932565b5073ffffffffffffffffffffffffffffffffffffffff8316600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff808216845270010000000000000000000000000000000090910416908201819052831480613131575073ffffffffffffffffffffffffffffffffffffffff84166000908152610136602052604090205460ff165b1561315057516fffffffffffffffffffffffffffffffff169050610c73565b600073ffffffffffffffffffffffffffffffffffffffff85166132095761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131d657600080fd5b505afa1580156131ea573d6000803e3d6000fd5b505050506040513d602081101561320057600080fd5b505190506132ac565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561327d57600080fd5b505afa158015613291573d6000803e3d6000fd5b505050506040513d60208110156132a757600080fd5b505190505b806132cc5750516fffffffffffffffffffffffffffffffff169050610c73565b61331582600001516fffffffffffffffffffffffffffffffff168261331085602001516fffffffffffffffffffffffffffffffff1688612c0d90919063ffffffff16565b613681565b95945050505050565b5490565b61332a61161f565b1561339657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f01612c84565b6000611b21838361376a565b6000611b218373ffffffffffffffffffffffffffffffffffffffff84166137e8565b6000610c738261331e565b600061342d612d0b565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613505576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613a196022913960400191505060405180910390fd5b8360ff16601b148061351a57508360ff16601c145b61356f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613a6b6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156135cb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661331557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b80546001019055565b60006136a361369c670de0b6b3a76400006112408686612f2b565b8590612dc9565b949350505050565b6000611b218373ffffffffffffffffffffffffffffffffffffffff8416613800565b60c75490565b60c85490565b60008383836136e661384a565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b6000611b218373ffffffffffffffffffffffffffffffffffffffff841661384e565b815460009082106137c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061394a6022913960400191505060405180910390fd5b8260000182815481106137d557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b600061380c83836137e8565b61384257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c73565b506000610c73565b4690565b600081815260018301602052604081205480156139285783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808301919081019060009087908390811061389f57fe5b90600052602060002001549050808760000184815481106138bc57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806138ec57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610c73565b6000915050610c73565b60408051808201909152600080825260208201529056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a20617070726f766520746f20746865207a65726f2061646472657373526577617264457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746553616665436173743a2076616c756520646f65736e27742066697420696e20313238206269747345434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373526577617264457468546f6b656e3a2076616c756520646964206e6f74206368616e6765526577617264457468546f6b656e3a20696e76616c69642070726f746f636f6c20666565416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122079d0e1dbd2837cd5d6923957c35b3542bbcd0f870d7e53d7a1c6167664e4862e64736f6c63430007050033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103155760003560e01c806370480275116101a7578063aad3ec96116100ee578063d547741f11610097578063e521cb9211610071578063e521cb9214610b02578063e63ab1e914610b35578063f4537f7814610b3d57610315565b8063d547741f14610a1a578063dbb51d6e14610a53578063dd62ed3e14610ac757610315565b8063ca15c873116100c8578063ca15c87314610997578063cd3daf9d146109b4578063d505accf146109bc57610315565b8063aad3ec961461094e578063b0e21e8a14610987578063b4c6e4161461098f57610315565b80639010d07c11610150578063a217fddf1161012a578063a217fddf146108d4578063a457c2d7146108dc578063a9059cbb1461091557610315565b80639010d07c1461087057806391d148541461089357806395d89b41146108cc57610315565b80637ecebe00116101815780637ecebe001461080257806382dc1ec4146108355780638456cb591461086857610315565b8063704802751461077f57806370a08231146107b2578063787dce3d146107e557610315565b80633644e5151161026b5780635bbb860d1161021457806364df049e116101ee57806364df049e146106e05780636a9ecedb146107115780636b2c0f551461074c57610315565b80635bbb860d146106885780635bdc6d7e146106a55780635c975abb146106d857610315565b80633b0c9d90116102455780633b0c9d90146105f75780633f4ba83a1461064d57806346fbf68e1461065557610315565b80633644e5151461057d57806336568abe1461058557806339509351146105be57610315565b806318160ddd116102cd57806324d7806c116102a757806324d7806c146104f35780632f2ff15d14610526578063313ce5671461055f57610315565b806318160ddd1461047957806323b872dd14610493578063248a9ca3146104d657610315565b8063095ea7b3116102fe578063095ea7b3146103de5780630e15561a146104175780631785f53c1461044457610315565b806301ba793b1461031a57806306fdde0314610361575b600080fd5b61034d6004803603602081101561033057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b45565b604080519115158252519081900360200190f35b610369610bae565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103a357818101518382015260200161038b565b50505050905090810190601f1680156103d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61034d600480360360408110156103f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610c62565b61041f610c79565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104776004803603602081101561045a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c92565b005b610481610ca0565b60408051918252519081900360200190f35b61034d600480360360608110156104a957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610cb9565b610481600480360360208110156104ec57600080fd5b5035610d4b565b61034d6004803603602081101561050957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610d60565b6104776004803603604081101561053c57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610d6c565b610567610df2565b6040805160ff9092168252519081900360200190f35b610481610dfb565b6104776004803603604081101561059b57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610e0a565b61034d600480360360408110156105d457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e9f565b6106326004803603604081101561060d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610ee2565b60408051921515835290151560208301528051918290030190f35b610477610f7b565b61034d6004803603602081101561066b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661101a565b6104776004803603602081101561069e57600080fd5b5035611046565b61034d600480360360208110156106bb57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611609565b61034d61161f565b6106e8611628565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104776004803603604081101561072757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001351515611645565b6104776004803603602081101561076257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661189b565b6104776004803603602081101561079557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118c5565b610481600480360360208110156107c857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118d0565b610477600480360360208110156107fb57600080fd5b5035611908565b6104816004803603602081101561081857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611a14565b6104776004803603602081101561084b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611a42565b610477611a6c565b6106e86004803603604081101561088657600080fd5b5080359060200135611b09565b61034d600480360360408110156108a957600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611b28565b610369611b40565b610481611bbf565b61034d600480360360408110156108f257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611bc4565b61034d6004803603604081101561092b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611c07565b6104776004803603604081101561096457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611c14565b610481611ef8565b610481611eff565b610481600480360360208110156109ad57600080fd5b5035611f06565b61041f611f1d565b610477600480360360e08110156109d257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611f4a565b61047760048036036040811015610a3057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff1661217c565b610a8660048036036020811015610a6957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166121ef565b60405180836fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61048160048036036040811015610add57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661222c565b61047760048036036020811015610b1857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612264565b610481612354565b6106e8612378565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610136602052604090205460ff1680610ba95761013354610ba990839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612395565b919050565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c585780601f10610c2d57610100808354040283529160200191610c58565b820191906000526020600020905b815481529060010190602001808311610c3b57829003601f168201915b5050505050905090565b6000610c6f33848461271e565b5060015b92915050565b610133546fffffffffffffffffffffffffffffffff1681565b610c9d60008261217c565b50565b610133546fffffffffffffffffffffffffffffffff1690565b6000610cc6848484612865565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610d2757507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610d4057610d408533610d3b8487612c0d565b61271e565b506001949350505050565b60009081526065602052604090206002015490565b6000610c738183611b28565b600082815260656020526040902060020154610d8f90610d8a612c84565b611b28565b610de4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f81526020018061396c602f913960400191505060405180910390fd5b610dee8282612c88565b5050565b609a5460ff1690565b6000610e05612d0b565b905090565b610e12612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613b1a602f913960400191505060405180910390fd5b610dee8282612d46565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610c6f918590610d3b9086612dc9565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610136602052604080822054928416825290205460ff9182169116811580610f25575080155b15610f74576101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1682610f6357610f638582612395565b81610f7257610f728482612395565b505b9250929050565b610fa57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611b28565b61101057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611018612e3d565b565b6000610c737f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a83611b28565b61012f5473ffffffffffffffffffffffffffffffffffffffff1633146110cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b61013754604080517ffe110116000000000000000000000000000000000000000000000000000000008152905161116f9273ffffffffffffffffffffffffffffffffffffffff169163fe1101169160048083019260209291908290030181600087803b15801561113c57600080fd5b505af1158015611150573d6000803e3d6000fd5b505050506040513d602081101561116657600080fd5b50518290612dc9565b610133549091506000906111969083906fffffffffffffffffffffffffffffffff16612c0d565b90508061122257436101345561013354604080516000808252602082018690527001000000000000000000000000000000009093046fffffffffffffffffffffffffffffffff1681830152606081018390526080810192909252517fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd79160a0908290030190a150610c9d565b60006112466127106112406101325485612f2b90919063ffffffff16565b90612f9e565b6101335461012e54604080517f7d88209700000000000000000000000000000000000000000000000000000000815290519394507001000000000000000000000000000000009092046fffffffffffffffffffffffffffffffff169260009261133a926113339273ffffffffffffffffffffffffffffffffffffffff90911691637d882097916004808301926020929190829003018186803b1580156112eb57600080fd5b505afa1580156112ff573d6000803e3d6000fd5b505050506040513d602081101561131557600080fd5b5051611240670de0b6b3a764000061132d8989612c0d565b90612f2b565b8390612dc9565b905060006113478261301f565b9050600061135660008561308e565b90506113618761301f565b61013380547fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff918216700100000000000000000000000000000000878416021716921691909117905560006113c7818561308e565b6101315490915073ffffffffffffffffffffffffffffffffffffffff16801580156113f25750600087115b15611408576114018288612dc9565b91506114c7565b86156114c75760405180604001604052806114356114308a61142a868b61308e565b90612dc9565b61301f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff841660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317161790555b82821461157c5760405180604001604052806114e28461301f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015260008052610130825282517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805494909301518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317169190911790555b43610134557fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd7888a876115af8688612c0d565b73ffffffffffffffffffffffffffffffffffffffff8616156115d25760006115d4565b8b5b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190a1505050505050505050565b6101366020526000908152604090205460ff1681565b60335460ff1690565b6101315473ffffffffffffffffffffffffffffffffffffffff1681565b61012e5473ffffffffffffffffffffffffffffffffffffffff1633146116cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152610136602052604090205460ff1615158115151415611752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613ad26024913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080611796611430868561308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925561013683529083902080548615157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911681179091558351908152925190927fef7566603852520a8be81b2924311bce365c73c01809a279f86ed6c6f69f824992908290030190a2505050565b610c9d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a8261217c565b610c9d600082610d6c565b61013354600090610c7390839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661308e565b611913600033611b28565b61197e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b61271081106119d8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613af66024913960400191505060405180910390fd5b6101328190556040805182815290517fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de409181900360200190a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb60205260408120610c739061331e565b610c9d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610d6c565b611a967f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611b28565b611b0157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611018613322565b6000828152606560205260408120611b2190836133ea565b9392505050565b6000828152606560205260408120611b2190836133f6565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c585780601f10610c2d57610100808354040283529160200191610c58565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610c6f918590610d3b9086612c0d565b6000610c6f338484612865565b6101355473ffffffffffffffffffffffffffffffffffffffff163314611c9b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216611d1d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526577617264457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080611d6c61143085611d6660008761308e565b90612c0d565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905260008052610130835283517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805495909401517fffffffffffffffffffffffffffffffff00000000000000000000000000000000909516908316178216700100000000000000000000000000000000949092169390930217905560408051808201909152908190611e299061143090869061142a90899061308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925583518681529351909391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b6101325481565b6101345481565b6000818152606560205260408120610c7390613418565b6101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1681565b83421115611fb957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc5488888861200860fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061331e565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061208b82613423565b9050600061209b8287878761348a565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461213757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb6020526040902061216590613678565b6121708a8a8a61271e565b50505050505050505050565b60008281526065602052604090206002015461219a90610d8a612c84565b610e95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180613a3b6030913960400191505060405180910390fd5b610130602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b61226f600033611b28565b6122da57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610131805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d9181900360200190a150565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101355473ffffffffffffffffffffffffffffffffffffffff1681565b61239d613932565b5073ffffffffffffffffffffffffffffffffffffffff8216600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff80821684527001000000000000000000000000000000009091048116918301829052831614156124125750610dee565b600073ffffffffffffffffffffffffffffffffffffffff84166124cb5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561249857600080fd5b505afa1580156124ac573d6000803e3d6000fd5b505050506040513d60208110156124c257600080fd5b5051905061256e565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561253f57600080fd5b505afa158015612553573d6000803e3d6000fd5b505050506040513d602081101561256957600080fd5b505190505b806126175760408051808201825283516fffffffffffffffffffffffffffffffff9081168252858116602080840191825273ffffffffffffffffffffffffffffffffffffffff89166000908152610130909152939093209151825493518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716919091179055612718565b600061265483602001516fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff16612c0d90919063ffffffff16565b9050604051806040016040528061268561143086600001516fffffffffffffffffffffffffffffffff168686613681565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff881660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716179055505b50505050565b73ffffffffffffffffffffffffffffffffffffffff831661278a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613aae6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166127f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061399b6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b61286d61161f565b156128d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831661295b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f526577617264457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166129dd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b610134544311612a38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806139bd6035913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080612a8061143085611d66898761308e565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905273ffffffffffffffffffffffffffffffffffffffff8816600090815261013084526040908190208551815496909501518416700100000000000000000000000000000000029484167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909616959095179092169290921790925581518083019092528190612b3a9061143090869061142a90899061308e565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff8681166000818152610130855260409081902086518154978701517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090981690861617851670010000000000000000000000000000000097909516969096029390931790945581518681529151908816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a350505050565b600082821115612c7e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b6000828152606560205260409020612ca090826136ab565b15610dee57612cad612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e057f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612d396136cd565b612d416136d3565b6136d9565b6000828152606560205260409020612d5e9082613748565b15610dee57612d6b612c84565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015611b2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b612e4561161f565b612eb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612f01612c84565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b600082612f3a57506000610c73565b82820282848281612f4757fe5b0414611b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613a8d6021913960400191505060405180910390fd5b600080821161300e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161301757fe5b049392505050565b6000700100000000000000000000000000000000821061308a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806139f26027913960400191505060405180910390fd5b5090565b6000613098613932565b5073ffffffffffffffffffffffffffffffffffffffff8316600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff808216845270010000000000000000000000000000000090910416908201819052831480613131575073ffffffffffffffffffffffffffffffffffffffff84166000908152610136602052604090205460ff165b1561315057516fffffffffffffffffffffffffffffffff169050610c73565b600073ffffffffffffffffffffffffffffffffffffffff85166132095761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131d657600080fd5b505afa1580156131ea573d6000803e3d6000fd5b505050506040513d602081101561320057600080fd5b505190506132ac565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561327d57600080fd5b505afa158015613291573d6000803e3d6000fd5b505050506040513d60208110156132a757600080fd5b505190505b806132cc5750516fffffffffffffffffffffffffffffffff169050610c73565b61331582600001516fffffffffffffffffffffffffffffffff168261331085602001516fffffffffffffffffffffffffffffffff1688612c0d90919063ffffffff16565b613681565b95945050505050565b5490565b61332a61161f565b1561339657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f01612c84565b6000611b21838361376a565b6000611b218373ffffffffffffffffffffffffffffffffffffffff84166137e8565b6000610c738261331e565b600061342d612d0b565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613505576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613a196022913960400191505060405180910390fd5b8360ff16601b148061351a57508360ff16601c145b61356f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613a6b6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156135cb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661331557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b80546001019055565b60006136a361369c670de0b6b3a76400006112408686612f2b565b8590612dc9565b949350505050565b6000611b218373ffffffffffffffffffffffffffffffffffffffff8416613800565b60c75490565b60c85490565b60008383836136e661384a565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b6000611b218373ffffffffffffffffffffffffffffffffffffffff841661384e565b815460009082106137c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061394a6022913960400191505060405180910390fd5b8260000182815481106137d557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b600061380c83836137e8565b61384257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c73565b506000610c73565b4690565b600081815260018301602052604081205480156139285783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808301919081019060009087908390811061389f57fe5b90600052602060002001549050808760000184815481106138bc57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806138ec57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610c73565b6000915050610c73565b60408051808201909152600080825260208201529056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a20617070726f766520746f20746865207a65726f2061646472657373526577617264457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746553616665436173743a2076616c756520646f65736e27742066697420696e20313238206269747345434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373526577617264457468546f6b656e3a2076616c756520646964206e6f74206368616e6765526577617264457468546f6b656e3a20696e76616c69642070726f746f636f6c20666565416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122079d0e1dbd2837cd5d6923957c35b3542bbcd0f870d7e53d7a1c6167664e4862e64736f6c63430007050033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.