ETH Price: $3,681.40 (-5.19%)

Contract

0x03bFe744eed2e54D6e0F088F6b69B0C21f60Ec7a
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw192083342024-02-12 0:20:23310 days ago1707697223IN
0x03bFe744...21f60Ec7a
0 ETH0.0027543141.74400576
Claim Rewards192073152024-02-11 20:53:23311 days ago1707684803IN
0x03bFe744...21f60Ec7a
0 ETH0.0036658529.15727057
Swap Eth192072722024-02-11 20:44:23311 days ago1707684263IN
0x03bFe744...21f60Ec7a
0 ETH0.0038814124.85665203
Create Mission192072302024-02-11 20:35:59311 days ago1707683759IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0008065731.62168144
Create Mission192068252024-02-11 19:14:23311 days ago1707678863IN
0x03bFe744...21f60Ec7a
0.015 ETH0.000717828.14153788
Top Up192041372024-02-11 10:09:35311 days ago1707646175IN
0x03bFe744...21f60Ec7a
0 ETH0.0019198426.93649443
Claim Rewards192040282024-02-11 9:47:35311 days ago1707644855IN
0x03bFe744...21f60Ec7a
0 ETH0.0025792723.74213029
Create Mission192024842024-02-11 4:34:59311 days ago1707626099IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0005551521.76465133
Create Mission192018092024-02-11 2:18:47311 days ago1707617927IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0005347720.9658142
Top Up192016232024-02-11 1:41:23311 days ago1707615683IN
0x03bFe744...21f60Ec7a
0 ETH0.0015013821.06529792
Top Up192016182024-02-11 1:40:23311 days ago1707615623IN
0x03bFe744...21f60Ec7a
0 ETH0.0015774622.13270544
Create Mission192011892024-02-11 0:13:35311 days ago1707610415IN
0x03bFe744...21f60Ec7a
0.05 ETH0.000682726.7781829
Create Mission192007682024-02-10 22:48:23311 days ago1707605303IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0007845230.7573428
Swap Eth192005052024-02-10 21:54:59312 days ago1707602099IN
0x03bFe744...21f60Ec7a
0 ETH0.0048360230.97237052
Claim Rewards192000782024-02-10 20:29:11312 days ago1707596951IN
0x03bFe744...21f60Ec7a
0 ETH0.0044184740.67718211
Create Mission191992002024-02-10 17:31:35312 days ago1707586295IN
0x03bFe744...21f60Ec7a
0.05 ETH0.000920836.11692084
Create Mission191990472024-02-10 17:00:59312 days ago1707584459IN
0x03bFe744...21f60Ec7a
0.05 ETH0.0009132835.82208243
Claim Rewards191990312024-02-10 16:57:35312 days ago1707584255IN
0x03bFe744...21f60Ec7a
0 ETH0.0035385930.02703614
Top Up191990102024-02-10 16:53:23312 days ago1707584003IN
0x03bFe744...21f60Ec7a
0 ETH0.0023510532.98661134
Create Mission191982252024-02-10 14:13:47312 days ago1707574427IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0007045527.62217062
Top Up191979312024-02-10 13:13:35312 days ago1707570815IN
0x03bFe744...21f60Ec7a
0 ETH0.0022048430.93520373
Top Up191961012024-02-10 7:02:47312 days ago1707548567IN
0x03bFe744...21f60Ec7a
0 ETH0.0024443934.29625746
Create Mission191951122024-02-10 3:43:47312 days ago1707536627IN
0x03bFe744...21f60Ec7a
0.015 ETH0.0008007731.39413676
Claim Rewards191949362024-02-10 3:08:35312 days ago1707534515IN
0x03bFe744...21f60Ec7a
0 ETH0.0041907435.29287413
Create Mission191936702024-02-09 22:53:23312 days ago1707519203IN
0x03bFe744...21f60Ec7a
0.05 ETH0.001179646.2682114
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
192083342024-02-12 0:20:23310 days ago1707697223
0x03bFe744...21f60Ec7a
2.60698133 ETH
192073152024-02-11 20:53:23311 days ago1707684803
0x03bFe744...21f60Ec7a
0.0044 ETH
192072722024-02-11 20:44:23311 days ago1707684263
0x03bFe744...21f60Ec7a
2.33879999 ETH
192040282024-02-11 9:47:35311 days ago1707644855
0x03bFe744...21f60Ec7a
0.03045 ETH
192005052024-02-10 21:54:59312 days ago1707602099
0x03bFe744...21f60Ec7a
0.612 ETH
192000782024-02-10 20:29:11312 days ago1707596951
0x03bFe744...21f60Ec7a
0.04965 ETH
191799262024-02-08 0:36:47314 days ago1707352607
0x03bFe744...21f60Ec7a
0.824 ETH
191728022024-02-07 0:37:35315 days ago1707266255
0x03bFe744...21f60Ec7a
0.01185 ETH
191572042024-02-04 20:04:59318 days ago1707077099
0x03bFe744...21f60Ec7a
0.01956666 ETH
191509732024-02-03 23:03:23318 days ago1707001403
0x03bFe744...21f60Ec7a
2.6848 ETH
191503042024-02-03 20:48:11319 days ago1706993291
0x03bFe744...21f60Ec7a
0.014 ETH
191499312024-02-03 19:33:11319 days ago1706988791
0x03bFe744...21f60Ec7a
0.04693 ETH
191469412024-02-03 9:28:35319 days ago1706952515
0x03bFe744...21f60Ec7a
0.0099 ETH
191364532024-02-01 22:06:59320 days ago1706825219
0x03bFe744...21f60Ec7a
0.0371 ETH
191332732024-02-01 11:25:35321 days ago1706786735
0x03bFe744...21f60Ec7a
0.0026 ETH
191322932024-02-01 8:07:11321 days ago1706774831
0x03bFe744...21f60Ec7a
0.02085 ETH
191298822024-01-31 23:58:47321 days ago1706745527
0x03bFe744...21f60Ec7a
0.0042 ETH
191254822024-01-31 9:10:23322 days ago1706692223
0x03bFe744...21f60Ec7a
0.0015 ETH
191249802024-01-31 7:27:59322 days ago1706686079
0x03bFe744...21f60Ec7a
0.002 ETH
191237292024-01-31 3:15:35322 days ago1706670935
0x03bFe744...21f60Ec7a
0.0023 ETH
191233802024-01-31 2:04:59322 days ago1706666699
0x03bFe744...21f60Ec7a
0.0135 ETH
191213092024-01-30 19:08:23323 days ago1706641703
0x03bFe744...21f60Ec7a
0.0032 ETH
191208172024-01-30 17:28:59323 days ago1706635739
0x03bFe744...21f60Ec7a
0.0232 ETH
191200282024-01-30 14:49:47323 days ago1706626187
0x03bFe744...21f60Ec7a
0.01075 ETH
191173452024-01-30 5:50:35323 days ago1706593835
0x03bFe744...21f60Ec7a
0.02373 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ReachMainDistribution

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : ReachMainDistribution.sol
// SPDX-License-Identifier: unlicensed

pragma solidity 0.8.19;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import "./interfaces/IDex.sol";

error InvalidSignature();
error InvalidMerkleProof();
error ClaimingPaused();
error UnsufficientEthAllocation();
error AlreadyClaimed();
error InvalidMerkleRoot();
error UnsufficientEthBalance();
error UnsufficientReachBalance();
error InvalidTokenAddress();
error InvalidPrice();

/**
 * @title ReachDistribution
 * @dev This contract manages the distribution of Reach tokens and Ether based on Merkle proofs.
 */
contract ReachMainDistribution is Ownable2Step, ReentrancyGuard {
    using SafeERC20 for IERC20;

    // Events
    event EthSwapped(uint256 ethAmount, uint256 reachAmount, uint256 timestamp);
    event Received(address indexed sender, uint256 amount);
    event RewardsClaimed(
        address indexed account,
        uint256 ethAmount,
        uint256 reachAmount,
        uint256 indexed version,
        uint256 timestamp
    );
    event TopUp(
        address indexed user,
        uint256 balance,
        uint256 feesCollected,
        uint256 timestamp
    );
    event DistributionSet(
        bytes32 indexed merkleRoot,
        uint256 ethAmount,
        uint256 reachAmount
    );
    event MissionCreated(string missionId, uint256 amount);
    event Withdrawn(
        address indexed user,
        uint256 reachAmount,
        uint256 ethAmount,
        uint256 timestamp
    );
    struct Config {
        uint256 swapPercentage;
        uint256 leaderboardPercentage;
        uint256 rsPercentage;
    }

    IRouter public router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);

    uint256 public currentVersion;
    mapping(address => uint256) public lastClaimedVersion;
    address immutable reachToken = 0x8B12BD54CA9B2311960057C8F3C88013e79316E3;
    bytes32 public merkleRoot;
    uint256 public creditPrice = 50 ether;
    uint256 public totalEthAllocated;

    // External functions
    /*
     * @notice Creates a new mission
     * @param _missionId The ID of the new mission
     * @param _amount The amount allocated to the new mission
     */
    function createMission(
        string memory _missionId,
        uint256 _amount
    ) external payable {
        require(_amount > 0, "Amount must be greater than 0.");
        require(_amount == msg.value, "Incorrect amount sent.");
        emit MissionCreated(_missionId, _amount);
    }

    /**
     * @dev Allows users to top up their credit balance.
     * @param _amount The amount of credits to add.
     */
    function topUp(uint256 _amount) external {
        uint256 feesCollected = _amount * creditPrice;
        IERC20(reachToken).safeTransferFrom(
            msg.sender,
            address(this),
            feesCollected
        );
        emit TopUp(msg.sender, _amount, feesCollected, block.timestamp);
    }

    /**
     * @dev Withdraws all Reach tokens to the owner's address.
     */
    function withdraw() external onlyOwner {
        uint256 balance = IERC20(reachToken).balanceOf(address(this));
        uint256 ethBalance = address(this).balance;
        IERC20(reachToken).safeTransfer(msg.sender, balance);
        payable(msg.sender).transfer(ethBalance);

        emit Withdrawn(msg.sender, balance, ethBalance, block.timestamp);
    }

    /**
     * @dev Allows users to claim their rewards.
     * @param _merkleProof The merkle proof for the claim.
     * @param _ethAmount The ETH amount to claim.
     * @param _reachAmount The Reach token amount to claim.
     */
    function claimRewards(
        bytes32[] calldata _merkleProof,
        uint256 _ethAmount,
        uint256 _reachAmount
    ) external nonReentrant {
        if (lastClaimedVersion[msg.sender] == currentVersion)
            revert AlreadyClaimed();
        if (!verifyProof(_merkleProof, _ethAmount, _reachAmount))
            revert InvalidMerkleProof();

        lastClaimedVersion[msg.sender] = currentVersion;

        if (_ethAmount > 0) payable(msg.sender).transfer(_ethAmount);
        if (_reachAmount > 0)
            IERC20(reachToken).safeTransfer(msg.sender, _reachAmount);

        emit RewardsClaimed(
            msg.sender,
            _ethAmount,
            _reachAmount,
            currentVersion,
            block.timestamp
        );
    }

    // Public functions
    /**
     * @dev Sets the price for purchasing credits.
     * @param _price The new price for credits.
     */
    function setCreditPrice(uint256 _price) public onlyOwner {
        if (_price == 0) {
            revert InvalidPrice();
        }
        creditPrice = _price;
    }

    /**
     * @dev Creates a new distribution of rewards.
     * @param _merkleRoot The merkle root of the distribution.
     * @param _ethAmount The total ETH amount for the distribution.
     * @param _reachAmount The total Reach token amount for the distribution.
     */
    function createDistribution(
        bytes32 _merkleRoot,
        uint256 _ethAmount,
        uint256 _reachAmount
    ) public onlyOwner {
        if (_merkleRoot == bytes32(0)) revert InvalidMerkleRoot();
        if (address(this).balance < totalEthAllocated)
            revert UnsufficientEthBalance();
        if (IERC20(reachToken).balanceOf(address(this)) < _reachAmount)
            revert UnsufficientReachBalance();

        currentVersion++;
        merkleRoot = _merkleRoot;
        totalEthAllocated = 0;
        emit DistributionSet(_merkleRoot, _ethAmount, _reachAmount);
    }

    // Fallback function
    /**
     * @dev Fallback function to receive Ether.
     */
    receive() external payable {
        emit Received(msg.sender, msg.value);
    }

    // Internal functions
    /**
     * @dev Verifies the Merkle proof for a claim.
     * @param _merkleProof The Merkle proof.
     * @param _ethAmount The ETH amount in the claim.
     * @param _reachAmount The Reach token amount in the claim.
     * @return bool True if the proof is valid, false otherwise.
     */
    function verifyProof(
        bytes32[] calldata _merkleProof,
        uint256 _ethAmount,
        uint256 _reachAmount
    ) internal view returns (bool) {
        bytes32 leaf = keccak256(
            abi.encodePacked(msg.sender, _ethAmount, _reachAmount)
        );
        return MerkleProof.verifyCalldata(_merkleProof, merkleRoot, leaf);
    }

    // Override functions
    /**
     * @dev Prevents renouncing ownership.
     */
    function renounceOwnership() public virtual override onlyOwner {
        revert("Can't renounce ownership");
    }

    function swapEth(
        uint _ethAmount,
        uint _outputAmount
    ) external onlyOwner returns (uint256 outputAmount) {
        address[] memory path = new address[](2);
        path[0] = router.WETH();
        path[1] = reachToken;
        uint256 balanceBefore = IERC20(reachToken).balanceOf(address(this));
        totalEthAllocated += address(this).balance - _ethAmount;

        // make the swap
        router.swapExactETHForTokensSupportingFeeOnTransferTokens{
            value: _ethAmount
        }(_outputAmount, path, address(this), block.timestamp);

        uint256 balanceAfter = IERC20(reachToken).balanceOf(address(this));
        outputAmount = balanceAfter - balanceBefore;

        emit EthSwapped(_ethAmount, outputAmount, block.timestamp);
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.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 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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 12 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides 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} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 4 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

File 6 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

File 7 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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'
        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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 8 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 9 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 10 of 12 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 11 of 12 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^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.
 *
 * ```solidity
 * 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.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
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;

            if (lastIndex != toDeleteIndex) {
                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] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // 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) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity 0.8.19;

interface IPair {
    function getReserves()
        external
        view
        returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function token0() external view returns (address);
}

interface IFactory {
    function createPair(
        address tokenA,
        address tokenB
    ) external returns (address pair);

    function getPair(
        address tokenA,
        address tokenB
    ) external view returns (address pair);
}

interface IRouter {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    )
        external
        payable
        returns (uint amountToken, uint amountETH, uint liquidity);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;

    function swapExactETHForTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"InvalidMerkleRoot","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"UnsufficientEthBalance","type":"error"},{"inputs":[],"name":"UnsufficientReachBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"}],"name":"DistributionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"EthSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"missionId","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MissionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"version","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feesCollected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TopUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"internalType":"uint256","name":"_reachAmount","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"internalType":"uint256","name":"_reachAmount","type":"uint256"}],"name":"createDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_missionId","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createMission","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"creditPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimedVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setCreditPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"internalType":"uint256","name":"_outputAmount","type":"uint256"}],"name":"swapEth","outputs":[{"internalType":"uint256","name":"outputAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"topUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalEthAllocated","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":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052737a250d5630b4cf539739df2c5dacb4c659f2488d600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550738b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152506802b5e3af16b1880000600755348015620000ba57600080fd5b50620000db620000cf620000e960201b60201c565b620000f160201b60201c565b6001600281905550620001ee565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905562000127816200012a60201b60201c565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6080516127666200023b600039600081816104bf0152818161076001528181610941015281816109b201528181610b0801528181610c0601528181610cac0152610dbf01526127666000f3fe60806040526004361061010d5760003560e01c80638da5cb5b11610095578063d2d562a411610064578063d2d562a414610376578063e30c3978146103a1578063ee863180146103cc578063f2fde38b146103e8578063f887ea401461041157610162565b80638da5cb5b146102cc5780639d888e86146102f7578063ad17a0b314610322578063ca6358cd1461034b57610162565b80633ccfd60b116100dc5780633ccfd60b146102215780633e1ec4281461023857806350017f3e14610275578063715018a61461029e57806379ba5097146102b557610162565b80630b0621401461016757806325342ecc1461019057806328c622f1146101b95780632eb4a7ab146101f657610162565b36610162573373ffffffffffffffffffffffffffffffffffffffff167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743460405161015891906117fa565b60405180910390a2005b600080fd5b34801561017357600080fd5b5061018e6004803603810190610189919061188b565b61043c565b005b34801561019c57600080fd5b506101b760048036038101906101b29190611943565b6105f5565b005b3480156101c557600080fd5b506101e060048036038101906101db91906119b7565b610808565b6040516101ed91906117fa565b60405180910390f35b34801561020257600080fd5b5061020b610bf4565b6040516102189190611a06565b60405180910390f35b34801561022d57600080fd5b50610236610bfa565b005b34801561024457600080fd5b5061025f600480360381019061025a9190611a7f565b610d8d565b60405161026c91906117fa565b60405180910390f35b34801561028157600080fd5b5061029c60048036038101906102979190611aac565b610da5565b005b3480156102aa57600080fd5b506102b3610e5a565b005b3480156102c157600080fd5b506102ca610e9d565b005b3480156102d857600080fd5b506102e1610f2a565b6040516102ee9190611ae8565b60405180910390f35b34801561030357600080fd5b5061030c610f53565b60405161031991906117fa565b60405180910390f35b34801561032e57600080fd5b5061034960048036038101906103449190611aac565b610f59565b005b34801561035757600080fd5b50610360610fa4565b60405161036d91906117fa565b60405180910390f35b34801561038257600080fd5b5061038b610faa565b60405161039891906117fa565b60405180910390f35b3480156103ad57600080fd5b506103b6610fb0565b6040516103c39190611ae8565b60405180910390f35b6103e660048036038101906103e19190611c44565b610fda565b005b3480156103f457600080fd5b5061040f600480360381019061040a9190611a7f565b61109c565b005b34801561041d57600080fd5b50610426611149565b6040516104339190611cff565b60405180910390f35b61044461116f565b6000801b8303610480576040517f9dd854d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008544710156104bc576040517fb0e0a91f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105169190611ae8565b602060405180830381865afa158015610533573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105579190611d2f565b101561058f576040517ff5bdd33400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600460008154809291906105a290611d8b565b9190505550826006819055506000600881905550827f9d700ed7d64303281d0221273ac003349bc5143ccd917e1789630ca22eba1bc783836040516105e8929190611dd3565b60405180910390a2505050565b6105fd6111ed565b600454600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610677576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106838484848461123a565b6106b9576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000821115610750573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561074e573d6000803e3d6000fd5b505b60008111156107a5576107a433827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166112839092919063ffffffff16565b5b6004543373ffffffffffffffffffffffffffffffffffffffff167f5619b8583bbbb0760d27ac9ff844cec866b333bf7ad0262c2d809ff42f22e5fc8484426040516107f293929190611dfc565b60405180910390a3610802611309565b50505050565b600061081261116f565b6000600267ffffffffffffffff81111561082f5761082e611b19565b5b60405190808252806020026020018201604052801561085d5781602001602082028036833780820191505090505b509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f19190611e48565b8160008151811061090557610904611e75565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061097457610973611e75565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a099190611ae8565b602060405180830381865afa158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a9190611d2f565b90508447610a589190611ea4565b60086000828254610a699190611ed8565b92505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de9586868530426040518663ffffffff1660e01b8152600401610ad29493929190611fca565b6000604051808303818588803b158015610aeb57600080fd5b505af1158015610aff573d6000803e3d6000fd5b505050505060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b5f9190611ae8565b602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190611d2f565b90508181610bae9190611ea4565b93507f8ba8eee785cd2af8020ee28bd97c37d9d1095205621500ed770d0d478c12db31868542604051610be393929190611dfc565b60405180910390a150505092915050565b60065481565b610c0261116f565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c5d9190611ae8565b602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190611d2f565b90506000479050610cf033837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166112839092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d36573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a21838342604051610d8193929190611dfc565b60405180910390a25050565b60056020528060005260406000206000915090505481565b600060075482610db59190612016565b9050610e043330837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611313909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fda01de4f1c68fdf5b5fbb6b264ad7b57d19d2c1701493407ad3c274c14102b6a838342604051610e4e93929190611dfc565b60405180910390a25050565b610e6261116f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e94906120b5565b60405180910390fd5b6000610ea761139c565b90508073ffffffffffffffffffffffffffffffffffffffff16610ec8610fb0565b73ffffffffffffffffffffffffffffffffffffffff1614610f1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1590612147565b60405180910390fd5b610f27816113a4565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60045481565b610f6161116f565b60008103610f9a576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060078190555050565b60075481565b60085481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000811161101d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611014906121b3565b60405180910390fd5b34811461105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110569061221f565b60405180910390fd5b7f7a9a0839d82bd76df4e7e95befca46c7a54d34aadcc54bf0f86da048f39e043b82826040516110909291906122ad565b60405180910390a15050565b6110a461116f565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611104610f2a565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61117761139c565b73ffffffffffffffffffffffffffffffffffffffff16611195610f2a565b73ffffffffffffffffffffffffffffffffffffffff16146111eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e290612329565b60405180910390fd5b565b6002805403611231576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122890612395565b60405180910390fd5b60028081905550565b6000803384846040516020016112529392919061241e565b6040516020818303038152906040528051906020012090506112788686600654846113d5565b915050949350505050565b6113048363a9059cbb60e01b84846040516024016112a292919061245b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506113ee565b505050565b6001600281905550565b611396846323b872dd60e01b85858560405160240161133493929190612484565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506113ee565b50505050565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556113d2816114b6565b50565b6000826113e386868561157a565b149050949350505050565b6000611450826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115d29092919063ffffffff16565b905060008151148061147257508080602001905181019061147191906124f3565b5b6114b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a890612592565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008082905060005b858590508110156115c6576115b1828787848181106115a5576115a4611e75565b5b905060200201356115ea565b915080806115be90611d8b565b915050611583565b50809150509392505050565b60606115e18484600085611615565b90509392505050565b6000818310611602576115fd82846116e2565b61160d565b61160c83836116e2565b5b905092915050565b60608247101561165a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165190612624565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611683919061268b565b60006040518083038185875af1925050503d80600081146116c0576040519150601f19603f3d011682016040523d82523d6000602084013e6116c5565b606091505b50915091506116d6878383876116f9565b92505050949350505050565b600082600052816020526040600020905092915050565b6060831561175b576000835103611753576117138561176e565b611752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611749906126ee565b60405180910390fd5b5b829050611766565b6117658383611791565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156117a45781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d8919061270e565b60405180910390fd5b6000819050919050565b6117f4816117e1565b82525050565b600060208201905061180f60008301846117eb565b92915050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61183c81611829565b811461184757600080fd5b50565b60008135905061185981611833565b92915050565b611868816117e1565b811461187357600080fd5b50565b6000813590506118858161185f565b92915050565b6000806000606084860312156118a4576118a361181f565b5b60006118b28682870161184a565b93505060206118c386828701611876565b92505060406118d486828701611876565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f840112611903576119026118de565b5b8235905067ffffffffffffffff8111156119205761191f6118e3565b5b60208301915083602082028301111561193c5761193b6118e8565b5b9250929050565b6000806000806060858703121561195d5761195c61181f565b5b600085013567ffffffffffffffff81111561197b5761197a611824565b5b611987878288016118ed565b9450945050602061199a87828801611876565b92505060406119ab87828801611876565b91505092959194509250565b600080604083850312156119ce576119cd61181f565b5b60006119dc85828601611876565b92505060206119ed85828601611876565b9150509250929050565b611a0081611829565b82525050565b6000602082019050611a1b60008301846119f7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a4c82611a21565b9050919050565b611a5c81611a41565b8114611a6757600080fd5b50565b600081359050611a7981611a53565b92915050565b600060208284031215611a9557611a9461181f565b5b6000611aa384828501611a6a565b91505092915050565b600060208284031215611ac257611ac161181f565b5b6000611ad084828501611876565b91505092915050565b611ae281611a41565b82525050565b6000602082019050611afd6000830184611ad9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611b5182611b08565b810181811067ffffffffffffffff82111715611b7057611b6f611b19565b5b80604052505050565b6000611b83611815565b9050611b8f8282611b48565b919050565b600067ffffffffffffffff821115611baf57611bae611b19565b5b611bb882611b08565b9050602081019050919050565b82818337600083830152505050565b6000611be7611be284611b94565b611b79565b905082815260208101848484011115611c0357611c02611b03565b5b611c0e848285611bc5565b509392505050565b600082601f830112611c2b57611c2a6118de565b5b8135611c3b848260208601611bd4565b91505092915050565b60008060408385031215611c5b57611c5a61181f565b5b600083013567ffffffffffffffff811115611c7957611c78611824565b5b611c8585828601611c16565b9250506020611c9685828601611876565b9150509250929050565b6000819050919050565b6000611cc5611cc0611cbb84611a21565b611ca0565b611a21565b9050919050565b6000611cd782611caa565b9050919050565b6000611ce982611ccc565b9050919050565b611cf981611cde565b82525050565b6000602082019050611d146000830184611cf0565b92915050565b600081519050611d298161185f565b92915050565b600060208284031215611d4557611d4461181f565b5b6000611d5384828501611d1a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d96826117e1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611dc857611dc7611d5c565b5b600182019050919050565b6000604082019050611de860008301856117eb565b611df560208301846117eb565b9392505050565b6000606082019050611e1160008301866117eb565b611e1e60208301856117eb565b611e2b60408301846117eb565b949350505050565b600081519050611e4281611a53565b92915050565b600060208284031215611e5e57611e5d61181f565b5b6000611e6c84828501611e33565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611eaf826117e1565b9150611eba836117e1565b9250828203905081811115611ed257611ed1611d5c565b5b92915050565b6000611ee3826117e1565b9150611eee836117e1565b9250828201905080821115611f0657611f05611d5c565b5b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611f4181611a41565b82525050565b6000611f538383611f38565b60208301905092915050565b6000602082019050919050565b6000611f7782611f0c565b611f818185611f17565b9350611f8c83611f28565b8060005b83811015611fbd578151611fa48882611f47565b9750611faf83611f5f565b925050600181019050611f90565b5085935050505092915050565b6000608082019050611fdf60008301876117eb565b8181036020830152611ff18186611f6c565b90506120006040830185611ad9565b61200d60608301846117eb565b95945050505050565b6000612021826117e1565b915061202c836117e1565b925082820261203a816117e1565b9150828204841483151761205157612050611d5c565b5b5092915050565b600082825260208201905092915050565b7f43616e27742072656e6f756e6365206f776e6572736869700000000000000000600082015250565b600061209f601883612058565b91506120aa82612069565b602082019050919050565b600060208201905081810360008301526120ce81612092565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b6000612131602983612058565b915061213c826120d5565b604082019050919050565b6000602082019050818103600083015261216081612124565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e20302e0000600082015250565b600061219d601e83612058565b91506121a882612167565b602082019050919050565b600060208201905081810360008301526121cc81612190565b9050919050565b7f496e636f727265637420616d6f756e742073656e742e00000000000000000000600082015250565b6000612209601683612058565b9150612214826121d3565b602082019050919050565b60006020820190508181036000830152612238816121fc565b9050919050565b600081519050919050565b60005b8381101561226857808201518184015260208101905061224d565b60008484015250505050565b600061227f8261223f565b6122898185612058565b935061229981856020860161224a565b6122a281611b08565b840191505092915050565b600060408201905081810360008301526122c78185612274565b90506122d660208301846117eb565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612313602083612058565b915061231e826122dd565b602082019050919050565b6000602082019050818103600083015261234281612306565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061237f601f83612058565b915061238a82612349565b602082019050919050565b600060208201905081810360008301526123ae81612372565b9050919050565b60008160601b9050919050565b60006123cd826123b5565b9050919050565b60006123df826123c2565b9050919050565b6123f76123f282611a41565b6123d4565b82525050565b6000819050919050565b612418612413826117e1565b6123fd565b82525050565b600061242a82866123e6565b60148201915061243a8285612407565b60208201915061244a8284612407565b602082019150819050949350505050565b60006040820190506124706000830185611ad9565b61247d60208301846117eb565b9392505050565b60006060820190506124996000830186611ad9565b6124a66020830185611ad9565b6124b360408301846117eb565b949350505050565b60008115159050919050565b6124d0816124bb565b81146124db57600080fd5b50565b6000815190506124ed816124c7565b92915050565b6000602082840312156125095761250861181f565b5b6000612517848285016124de565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061257c602a83612058565b915061258782612520565b604082019050919050565b600060208201905081810360008301526125ab8161256f565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061260e602683612058565b9150612619826125b2565b604082019050919050565b6000602082019050818103600083015261263d81612601565b9050919050565b600081519050919050565b600081905092915050565b600061266582612644565b61266f818561264f565b935061267f81856020860161224a565b80840191505092915050565b6000612697828461265a565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006126d8601d83612058565b91506126e3826126a2565b602082019050919050565b60006020820190508181036000830152612707816126cb565b9050919050565b600060208201905081810360008301526127288184612274565b90509291505056fea264697066735822122048d78f7051d5d2aadf5e3492d8633ebfdcb9851892222b24911fa461200c556164736f6c63430008130033

Deployed Bytecode

0x60806040526004361061010d5760003560e01c80638da5cb5b11610095578063d2d562a411610064578063d2d562a414610376578063e30c3978146103a1578063ee863180146103cc578063f2fde38b146103e8578063f887ea401461041157610162565b80638da5cb5b146102cc5780639d888e86146102f7578063ad17a0b314610322578063ca6358cd1461034b57610162565b80633ccfd60b116100dc5780633ccfd60b146102215780633e1ec4281461023857806350017f3e14610275578063715018a61461029e57806379ba5097146102b557610162565b80630b0621401461016757806325342ecc1461019057806328c622f1146101b95780632eb4a7ab146101f657610162565b36610162573373ffffffffffffffffffffffffffffffffffffffff167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743460405161015891906117fa565b60405180910390a2005b600080fd5b34801561017357600080fd5b5061018e6004803603810190610189919061188b565b61043c565b005b34801561019c57600080fd5b506101b760048036038101906101b29190611943565b6105f5565b005b3480156101c557600080fd5b506101e060048036038101906101db91906119b7565b610808565b6040516101ed91906117fa565b60405180910390f35b34801561020257600080fd5b5061020b610bf4565b6040516102189190611a06565b60405180910390f35b34801561022d57600080fd5b50610236610bfa565b005b34801561024457600080fd5b5061025f600480360381019061025a9190611a7f565b610d8d565b60405161026c91906117fa565b60405180910390f35b34801561028157600080fd5b5061029c60048036038101906102979190611aac565b610da5565b005b3480156102aa57600080fd5b506102b3610e5a565b005b3480156102c157600080fd5b506102ca610e9d565b005b3480156102d857600080fd5b506102e1610f2a565b6040516102ee9190611ae8565b60405180910390f35b34801561030357600080fd5b5061030c610f53565b60405161031991906117fa565b60405180910390f35b34801561032e57600080fd5b5061034960048036038101906103449190611aac565b610f59565b005b34801561035757600080fd5b50610360610fa4565b60405161036d91906117fa565b60405180910390f35b34801561038257600080fd5b5061038b610faa565b60405161039891906117fa565b60405180910390f35b3480156103ad57600080fd5b506103b6610fb0565b6040516103c39190611ae8565b60405180910390f35b6103e660048036038101906103e19190611c44565b610fda565b005b3480156103f457600080fd5b5061040f600480360381019061040a9190611a7f565b61109c565b005b34801561041d57600080fd5b50610426611149565b6040516104339190611cff565b60405180910390f35b61044461116f565b6000801b8303610480576040517f9dd854d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008544710156104bc576040517fb0e0a91f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105169190611ae8565b602060405180830381865afa158015610533573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105579190611d2f565b101561058f576040517ff5bdd33400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600460008154809291906105a290611d8b565b9190505550826006819055506000600881905550827f9d700ed7d64303281d0221273ac003349bc5143ccd917e1789630ca22eba1bc783836040516105e8929190611dd3565b60405180910390a2505050565b6105fd6111ed565b600454600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610677576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106838484848461123a565b6106b9576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000821115610750573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561074e573d6000803e3d6000fd5b505b60008111156107a5576107a433827f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166112839092919063ffffffff16565b5b6004543373ffffffffffffffffffffffffffffffffffffffff167f5619b8583bbbb0760d27ac9ff844cec866b333bf7ad0262c2d809ff42f22e5fc8484426040516107f293929190611dfc565b60405180910390a3610802611309565b50505050565b600061081261116f565b6000600267ffffffffffffffff81111561082f5761082e611b19565b5b60405190808252806020026020018201604052801561085d5781602001602082028036833780820191505090505b509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f19190611e48565b8160008151811061090557610904611e75565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e38160018151811061097457610973611e75565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060007f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a099190611ae8565b602060405180830381865afa158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a9190611d2f565b90508447610a589190611ea4565b60086000828254610a699190611ed8565b92505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de9586868530426040518663ffffffff1660e01b8152600401610ad29493929190611fca565b6000604051808303818588803b158015610aeb57600080fd5b505af1158015610aff573d6000803e3d6000fd5b505050505060007f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b5f9190611ae8565b602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190611d2f565b90508181610bae9190611ea4565b93507f8ba8eee785cd2af8020ee28bd97c37d9d1095205621500ed770d0d478c12db31868542604051610be393929190611dfc565b60405180910390a150505092915050565b60065481565b610c0261116f565b60007f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c5d9190611ae8565b602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190611d2f565b90506000479050610cf033837f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff166112839092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d36573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a21838342604051610d8193929190611dfc565b60405180910390a25050565b60056020528060005260406000206000915090505481565b600060075482610db59190612016565b9050610e043330837f0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e373ffffffffffffffffffffffffffffffffffffffff16611313909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fda01de4f1c68fdf5b5fbb6b264ad7b57d19d2c1701493407ad3c274c14102b6a838342604051610e4e93929190611dfc565b60405180910390a25050565b610e6261116f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e94906120b5565b60405180910390fd5b6000610ea761139c565b90508073ffffffffffffffffffffffffffffffffffffffff16610ec8610fb0565b73ffffffffffffffffffffffffffffffffffffffff1614610f1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1590612147565b60405180910390fd5b610f27816113a4565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60045481565b610f6161116f565b60008103610f9a576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060078190555050565b60075481565b60085481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000811161101d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611014906121b3565b60405180910390fd5b34811461105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110569061221f565b60405180910390fd5b7f7a9a0839d82bd76df4e7e95befca46c7a54d34aadcc54bf0f86da048f39e043b82826040516110909291906122ad565b60405180910390a15050565b6110a461116f565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611104610f2a565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61117761139c565b73ffffffffffffffffffffffffffffffffffffffff16611195610f2a565b73ffffffffffffffffffffffffffffffffffffffff16146111eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e290612329565b60405180910390fd5b565b6002805403611231576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122890612395565b60405180910390fd5b60028081905550565b6000803384846040516020016112529392919061241e565b6040516020818303038152906040528051906020012090506112788686600654846113d5565b915050949350505050565b6113048363a9059cbb60e01b84846040516024016112a292919061245b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506113ee565b505050565b6001600281905550565b611396846323b872dd60e01b85858560405160240161133493929190612484565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506113ee565b50505050565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556113d2816114b6565b50565b6000826113e386868561157a565b149050949350505050565b6000611450826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115d29092919063ffffffff16565b905060008151148061147257508080602001905181019061147191906124f3565b5b6114b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a890612592565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008082905060005b858590508110156115c6576115b1828787848181106115a5576115a4611e75565b5b905060200201356115ea565b915080806115be90611d8b565b915050611583565b50809150509392505050565b60606115e18484600085611615565b90509392505050565b6000818310611602576115fd82846116e2565b61160d565b61160c83836116e2565b5b905092915050565b60608247101561165a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165190612624565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611683919061268b565b60006040518083038185875af1925050503d80600081146116c0576040519150601f19603f3d011682016040523d82523d6000602084013e6116c5565b606091505b50915091506116d6878383876116f9565b92505050949350505050565b600082600052816020526040600020905092915050565b6060831561175b576000835103611753576117138561176e565b611752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611749906126ee565b60405180910390fd5b5b829050611766565b6117658383611791565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156117a45781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d8919061270e565b60405180910390fd5b6000819050919050565b6117f4816117e1565b82525050565b600060208201905061180f60008301846117eb565b92915050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61183c81611829565b811461184757600080fd5b50565b60008135905061185981611833565b92915050565b611868816117e1565b811461187357600080fd5b50565b6000813590506118858161185f565b92915050565b6000806000606084860312156118a4576118a361181f565b5b60006118b28682870161184a565b93505060206118c386828701611876565b92505060406118d486828701611876565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f840112611903576119026118de565b5b8235905067ffffffffffffffff8111156119205761191f6118e3565b5b60208301915083602082028301111561193c5761193b6118e8565b5b9250929050565b6000806000806060858703121561195d5761195c61181f565b5b600085013567ffffffffffffffff81111561197b5761197a611824565b5b611987878288016118ed565b9450945050602061199a87828801611876565b92505060406119ab87828801611876565b91505092959194509250565b600080604083850312156119ce576119cd61181f565b5b60006119dc85828601611876565b92505060206119ed85828601611876565b9150509250929050565b611a0081611829565b82525050565b6000602082019050611a1b60008301846119f7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a4c82611a21565b9050919050565b611a5c81611a41565b8114611a6757600080fd5b50565b600081359050611a7981611a53565b92915050565b600060208284031215611a9557611a9461181f565b5b6000611aa384828501611a6a565b91505092915050565b600060208284031215611ac257611ac161181f565b5b6000611ad084828501611876565b91505092915050565b611ae281611a41565b82525050565b6000602082019050611afd6000830184611ad9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611b5182611b08565b810181811067ffffffffffffffff82111715611b7057611b6f611b19565b5b80604052505050565b6000611b83611815565b9050611b8f8282611b48565b919050565b600067ffffffffffffffff821115611baf57611bae611b19565b5b611bb882611b08565b9050602081019050919050565b82818337600083830152505050565b6000611be7611be284611b94565b611b79565b905082815260208101848484011115611c0357611c02611b03565b5b611c0e848285611bc5565b509392505050565b600082601f830112611c2b57611c2a6118de565b5b8135611c3b848260208601611bd4565b91505092915050565b60008060408385031215611c5b57611c5a61181f565b5b600083013567ffffffffffffffff811115611c7957611c78611824565b5b611c8585828601611c16565b9250506020611c9685828601611876565b9150509250929050565b6000819050919050565b6000611cc5611cc0611cbb84611a21565b611ca0565b611a21565b9050919050565b6000611cd782611caa565b9050919050565b6000611ce982611ccc565b9050919050565b611cf981611cde565b82525050565b6000602082019050611d146000830184611cf0565b92915050565b600081519050611d298161185f565b92915050565b600060208284031215611d4557611d4461181f565b5b6000611d5384828501611d1a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d96826117e1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611dc857611dc7611d5c565b5b600182019050919050565b6000604082019050611de860008301856117eb565b611df560208301846117eb565b9392505050565b6000606082019050611e1160008301866117eb565b611e1e60208301856117eb565b611e2b60408301846117eb565b949350505050565b600081519050611e4281611a53565b92915050565b600060208284031215611e5e57611e5d61181f565b5b6000611e6c84828501611e33565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611eaf826117e1565b9150611eba836117e1565b9250828203905081811115611ed257611ed1611d5c565b5b92915050565b6000611ee3826117e1565b9150611eee836117e1565b9250828201905080821115611f0657611f05611d5c565b5b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611f4181611a41565b82525050565b6000611f538383611f38565b60208301905092915050565b6000602082019050919050565b6000611f7782611f0c565b611f818185611f17565b9350611f8c83611f28565b8060005b83811015611fbd578151611fa48882611f47565b9750611faf83611f5f565b925050600181019050611f90565b5085935050505092915050565b6000608082019050611fdf60008301876117eb565b8181036020830152611ff18186611f6c565b90506120006040830185611ad9565b61200d60608301846117eb565b95945050505050565b6000612021826117e1565b915061202c836117e1565b925082820261203a816117e1565b9150828204841483151761205157612050611d5c565b5b5092915050565b600082825260208201905092915050565b7f43616e27742072656e6f756e6365206f776e6572736869700000000000000000600082015250565b600061209f601883612058565b91506120aa82612069565b602082019050919050565b600060208201905081810360008301526120ce81612092565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b6000612131602983612058565b915061213c826120d5565b604082019050919050565b6000602082019050818103600083015261216081612124565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e20302e0000600082015250565b600061219d601e83612058565b91506121a882612167565b602082019050919050565b600060208201905081810360008301526121cc81612190565b9050919050565b7f496e636f727265637420616d6f756e742073656e742e00000000000000000000600082015250565b6000612209601683612058565b9150612214826121d3565b602082019050919050565b60006020820190508181036000830152612238816121fc565b9050919050565b600081519050919050565b60005b8381101561226857808201518184015260208101905061224d565b60008484015250505050565b600061227f8261223f565b6122898185612058565b935061229981856020860161224a565b6122a281611b08565b840191505092915050565b600060408201905081810360008301526122c78185612274565b90506122d660208301846117eb565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612313602083612058565b915061231e826122dd565b602082019050919050565b6000602082019050818103600083015261234281612306565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061237f601f83612058565b915061238a82612349565b602082019050919050565b600060208201905081810360008301526123ae81612372565b9050919050565b60008160601b9050919050565b60006123cd826123b5565b9050919050565b60006123df826123c2565b9050919050565b6123f76123f282611a41565b6123d4565b82525050565b6000819050919050565b612418612413826117e1565b6123fd565b82525050565b600061242a82866123e6565b60148201915061243a8285612407565b60208201915061244a8284612407565b602082019150819050949350505050565b60006040820190506124706000830185611ad9565b61247d60208301846117eb565b9392505050565b60006060820190506124996000830186611ad9565b6124a66020830185611ad9565b6124b360408301846117eb565b949350505050565b60008115159050919050565b6124d0816124bb565b81146124db57600080fd5b50565b6000815190506124ed816124c7565b92915050565b6000602082840312156125095761250861181f565b5b6000612517848285016124de565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061257c602a83612058565b915061258782612520565b604082019050919050565b600060208201905081810360008301526125ab8161256f565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061260e602683612058565b9150612619826125b2565b604082019050919050565b6000602082019050818103600083015261263d81612601565b9050919050565b600081519050919050565b600081905092915050565b600061266582612644565b61266f818561264f565b935061267f81856020860161224a565b80840191505092915050565b6000612697828461265a565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006126d8601d83612058565b91506126e3826126a2565b602082019050919050565b60006020820190508181036000830152612707816126cb565b9050919050565b600060208201905081810360008301526127288184612274565b90509291505056fea264697066735822122048d78f7051d5d2aadf5e3492d8633ebfdcb9851892222b24911fa461200c556164736f6c63430008130033

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  ]
[ 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.