ETH Price: $2,605.30 (+0.55%)
Gas: 1 Gwei

Contract

0xB4b38429BdBc0B046AF178DFDC0638570DeE0a39
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Request Withdraw...161693572022-12-12 14:55:23607 days ago1670856923IN
0xB4b38429...70DeE0a39
0 ETH0.0014540729.17837361
Make Requested W...156327432022-09-28 15:30:23682 days ago1664379023IN
0xB4b38429...70DeE0a39
0 ETH0.0015018416.08468058
Request Withdraw...155893382022-09-22 14:00:23688 days ago1663855223IN
0xB4b38429...70DeE0a39
0 ETH0.0003636311.10872638
Request Withdraw...155892872022-09-22 13:50:11688 days ago1663854611IN
0xB4b38429...70DeE0a39
0 ETH0.000319899.77249511
Request Withdraw...155573362022-09-18 2:03:47692 days ago1663466627IN
0xB4b38429...70DeE0a39
0 ETH0.000218174.37803958
Request Withdraw...151803212022-07-20 15:33:25752 days ago1658331205IN
0xB4b38429...70DeE0a39
0 ETH0.0024746349.65750381
Deposit150668432022-07-03 2:22:36769 days ago1656814956IN
0xB4b38429...70DeE0a39
0 ETH0.000805595.37212867
Set Withdrawal L...149957712022-06-20 9:24:19782 days ago1655717059IN
0xB4b38429...70DeE0a39
0 ETH0.0006067115.15316506
Set Withdrawal U...149957582022-06-20 9:22:27782 days ago1655716947IN
0xB4b38429...70DeE0a39
0 ETH0.0008027220.06669523
Request Withdraw...149681172022-06-15 15:04:43787 days ago1655305483IN
0xB4b38429...70DeE0a39
0 ETH0.00331045101.13186883
Request Withdraw...149675862022-06-15 12:55:22787 days ago1655297722IN
0xB4b38429...70DeE0a39
0 ETH0.0013978142.70209132
Make Requested W...148369332022-05-24 17:09:38809 days ago1653412178IN
0xB4b38429...70DeE0a39
0 ETH0.0052996747.97340571
Request Withdraw...148366872022-05-24 16:07:51809 days ago1653408471IN
0xB4b38429...70DeE0a39
0 ETH0.00557847111.94121824
Deposit148191182022-05-21 19:36:30812 days ago1653161790IN
0xB4b38429...70DeE0a39
0 ETH0.0022517715.01484715
Request Withdraw...147990542022-05-18 13:14:50815 days ago1652879690IN
0xB4b38429...70DeE0a39
0 ETH0.0009210928.1387171
Request Withdraw...147976922022-05-18 8:04:57815 days ago1652861097IN
0xB4b38429...70DeE0a39
0 ETH0.0006281719.19017654
Request Withdraw...147863522022-05-16 12:48:20817 days ago1652705300IN
0xB4b38429...70DeE0a39
0 ETH0.0007141721.81738207
Request Withdraw...147848982022-05-16 7:22:32817 days ago1652685752IN
0xB4b38429...70DeE0a39
0 ETH0.0009258418.57862904
Make Forced With...147848872022-05-16 7:20:44817 days ago1652685644IN
0xB4b38429...70DeE0a39
0 ETH0.0029158125.9309904
Make Forced With...147848782022-05-16 7:18:20817 days ago1652685500IN
0xB4b38429...70DeE0a39
0 ETH0.0032557128.95388304
Request Withdraw...147487062022-05-10 12:58:38823 days ago1652187518IN
0xB4b38429...70DeE0a39
0 ETH0.0011555235.30048449
Request Withdraw...147481322022-05-10 10:49:27823 days ago1652179767IN
0xB4b38429...70DeE0a39
0 ETH0.001069732.67885315
Request Withdraw...146924792022-05-01 14:25:10832 days ago1651415110IN
0xB4b38429...70DeE0a39
0 ETH0.0022835569.76098529
Request Withdraw...146924762022-05-01 14:23:54832 days ago1651415034IN
0xB4b38429...70DeE0a39
0 ETH0.0028008556.20369558
Deposit146776132022-04-29 6:29:57834 days ago1651213797IN
0xB4b38429...70DeE0a39
0 ETH0.0056578241.10057712
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Staking

Compiler Version
v0.7.0+commit.9e61f92b

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-06-15
*/

// Sources flattened with hardhat v2.0.5 https://hardhat.org

// File @openzeppelin/contracts-upgradeable/utils/[email protected]

// 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 @openzeppelin/contracts-upgradeable/proxy/[email protected]

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

/**
 * @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 @openzeppelin/contracts-upgradeable/utils/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/*
 * @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 @openzeppelin/contracts-upgradeable/access/[email protected]

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}


// File @openzeppelin/contracts-upgradeable/math/[email protected]

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 @openzeppelin/contracts-upgradeable/utils/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
    uint256[49] private __gap;
}


// File @openzeppelin/contracts-upgradeable/token/ERC20/[email protected]

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 @openzeppelin/contracts-upgradeable/token/ERC20/[email protected]

pragma solidity >=0.6.0 <0.8.0;



/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;

    function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


// File @openzeppelin/contracts-upgradeable/utils/[email protected]

pragma solidity >=0.6.0 <0.8.0;


/**
 * @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 contracts/helpers/Sacrifice.sol

pragma solidity 0.7.0;

contract Sacrifice {
    constructor(address payable _recipient) payable {
        selfdestruct(_recipient);
    }
}


// File @openzeppelin/contracts/utils/[email protected]

pragma solidity >=0.6.0 <0.8.0;

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


// File @openzeppelin/contracts/token/ERC20/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// File @openzeppelin/contracts/math/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]

pragma solidity >=0.6.0 <0.8.0;



/**
 * @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}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    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.
     */
    constructor (string memory name_, string memory symbol_) public {
        _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-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @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(_msgSender(), 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(_msgSender(), 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);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        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(_msgSender(), spender, _allowances[_msgSender()][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(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        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 {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

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

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}


// File @openzeppelin/contracts/utils/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/**
 * @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 Pausable is Context {
    /**
     * @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.
     */
    constructor () internal {
        _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());
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev ERC20 token with pausable token transfers, minting and burning.
 *
 * Useful for scenarios such as preventing trades until the end of an evaluation
 * period, or having an emergency switch for freezing all token transfers in the
 * event of a large bug.
 */
abstract contract ERC20Pausable is ERC20, Pausable {
    /**
     * @dev See {ERC20-_beforeTokenTransfer}.
     *
     * Requirements:
     *
     * - the contract must not be paused.
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
        super._beforeTokenTransfer(from, to, amount);

        require(!paused(), "ERC20Pausable: token transfer while paused");
    }
}


// File @openzeppelin/contracts/access/[email protected]

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


// File @openzeppelin/contracts/utils/[email protected]

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 EnumerableSet {
    // 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 @openzeppelin/contracts/utils/[email protected]

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// File @openzeppelin/contracts/access/[email protected]

pragma solidity >=0.6.0 <0.8.0;



/**
 * @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 AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.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());
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    using SafeMath for uint256;

    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
}


// File @openzeppelin/contracts/presets/[email protected]

pragma solidity >=0.6.0 <0.8.0;





/**
 * @dev {ERC20} token, including:
 *
 *  - ability for holders to burn (destroy) their tokens
 *  - a minter role that allows for token minting (creation)
 *  - a pauser role that allows to stop all token transfers
 *
 * This contract uses {AccessControl} to lock permissioned functions using the
 * different roles - head to its documentation for details.
 *
 * The account that deploys the contract will be granted the minter and pauser
 * roles, as well as the default admin role, which will let it grant both minter
 * and pauser roles to other accounts.
 */
contract ERC20PresetMinterPauser is Context, AccessControl, ERC20Burnable, ERC20Pausable {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    /**
     * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the
     * account that deploys the contract.
     *
     * See {ERC20-constructor}.
     */
    constructor(string memory name, string memory symbol) public ERC20(name, symbol) {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());

        _setupRole(MINTER_ROLE, _msgSender());
        _setupRole(PAUSER_ROLE, _msgSender());
    }

    /**
     * @dev Creates `amount` new tokens for `to`.
     *
     * See {ERC20-_mint}.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     */
    function mint(address to, uint256 amount) public virtual {
        require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint");
        _mint(to, amount);
    }

    /**
     * @dev Pauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_pause}.
     *
     * Requirements:
     *
     * - the caller must have the `PAUSER_ROLE`.
     */
    function pause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to pause");
        _pause();
    }

    /**
     * @dev Unpauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_unpause}.
     *
     * Requirements:
     *
     * - the caller must have the `PAUSER_ROLE`.
     */
    function unpause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause");
        _unpause();
    }

    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Pausable) {
        super._beforeTokenTransfer(from, to, amount);
    }
}


// File contracts/CentralexToken.sol

pragma solidity 0.7.0;





contract CentralexToken is ERC20, ERC20Pausable, Ownable, AccessControl {
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    constructor() ERC20("Centralex Token 3.0", "CenX3.0") {
        _mint(msg.sender, 5 * 1e8 ether);
    }

    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Pausable) {
        super._beforeTokenTransfer(from, to, amount);
    }

    /**
     * @dev Pauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_pause}.
     *
     */
    function pause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "CentralexToken2: must have pauser role to pause");
        _pause();
    }

    /**
     * @dev Unpauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_unpause}.
     *
     */
    function unpause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "CentralexToken2: must have pauser role to unpause");
        _unpause();
    }
}


// File contracts/Staking.sol
pragma solidity 0.7.0;









/**
 * @title Compound reward staking
 *
 * Note: all percentage values are between 0 (0%) and 1 (100%)
 * and represented as fixed point numbers containing 18 decimals like with Ether
 * 100% == 1 ether
 */
contract Staking is OwnableUpgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable {
    using AddressUpgradeable for address;
    using SafeMathUpgradeable for uint256;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    /**
     * @dev Emitted when a user deposits tokens.
     * @param sender User address.
     * @param id User's unique deposit ID.
     * @param amount The amount of deposited tokens.
     * @param userBalance Current user balance.
     * @param reward User's reward.
     * @param prevDepositDuration Duration of the previous deposit in seconds.
     * @param currentRewardFactor Factor to calculate reward.
     * @param totalStaked Total staked amount.
     */
    event Deposited(
        address indexed sender,
        uint256 indexed id,
        uint256 amount,
        uint256 userBalance,
        uint256 reward,
        uint256 prevDepositDuration,
        uint256 currentRewardFactor,
        uint256 totalStaked
    );

    /**
     * @dev Emitted when a user requests withdrawal.
     * @param sender User address.
     * @param id User's unique deposit ID.
     */
    event WithdrawalRequested(address indexed sender, uint256 indexed id);

    /**
     * @dev Emitted when deposit and reward are calculated before withdrawal.
     * @param sender User address.
     * @param id User's unique deposit ID.
     * @param deposit Removed deposit.
     * @param reward Assigned reward.
     */
    event BeforeDepositAndRewardWithdrawn(
        address indexed sender,
        uint256 indexed id,
        uint256 deposit,
        uint256 reward
    );

    /**
     * @dev Emitted when a user withdraws tokens.
     * @param sender User address.
     * @param id User's unique deposit ID.
     * @param withdrawalSum The amount of withdrawn tokens.
     * @param fee The withdrawal fee.
     * @param balance Current user balance.
     * @param reward User's reward assigned.
     * @param lastDepositDuration Duration of the last deposit in seconds.
     * @param totalStaked Total staked amount updated.
     * @param totalRemainingReward Total remaining reward which changes after someone withdraws his reward.
     */
    event Withdrawn(
        address indexed sender,
        uint256 indexed id,
        uint256 withdrawalSum,
        uint256 fee,
        uint256 balance,
        uint256 reward,
        uint256 lastDepositDuration,
        uint256 totalStaked,
        uint256 totalRemainingReward
    );

    /**
     * @dev Emitted when a new fee value is set.
     * @param value A new fee value.
     * @param sender The owner address at the moment of fee changing.
     */
    event FeeSet(uint256 value, address sender);

    /**
     * @dev Emitted when a new reward distribution set.
     * @param value A new distribution ration value.
     * @param sender The owner address at the moment of ratio changing.
     */
    event RewardDistributionSet(uint256 value, address sender);

    /**
     * @dev Emitted when a new reward maturity duration set.
     * @param value A new time in seconds.
     * @param sender The owner address at the time of changing.
     */
    event RewardMaturityDurationSet(uint256 value, address sender);

    /**
     * @dev Emitted when a new withdrawal lock duration value is set.
     * @param value A new withdrawal lock duration value.
     * @param sender The owner address at the moment of value changing.
     */
    event WithdrawalLockDurationSet(uint256 value, address sender);

    /**
     * @dev Emitted when a new withdrawal unlock duration value is set.
     * @param value A new withdrawal unlock duration value.
     * @param sender The owner address at the moment of value changing.
     */
    event WithdrawalUnlockDurationSet(uint256 value, address sender);

    /**
     * @dev Emitted when a request to distribute the reward.
     * @param amount A reward received.
     */
    event RewardDistributed(
        uint256 amount
    );

    /**
     * @dev Emitted when a request to distribute the reward.
     * @param rewardFactor.
     * @param totalStaked - All staked amount
     */
    event RewardFactorUpdated(
        uint256 rewardFactor,
        uint256 totalStaked
    );

    /**
     * @dev Emitted when reward has been updated.
     * @param stakersReward - Added stakers reward
     * @param ownerReward - Added owner reward
     * @param totalRemainingReward - Total remaining reward which cnanges when reward is accrued and withdrawn
     * @param totalStakersReward - Total stakers reward value
     * @param totalOnwerReward - Total onwer reward value
     */
    event RewardUpdated(
        uint256 stakersReward,
        uint256 ownerReward,
        uint256 totalRemainingReward,
        uint256 totalStakersReward,
        uint256 totalOnwerReward
    );

    struct UintParam {
        uint256 oldValue;
        uint256 newValue;
        uint256 timestamp;
    }

    struct AddressParam {
        address oldValue;
        address newValue;
        uint256 timestamp;
    }

    // uint256 constant PPB = 10**9;
    // Withdrawal fee, in parts per billion.
    // uint256 constant FEE_RATIO_PPB = 30 * PPB / 1000; // 3.0%
    // The maximum emission rate (in percentage)
    // uint256 public constant MAX_EMISSION_RATE = 15 * 1e16 wei; // 15%, 0.15 ether

    // uint256 private constant YEAR = 365 days;

    // The period after which the new value of the parameter is set
    uint256 public constant PARAM_UPDATE_DELAY = 7 days;

    // The reward factor of the staker(j) = SUM ( reward(j) / SUM(stakes(0->N))
    uint256 private currentRewardFactor = 0;

    // Saves the value of S at the time the participant j makes a deposit.
    mapping (address => mapping (uint256 => uint256)) public depositRewardFactor;

    // CenX token
    CentralexToken public token;

    // The fee of the forced withdrawal (in percentage)
    UintParam public feeParam;
    // The reward distribution (in percentage) fot stakeholders, i.e. 25% for the first year
    UintParam public rewardSharePercentParam;
    // The time from the request after which the withdrawal will be available (in seconds)
    UintParam public withdrawalLockDurationParam;
    // The time during which the withdrawal will be available from the moment of unlocking (in seconds)
    UintParam public withdrawalUnlockDurationParam;
    // The time during which the reward will be available to withdraw only partially depending on the deposit duration (in seconds)
    UintParam public rewardMaturityDurationParam;


    /// @notice The deposit balances of users
    mapping (address => mapping (uint256 => uint256)) public balances;
    /// @notice  The dates of users' deposits
    mapping (address => mapping (uint256 => uint256)) public depositDates;
    /// @notice  The dates of users' withdrawal requests
    mapping (address => mapping (uint256 => uint256)) public withdrawalRequestsDates;
    /// @notice  The last deposit id
    mapping (address => uint256) public lastDepositIds;
    /// @notice  The total staked amount
    uint256 public totalStaked;
    /// @notice The total remaining reward. Changes when user withdraws and when reward is distributed to stakeholders.
    uint256 public totalRemainingReward;
    /// @notice The total reward received by stakeholders.
    uint256 public totalStakersReward;
    /// @notice The total Cetralex reward. To be transfered back to CenX Token or liquidity providers.
    uint256 public totalOnwerReward;

    /**
     * @dev Initializes the contract.
     * @param _owner The owner of the contract.
     * @param _tokenAddress The address of the CenX token contract.
     * @param _fee The fee of the forced withdrawal (in percentage).
     * @param _withdrawalLockDuration The time from the request after which the withdrawal will be available (in seconds).
     * @param _withdrawalUnlockDuration The time during which the withdrawal will be available from the moment of unlocking (in seconds).
     */
    function initialize(
        address _owner,
        address _tokenAddress,
        uint256 _fee,
        uint256 _withdrawalLockDuration,
        uint256 _withdrawalUnlockDuration,
        uint256 _rewardMaturityDuration,
        uint256 _rewardSharePercent
    ) external initializer {
        require(_owner != address(0), "zero address");
        require(_tokenAddress.isContract(), "not a contract address");

        OwnableUpgradeable.__Ownable_init_unchained();
        ReentrancyGuardUpgradeable.__ReentrancyGuard_init_unchained();
        PausableUpgradeable.__Pausable_init_unchained();

        token = CentralexToken(_tokenAddress);

        setFee(_fee);
        setWithdrawalLockDuration(_withdrawalLockDuration);
        setWithdrawalUnlockDuration(_withdrawalUnlockDuration);
        setRewardMaturityDuration(_rewardMaturityDuration);
        setRewardSharePercent(_rewardSharePercent);

        OwnableUpgradeable.transferOwnership(_owner);
    }

    /**
     * @dev This method is used to deposit tokens to a new deposit.
     * It generates a new deposit ID and calls another public "deposit" method. See its description.
     * @param _amount The amount to deposit.
     */
    function deposit(uint256 _amount) external whenNotPaused {
        deposit(++lastDepositIds[msg.sender], _amount);
    }

    /**
     * @dev This method is used to deposit tokens to the deposit opened before.
     * Sender must approve tokens first.
     *
     * Note: each call updates the deposit date so be careful if you want to make a long staking.
     *
     * @param _depositId User's unique deposit ID.
     * @param _amount The amount to deposit.
     */
    function deposit(uint256 _depositId, uint256 _amount) public whenNotPaused nonReentrant {
        require(_depositId > 0 && _depositId <= lastDepositIds[msg.sender], "deposit: wrong deposit id");
        _deposit(msg.sender, _depositId, _amount);
        require(token.transferFrom(msg.sender, address(this), _amount), "deposit: transfer failed");
    }

    /**
     * @dev This method is used withdraw tokens from the staking back to owners token account.
     * Sender must approve tokens first.
     */
    function ownerWithdraw() public whenNotPaused onlyOwner nonReentrant {
        require(token.transfer(owner(), totalOnwerReward), "_withdraw: transfer failed");
        totalOnwerReward = 0;
    }

    /**
     * @dev This method is used to make a forced withdrawal with a fee.
     * It calls the internal "_withdraw" method.
     * @param depositId User's unique deposit ID.
     */
    function makeForcedWithdrawal(uint256 depositId) external whenNotPaused nonReentrant {
        _withdraw(msg.sender, depositId, true);
    }

    /**
     * @dev This method is used to request a withdrawal without a fee.
     * It sets the date of the request.
     *
     * Note: each call updates the date of the request so don't call this method twice during the lock.
     *
     * @param _depositId User's unique deposit ID.
     */
    function requestWithdrawal(uint256 _depositId) external whenNotPaused {
        require(_depositId > 0 && _depositId <= lastDepositIds[msg.sender], "wrong deposit id");
        withdrawalRequestsDates[msg.sender][_depositId] = _now();
        emit WithdrawalRequested(msg.sender, _depositId);
    }

    /**
     * @dev This method is used to make a requested withdrawal.
     * It calls the internal "_withdraw" method and resets the date of the request.
     * If sender didn't call this method during the unlock period (if timestamp >= lockEnd + withdrawalUnlockDuration)
     * they have to call "requestWithdrawal" one more time.
     *
     * @param _depositId User's unique deposit ID.
     */
    function makeRequestedWithdrawal(uint256 _depositId) external whenNotPaused nonReentrant {
        uint256 requestDate = withdrawalRequestsDates[msg.sender][_depositId];
        require(requestDate > 0, "withdrawal wasn't requested");
        uint256 timestamp = _now();
        uint256 lockEnd = requestDate.add(withdrawalLockDuration());
        require(timestamp >= lockEnd, "too early");
        require(timestamp < lockEnd.add(withdrawalUnlockDuration()), "too late");
        withdrawalRequestsDates[msg.sender][_depositId] = 0;
        _withdraw(msg.sender, _depositId, false);
    }

    /**
     * @dev Sets the fee for forced withdrawals. Can only be called by owner.
     * @param _value The new fee value (in percentage).
     */
    function setFee(uint256 _value) public onlyOwner whenNotPaused {
        require(_value <= 1 ether, "should be less than or equal to 1 ether");
        _updateUintParam(feeParam, _value);
        emit FeeSet(_value, msg.sender);
    }

    /**
     * @dev Sets the fee for forced withdrawals. Can only be called by owner.
     * @param _value The new fee value (in percentage).
     */
    function setRewardMaturityDuration(uint256 _value) public onlyOwner whenNotPaused {
        require(_value <= 180 days, "shouldn't be greater than 180 days");
        _updateUintParam(rewardMaturityDurationParam, _value);
        emit RewardMaturityDurationSet(_value, msg.sender);
    }

    /**
     * @dev Sets the reward distribution. Can only be called by owner.
     * @param _value The new fee value (in percentage).
     */
    function setRewardSharePercent(uint256 _value) public onlyOwner whenNotPaused {
        require(_value <= 1 ether, "should be less than or equal to 1 ether");
        _updateUintParam(rewardSharePercentParam, _value);
        emit RewardDistributionSet(_value, msg.sender);
    }

    /**
     * @dev Sets the time from the request after which the withdrawal will be available.
     * Can only be called by owner.
     * @param _value The new duration value (in seconds).
     */
    function setWithdrawalLockDuration(uint256 _value) public onlyOwner whenNotPaused {
        require(_value <= 30 days, "shouldn't be greater than 30 days");
        _updateUintParam(withdrawalLockDurationParam, _value);
        emit WithdrawalLockDurationSet(_value, msg.sender);
    }

    /**
     * @dev Sets the time during which the withdrawal will be available from the moment of unlocking.
     * Can only be called by owner.
     * @param _value The new duration value (in seconds).
     */
    function setWithdrawalUnlockDuration(uint256 _value) public onlyOwner whenNotPaused {
        require(_value >= 1 hours, "shouldn't be less than 1 hour");
        _updateUintParam(withdrawalUnlockDurationParam, _value);
        emit WithdrawalUnlockDurationSet(_value, msg.sender);
    }

    /**
     * @dev Returns user total balance.
     * @param voter The user who votes.
     * @return Returns User total balance.
     */
    function totalUserBalance(address voter)
        public view
        whenNotPaused
        returns(uint256)
    {
        require(voter != address(0), "totalUserBalance: voter address is not valid");
        uint256 count = lastDepositIds[voter];
        uint256 totalUserStaked = 0;

        for (uint i = 0; i <= count; i++) {
            totalUserStaked = totalUserStaked.add(balances[voter][i]);
        }

        return totalUserStaked;
    }

    /**
     * @return Returns current fee.
     */
    function fee() public view whenNotPaused returns (uint256) {
        return _getUintParamValue(feeParam);
    }

    /**
     * @return Returns the current reward distribution.
     */
    function rewardSharePercent() public view whenNotPaused returns (uint256) {
        return _getUintParamValue(rewardSharePercentParam);
    }

    /**
     * @return Returns current reward maturity duration in seconds.
     */
    function rewardMaturityDuration() public view whenNotPaused returns (uint256) {
        return _getUintParamValue(rewardMaturityDurationParam);
    }

    /**
     * @return Returns current withdrawal lock duration.
     */
    function withdrawalLockDuration() public view whenNotPaused returns (uint256) {
        return _getUintParamValue(withdrawalLockDurationParam);
    }

    /**
     * @return Returns current withdrawal unlock duration.
     */
    function withdrawalUnlockDuration() public whenNotPaused view returns (uint256) {
        return _getUintParamValue(withdrawalUnlockDurationParam);
    }

    /**
     * @dev Reward _amount to be distributed proportionally to active stake.
     * @param _amount New reward coming into the staking.
     */
    function distribute(uint256 _amount) public whenNotPaused onlyOwner nonReentrant {
        require(_amount > 0, "distribute: amount must be greater than 0");
        _distribute(msg.sender, _amount, false);
    }

    /**
     * @dev Reward _amount to be distributed proportionally to active stake.
     * @param reward New reward coming into the staking.
     */
    function _distribute(address sender, uint256 reward, bool isFee) internal {
        emit RewardDistributed(reward);

        uint256 stakersReward = reward.mul(rewardSharePercent()).div(1 ether);
        uint256 onwerReward = reward.sub(stakersReward);

        totalRemainingReward = totalRemainingReward.add(reward);
        totalStakersReward = totalStakersReward.add(stakersReward);
        totalOnwerReward = totalOnwerReward.add(onwerReward);

        emit RewardUpdated(stakersReward, onwerReward, totalRemainingReward, totalStakersReward, totalOnwerReward);

        if (totalStaked != 0) {
            // S = S + r / T;
            currentRewardFactor = currentRewardFactor.add(stakersReward.mul(1 ether).div(totalStaked));
            emit RewardFactorUpdated(currentRewardFactor, totalStaked);
        }

        if (!isFee){
            require(token.transferFrom(sender, address(this), reward), "_distribute: transfer failed");
        }
    }

    /**
     * @dev Recalculate balance in case the deposit is already made.
     * @param _sender The address of the sender.
     * @param _id User's unique deposit ID.
     * @param _amount The amount to deposit.
     */
    function _deposit(address _sender, uint256 _id, uint256 _amount) internal {
        require(_amount > 0, "deposit amount should be more than 0");

        uint256 userBalance = balances[_sender][_id];
        uint256 deposited = 0;
        uint256 reward = 0;
        uint256 timePassed = 0;

        // Recalculate balances
        if (userBalance > 0)
        {
            (deposited, reward, timePassed) = _withdrawDepositAndReward(_sender, _id);
            userBalance = _amount.add(deposited).add(reward);
        } else {
            userBalance = _amount;
        }

        // Assign amount
        balances[_sender][_id] = userBalance;
        // Update lastRewardFactor
        depositRewardFactor[_sender][_id] = currentRewardFactor;
        // Update total staked
        totalStaked = totalStaked.add(userBalance);
        // Update last deposit date
        depositDates[_sender][_id] = _now();

        emit Deposited(_sender, _id, _amount, userBalance, reward, timePassed, currentRewardFactor, totalStaked);
    }

    /**
     * @dev Helper function to withdraw full amount and assign reward.
     * @param _user The address of the sender.
     * @param _id User's unique deposit ID.
     */
    function _withdrawDepositAndReward(address _user, uint256 _id)
        internal
        returns (uint256 deposited, uint256 reward, uint256 timePassed) {

        deposited = balances[_user][_id];
        uint256 depositTime = depositDates[_user][_id];
        timePassed = _now().sub(depositTime);

        // Formula: reward = deposited * (S - S0[address]);
        reward = deposited.mul(currentRewardFactor.sub(depositRewardFactor[_user][_id])).div(1 ether);

        if (timePassed < 1 days) {
            reward = 0;
        } else if (timePassed < rewardMaturityDuration()) {
            reward = rewardMaturityDuration().div(timePassed).mul(reward).sub(reward);
        }

        // Finalizing with contract states
        balances[_user][_id] = 0;
        totalRemainingReward = totalRemainingReward.sub(reward);
        totalStaked = totalStaked.sub(deposited);
        depositDates[_user][_id] = 0;

        emit BeforeDepositAndRewardWithdrawn(_user, _id, deposited, reward);
    }

    /**
     * @dev Withdraw is possible only in full amount.
     * @dev Calls internal "_mint" method and then transfers tokens to the sender.
     * @param _sender The address of the sender.
     * @param _id User's unique deposit ID.
     * @param _forced Defines whether to apply fee (true), or not (false).
     */
    function _withdraw(address _sender, uint256 _id, bool _forced) internal {
        require(_id > 0 && _id <= lastDepositIds[_sender], "wrong deposit id");
        require(balances[_sender][_id] > 0, "insufficient funds");

        (uint256 deposited, uint256 reward, uint timePassed) = _withdrawDepositAndReward(_sender, _id);

        uint256 feeValue = 0;
        if (_forced) {
            feeValue = deposited.mul(fee()).div(1 ether);
            deposited = deposited.sub(feeValue);
            _distribute(_sender, feeValue, true);
        }

        uint256 withdrawalSum = deposited.add(reward);

        require(token.transfer(_sender, withdrawalSum), "_withdraw: transfer failed");
        emit Withdrawn(_sender, _id, withdrawalSum, feeValue, balances[_sender][_id], reward, timePassed, totalStaked, totalRemainingReward);
    }

    /**
     * @dev Sets the next value of the parameter and the timestamp of this setting.
     */
    function _updateUintParam(UintParam storage _param, uint256 _newValue) internal {
        if (_param.timestamp == 0) {
            _param.oldValue = _newValue;
        } else if (_paramUpdateDelayElapsed(_param.timestamp)) {
            _param.oldValue = _param.newValue;
        }
        _param.newValue = _newValue;
        _param.timestamp = _now();
    }

    /**
     * @return Returns the current value of the parameter.
     */
    function _getUintParamValue(UintParam memory _param) internal view returns (uint256) {
        return _paramUpdateDelayElapsed(_param.timestamp) ? _param.newValue : _param.oldValue;
    }

    /**
     * @return Returns true if param update delay elapsed.
     */
    function _paramUpdateDelayElapsed(uint256 _paramTimestamp) internal view returns (bool) {
        return _now() > _paramTimestamp.add(PARAM_UPDATE_DELAY);
    }

    /**
     * @dev Pauses all actions on the contract.
     *
     * See {ERC20Pausable} and {Pausable-_pause}.
     */
    function pause() public onlyOwner virtual {
        _pause();
    }

    /**
     * @dev Unpauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_unpause}.
     *
     */
    function unpause() public onlyOwner virtual {
        _unpause();
    }

    /**
     * @return Returns current timestamp.
     */
    function _now() internal view returns (uint256) {
        // Note that the timestamp can have a 900-second error:
        // https://github.com/ethereum/wiki/blob/c02254611f218f43cbb07517ca8e5d00fd6d6d75/Block-Protocol-2.0.md
        return block.timestamp; // solium-disable-line security/no-block-members
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"deposit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"BeforeDepositAndRewardWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prevDepositDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentRewardFactor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"RewardDistributionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardFactor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"}],"name":"RewardFactorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"RewardMaturityDurationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stakersReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ownerReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRemainingReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStakersReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalOnwerReward","type":"uint256"}],"name":"RewardUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"WithdrawalLockDurationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"WithdrawalRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"WithdrawalUnlockDurationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawalSum","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastDepositDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRemainingReward","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"PARAM_UPDATE_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositDates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositRewardFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeParam","outputs":[{"internalType":"uint256","name":"oldValue","type":"uint256"},{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_withdrawalLockDuration","type":"uint256"},{"internalType":"uint256","name":"_withdrawalUnlockDuration","type":"uint256"},{"internalType":"uint256","name":"_rewardMaturityDuration","type":"uint256"},{"internalType":"uint256","name":"_rewardSharePercent","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastDepositIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"makeForcedWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositId","type":"uint256"}],"name":"makeRequestedWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositId","type":"uint256"}],"name":"requestWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardMaturityDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardMaturityDurationParam","outputs":[{"internalType":"uint256","name":"oldValue","type":"uint256"},{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardSharePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardSharePercentParam","outputs":[{"internalType":"uint256","name":"oldValue","type":"uint256"},{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setRewardMaturityDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setRewardSharePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setWithdrawalLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setWithdrawalUnlockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract CentralexToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalOnwerReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRemainingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakersReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"voter","type":"address"}],"name":"totalUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalLockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalLockDurationParam","outputs":[{"internalType":"uint256","name":"oldValue","type":"uint256"},{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawalRequestsDates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalUnlockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalUnlockDurationParam","outputs":[{"internalType":"uint256","name":"oldValue","type":"uint256"},{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052600060c95534801561001557600080fd5b5061492b806100256000396000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c80638f83417811610146578063cbf1304d116100c3578063e89c5c8211610087578063e89c5c821461089e578063edbf4ac2146108cc578063f2fde38b14610962578063faea1ab0146109a6578063fb13a2ae146109c4578063fc0c546a146109f257610253565b8063cbf1304d14610766578063db51ef92146107c8578063ddca3f43146107e6578063e0648a2814610804578063e2bbb1581461086657610253565b8063a551e4c61161010a578063a551e4c614610632578063b6b55f2514610694578063beae9289146106c2578063c3bd8fd0146106e0578063c9f704611461073857610253565b80638f8341781461055e57806391c05b0b1461057c57806397f30534146105aa5780639ee679e8146105d8578063a260b4091461060657610253565b806360c251c1116101d45780638456cb59116101985780638456cb5914610472578063868867b51461047c5780638b53ccb3146104aa5780638da5cb5b1461050c5780638df676801461054057610253565b806360c251c1146103e057806369fe0e2d146103fe578063715018a61461042c57806378483f7014610436578063817b1cd21461045457610253565b80633f4ba83a1161021b5780633f4ba83a146103545780634311de8f1461035e57806347e318de146103685780635c975abb146103945780635e9e230d146103b457610253565b806311c6183e1461025857806320cb5aa614610276578063224313fa146102ce5780632c3144da146102fc578063385ffddd14610328575b600080fd5b610260610a26565b6040518082815260200191505060405180910390f35b6102b86004803603602081101561028c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a2c565b6040518082815260200191505060405180910390f35b6102fa600480360360208110156102e457600080fd5b8101908080359060200190929190505050610bfb565b005b610304610de4565b60405180848152602001838152602001828152602001935050505060405180910390f35b610330610dfc565b60405180848152602001838152602001828152602001935050505060405180910390f35b61035c610e14565b005b610366610ecd565b005b6103706111d3565b60405180848152602001838152602001828152602001935050505060405180910390f35b61039c6111eb565b60405180821515815260200191505060405180910390f35b6103bc611202565b60405180848152602001838152602001828152602001935050505060405180910390f35b6103e861121a565b6040518082815260200191505060405180910390f35b61042a6004803603602081101561041457600080fd5b81019080803590602001909291905050506112cf565b005b6104346114bd565b005b61043e61162d565b6040518082815260200191505060405180910390f35b61045c611633565b6040518082815260200191505060405180910390f35b61047a611639565b005b6104a86004803603602081101561049257600080fd5b81019080803590602001909291905050506116f2565b005b6104f6600480360360408110156104c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118f7565b6040518082815260200191505060405180910390f35b61051461191c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610548611946565b6040518082815260200191505060405180910390f35b6105666119fb565b6040518082815260200191505060405180910390f35b6105a86004803603602081101561059257600080fd5b8101908080359060200190929190505050611ab0565b005b6105d6600480360360208110156105c057600080fd5b8101908080359060200190929190505050611ccb565b005b610604600480360360208110156105ee57600080fd5b8101908080359060200190929190505050611eb9565b005b61060e612098565b60405180848152602001838152602001828152602001935050505060405180910390f35b61067e6004803603604081101561064857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120b0565b6040518082815260200191505060405180910390f35b6106c0600480360360208110156106aa57600080fd5b81019080803590602001909291905050506120d5565b005b6106ca6121a8565b6040518082815260200191505060405180910390f35b610722600480360360208110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061225d565b6040518082815260200191505060405180910390f35b6107646004803603602081101561074e57600080fd5b8101908080359060200190929190505050612275565b005b6107b26004803603604081101561077c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506125da565b6040518082815260200191505060405180910390f35b6107d06125ff565b6040518082815260200191505060405180910390f35b6107ee612606565b6040518082815260200191505060405180910390f35b6108506004803603604081101561081a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126bb565b6040518082815260200191505060405180910390f35b61089c6004803603604081101561087c57600080fd5b8101908080359060200190929190803590602001909291905050506126e0565b005b6108ca600480360360208110156108b457600080fd5b8101908080359060200190929190505050612a12565b005b610960600480360360e08110156108e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612b25565b005b6109a46004803603602081101561097857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ded565b005b6109ae612fe2565b6040518082815260200191505060405180910390f35b6109f0600480360360208110156109da57600080fd5b8101908080359060200190929190505050612fe8565b005b6109fa6131d1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60e15481565b6000610a366111eb565b15610aa9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180614859602c913960400191505060405180910390fd5b600060de60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000805b828111610bf057610be160db60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054836131f790919063ffffffff16565b91508080600101915050610b77565b508092505050919050565b610c0361327f565b73ffffffffffffffffffffffffffffffffffffffff16610c2161191c565b73ffffffffffffffffffffffffffffffffffffffff1614610caa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610cb26111eb565b15610d25576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b62278d00811115610d81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806148d56021913960400191505060405180910390fd5b610d8c60d282613287565b7fb1effbb8dc5cfa97751137110a061198891986f1567677e11ec9449743180f748133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60d28060000154908060010154908060020154905083565b60d88060000154908060010154908060020154905083565b610e1c61327f565b73ffffffffffffffffffffffffffffffffffffffff16610e3a61191c565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ecb6132e0565b565b610ed56111eb565b15610f48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f5061327f565b73ffffffffffffffffffffffffffffffffffffffff16610f6e61191c565b73ffffffffffffffffffffffffffffffffffffffff1614610ff7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026065541415611070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6110be61191c565b60e2546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561111457600080fd5b505af1158015611128573d6000803e3d6000fd5b505050506040513d602081101561113e57600080fd5b81019080805190602001909291905050506111c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5f77697468647261773a207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b600060e2819055506001606581905550565b60cc8060000154908060010154908060020154905083565b6000609760009054906101000a900460ff16905090565b60d58060000154908060010154908060020154905083565b60006112246111eb565b15611297576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6112ca60d260405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b6112d761327f565b73ffffffffffffffffffffffffffffffffffffffff166112f561191c565b73ffffffffffffffffffffffffffffffffffffffff161461137e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6113866111eb565b156113f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a764000081111561145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806148ae6027913960400191505060405180910390fd5b61146560cc82613287565b7fc8242dc5446855370b781abbfc5d882af1d1a3cc29143216aba3558feb0ce9258133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b6114c561327f565b73ffffffffffffffffffffffffffffffffffffffff166114e361191c565b73ffffffffffffffffffffffffffffffffffffffff161461156c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60e25481565b60df5481565b61164161327f565b73ffffffffffffffffffffffffffffffffffffffff1661165f61191c565b73ffffffffffffffffffffffffffffffffffffffff16146116e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6116f06133f5565b565b6116fa61327f565b73ffffffffffffffffffffffffffffffffffffffff1661171861191c565b73ffffffffffffffffffffffffffffffffffffffff16146117a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6117a96111eb565b1561181c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610e10811015611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f73686f756c646e2774206265206c657373207468616e203120686f757200000081525060200191505060405180910390fd5b61189f60d582613287565b7f3a963fa1d1d0da205f1ae9869aa14bf4ff7a4585efa819b0c94326b4a3e1e2288133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60dc602052816000526040600020602052806000526040600020600091509150505481565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006119506111eb565b156119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6119f660d560405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b6000611a056111eb565b15611a78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aab60cf60405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b611ab86111eb565b15611b2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611b3361327f565b73ffffffffffffffffffffffffffffffffffffffff16611b5161191c565b73ffffffffffffffffffffffffffffffffffffffff1614611bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026065541415611c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060008111611cb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806148856029913960400191505060405180910390fd5b611cc0338260006134e1565b600160658190555050565b611cd361327f565b73ffffffffffffffffffffffffffffffffffffffff16611cf161191c565b73ffffffffffffffffffffffffffffffffffffffff1614611d7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d826111eb565b15611df5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a7640000811115611e56576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806148ae6027913960400191505060405180910390fd5b611e6160cf82613287565b7f58b567223b5ed2ff5525ef4a6f35309f336be7477f8a0ddac00d1b0ad8825c408133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b611ec16111eb565b15611f34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600081118015611f83575060de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111155b611ff5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f77726f6e67206465706f7369742069640000000000000000000000000000000081525060200191505060405180910390fd5b611ffd613817565b60dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550803373ffffffffffffffffffffffffffffffffffffffff167fe670e4e82118d22a1f9ee18920455ebc958bae26a90a05d31d3378788b1b0e4460405160405180910390a350565b60cf8060000154908060010154908060020154905083565b60ca602052816000526040600020602052806000526040600020600091509150505481565b6120dd6111eb565b15612150576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6121a560de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154600101919050819055826126e0565b50565b60006121b26111eb565b15612225576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61225860d860405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b60de6020528060005260406000206000915090505481565b61227d6111eb565b156122f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60026065541415612369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002606581905550600060dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000205490506000811161243c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f7769746864726177616c207761736e277420726571756573746564000000000081525060200191505060405180910390fd5b6000612446613817565b9050600061246461245561121a565b846131f790919063ffffffff16565b9050808210156124dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f746f6f206561726c79000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6124f66124e7611946565b826131f790919063ffffffff16565b821061256a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f746f6f206c61746500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600060dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020819055506125cc3385600061381f565b505050600160658190555050565b60db602052816000526040600020602052806000526040600020600091509150505481565b62093a8081565b60006126106111eb565b15612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6126b660cc60405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b60dd602052816000526040600020602052806000526040600020600091509150505481565b6126e86111eb565b1561275b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600260655414156127d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060008211801561282b575060de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b61289d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f6465706f7369743a2077726f6e67206465706f7369742069640000000000000081525060200191505060405180910390fd5b6128a8338383613c4f565b60cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561295957600080fd5b505af115801561296d573d6000803e3d6000fd5b505050506040513d602081101561298357600080fd5b8101908080519060200190929190505050612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f6465706f7369743a207472616e73666572206661696c6564000000000000000081525060200191505060405180910390fd5b60016065819055505050565b612a1a6111eb565b15612a8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60026065541415612b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002606581905550612b1a3382600161381f565b600160658190555050565b600060019054906101000a900460ff1680612b445750612b43613ef7565b5b80612b5a575060008054906101000a900460ff16155b612baf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015612bff576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612ca2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f7a65726f2061646472657373000000000000000000000000000000000000000081525060200191505060405180910390fd5b612cc18773ffffffffffffffffffffffffffffffffffffffff16613f08565b612d33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f6e6f74206120636f6e747261637420616464726573730000000000000000000081525060200191505060405180910390fd5b612d3b613f1b565b612d436140c2565b612d4b6141c8565b8660cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612d95866112cf565b612d9e85610bfb565b612da7846116f2565b612db083612fe8565b612db982611ccb565b612dc288612ded565b8015612de35760008060016101000a81548160ff0219169083151502179055505b5050505050505050565b612df561327f565b73ffffffffffffffffffffffffffffffffffffffff16612e1361191c565b73ffffffffffffffffffffffffffffffffffffffff1614612e9c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806147c06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60e05481565b612ff061327f565b73ffffffffffffffffffffffffffffffffffffffff1661300e61191c565b73ffffffffffffffffffffffffffffffffffffffff1614613097576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61309f6111eb565b15613112576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b62ed4e0081111561316e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061479e6022913960400191505060405180910390fd5b61317960d882613287565b7fc3e9ca713496b458296687b2412859ba2cd55f4c66b900b0201967eda7beed338133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828401905083811015613275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b6000826002015414156132a2578082600001819055506132c3565b6132af82600201546142e1565b156132c257816001015482600001819055505b5b8082600101819055506132d4613817565b82600201819055505050565b6132e86111eb565b61335a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000609760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61339e61327f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60006133da82604001516142e1565b6133e85781600001516133ee565b81602001515b9050919050565b6133fd6111eb565b15613470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001609760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586134b461327f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b7f04944120d2e185fc95ba63f3ca24c385ec4c5215a801c8766c96486d7fc4ed8e826040518082815260200191505060405180910390a1600061354e670de0b6b3a76400006135406135316119fb565b8661430990919063ffffffff16565b61438f90919063ffffffff16565b90506000613565828561441890919063ffffffff16565b905061357c8460e0546131f790919063ffffffff16565b60e0819055506135978260e1546131f790919063ffffffff16565b60e1819055506135b28160e2546131f790919063ffffffff16565b60e2819055507f0f76b4c8a50ff02f5a2f6fa17e8637df0c39b4076d079775276ba3cd30f00328828260e05460e15460e254604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a1600060df54146136ac5761366261365160df54613643670de0b6b3a76400008661430990919063ffffffff16565b61438f90919063ffffffff16565b60c9546131f790919063ffffffff16565b60c9819055507f977f10cdbafda6ab996d38277835a4c15d0040078976017f2b3b77496b88ea8860c95460df54604051808381526020018281526020019250505060405180910390a15b826138105760cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561376257600080fd5b505af1158015613776573d6000803e3d6000fd5b505050506040513d602081101561378c57600080fd5b810190808051906020019092919050505061380f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5f646973747269627574653a207472616e73666572206661696c65640000000081525060200191505060405180910390fd5b5b5050505050565b600042905090565b60008211801561386e575060de60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b6138e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f77726f6e67206465706f7369742069640000000000000000000000000000000081525060200191505060405180910390fd5b600060db60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054116139a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f696e73756666696369656e742066756e6473000000000000000000000000000081525060200191505060405180910390fd5b60008060006139b5868661449b565b92509250925060008415613a1b576139f7670de0b6b3a76400006139e96139da612606565b8761430990919063ffffffff16565b61438f90919063ffffffff16565b9050613a0c818561441890919063ffffffff16565b9350613a1a878260016134e1565b5b6000613a3084866131f790919063ffffffff16565b905060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613ac557600080fd5b505af1158015613ad9573d6000803e3d6000fd5b505050506040513d6020811015613aef57600080fd5b8101908080519060200190929190505050613b72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5f77697468647261773a207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b868873ffffffffffffffffffffffffffffffffffffffff167f5d23719d61080aafce74ac83a4f60154c3040481ecfec7e0844a14318534bd5b838560db60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d815260200190815260200160002054898960df5460e0546040518088815260200187815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390a35050505050505050565b60008111613ca8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806147e66024913960400191505060405180910390fd5b600060db60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020549050600080600080841115613d4c57613d14878761449b565b809350819450829550505050613d4582613d3785886131f790919063ffffffff16565b6131f790919063ffffffff16565b9350613d50565b8493505b8360db60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008881526020019081526020016000208190555060c95460ca60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002081905550613e118460df546131f790919063ffffffff16565b60df81905550613e1f613817565b60dc60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002081905550858773ffffffffffffffffffffffffffffffffffffffff167f1f435c9b460eeab9fecb7b687813a0b3bf8b6959263ba4785af0c582e90fe1798787868660c95460df5460405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a350505050505050565b6000613f0230613f08565b15905090565b600080823b905060008111915050919050565b600060019054906101000a900460ff1680613f3a5750613f39613ef7565b5b80613f50575060008054906101000a900460ff16155b613fa5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015613ff5576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6000613fff61327f565b905080603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35080156140bf5760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806140e157506140e0613ef7565b5b806140f7575060008054906101000a900460ff16155b61414c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff16159050801561419c576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600160658190555080156141c55760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806141e757506141e6613ef7565b5b806141fd575060008054906101000a900460ff16155b614252576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156142a2576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6000609760006101000a81548160ff02191690831515021790555080156142de5760008060016101000a81548160ff0219169083151502179055505b50565b60006142f962093a80836131f790919063ffffffff16565b614301613817565b119050919050565b60008083141561431c5760009050614389565b600082840290508284828161432d57fe5b0414614384576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806148386021913960400191505060405180910390fd5b809150505b92915050565b6000808211614406576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161440f57fe5b04905092915050565b600082821115614490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080600060db60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020549250600060dc60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905061456281614554613817565b61441890919063ffffffff16565b91506145f5670de0b6b3a76400006145e76145d860ca60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a81526020019081526020016000205460c95461441890919063ffffffff16565b8761430990919063ffffffff16565b61438f90919063ffffffff16565b92506201518082101561460b576000925061465c565b6146136121a8565b82101561465b576146588361464a8561463c8661462e6121a8565b61438f90919063ffffffff16565b61430990919063ffffffff16565b61441890919063ffffffff16565b92505b5b600060db60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878152602001908152602001600020819055506146c78360e05461441890919063ffffffff16565b60e0819055506146e28460df5461441890919063ffffffff16565b60df81905550600060dc60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002081905550848673ffffffffffffffffffffffffffffffffffffffff167fe97aaf9c5be9d8a2a75963d3b0fe81d793e8e9e268fe73ab6c70acc285332c058686604051808381526020018281526020019250505060405180910390a350925092509256fe73686f756c646e27742062652067726561746572207468616e2031383020646179734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573736465706f73697420616d6f756e742073686f756c64206265206d6f7265207468616e2030496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77746f74616c5573657242616c616e63653a20766f7465722061646472657373206973206e6f742076616c6964646973747269627574653a20616d6f756e74206d7573742062652067726561746572207468616e203073686f756c64206265206c657373207468616e206f7220657175616c20746f203120657468657273686f756c646e27742062652067726561746572207468616e2033302064617973a2646970667358221220502ef8612ac6b1699c2b81b6c7b1d5d044d89ad6c8557082bfd438bd2011524064736f6c63430007000033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102535760003560e01c80638f83417811610146578063cbf1304d116100c3578063e89c5c8211610087578063e89c5c821461089e578063edbf4ac2146108cc578063f2fde38b14610962578063faea1ab0146109a6578063fb13a2ae146109c4578063fc0c546a146109f257610253565b8063cbf1304d14610766578063db51ef92146107c8578063ddca3f43146107e6578063e0648a2814610804578063e2bbb1581461086657610253565b8063a551e4c61161010a578063a551e4c614610632578063b6b55f2514610694578063beae9289146106c2578063c3bd8fd0146106e0578063c9f704611461073857610253565b80638f8341781461055e57806391c05b0b1461057c57806397f30534146105aa5780639ee679e8146105d8578063a260b4091461060657610253565b806360c251c1116101d45780638456cb59116101985780638456cb5914610472578063868867b51461047c5780638b53ccb3146104aa5780638da5cb5b1461050c5780638df676801461054057610253565b806360c251c1146103e057806369fe0e2d146103fe578063715018a61461042c57806378483f7014610436578063817b1cd21461045457610253565b80633f4ba83a1161021b5780633f4ba83a146103545780634311de8f1461035e57806347e318de146103685780635c975abb146103945780635e9e230d146103b457610253565b806311c6183e1461025857806320cb5aa614610276578063224313fa146102ce5780632c3144da146102fc578063385ffddd14610328575b600080fd5b610260610a26565b6040518082815260200191505060405180910390f35b6102b86004803603602081101561028c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a2c565b6040518082815260200191505060405180910390f35b6102fa600480360360208110156102e457600080fd5b8101908080359060200190929190505050610bfb565b005b610304610de4565b60405180848152602001838152602001828152602001935050505060405180910390f35b610330610dfc565b60405180848152602001838152602001828152602001935050505060405180910390f35b61035c610e14565b005b610366610ecd565b005b6103706111d3565b60405180848152602001838152602001828152602001935050505060405180910390f35b61039c6111eb565b60405180821515815260200191505060405180910390f35b6103bc611202565b60405180848152602001838152602001828152602001935050505060405180910390f35b6103e861121a565b6040518082815260200191505060405180910390f35b61042a6004803603602081101561041457600080fd5b81019080803590602001909291905050506112cf565b005b6104346114bd565b005b61043e61162d565b6040518082815260200191505060405180910390f35b61045c611633565b6040518082815260200191505060405180910390f35b61047a611639565b005b6104a86004803603602081101561049257600080fd5b81019080803590602001909291905050506116f2565b005b6104f6600480360360408110156104c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118f7565b6040518082815260200191505060405180910390f35b61051461191c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610548611946565b6040518082815260200191505060405180910390f35b6105666119fb565b6040518082815260200191505060405180910390f35b6105a86004803603602081101561059257600080fd5b8101908080359060200190929190505050611ab0565b005b6105d6600480360360208110156105c057600080fd5b8101908080359060200190929190505050611ccb565b005b610604600480360360208110156105ee57600080fd5b8101908080359060200190929190505050611eb9565b005b61060e612098565b60405180848152602001838152602001828152602001935050505060405180910390f35b61067e6004803603604081101561064857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120b0565b6040518082815260200191505060405180910390f35b6106c0600480360360208110156106aa57600080fd5b81019080803590602001909291905050506120d5565b005b6106ca6121a8565b6040518082815260200191505060405180910390f35b610722600480360360208110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061225d565b6040518082815260200191505060405180910390f35b6107646004803603602081101561074e57600080fd5b8101908080359060200190929190505050612275565b005b6107b26004803603604081101561077c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506125da565b6040518082815260200191505060405180910390f35b6107d06125ff565b6040518082815260200191505060405180910390f35b6107ee612606565b6040518082815260200191505060405180910390f35b6108506004803603604081101561081a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126bb565b6040518082815260200191505060405180910390f35b61089c6004803603604081101561087c57600080fd5b8101908080359060200190929190803590602001909291905050506126e0565b005b6108ca600480360360208110156108b457600080fd5b8101908080359060200190929190505050612a12565b005b610960600480360360e08110156108e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612b25565b005b6109a46004803603602081101561097857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ded565b005b6109ae612fe2565b6040518082815260200191505060405180910390f35b6109f0600480360360208110156109da57600080fd5b8101908080359060200190929190505050612fe8565b005b6109fa6131d1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60e15481565b6000610a366111eb565b15610aa9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180614859602c913960400191505060405180910390fd5b600060de60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000805b828111610bf057610be160db60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054836131f790919063ffffffff16565b91508080600101915050610b77565b508092505050919050565b610c0361327f565b73ffffffffffffffffffffffffffffffffffffffff16610c2161191c565b73ffffffffffffffffffffffffffffffffffffffff1614610caa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610cb26111eb565b15610d25576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b62278d00811115610d81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806148d56021913960400191505060405180910390fd5b610d8c60d282613287565b7fb1effbb8dc5cfa97751137110a061198891986f1567677e11ec9449743180f748133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60d28060000154908060010154908060020154905083565b60d88060000154908060010154908060020154905083565b610e1c61327f565b73ffffffffffffffffffffffffffffffffffffffff16610e3a61191c565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ecb6132e0565b565b610ed56111eb565b15610f48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f5061327f565b73ffffffffffffffffffffffffffffffffffffffff16610f6e61191c565b73ffffffffffffffffffffffffffffffffffffffff1614610ff7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026065541415611070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6110be61191c565b60e2546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561111457600080fd5b505af1158015611128573d6000803e3d6000fd5b505050506040513d602081101561113e57600080fd5b81019080805190602001909291905050506111c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5f77697468647261773a207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b600060e2819055506001606581905550565b60cc8060000154908060010154908060020154905083565b6000609760009054906101000a900460ff16905090565b60d58060000154908060010154908060020154905083565b60006112246111eb565b15611297576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6112ca60d260405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b6112d761327f565b73ffffffffffffffffffffffffffffffffffffffff166112f561191c565b73ffffffffffffffffffffffffffffffffffffffff161461137e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6113866111eb565b156113f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a764000081111561145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806148ae6027913960400191505060405180910390fd5b61146560cc82613287565b7fc8242dc5446855370b781abbfc5d882af1d1a3cc29143216aba3558feb0ce9258133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b6114c561327f565b73ffffffffffffffffffffffffffffffffffffffff166114e361191c565b73ffffffffffffffffffffffffffffffffffffffff161461156c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60e25481565b60df5481565b61164161327f565b73ffffffffffffffffffffffffffffffffffffffff1661165f61191c565b73ffffffffffffffffffffffffffffffffffffffff16146116e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6116f06133f5565b565b6116fa61327f565b73ffffffffffffffffffffffffffffffffffffffff1661171861191c565b73ffffffffffffffffffffffffffffffffffffffff16146117a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6117a96111eb565b1561181c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610e10811015611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f73686f756c646e2774206265206c657373207468616e203120686f757200000081525060200191505060405180910390fd5b61189f60d582613287565b7f3a963fa1d1d0da205f1ae9869aa14bf4ff7a4585efa819b0c94326b4a3e1e2288133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60dc602052816000526040600020602052806000526040600020600091509150505481565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006119506111eb565b156119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6119f660d560405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b6000611a056111eb565b15611a78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aab60cf60405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b611ab86111eb565b15611b2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611b3361327f565b73ffffffffffffffffffffffffffffffffffffffff16611b5161191c565b73ffffffffffffffffffffffffffffffffffffffff1614611bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026065541415611c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060008111611cb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806148856029913960400191505060405180910390fd5b611cc0338260006134e1565b600160658190555050565b611cd361327f565b73ffffffffffffffffffffffffffffffffffffffff16611cf161191c565b73ffffffffffffffffffffffffffffffffffffffff1614611d7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d826111eb565b15611df5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a7640000811115611e56576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806148ae6027913960400191505060405180910390fd5b611e6160cf82613287565b7f58b567223b5ed2ff5525ef4a6f35309f336be7477f8a0ddac00d1b0ad8825c408133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b611ec16111eb565b15611f34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600081118015611f83575060de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111155b611ff5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f77726f6e67206465706f7369742069640000000000000000000000000000000081525060200191505060405180910390fd5b611ffd613817565b60dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550803373ffffffffffffffffffffffffffffffffffffffff167fe670e4e82118d22a1f9ee18920455ebc958bae26a90a05d31d3378788b1b0e4460405160405180910390a350565b60cf8060000154908060010154908060020154905083565b60ca602052816000526040600020602052806000526040600020600091509150505481565b6120dd6111eb565b15612150576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6121a560de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154600101919050819055826126e0565b50565b60006121b26111eb565b15612225576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61225860d860405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b60de6020528060005260406000206000915090505481565b61227d6111eb565b156122f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60026065541415612369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002606581905550600060dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000205490506000811161243c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f7769746864726177616c207761736e277420726571756573746564000000000081525060200191505060405180910390fd5b6000612446613817565b9050600061246461245561121a565b846131f790919063ffffffff16565b9050808210156124dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f746f6f206561726c79000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6124f66124e7611946565b826131f790919063ffffffff16565b821061256a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f746f6f206c61746500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600060dd60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020819055506125cc3385600061381f565b505050600160658190555050565b60db602052816000526040600020602052806000526040600020600091509150505481565b62093a8081565b60006126106111eb565b15612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6126b660cc60405180606001604052908160008201548152602001600182015481526020016002820154815250506133cb565b905090565b60dd602052816000526040600020602052806000526040600020600091509150505481565b6126e86111eb565b1561275b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600260655414156127d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260658190555060008211801561282b575060de60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b61289d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f6465706f7369743a2077726f6e67206465706f7369742069640000000000000081525060200191505060405180910390fd5b6128a8338383613c4f565b60cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561295957600080fd5b505af115801561296d573d6000803e3d6000fd5b505050506040513d602081101561298357600080fd5b8101908080519060200190929190505050612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f6465706f7369743a207472616e73666572206661696c6564000000000000000081525060200191505060405180910390fd5b60016065819055505050565b612a1a6111eb565b15612a8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60026065541415612b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002606581905550612b1a3382600161381f565b600160658190555050565b600060019054906101000a900460ff1680612b445750612b43613ef7565b5b80612b5a575060008054906101000a900460ff16155b612baf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015612bff576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612ca2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f7a65726f2061646472657373000000000000000000000000000000000000000081525060200191505060405180910390fd5b612cc18773ffffffffffffffffffffffffffffffffffffffff16613f08565b612d33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f6e6f74206120636f6e747261637420616464726573730000000000000000000081525060200191505060405180910390fd5b612d3b613f1b565b612d436140c2565b612d4b6141c8565b8660cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612d95866112cf565b612d9e85610bfb565b612da7846116f2565b612db083612fe8565b612db982611ccb565b612dc288612ded565b8015612de35760008060016101000a81548160ff0219169083151502179055505b5050505050505050565b612df561327f565b73ffffffffffffffffffffffffffffffffffffffff16612e1361191c565b73ffffffffffffffffffffffffffffffffffffffff1614612e9c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806147c06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60e05481565b612ff061327f565b73ffffffffffffffffffffffffffffffffffffffff1661300e61191c565b73ffffffffffffffffffffffffffffffffffffffff1614613097576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61309f6111eb565b15613112576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b62ed4e0081111561316e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061479e6022913960400191505060405180910390fd5b61317960d882613287565b7fc3e9ca713496b458296687b2412859ba2cd55f4c66b900b0201967eda7beed338133604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b60cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828401905083811015613275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b6000826002015414156132a2578082600001819055506132c3565b6132af82600201546142e1565b156132c257816001015482600001819055505b5b8082600101819055506132d4613817565b82600201819055505050565b6132e86111eb565b61335a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000609760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61339e61327f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60006133da82604001516142e1565b6133e85781600001516133ee565b81602001515b9050919050565b6133fd6111eb565b15613470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001609760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586134b461327f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b7f04944120d2e185fc95ba63f3ca24c385ec4c5215a801c8766c96486d7fc4ed8e826040518082815260200191505060405180910390a1600061354e670de0b6b3a76400006135406135316119fb565b8661430990919063ffffffff16565b61438f90919063ffffffff16565b90506000613565828561441890919063ffffffff16565b905061357c8460e0546131f790919063ffffffff16565b60e0819055506135978260e1546131f790919063ffffffff16565b60e1819055506135b28160e2546131f790919063ffffffff16565b60e2819055507f0f76b4c8a50ff02f5a2f6fa17e8637df0c39b4076d079775276ba3cd30f00328828260e05460e15460e254604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a1600060df54146136ac5761366261365160df54613643670de0b6b3a76400008661430990919063ffffffff16565b61438f90919063ffffffff16565b60c9546131f790919063ffffffff16565b60c9819055507f977f10cdbafda6ab996d38277835a4c15d0040078976017f2b3b77496b88ea8860c95460df54604051808381526020018281526020019250505060405180910390a15b826138105760cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561376257600080fd5b505af1158015613776573d6000803e3d6000fd5b505050506040513d602081101561378c57600080fd5b810190808051906020019092919050505061380f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5f646973747269627574653a207472616e73666572206661696c65640000000081525060200191505060405180910390fd5b5b5050505050565b600042905090565b60008211801561386e575060de60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b6138e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f77726f6e67206465706f7369742069640000000000000000000000000000000081525060200191505060405180910390fd5b600060db60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054116139a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f696e73756666696369656e742066756e6473000000000000000000000000000081525060200191505060405180910390fd5b60008060006139b5868661449b565b92509250925060008415613a1b576139f7670de0b6b3a76400006139e96139da612606565b8761430990919063ffffffff16565b61438f90919063ffffffff16565b9050613a0c818561441890919063ffffffff16565b9350613a1a878260016134e1565b5b6000613a3084866131f790919063ffffffff16565b905060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613ac557600080fd5b505af1158015613ad9573d6000803e3d6000fd5b505050506040513d6020811015613aef57600080fd5b8101908080519060200190929190505050613b72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5f77697468647261773a207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b868873ffffffffffffffffffffffffffffffffffffffff167f5d23719d61080aafce74ac83a4f60154c3040481ecfec7e0844a14318534bd5b838560db60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d815260200190815260200160002054898960df5460e0546040518088815260200187815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390a35050505050505050565b60008111613ca8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806147e66024913960400191505060405180910390fd5b600060db60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020549050600080600080841115613d4c57613d14878761449b565b809350819450829550505050613d4582613d3785886131f790919063ffffffff16565b6131f790919063ffffffff16565b9350613d50565b8493505b8360db60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008881526020019081526020016000208190555060c95460ca60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002081905550613e118460df546131f790919063ffffffff16565b60df81905550613e1f613817565b60dc60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002081905550858773ffffffffffffffffffffffffffffffffffffffff167f1f435c9b460eeab9fecb7b687813a0b3bf8b6959263ba4785af0c582e90fe1798787868660c95460df5460405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a350505050505050565b6000613f0230613f08565b15905090565b600080823b905060008111915050919050565b600060019054906101000a900460ff1680613f3a5750613f39613ef7565b5b80613f50575060008054906101000a900460ff16155b613fa5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015613ff5576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6000613fff61327f565b905080603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35080156140bf5760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806140e157506140e0613ef7565b5b806140f7575060008054906101000a900460ff16155b61414c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff16159050801561419c576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600160658190555080156141c55760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806141e757506141e6613ef7565b5b806141fd575060008054906101000a900460ff16155b614252576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061480a602e913960400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156142a2576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6000609760006101000a81548160ff02191690831515021790555080156142de5760008060016101000a81548160ff0219169083151502179055505b50565b60006142f962093a80836131f790919063ffffffff16565b614301613817565b119050919050565b60008083141561431c5760009050614389565b600082840290508284828161432d57fe5b0414614384576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806148386021913960400191505060405180910390fd5b809150505b92915050565b6000808211614406576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161440f57fe5b04905092915050565b600082821115614490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080600060db60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020549250600060dc60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905061456281614554613817565b61441890919063ffffffff16565b91506145f5670de0b6b3a76400006145e76145d860ca60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a81526020019081526020016000205460c95461441890919063ffffffff16565b8761430990919063ffffffff16565b61438f90919063ffffffff16565b92506201518082101561460b576000925061465c565b6146136121a8565b82101561465b576146588361464a8561463c8661462e6121a8565b61438f90919063ffffffff16565b61430990919063ffffffff16565b61441890919063ffffffff16565b92505b5b600060db60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878152602001908152602001600020819055506146c78360e05461441890919063ffffffff16565b60e0819055506146e28460df5461441890919063ffffffff16565b60df81905550600060dc60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002081905550848673ffffffffffffffffffffffffffffffffffffffff167fe97aaf9c5be9d8a2a75963d3b0fe81d793e8e9e268fe73ab6c70acc285332c058686604051808381526020018281526020019250505060405180910390a350925092509256fe73686f756c646e27742062652067726561746572207468616e2031383020646179734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573736465706f73697420616d6f756e742073686f756c64206265206d6f7265207468616e2030496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77746f74616c5573657242616c616e63653a20766f7465722061646472657373206973206e6f742076616c6964646973747269627574653a20616d6f756e74206d7573742062652067726561746572207468616e203073686f756c64206265206c657373207468616e206f7220657175616c20746f203120657468657273686f756c646e27742062652067726561746572207468616e2033302064617973a2646970667358221220502ef8612ac6b1699c2b81b6c7b1d5d044d89ad6c8557082bfd438bd2011524064736f6c63430007000033

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.