ETH Price: $1,582.83 (-0.48%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CollectorStakingPoolV2a

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : CollectorStakingPoolV2a.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

/**
 * Staking pool for the score calculated by the polymon-collector-staking-backend.
 */
contract CollectorStakingPoolV2a is Initializable, OwnableUpgradeable {
    using SafeERC20 for IERC20;

    uint256 private constant DIV_PRECISION = 1e18;

    struct PendingRewardResult {
        uint256 intervalId;
        uint256 reward;
    }

    struct PendingRewardRequest {
        uint256 intervalId;
        uint256 points;
        uint256 totalPoints;
    }

    struct UserData {
        uint256 lastHarvestedInterval;
    }

    struct Interval {
        uint256 rewardAmount;
        uint256 claimedRewardAmount;
    }

    // PMON
    IERC20 private token;

    // expireAfter = 4 means there are up to 3 closed intervals and 1 open
    uint256 public expireAfter;
    uint256 public intervalLengthInSec;

    address trustedSigner;

    uint256 public nextIntervalTimestamp;
    uint256 public intervalIdCounter;
    mapping(uint256 => Interval) idToInterval;

    mapping(uint256 => UserData) userIdToUserData;

    event AddRewards(uint256 amount);
    event IntervalClosed(uint256 newInterval);
    event RedistributeRewards(uint256 unclaimedRewards);

    function initialize(
        IERC20 _token,
        uint256 _expireAfter,
        uint256 _intervalLengthInSec,
        uint256 endOfFirstInterval,
        address _trustedSigner
    ) public initializer {
        intervalIdCounter = 1;
        token = _token;
        expireAfter = _expireAfter;
        intervalLengthInSec = _intervalLengthInSec;
        nextIntervalTimestamp = endOfFirstInterval;
        trustedSigner = _trustedSigner;
        OwnableUpgradeable.__Ownable_init();
    }

    function setExpireAfter(uint256 _expireAfter) external onlyOwner {
        if (isNextIntervalReached()) {
            // cleanup the current state first if necessary
            closeCurrentInterval();
        }
        if (_expireAfter < expireAfter && intervalIdCounter > _expireAfter) {
            // cleanup expired intervals
            uint256 iStart = 1;
            if (intervalIdCounter > expireAfter) {
                iStart = intervalIdCounter - expireAfter;
            }
            for (uint256 i = iStart; i < intervalIdCounter - _expireAfter; i++) {
                redistributeRewards(i);
            }
        }
        expireAfter = _expireAfter;
    }

    function redistributeRewards(uint256 intervalId) private {
        Interval memory oldInterval = idToInterval[intervalId];
        if (oldInterval.rewardAmount > 0 && oldInterval.rewardAmount > oldInterval.claimedRewardAmount) {
            // redistribute unclaimed rewards
            uint256 unclaimedRewards = oldInterval.rewardAmount - oldInterval.claimedRewardAmount;
            if (unclaimedRewards > 0) {
                idToInterval[intervalIdCounter].rewardAmount += unclaimedRewards;
                emit RedistributeRewards(unclaimedRewards);
            }
            delete idToInterval[intervalId];
        }
    }

    function setTrustedSigner(address _trustedSigner) external onlyOwner {
        trustedSigner = _trustedSigner;
    }

    /**
     * The new interval length does not affect the current interval
     */
    function setIntervalLengthInSec(uint256 _intervalLengthInSec) external onlyOwner {
        intervalLengthInSec = _intervalLengthInSec;
    }

    function isNextIntervalReached() private view returns (bool) {
        return block.timestamp >= nextIntervalTimestamp;
    }

    function addRewards(uint256 amount) external {
        require(amount > 0, "Amount must be greater than zero");
        if (isNextIntervalReached()) {
            closeCurrentInterval();
        }
        token.safeTransferFrom(msg.sender, address(this), amount);
        // add rewards to the current interval
        idToInterval[intervalIdCounter].rewardAmount += amount;
        emit AddRewards(amount);
    }

    function closeCurrentInterval() private {
        ++intervalIdCounter;
        nextIntervalTimestamp += intervalLengthInSec;
        // cleanup expired interval
        if (intervalIdCounter > expireAfter) {
            redistributeRewards(intervalIdCounter - expireAfter);
        }
        emit IntervalClosed(intervalIdCounter - 1);
    }

    function splitSignature(bytes memory signature) private pure returns (uint8, bytes32, bytes32) {
        bytes32 sigR;
        bytes32 sigS;
        uint8 sigV;
        assembly {
            sigR := mload(add(signature, 32))
            sigS := mload(add(signature, 64))
            sigV := byte(0, mload(add(signature, 96)))
        }
        return (sigV, sigR, sigS);
    }

    /**
     * Check the signature of the harvest function.
     */
    function signatureVerification(
        uint256 userId,
        address[] memory userWallets,
        uint256[] memory harvestRequests,
        bytes memory signature
    )
    private
    returns (bool)
    {
        bytes32 sigR;
        bytes32 sigS;
        uint8 sigV;
        (sigV, sigR, sigS) = splitSignature(signature);
        bytes32 msg = keccak256(abi.encodePacked(userId, userWallets, harvestRequests));
        return trustedSigner == ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", msg)), sigV, sigR, sigS);
    }

    /**
     * To make it easier to verify the signature, harvestRequests contains an intervalId in each even index and the
     * reward for the interval in the next odd index.
     */
    function harvest(
        uint256 userId,
        address[] memory userWallets,
        uint256[] memory harvestRequests,
        bytes memory signature
    )
    external
    {
        bool senderAssociatedWithTheUser = false;
        for (uint i = 0; i < userWallets.length && !senderAssociatedWithTheUser; i++) {
            senderAssociatedWithTheUser = msg.sender == userWallets[i];
        }
        require(
            senderAssociatedWithTheUser,
            "Sender is not associated with the user"
        );
        require(
            signatureVerification(userId, userWallets, harvestRequests, signature),
            "Invalid signer or signature"
        );
        if (isNextIntervalReached()) {
            closeCurrentInterval();
        }

        uint256 totalRewards = 0;
        for (uint i = 0; i < harvestRequests.length; i += 2) {
            uint256 intervalId = harvestRequests[i];
            // all of the latest harvest intervals have to be older than the current. Prevent double harvest.
            require(
                userIdToUserData[userId].lastHarvestedInterval < intervalId,
                "Tried to harvest already harvested interval"
            );
            // Prevent harvest of expired interval.
            require(
                intervalIdCounter < intervalId + expireAfter,
                "Tried to harvest expired interval"
            );
            uint256 reward = harvestRequests[i + 1];
            // update latest harvest interval
            userIdToUserData[userId].lastHarvestedInterval = intervalId;
            // update the claimed rewards for this interval
            idToInterval[intervalId].claimedRewardAmount += reward;
            // sum total rewards
            totalRewards += reward;
        }
        // transfer reward to the user
        token.safeTransfer(msg.sender, totalRewards);
    }

    function isExpiredButNotProcessed(uint256 intervalId) private view returns (bool) {
        return isNextIntervalReached()
                && intervalIdCounter + 1 > expireAfter
                && intervalIdCounter - expireAfter == intervalId;
    }

    function pendingRewards(uint256 userId, PendingRewardRequest[] memory pendingRewardRequests)
    external
    view
    returns (PendingRewardResult[] memory)
    {
        uint256 lastHarvestedInterval = userIdToUserData[userId].lastHarvestedInterval;
        PendingRewardResult[] memory rewards = new PendingRewardResult[](pendingRewardRequests.length);
        // calculate rewards for each interval
        for (uint i = 0; i < pendingRewardRequests.length; i++) {
            PendingRewardRequest memory request = pendingRewardRequests[i];
            // only calculate rewards for valid interval ID's
            if (
                // interval is not already harvested
                lastHarvestedInterval < request.intervalId
                // interval is closed
                && (request.intervalId < intervalIdCounter || (request.intervalId == intervalIdCounter && isNextIntervalReached()))
                && !isExpiredButNotProcessed(request.intervalId)
            ) {
                rewards[i] = PendingRewardResult(
                    request.intervalId,
                    calculateReward(idToInterval[request.intervalId].rewardAmount, request.totalPoints, request.points)
                );
            } else {
                rewards[i] = PendingRewardResult(request.intervalId, 0);
            }
        }
        return rewards;
    }

    function calculateReward(uint256 intervalRewardAmount, uint256 totalPointsForTheInterval, uint256 points)
    private
    view
    returns (uint256)
    {
        return intervalRewardAmount * DIV_PRECISION / totalPointsForTheInterval * points / DIV_PRECISION;
    }

    function getLastHarvestedInterval(uint256 userId)
    external
    view
    returns (uint256)
    {
        return userIdToUserData[userId].lastHarvestedInterval;
    }

    function recoverToken(address _token, uint256 amount) external onlyOwner {
        IERC20(_token).safeTransfer(_msgSender(), amount);
    }
}

File 2 of 8 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
 * @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 3 of 8 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

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

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

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

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

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

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 4 of 8 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 5 of 8 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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) {
        return msg.sender;
    }

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

File 6 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 7 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

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

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

File 8 of 8 : Address.sol
// SPDX-License-Identifier: MIT

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

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newInterval","type":"uint256"}],"name":"IntervalClosed","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":"uint256","name":"unclaimedRewards","type":"uint256"}],"name":"RedistributeRewards","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expireAfter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"}],"name":"getLastHarvestedInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"},{"internalType":"address[]","name":"userWallets","type":"address[]"},{"internalType":"uint256[]","name":"harvestRequests","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_expireAfter","type":"uint256"},{"internalType":"uint256","name":"_intervalLengthInSec","type":"uint256"},{"internalType":"uint256","name":"endOfFirstInterval","type":"uint256"},{"internalType":"address","name":"_trustedSigner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"intervalIdCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"intervalLengthInSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextIntervalTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"},{"components":[{"internalType":"uint256","name":"intervalId","type":"uint256"},{"internalType":"uint256","name":"points","type":"uint256"},{"internalType":"uint256","name":"totalPoints","type":"uint256"}],"internalType":"struct CollectorStakingPoolV2a.PendingRewardRequest[]","name":"pendingRewardRequests","type":"tuple[]"}],"name":"pendingRewards","outputs":[{"components":[{"internalType":"uint256","name":"intervalId","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"}],"internalType":"struct CollectorStakingPoolV2a.PendingRewardResult[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expireAfter","type":"uint256"}],"name":"setExpireAfter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_intervalLengthInSec","type":"uint256"}],"name":"setIntervalLengthInSec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_trustedSigner","type":"address"}],"name":"setTrustedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50612f7a806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639145e45511610097578063beceed3911610066578063beceed391461025f578063c08ff4881461027b578063c9709588146102ab578063f2fde38b146102c957610100565b80639145e455146101d7578063a9e11600146101f5578063b29a814014610225578063b7b8533a1461024157610100565b8063715018a6116100d3578063715018a6146101755780637291caa21461017f5780638da5cb5b1461019b57806390aa5ac7146101b957610100565b8063070cc24d1461010557806356a1c70114610121578063614997351461013d5780636c28e34914610159575b600080fd5b61011f600480360381019061011a9190611b1c565b6102e5565b005b61013b60048036038101906101369190611ba7565b6103f7565b005b61015760048036038101906101529190611ea5565b6104b7565b005b610173600480360381019061016e9190611f9e565b610790565b005b61017d610915565b005b61019960048036038101906101949190611b1c565b610a52565b005b6101a3610ad8565b6040516101b09190612028565b60405180910390f35b6101c1610b02565b6040516101ce9190612052565b60405180910390f35b6101df610b08565b6040516101ec9190612052565b60405180910390f35b61020f600480360381019061020a9190612199565b610b0e565b60405161021c91906122e2565b60405180910390f35b61023f600480360381019061023a9190612304565b610cc3565b005b610249610d75565b6040516102569190612052565b60405180910390f35b61027960048036038101906102749190611b1c565b610d7b565b005b61029560048036038101906102909190611b1c565b610e8c565b6040516102a29190612052565b60405180910390f35b6102b3610eac565b6040516102c09190612052565b60405180910390f35b6102e360048036038101906102de9190611ba7565b610eb2565b005b6102ed61105d565b73ffffffffffffffffffffffffffffffffffffffff1661030b610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610361576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610358906123a1565b60405180910390fd5b610369611065565b1561037757610376611072565b5b60665481108015610389575080606a54115b156103ed57600060019050606654606a5411156103b357606654606a546103b091906123f0565b90505b60008190505b82606a546103c791906123f0565b8110156103ea576103d78161110f565b80806103e290612424565b9150506103b9565b50505b8060668190555050565b6103ff61105d565b73ffffffffffffffffffffffffffffffffffffffff1661041d610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046a906123a1565b60405180910390fd5b80606860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000805b8451811080156104c9575081155b1561052c578481815181106104e1576104e061246c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16149150808061052490612424565b9150506104bb565b508061056d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105649061250d565b60405180910390fd5b61057985858585611219565b6105b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105af90612579565b60405180910390fd5b6105c0611065565b156105ce576105cd611072565b5b6000805b845181101561073a5760008582815181106105f0576105ef61246c565b5b6020026020010151905080606c60008a81526020019081526020016000206000015410610652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106499061260b565b60405180910390fd5b60665481610660919061262b565b606a54106106a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069a906126d1565b60405180910390fd5b6000866001846106b3919061262b565b815181106106c4576106c361246c565b5b6020026020010151905081606c60008b81526020019081526020016000206000018190555080606b6000848152602001908152602001600020600101600082825461070f919061262b565b925050819055508084610722919061262b565b93505050600281610733919061262b565b90506105d2565b506107883382606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113369092919063ffffffff16565b505050505050565b600060019054906101000a900460ff16806107b6575060008054906101000a900460ff16155b6107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015610845576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6001606a8190555085606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084606681905550836067819055508260698190555081606860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108ec6113bc565b801561090d5760008060016101000a81548160ff0219169083151502179055505b505050505050565b61091d61105d565b73ffffffffffffffffffffffffffffffffffffffff1661093b610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610991576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610988906123a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a5a61105d565b73ffffffffffffffffffffffffffffffffffffffff16610a78610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac5906123a1565b60405180910390fd5b8060678190555050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60695481565b606a5481565b60606000606c60008581526020019081526020016000206000015490506000835167ffffffffffffffff811115610b4857610b47611bea565b5b604051908082528060200260200182016040528015610b8157816020015b610b6e611ab8565b815260200190600190039081610b665790505b50905060005b8451811015610cb7576000858281518110610ba557610ba461246c565b5b60200260200101519050806000015184108015610be75750606a5481600001511080610be65750606a548160000151148015610be55750610be4611065565b5b5b5b8015610bfd5750610bfb81600001516114a5565b155b15610c6a57604051806040016040528082600001518152602001610c44606b60008560000151815260200190815260200160002060000154846040015185602001516114eb565b815250838381518110610c5a57610c5961246c565b5b6020026020010181905250610ca3565b6040518060400160405280826000015181526020016000815250838381518110610c9757610c9661246c565b5b60200260200101819052505b508080610caf90612424565b915050610b87565b50809250505092915050565b610ccb61105d565b73ffffffffffffffffffffffffffffffffffffffff16610ce9610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d36906123a1565b60405180910390fd5b610d71610d4a61105d565b828473ffffffffffffffffffffffffffffffffffffffff166113369092919063ffffffff16565b5050565b60665481565b60008111610dbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db5906127cf565b60405180910390fd5b610dc6611065565b15610dd457610dd3611072565b5b610e23333083606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611533909392919063ffffffff16565b80606b6000606a5481526020019081526020016000206000016000828254610e4b919061262b565b925050819055507fa8c8f6c9639d5a378696689ad02c4ea707de67f3175f609f1c016d3ce942978981604051610e819190612052565b60405180910390a150565b6000606c6000838152602001908152602001600020600001549050919050565b60675481565b610eba61105d565b73ffffffffffffffffffffffffffffffffffffffff16610ed8610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610f2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f25906123a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9490612861565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b6000606954421015905090565b606a6000815461108190612424565b919050819055506067546069600082825461109c919061262b565b92505081905550606654606a5411156110c8576110c7606654606a546110c291906123f0565b61110f565b5b7f40396f5f47af716023f2fa148e8c0dc30c8820e94273767ad3cb3959491d49f16001606a546110f891906123f0565b6040516111059190612052565b60405180910390a1565b6000606b600083815260200190815260200160002060405180604001604052908160008201548152602001600182015481525050905060008160000151118015611160575080602001518160000151115b156112155760008160200151826000015161117b91906123f0565b905060008111156111ed5780606b6000606a54815260200190815260200160002060000160008282546111ae919061262b565b925050819055507f2ed6f36e01d6b971ea55b4cc2b61cb29b4cbf84042232cd0fa2418978989f87d816040516111e49190612052565b60405180910390a15b606b600084815260200190815260200160002060008082016000905560018201600090555050505b5050565b600080600080611228856115bc565b809450819550829350505050600088888860405160200161124b93929190612a12565b6040516020818303038152906040528051906020012090506001816040516020016112769190612ac9565b60405160208183030381529060405280519060200120838686604051600081526020016040526040516112ac9493929190612b1a565b6020604051602081039080840390855afa1580156112ce573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16606860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614945050505050949350505050565b6113b78363a9059cbb60e01b8484604051602401611355929190612b5f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115f0565b505050565b600060019054906101000a900460ff16806113e2575060008054906101000a900460ff16155b611421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141890612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015611471576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6114796116b7565b611481611790565b80156114a25760008060016101000a81548160ff0219169083151502179055505b50565b60006114af611065565b80156114ca57506066546001606a546114c8919061262b565b115b80156114e4575081606654606a546114e291906123f0565b145b9050919050565b6000670de0b6b3a76400008284670de0b6b3a76400008761150c9190612b88565b6115169190612bf9565b6115209190612b88565b61152a9190612bf9565b90509392505050565b6115b6846323b872dd60e01b85858560405160240161155493929190612c2a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115f0565b50505050565b6000806000806000806020870151925060408701519150606087015160001a90508083839550955095505050509193909250565b6000611652826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166119129092919063ffffffff16565b90506000815111156116b257808060200190518101906116729190612c99565b6116b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a890612d38565b60405180910390fd5b5b505050565b600060019054906101000a900460ff16806116dd575060008054906101000a900460ff16155b61171c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171390612763565b60405180910390fd5b60008060019054906101000a900460ff16159050801561176c576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b801561178d5760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806117b6575060008054906101000a900460ff16155b6117f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ec90612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015611845576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600061184f61105d565b905080603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350801561190f5760008060016101000a81548160ff0219169083151502179055505b50565b6060611921848460008561192a565b90509392505050565b60608247101561196f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196690612dca565b60405180910390fd5b61197885611a3e565b6119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90612e36565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516119e09190612ec7565b60006040518083038185875af1925050503d8060008114611a1d576040519150601f19603f3d011682016040523d82523d6000602084013e611a22565b606091505b5091509150611a32828286611a51565b92505050949350505050565b600080823b905060008111915050919050565b60608315611a6157829050611ab1565b600083511115611a745782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa89190612f22565b60405180910390fd5b9392505050565b604051806040016040528060008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611af981611ae6565b8114611b0457600080fd5b50565b600081359050611b1681611af0565b92915050565b600060208284031215611b3257611b31611adc565b5b6000611b4084828501611b07565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611b7482611b49565b9050919050565b611b8481611b69565b8114611b8f57600080fd5b50565b600081359050611ba181611b7b565b92915050565b600060208284031215611bbd57611bbc611adc565b5b6000611bcb84828501611b92565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611c2282611bd9565b810181811067ffffffffffffffff82111715611c4157611c40611bea565b5b80604052505050565b6000611c54611ad2565b9050611c608282611c19565b919050565b600067ffffffffffffffff821115611c8057611c7f611bea565b5b602082029050602081019050919050565b600080fd5b6000611ca9611ca484611c65565b611c4a565b90508083825260208201905060208402830185811115611ccc57611ccb611c91565b5b835b81811015611cf55780611ce18882611b92565b845260208401935050602081019050611cce565b5050509392505050565b600082601f830112611d1457611d13611bd4565b5b8135611d24848260208601611c96565b91505092915050565b600067ffffffffffffffff821115611d4857611d47611bea565b5b602082029050602081019050919050565b6000611d6c611d6784611d2d565b611c4a565b90508083825260208201905060208402830185811115611d8f57611d8e611c91565b5b835b81811015611db85780611da48882611b07565b845260208401935050602081019050611d91565b5050509392505050565b600082601f830112611dd757611dd6611bd4565b5b8135611de7848260208601611d59565b91505092915050565b600080fd5b600067ffffffffffffffff821115611e1057611e0f611bea565b5b611e1982611bd9565b9050602081019050919050565b82818337600083830152505050565b6000611e48611e4384611df5565b611c4a565b905082815260208101848484011115611e6457611e63611df0565b5b611e6f848285611e26565b509392505050565b600082601f830112611e8c57611e8b611bd4565b5b8135611e9c848260208601611e35565b91505092915050565b60008060008060808587031215611ebf57611ebe611adc565b5b6000611ecd87828801611b07565b945050602085013567ffffffffffffffff811115611eee57611eed611ae1565b5b611efa87828801611cff565b935050604085013567ffffffffffffffff811115611f1b57611f1a611ae1565b5b611f2787828801611dc2565b925050606085013567ffffffffffffffff811115611f4857611f47611ae1565b5b611f5487828801611e77565b91505092959194509250565b6000611f6b82611b69565b9050919050565b611f7b81611f60565b8114611f8657600080fd5b50565b600081359050611f9881611f72565b92915050565b600080600080600060a08688031215611fba57611fb9611adc565b5b6000611fc888828901611f89565b9550506020611fd988828901611b07565b9450506040611fea88828901611b07565b9350506060611ffb88828901611b07565b925050608061200c88828901611b92565b9150509295509295909350565b61202281611b69565b82525050565b600060208201905061203d6000830184612019565b92915050565b61204c81611ae6565b82525050565b60006020820190506120676000830184612043565b92915050565b600067ffffffffffffffff82111561208857612087611bea565b5b602082029050602081019050919050565b600080fd5b6000606082840312156120b4576120b3612099565b5b6120be6060611c4a565b905060006120ce84828501611b07565b60008301525060206120e284828501611b07565b60208301525060406120f684828501611b07565b60408301525092915050565b60006121156121108461206d565b611c4a565b9050808382526020820190506060840283018581111561213857612137611c91565b5b835b81811015612161578061214d888261209e565b84526020840193505060608101905061213a565b5050509392505050565b600082601f8301126121805761217f611bd4565b5b8135612190848260208601612102565b91505092915050565b600080604083850312156121b0576121af611adc565b5b60006121be85828601611b07565b925050602083013567ffffffffffffffff8111156121df576121de611ae1565b5b6121eb8582860161216b565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61222a81611ae6565b82525050565b6040820160008201516122466000850182612221565b5060208201516122596020850182612221565b50505050565b600061226b8383612230565b60408301905092915050565b6000602082019050919050565b600061228f826121f5565b6122998185612200565b93506122a483612211565b8060005b838110156122d55781516122bc888261225f565b97506122c783612277565b9250506001810190506122a8565b5085935050505092915050565b600060208201905081810360008301526122fc8184612284565b905092915050565b6000806040838503121561231b5761231a611adc565b5b600061232985828601611b92565b925050602061233a85828601611b07565b9150509250929050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061238b602083612344565b915061239682612355565b602082019050919050565b600060208201905081810360008301526123ba8161237e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006123fb82611ae6565b915061240683611ae6565b925082820390508181111561241e5761241d6123c1565b5b92915050565b600061242f82611ae6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612461576124606123c1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f53656e646572206973206e6f74206173736f636961746564207769746820746860008201527f6520757365720000000000000000000000000000000000000000000000000000602082015250565b60006124f7602683612344565b91506125028261249b565b604082019050919050565b60006020820190508181036000830152612526816124ea565b9050919050565b7f496e76616c6964207369676e6572206f72207369676e61747572650000000000600082015250565b6000612563601b83612344565b915061256e8261252d565b602082019050919050565b6000602082019050818103600083015261259281612556565b9050919050565b7f547269656420746f206861727665737420616c7265616479206861727665737460008201527f656420696e74657276616c000000000000000000000000000000000000000000602082015250565b60006125f5602b83612344565b915061260082612599565b604082019050919050565b60006020820190508181036000830152612624816125e8565b9050919050565b600061263682611ae6565b915061264183611ae6565b9250828201905080821115612659576126586123c1565b5b92915050565b7f547269656420746f2068617276657374206578706972656420696e746572766160008201527f6c00000000000000000000000000000000000000000000000000000000000000602082015250565b60006126bb602183612344565b91506126c68261265f565b604082019050919050565b600060208201905081810360008301526126ea816126ae565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b600061274d602e83612344565b9150612758826126f1565b604082019050919050565b6000602082019050818103600083015261277c81612740565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e207a65726f600082015250565b60006127b9602083612344565b91506127c482612783565b602082019050919050565b600060208201905081810360008301526127e8816127ac565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061284b602683612344565b9150612856826127ef565b604082019050919050565b6000602082019050818103600083015261287a8161283e565b9050919050565b6000819050919050565b61289c61289782611ae6565b612881565b82525050565b600081519050919050565b600081905092915050565b6000819050602082019050919050565b6128d181611b69565b82525050565b60006128e383836128c8565b60208301905092915050565b6000602082019050919050565b6000612907826128a2565b61291181856128ad565b935061291c836128b8565b8060005b8381101561294d57815161293488826128d7565b975061293f836128ef565b925050600181019050612920565b5085935050505092915050565b600081519050919050565b600081905092915050565b6000819050602082019050919050565b61298981611ae6565b82525050565b600061299b8383612980565b60208301905092915050565b6000602082019050919050565b60006129bf8261295a565b6129c98185612965565b93506129d483612970565b8060005b83811015612a055781516129ec888261298f565b97506129f7836129a7565b9250506001810190506129d8565b5085935050505092915050565b6000612a1e828661288b565b602082019150612a2e82856128fc565b9150612a3a82846129b4565b9150819050949350505050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000612a88601c83612a47565b9150612a9382612a52565b601c82019050919050565b6000819050919050565b6000819050919050565b612ac3612abe82612a9e565b612aa8565b82525050565b6000612ad482612a7b565b9150612ae08284612ab2565b60208201915081905092915050565b612af881612a9e565b82525050565b600060ff82169050919050565b612b1481612afe565b82525050565b6000608082019050612b2f6000830187612aef565b612b3c6020830186612b0b565b612b496040830185612aef565b612b566060830184612aef565b95945050505050565b6000604082019050612b746000830185612019565b612b816020830184612043565b9392505050565b6000612b9382611ae6565b9150612b9e83611ae6565b9250828202612bac81611ae6565b91508282048414831517612bc357612bc26123c1565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612c0482611ae6565b9150612c0f83611ae6565b925082612c1f57612c1e612bca565b5b828204905092915050565b6000606082019050612c3f6000830186612019565b612c4c6020830185612019565b612c596040830184612043565b949350505050565b60008115159050919050565b612c7681612c61565b8114612c8157600080fd5b50565b600081519050612c9381612c6d565b92915050565b600060208284031215612caf57612cae611adc565b5b6000612cbd84828501612c84565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612d22602a83612344565b9150612d2d82612cc6565b604082019050919050565b60006020820190508181036000830152612d5181612d15565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612db4602683612344565b9150612dbf82612d58565b604082019050919050565b60006020820190508181036000830152612de381612da7565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612e20601d83612344565b9150612e2b82612dea565b602082019050919050565b60006020820190508181036000830152612e4f81612e13565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612e8a578082015181840152602081019050612e6f565b60008484015250505050565b6000612ea182612e56565b612eab8185612e61565b9350612ebb818560208601612e6c565b80840191505092915050565b6000612ed38284612e96565b915081905092915050565b600081519050919050565b6000612ef482612ede565b612efe8185612344565b9350612f0e818560208601612e6c565b612f1781611bd9565b840191505092915050565b60006020820190508181036000830152612f3c8184612ee9565b90509291505056fea26469706673582212203adb2c9a4847bd6eb2a2b8b4551a9adf3669bf1d3bc9dc9c5232f375d208805364736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c80639145e45511610097578063beceed3911610066578063beceed391461025f578063c08ff4881461027b578063c9709588146102ab578063f2fde38b146102c957610100565b80639145e455146101d7578063a9e11600146101f5578063b29a814014610225578063b7b8533a1461024157610100565b8063715018a6116100d3578063715018a6146101755780637291caa21461017f5780638da5cb5b1461019b57806390aa5ac7146101b957610100565b8063070cc24d1461010557806356a1c70114610121578063614997351461013d5780636c28e34914610159575b600080fd5b61011f600480360381019061011a9190611b1c565b6102e5565b005b61013b60048036038101906101369190611ba7565b6103f7565b005b61015760048036038101906101529190611ea5565b6104b7565b005b610173600480360381019061016e9190611f9e565b610790565b005b61017d610915565b005b61019960048036038101906101949190611b1c565b610a52565b005b6101a3610ad8565b6040516101b09190612028565b60405180910390f35b6101c1610b02565b6040516101ce9190612052565b60405180910390f35b6101df610b08565b6040516101ec9190612052565b60405180910390f35b61020f600480360381019061020a9190612199565b610b0e565b60405161021c91906122e2565b60405180910390f35b61023f600480360381019061023a9190612304565b610cc3565b005b610249610d75565b6040516102569190612052565b60405180910390f35b61027960048036038101906102749190611b1c565b610d7b565b005b61029560048036038101906102909190611b1c565b610e8c565b6040516102a29190612052565b60405180910390f35b6102b3610eac565b6040516102c09190612052565b60405180910390f35b6102e360048036038101906102de9190611ba7565b610eb2565b005b6102ed61105d565b73ffffffffffffffffffffffffffffffffffffffff1661030b610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610361576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610358906123a1565b60405180910390fd5b610369611065565b1561037757610376611072565b5b60665481108015610389575080606a54115b156103ed57600060019050606654606a5411156103b357606654606a546103b091906123f0565b90505b60008190505b82606a546103c791906123f0565b8110156103ea576103d78161110f565b80806103e290612424565b9150506103b9565b50505b8060668190555050565b6103ff61105d565b73ffffffffffffffffffffffffffffffffffffffff1661041d610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046a906123a1565b60405180910390fd5b80606860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000805b8451811080156104c9575081155b1561052c578481815181106104e1576104e061246c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16149150808061052490612424565b9150506104bb565b508061056d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105649061250d565b60405180910390fd5b61057985858585611219565b6105b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105af90612579565b60405180910390fd5b6105c0611065565b156105ce576105cd611072565b5b6000805b845181101561073a5760008582815181106105f0576105ef61246c565b5b6020026020010151905080606c60008a81526020019081526020016000206000015410610652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106499061260b565b60405180910390fd5b60665481610660919061262b565b606a54106106a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069a906126d1565b60405180910390fd5b6000866001846106b3919061262b565b815181106106c4576106c361246c565b5b6020026020010151905081606c60008b81526020019081526020016000206000018190555080606b6000848152602001908152602001600020600101600082825461070f919061262b565b925050819055508084610722919061262b565b93505050600281610733919061262b565b90506105d2565b506107883382606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113369092919063ffffffff16565b505050505050565b600060019054906101000a900460ff16806107b6575060008054906101000a900460ff16155b6107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015610845576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6001606a8190555085606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084606681905550836067819055508260698190555081606860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108ec6113bc565b801561090d5760008060016101000a81548160ff0219169083151502179055505b505050505050565b61091d61105d565b73ffffffffffffffffffffffffffffffffffffffff1661093b610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610991576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610988906123a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a5a61105d565b73ffffffffffffffffffffffffffffffffffffffff16610a78610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac5906123a1565b60405180910390fd5b8060678190555050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60695481565b606a5481565b60606000606c60008581526020019081526020016000206000015490506000835167ffffffffffffffff811115610b4857610b47611bea565b5b604051908082528060200260200182016040528015610b8157816020015b610b6e611ab8565b815260200190600190039081610b665790505b50905060005b8451811015610cb7576000858281518110610ba557610ba461246c565b5b60200260200101519050806000015184108015610be75750606a5481600001511080610be65750606a548160000151148015610be55750610be4611065565b5b5b5b8015610bfd5750610bfb81600001516114a5565b155b15610c6a57604051806040016040528082600001518152602001610c44606b60008560000151815260200190815260200160002060000154846040015185602001516114eb565b815250838381518110610c5a57610c5961246c565b5b6020026020010181905250610ca3565b6040518060400160405280826000015181526020016000815250838381518110610c9757610c9661246c565b5b60200260200101819052505b508080610caf90612424565b915050610b87565b50809250505092915050565b610ccb61105d565b73ffffffffffffffffffffffffffffffffffffffff16610ce9610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d36906123a1565b60405180910390fd5b610d71610d4a61105d565b828473ffffffffffffffffffffffffffffffffffffffff166113369092919063ffffffff16565b5050565b60665481565b60008111610dbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db5906127cf565b60405180910390fd5b610dc6611065565b15610dd457610dd3611072565b5b610e23333083606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611533909392919063ffffffff16565b80606b6000606a5481526020019081526020016000206000016000828254610e4b919061262b565b925050819055507fa8c8f6c9639d5a378696689ad02c4ea707de67f3175f609f1c016d3ce942978981604051610e819190612052565b60405180910390a150565b6000606c6000838152602001908152602001600020600001549050919050565b60675481565b610eba61105d565b73ffffffffffffffffffffffffffffffffffffffff16610ed8610ad8565b73ffffffffffffffffffffffffffffffffffffffff1614610f2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f25906123a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9490612861565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b6000606954421015905090565b606a6000815461108190612424565b919050819055506067546069600082825461109c919061262b565b92505081905550606654606a5411156110c8576110c7606654606a546110c291906123f0565b61110f565b5b7f40396f5f47af716023f2fa148e8c0dc30c8820e94273767ad3cb3959491d49f16001606a546110f891906123f0565b6040516111059190612052565b60405180910390a1565b6000606b600083815260200190815260200160002060405180604001604052908160008201548152602001600182015481525050905060008160000151118015611160575080602001518160000151115b156112155760008160200151826000015161117b91906123f0565b905060008111156111ed5780606b6000606a54815260200190815260200160002060000160008282546111ae919061262b565b925050819055507f2ed6f36e01d6b971ea55b4cc2b61cb29b4cbf84042232cd0fa2418978989f87d816040516111e49190612052565b60405180910390a15b606b600084815260200190815260200160002060008082016000905560018201600090555050505b5050565b600080600080611228856115bc565b809450819550829350505050600088888860405160200161124b93929190612a12565b6040516020818303038152906040528051906020012090506001816040516020016112769190612ac9565b60405160208183030381529060405280519060200120838686604051600081526020016040526040516112ac9493929190612b1a565b6020604051602081039080840390855afa1580156112ce573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16606860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614945050505050949350505050565b6113b78363a9059cbb60e01b8484604051602401611355929190612b5f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115f0565b505050565b600060019054906101000a900460ff16806113e2575060008054906101000a900460ff16155b611421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141890612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015611471576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6114796116b7565b611481611790565b80156114a25760008060016101000a81548160ff0219169083151502179055505b50565b60006114af611065565b80156114ca57506066546001606a546114c8919061262b565b115b80156114e4575081606654606a546114e291906123f0565b145b9050919050565b6000670de0b6b3a76400008284670de0b6b3a76400008761150c9190612b88565b6115169190612bf9565b6115209190612b88565b61152a9190612bf9565b90509392505050565b6115b6846323b872dd60e01b85858560405160240161155493929190612c2a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115f0565b50505050565b6000806000806000806020870151925060408701519150606087015160001a90508083839550955095505050509193909250565b6000611652826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166119129092919063ffffffff16565b90506000815111156116b257808060200190518101906116729190612c99565b6116b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a890612d38565b60405180910390fd5b5b505050565b600060019054906101000a900460ff16806116dd575060008054906101000a900460ff16155b61171c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171390612763565b60405180910390fd5b60008060019054906101000a900460ff16159050801561176c576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b801561178d5760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff16806117b6575060008054906101000a900460ff16155b6117f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ec90612763565b60405180910390fd5b60008060019054906101000a900460ff161590508015611845576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600061184f61105d565b905080603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350801561190f5760008060016101000a81548160ff0219169083151502179055505b50565b6060611921848460008561192a565b90509392505050565b60608247101561196f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196690612dca565b60405180910390fd5b61197885611a3e565b6119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90612e36565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516119e09190612ec7565b60006040518083038185875af1925050503d8060008114611a1d576040519150601f19603f3d011682016040523d82523d6000602084013e611a22565b606091505b5091509150611a32828286611a51565b92505050949350505050565b600080823b905060008111915050919050565b60608315611a6157829050611ab1565b600083511115611a745782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa89190612f22565b60405180910390fd5b9392505050565b604051806040016040528060008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611af981611ae6565b8114611b0457600080fd5b50565b600081359050611b1681611af0565b92915050565b600060208284031215611b3257611b31611adc565b5b6000611b4084828501611b07565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611b7482611b49565b9050919050565b611b8481611b69565b8114611b8f57600080fd5b50565b600081359050611ba181611b7b565b92915050565b600060208284031215611bbd57611bbc611adc565b5b6000611bcb84828501611b92565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611c2282611bd9565b810181811067ffffffffffffffff82111715611c4157611c40611bea565b5b80604052505050565b6000611c54611ad2565b9050611c608282611c19565b919050565b600067ffffffffffffffff821115611c8057611c7f611bea565b5b602082029050602081019050919050565b600080fd5b6000611ca9611ca484611c65565b611c4a565b90508083825260208201905060208402830185811115611ccc57611ccb611c91565b5b835b81811015611cf55780611ce18882611b92565b845260208401935050602081019050611cce565b5050509392505050565b600082601f830112611d1457611d13611bd4565b5b8135611d24848260208601611c96565b91505092915050565b600067ffffffffffffffff821115611d4857611d47611bea565b5b602082029050602081019050919050565b6000611d6c611d6784611d2d565b611c4a565b90508083825260208201905060208402830185811115611d8f57611d8e611c91565b5b835b81811015611db85780611da48882611b07565b845260208401935050602081019050611d91565b5050509392505050565b600082601f830112611dd757611dd6611bd4565b5b8135611de7848260208601611d59565b91505092915050565b600080fd5b600067ffffffffffffffff821115611e1057611e0f611bea565b5b611e1982611bd9565b9050602081019050919050565b82818337600083830152505050565b6000611e48611e4384611df5565b611c4a565b905082815260208101848484011115611e6457611e63611df0565b5b611e6f848285611e26565b509392505050565b600082601f830112611e8c57611e8b611bd4565b5b8135611e9c848260208601611e35565b91505092915050565b60008060008060808587031215611ebf57611ebe611adc565b5b6000611ecd87828801611b07565b945050602085013567ffffffffffffffff811115611eee57611eed611ae1565b5b611efa87828801611cff565b935050604085013567ffffffffffffffff811115611f1b57611f1a611ae1565b5b611f2787828801611dc2565b925050606085013567ffffffffffffffff811115611f4857611f47611ae1565b5b611f5487828801611e77565b91505092959194509250565b6000611f6b82611b69565b9050919050565b611f7b81611f60565b8114611f8657600080fd5b50565b600081359050611f9881611f72565b92915050565b600080600080600060a08688031215611fba57611fb9611adc565b5b6000611fc888828901611f89565b9550506020611fd988828901611b07565b9450506040611fea88828901611b07565b9350506060611ffb88828901611b07565b925050608061200c88828901611b92565b9150509295509295909350565b61202281611b69565b82525050565b600060208201905061203d6000830184612019565b92915050565b61204c81611ae6565b82525050565b60006020820190506120676000830184612043565b92915050565b600067ffffffffffffffff82111561208857612087611bea565b5b602082029050602081019050919050565b600080fd5b6000606082840312156120b4576120b3612099565b5b6120be6060611c4a565b905060006120ce84828501611b07565b60008301525060206120e284828501611b07565b60208301525060406120f684828501611b07565b60408301525092915050565b60006121156121108461206d565b611c4a565b9050808382526020820190506060840283018581111561213857612137611c91565b5b835b81811015612161578061214d888261209e565b84526020840193505060608101905061213a565b5050509392505050565b600082601f8301126121805761217f611bd4565b5b8135612190848260208601612102565b91505092915050565b600080604083850312156121b0576121af611adc565b5b60006121be85828601611b07565b925050602083013567ffffffffffffffff8111156121df576121de611ae1565b5b6121eb8582860161216b565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61222a81611ae6565b82525050565b6040820160008201516122466000850182612221565b5060208201516122596020850182612221565b50505050565b600061226b8383612230565b60408301905092915050565b6000602082019050919050565b600061228f826121f5565b6122998185612200565b93506122a483612211565b8060005b838110156122d55781516122bc888261225f565b97506122c783612277565b9250506001810190506122a8565b5085935050505092915050565b600060208201905081810360008301526122fc8184612284565b905092915050565b6000806040838503121561231b5761231a611adc565b5b600061232985828601611b92565b925050602061233a85828601611b07565b9150509250929050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061238b602083612344565b915061239682612355565b602082019050919050565b600060208201905081810360008301526123ba8161237e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006123fb82611ae6565b915061240683611ae6565b925082820390508181111561241e5761241d6123c1565b5b92915050565b600061242f82611ae6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612461576124606123c1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f53656e646572206973206e6f74206173736f636961746564207769746820746860008201527f6520757365720000000000000000000000000000000000000000000000000000602082015250565b60006124f7602683612344565b91506125028261249b565b604082019050919050565b60006020820190508181036000830152612526816124ea565b9050919050565b7f496e76616c6964207369676e6572206f72207369676e61747572650000000000600082015250565b6000612563601b83612344565b915061256e8261252d565b602082019050919050565b6000602082019050818103600083015261259281612556565b9050919050565b7f547269656420746f206861727665737420616c7265616479206861727665737460008201527f656420696e74657276616c000000000000000000000000000000000000000000602082015250565b60006125f5602b83612344565b915061260082612599565b604082019050919050565b60006020820190508181036000830152612624816125e8565b9050919050565b600061263682611ae6565b915061264183611ae6565b9250828201905080821115612659576126586123c1565b5b92915050565b7f547269656420746f2068617276657374206578706972656420696e746572766160008201527f6c00000000000000000000000000000000000000000000000000000000000000602082015250565b60006126bb602183612344565b91506126c68261265f565b604082019050919050565b600060208201905081810360008301526126ea816126ae565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b600061274d602e83612344565b9150612758826126f1565b604082019050919050565b6000602082019050818103600083015261277c81612740565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e207a65726f600082015250565b60006127b9602083612344565b91506127c482612783565b602082019050919050565b600060208201905081810360008301526127e8816127ac565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061284b602683612344565b9150612856826127ef565b604082019050919050565b6000602082019050818103600083015261287a8161283e565b9050919050565b6000819050919050565b61289c61289782611ae6565b612881565b82525050565b600081519050919050565b600081905092915050565b6000819050602082019050919050565b6128d181611b69565b82525050565b60006128e383836128c8565b60208301905092915050565b6000602082019050919050565b6000612907826128a2565b61291181856128ad565b935061291c836128b8565b8060005b8381101561294d57815161293488826128d7565b975061293f836128ef565b925050600181019050612920565b5085935050505092915050565b600081519050919050565b600081905092915050565b6000819050602082019050919050565b61298981611ae6565b82525050565b600061299b8383612980565b60208301905092915050565b6000602082019050919050565b60006129bf8261295a565b6129c98185612965565b93506129d483612970565b8060005b83811015612a055781516129ec888261298f565b97506129f7836129a7565b9250506001810190506129d8565b5085935050505092915050565b6000612a1e828661288b565b602082019150612a2e82856128fc565b9150612a3a82846129b4565b9150819050949350505050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000612a88601c83612a47565b9150612a9382612a52565b601c82019050919050565b6000819050919050565b6000819050919050565b612ac3612abe82612a9e565b612aa8565b82525050565b6000612ad482612a7b565b9150612ae08284612ab2565b60208201915081905092915050565b612af881612a9e565b82525050565b600060ff82169050919050565b612b1481612afe565b82525050565b6000608082019050612b2f6000830187612aef565b612b3c6020830186612b0b565b612b496040830185612aef565b612b566060830184612aef565b95945050505050565b6000604082019050612b746000830185612019565b612b816020830184612043565b9392505050565b6000612b9382611ae6565b9150612b9e83611ae6565b9250828202612bac81611ae6565b91508282048414831517612bc357612bc26123c1565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612c0482611ae6565b9150612c0f83611ae6565b925082612c1f57612c1e612bca565b5b828204905092915050565b6000606082019050612c3f6000830186612019565b612c4c6020830185612019565b612c596040830184612043565b949350505050565b60008115159050919050565b612c7681612c61565b8114612c8157600080fd5b50565b600081519050612c9381612c6d565b92915050565b600060208284031215612caf57612cae611adc565b5b6000612cbd84828501612c84565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612d22602a83612344565b9150612d2d82612cc6565b604082019050919050565b60006020820190508181036000830152612d5181612d15565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612db4602683612344565b9150612dbf82612d58565b604082019050919050565b60006020820190508181036000830152612de381612da7565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612e20601d83612344565b9150612e2b82612dea565b602082019050919050565b60006020820190508181036000830152612e4f81612e13565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612e8a578082015181840152602081019050612e6f565b60008484015250505050565b6000612ea182612e56565b612eab8185612e61565b9350612ebb818560208601612e6c565b80840191505092915050565b6000612ed38284612e96565b915081905092915050565b600081519050919050565b6000612ef482612ede565b612efe8185612344565b9350612f0e818560208601612e6c565b612f1781611bd9565b840191505092915050565b60006020820190508181036000830152612f3c8184612ee9565b90509291505056fea26469706673582212203adb2c9a4847bd6eb2a2b8b4551a9adf3669bf1d3bc9dc9c5232f375d208805364736f6c63430008110033

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

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.