ETH Price: $3,834.76 (+1.91%)
Gas: 4 Gwei

Contract

0x6D7812d41A08BC2a910B562d8B56411964A4eD88
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Pause167328642023-03-01 9:24:23458 days ago1677662663IN
X2Y2: X2Y2_r1
0 ETH0.0013654329.18723509
Initialize167328542023-03-01 9:22:23458 days ago1677662543IN
X2Y2: X2Y2_r1
0 ETH0.0032439827.63450873
0x60806040141391502022-02-04 11:10:04848 days ago1643973004IN
 Create: X2Y2_r1
0 ETH0.2378779462

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
X2Y2_r1

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 14 : X2Y2_r1.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.0;
pragma abicoder v2;

import './IDelegate.sol';
import './IWETHUpgradable.sol';
import './MarketConsts.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';

interface IX2Y2Run {
    function run1(
        Market.Order memory order,
        Market.SettleShared memory shared,
        Market.SettleDetail memory detail
    ) external returns (uint256);
}

contract X2Y2_r1 is
    Initializable,
    ReentrancyGuardUpgradeable,
    OwnableUpgradeable,
    PausableUpgradeable,
    IX2Y2Run
{
    using SafeERC20Upgradeable for IERC20Upgradeable;

    event EvProfit(bytes32 itemHash, address currency, address to, uint256 amount);
    event EvAuctionRefund(
        bytes32 indexed itemHash,
        address currency,
        address to,
        uint256 amount,
        uint256 incentive
    );
    event EvInventory(
        bytes32 indexed itemHash,
        address maker,
        address taker,
        uint256 orderSalt,
        uint256 settleSalt,
        uint256 intent,
        uint256 delegateType,
        uint256 deadline,
        IERC20Upgradeable currency,
        bytes dataMask,
        Market.OrderItem item,
        Market.SettleDetail detail
    );
    event EvSigner(address signer, bool isRemoval);
    event EvDelegate(address delegate, bool isRemoval);
    event EvFeeCapUpdate(uint256 newValue);
    event EvCancel(bytes32 indexed itemHash);
    event EvFailure(uint256 index, bytes error);

    mapping(address => bool) public delegates;
    mapping(address => bool) public signers;

    mapping(bytes32 => Market.InvStatus) public inventoryStatus;
    mapping(bytes32 => Market.OngoingAuction) public ongoingAuctions;

    uint256 public constant RATE_BASE = 1e6;
    uint256 public feeCapPct;
    IWETHUpgradable public weth;

    receive() external payable {}

    function pause() public onlyOwner {
        _pause();
    }

    function unpause() public onlyOwner {
        _unpause();
    }

    function initialize(uint256 feeCapPct_, address weth_) public initializer {
        feeCapPct = feeCapPct_;
        weth = IWETHUpgradable(weth_);

        __ReentrancyGuard_init_unchained();
        __Pausable_init_unchained();
        __Ownable_init_unchained();
    }

    function updateFeeCap(uint256 val) public virtual onlyOwner {
        feeCapPct = val;
        emit EvFeeCapUpdate(val);
    }

    function updateSigners(address[] memory toAdd, address[] memory toRemove)
        public
        virtual
        onlyOwner
    {
        for (uint256 i = 0; i < toAdd.length; i++) {
            signers[toAdd[i]] = true;
            emit EvSigner(toAdd[i], false);
        }
        for (uint256 i = 0; i < toRemove.length; i++) {
            delete signers[toRemove[i]];
            emit EvSigner(toRemove[i], true);
        }
    }

    function updateDelegates(address[] memory toAdd, address[] memory toRemove)
        public
        virtual
        onlyOwner
    {
        for (uint256 i = 0; i < toAdd.length; i++) {
            delegates[toAdd[i]] = true;
            emit EvDelegate(toAdd[i], false);
        }
        for (uint256 i = 0; i < toRemove.length; i++) {
            delete delegates[toRemove[i]];
            emit EvDelegate(toRemove[i], true);
        }
    }

    function cancel(
        bytes32[] memory itemHashes,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual nonReentrant whenNotPaused {
        require(deadline > block.timestamp, 'deadline reached');
        bytes32 hash = keccak256(abi.encode(itemHashes.length, itemHashes, deadline));
        address signer = ECDSA.recover(hash, v, r, s);
        require(signers[signer], 'Input signature error');

        for (uint256 i = 0; i < itemHashes.length; i++) {
            bytes32 h = itemHashes[i];
            if (inventoryStatus[h] == Market.InvStatus.NEW) {
                inventoryStatus[h] = Market.InvStatus.CANCELLED;
                emit EvCancel(h);
            }
        }
    }

    function run(Market.RunInput memory input) public payable virtual nonReentrant whenNotPaused {
        require(input.shared.deadline > block.timestamp, 'input deadline reached');
        require(msg.sender == input.shared.user, 'sender does not match');
        _verifyInputSignature(input);

        uint256 amountEth = msg.value;
        if (input.shared.amountToWeth > 0) {
            uint256 amt = input.shared.amountToWeth;
            weth.deposit{value: amt}();
            SafeERC20Upgradeable.safeTransfer(weth, msg.sender, amt);
            amountEth -= amt;
        }
        if (input.shared.amountToEth > 0) {
            uint256 amt = input.shared.amountToEth;
            SafeERC20Upgradeable.safeTransferFrom(weth, msg.sender, address(this), amt);
            weth.withdraw(amt);
            amountEth += amt;
        }

        for (uint256 i = 0; i < input.orders.length; i++) {
            _verifyOrderSignature(input.orders[i]);
        }

        for (uint256 i = 0; i < input.details.length; i++) {
            Market.SettleDetail memory detail = input.details[i];
            Market.Order memory order = input.orders[detail.orderIdx];
            if (input.shared.canFail) {
                try IX2Y2Run(address(this)).run1(order, input.shared, detail) returns (
                    uint256 ethPayment
                ) {
                    amountEth -= ethPayment;
                } catch Error(string memory _err) {
                    emit EvFailure(i, bytes(_err));
                } catch (bytes memory _err) {
                    emit EvFailure(i, _err);
                }
            } else {
                amountEth -= _run(order, input.shared, detail);
            }
        }
        if (amountEth > 0) {
            payable(msg.sender).transfer(amountEth);
        }
    }

    function run1(
        Market.Order memory order,
        Market.SettleShared memory shared,
        Market.SettleDetail memory detail
    ) external virtual returns (uint256) {
        require(msg.sender == address(this), 'unsafe call');

        return _run(order, shared, detail);
    }

    function _hashItem(Market.Order memory order, Market.OrderItem memory item)
        internal
        view
        virtual
        returns (bytes32)
    {
        return
            keccak256(
                abi.encode(
                    order.salt,
                    order.user,
                    order.network,
                    order.intent,
                    order.delegateType,
                    order.deadline,
                    order.currency,
                    order.dataMask,
                    item
                )
            );
    }

    function _emitInventory(
        bytes32 itemHash,
        Market.Order memory order,
        Market.OrderItem memory item,
        Market.SettleShared memory shared,
        Market.SettleDetail memory detail
    ) internal virtual {
        emit EvInventory(
            itemHash,
            order.user,
            shared.user,
            order.salt,
            shared.salt,
            order.intent,
            order.delegateType,
            order.deadline,
            order.currency,
            order.dataMask,
            item,
            detail
        );
    }

    function _run(
        Market.Order memory order,
        Market.SettleShared memory shared,
        Market.SettleDetail memory detail
    ) internal virtual returns (uint256) {
        uint256 nativeAmount = 0;

        Market.OrderItem memory item = order.items[detail.itemIdx];
        bytes32 itemHash = _hashItem(order, item);

        {
            require(itemHash == detail.itemHash, 'item hash does not match');
            require(order.network == block.chainid, 'wrong network');
            require(
                address(detail.executionDelegate) != address(0) &&
                    delegates[address(detail.executionDelegate)],
                'unknown delegate'
            );
        }

        bytes memory data = item.data;
        {
            if (order.dataMask.length > 0 && detail.dataReplacement.length > 0) {
                _arrayReplace(data, detail.dataReplacement, order.dataMask);
            }
        }

        if (detail.op == Market.Op.COMPLETE_SELL_OFFER) {
            require(inventoryStatus[itemHash] == Market.InvStatus.NEW, 'order already exists');
            require(order.intent == Market.INTENT_SELL, 'intent != sell');
            _assertDelegation(order, detail);
            require(order.deadline > block.timestamp, 'deadline reached');
            require(detail.price >= item.price, 'underpaid');

            nativeAmount = _takePayment(itemHash, order.currency, shared.user, detail.price);
            require(
                detail.executionDelegate.executeSell(order.user, shared.user, data),
                'delegation error'
            );

            _distributeFeeAndProfit(
                itemHash,
                order.user,
                order.currency,
                detail,
                detail.price,
                detail.price
            );
            inventoryStatus[itemHash] = Market.InvStatus.COMPLETE;
        } else if (detail.op == Market.Op.COMPLETE_BUY_OFFER) {
            require(inventoryStatus[itemHash] == Market.InvStatus.NEW, 'order already exists');
            require(order.intent == Market.INTENT_BUY, 'intent != buy');
            _assertDelegation(order, detail);
            require(order.deadline > block.timestamp, 'deadline reached');
            require(item.price == detail.price, 'price not match');

            require(!_isNative(order.currency), 'native token not supported');

            nativeAmount = _takePayment(itemHash, order.currency, order.user, detail.price);
            require(
                detail.executionDelegate.executeBuy(shared.user, order.user, data),
                'delegation error'
            );

            _distributeFeeAndProfit(
                itemHash,
                shared.user,
                order.currency,
                detail,
                detail.price,
                detail.price
            );
            inventoryStatus[itemHash] = Market.InvStatus.COMPLETE;
        } else if (detail.op == Market.Op.CANCEL_OFFER) {
            require(inventoryStatus[itemHash] == Market.InvStatus.NEW, 'unable to cancel');
            require(order.deadline > block.timestamp, 'deadline reached');
            inventoryStatus[itemHash] = Market.InvStatus.CANCELLED;
            emit EvCancel(itemHash);
        } else if (detail.op == Market.Op.BID) {
            require(order.intent == Market.INTENT_AUCTION, 'intent != auction');
            _assertDelegation(order, detail);
            bool firstBid = false;
            if (ongoingAuctions[itemHash].bidder == address(0)) {
                require(inventoryStatus[itemHash] == Market.InvStatus.NEW, 'order already exists');
                require(order.deadline > block.timestamp, 'auction ended');
                require(detail.price >= item.price, 'underpaid');

                firstBid = true;
                ongoingAuctions[itemHash] = Market.OngoingAuction({
                    price: detail.price,
                    netPrice: detail.price,
                    bidder: shared.user,
                    endAt: order.deadline
                });
                inventoryStatus[itemHash] = Market.InvStatus.AUCTION;

                require(
                    detail.executionDelegate.executeBid(order.user, address(0), shared.user, data),
                    'delegation error'
                );
            }

            Market.OngoingAuction storage auc = ongoingAuctions[itemHash];
            require(auc.endAt > block.timestamp, 'auction ended');

            nativeAmount = _takePayment(itemHash, order.currency, shared.user, detail.price);

            if (!firstBid) {
                require(
                    inventoryStatus[itemHash] == Market.InvStatus.AUCTION,
                    'order is not auction'
                );
                require(
                    detail.price - auc.price >= (auc.price * detail.aucMinIncrementPct) / RATE_BASE,
                    'underbid'
                );

                uint256 bidRefund = auc.netPrice;
                uint256 incentive = (detail.price * detail.bidIncentivePct) / RATE_BASE;
                if (bidRefund + incentive > 0) {
                    _transferTo(order.currency, auc.bidder, bidRefund + incentive);
                    emit EvAuctionRefund(
                        itemHash,
                        address(order.currency),
                        auc.bidder,
                        bidRefund,
                        incentive
                    );
                }

                require(
                    detail.executionDelegate.executeBid(order.user, auc.bidder, shared.user, data),
                    'delegation error'
                );

                auc.price = detail.price;
                auc.netPrice = detail.price - incentive;
                auc.bidder = shared.user;
            }

            if (block.timestamp + detail.aucIncDurationSecs > auc.endAt) {
                auc.endAt += detail.aucIncDurationSecs;
            }
        } else if (
            detail.op == Market.Op.REFUND_AUCTION ||
            detail.op == Market.Op.REFUND_AUCTION_STUCK_ITEM
        ) {
            require(
                inventoryStatus[itemHash] == Market.InvStatus.AUCTION,
                'cannot cancel non-auction order'
            );
            Market.OngoingAuction storage auc = ongoingAuctions[itemHash];

            if (auc.netPrice > 0) {
                _transferTo(order.currency, auc.bidder, auc.netPrice);
                emit EvAuctionRefund(
                    itemHash,
                    address(order.currency),
                    auc.bidder,
                    auc.netPrice,
                    0
                );
            }
            _assertDelegation(order, detail);

            if (detail.op == Market.Op.REFUND_AUCTION) {
                require(
                    detail.executionDelegate.executeAuctionRefund(order.user, auc.bidder, data),
                    'delegation error'
                );
            }
            delete ongoingAuctions[itemHash];
            inventoryStatus[itemHash] = Market.InvStatus.REFUNDED;
        } else if (detail.op == Market.Op.COMPLETE_AUCTION) {
            require(
                inventoryStatus[itemHash] == Market.InvStatus.AUCTION,
                'cannot complete non-auction order'
            );
            _assertDelegation(order, detail);
            Market.OngoingAuction storage auc = ongoingAuctions[itemHash];
            require(block.timestamp >= auc.endAt, 'auction not finished yet');

            require(
                detail.executionDelegate.executeAuctionComplete(order.user, auc.bidder, data),
                'delegation error'
            );
            _distributeFeeAndProfit(
                itemHash,
                order.user,
                order.currency,
                detail,
                auc.price,
                auc.netPrice
            );

            inventoryStatus[itemHash] = Market.InvStatus.COMPLETE;
            delete ongoingAuctions[itemHash];
        } else {
            revert('unknown op');
        }

        _emitInventory(itemHash, order, item, shared, detail);
        return nativeAmount;
    }

    function _assertDelegation(Market.Order memory order, Market.SettleDetail memory detail)
        internal
        view
        virtual
    {
        require(
            detail.executionDelegate.delegateType() == order.delegateType,
            'delegation type error'
        );
    }

    // modifies `src`
    function _arrayReplace(
        bytes memory src,
        bytes memory replacement,
        bytes memory mask
    ) internal view virtual {
        require(src.length == replacement.length);
        require(src.length == mask.length);

        for (uint256 i = 0; i < src.length; i++) {
            if (mask[i] != 0) {
                src[i] = replacement[i];
            }
        }
    }

    function _verifyInputSignature(Market.RunInput memory input) internal view virtual {
        bytes32 hash = keccak256(abi.encode(input.shared, input.details.length, input.details));
        address signer = ECDSA.recover(hash, input.v, input.r, input.s);
        require(signers[signer], 'Input signature error');
    }

    function _verifyOrderSignature(Market.Order memory order) internal view virtual {
        address orderSigner;

        if (order.signVersion == Market.SIGN_V1) {
            bytes32 orderHash = keccak256(
                abi.encode(
                    order.salt,
                    order.user,
                    order.network,
                    order.intent,
                    order.delegateType,
                    order.deadline,
                    order.currency,
                    order.dataMask,
                    order.items.length,
                    order.items
                )
            );
            orderSigner = ECDSA.recover(
                ECDSA.toEthSignedMessageHash(orderHash),
                order.v,
                order.r,
                order.s
            );
        } else {
            revert('unknown signature version');
        }

        require(orderSigner == order.user, 'Order signature does not match');
    }

    function _isNative(IERC20Upgradeable currency) internal view virtual returns (bool) {
        return address(currency) == address(0);
    }

    function _takePayment(
        bytes32 itemHash,
        IERC20Upgradeable currency,
        address from,
        uint256 amount
    ) internal virtual returns (uint256) {
        if (amount > 0) {
            if (_isNative(currency)) {
                return amount;
            } else {
                currency.safeTransferFrom(from, address(this), amount);
            }
        }
        return 0;
    }

    function _transferTo(
        IERC20Upgradeable currency,
        address to,
        uint256 amount
    ) internal virtual {
        if (amount > 0) {
            if (_isNative(currency)) {
                AddressUpgradeable.sendValue(payable(to), amount);
            } else {
                currency.safeTransfer(to, amount);
            }
        }
    }

    function _distributeFeeAndProfit(
        bytes32 itemHash,
        address seller,
        IERC20Upgradeable currency,
        Market.SettleDetail memory sd,
        uint256 price,
        uint256 netPrice
    ) internal virtual {
        require(price >= netPrice, 'price error');

        uint256 payment = netPrice;
        uint256 totalFeePct;

        for (uint256 i = 0; i < sd.fees.length; i++) {
            Market.Fee memory fee = sd.fees[i];
            totalFeePct += fee.percentage;
            uint256 amount = (price * fee.percentage) / RATE_BASE;
            payment -= amount;
            _transferTo(currency, fee.to, amount);
        }

        require(feeCapPct >= totalFeePct, 'total fee cap exceeded');

        _transferTo(currency, seller, payment);
        emit EvProfit(itemHash, address(currency), seller, payment);
    }
}

File 3 of 14 : IDelegate.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.0;
pragma abicoder v2;

interface IDelegate {
    function delegateType() external view returns (uint256);

    function executeSell(
        address seller,
        address buyer,
        bytes calldata data
    ) external returns (bool);

    function executeBuy(
        address seller,
        address buyer,
        bytes calldata data
    ) external returns (bool);

    function executeBid(
        address seller,
        address previousBidder,
        address bidder,
        bytes calldata data
    ) external returns (bool);

    function executeAuctionComplete(
        address seller,
        address buyer,
        bytes calldata data
    ) external returns (bool);

    function executeAuctionRefund(
        address seller,
        address lastBidder,
        bytes calldata data
    ) external returns (bool);
}

File 4 of 14 : IWETHUpgradable.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.0;
pragma abicoder v2;

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

interface IWETHUpgradable is IERC20Upgradeable {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

File 5 of 14 : MarketConsts.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.0;
pragma abicoder v2;

import './IDelegate.sol';
import './IWETHUpgradable.sol';

library Market {
    uint256 constant INTENT_SELL = 1;
    uint256 constant INTENT_AUCTION = 2;
    uint256 constant INTENT_BUY = 3;

    uint8 constant SIGN_V1 = 1;
    uint8 constant SIGN_V3 = 3;

    struct OrderItem {
        uint256 price;
        bytes data;
    }

    struct Order {
        uint256 salt;
        address user;
        uint256 network;
        uint256 intent;
        uint256 delegateType;
        uint256 deadline;
        IERC20Upgradeable currency;
        bytes dataMask;
        OrderItem[] items;
        // signature
        bytes32 r;
        bytes32 s;
        uint8 v;
        uint8 signVersion;
    }

    struct Fee {
        uint256 percentage;
        address to;
    }

    struct SettleDetail {
        Market.Op op;
        uint256 orderIdx;
        uint256 itemIdx;
        uint256 price;
        bytes32 itemHash;
        IDelegate executionDelegate;
        bytes dataReplacement;
        uint256 bidIncentivePct;
        uint256 aucMinIncrementPct;
        uint256 aucIncDurationSecs;
        Fee[] fees;
    }

    struct SettleShared {
        uint256 salt;
        uint256 deadline;
        uint256 amountToEth;
        uint256 amountToWeth;
        address user;
        bool canFail;
    }

    struct RunInput {
        Order[] orders;
        SettleDetail[] details;
        SettleShared shared;
        // signature
        bytes32 r;
        bytes32 s;
        uint8 v;
    }

    struct OngoingAuction {
        uint256 price;
        uint256 netPrice;
        uint256 endAt;
        address bidder;
    }

    enum InvStatus {
        NEW,
        AUCTION,
        COMPLETE,
        CANCELLED,
        REFUNDED
    }

    enum Op {
        INVALID,
        // off-chain
        COMPLETE_SELL_OFFER,
        COMPLETE_BUY_OFFER,
        CANCEL_OFFER,
        // auction
        BID,
        COMPLETE_AUCTION,
        REFUND_AUCTION,
        REFUND_AUCTION_STUCK_ITEM
    }

    enum DelegationType {
        INVALID,
        ERC721,
        ERC1155
    }
}

File 6 of 14 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

File 7 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 8 of 14 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

File 9 of 14 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

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

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 10 of 14 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

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

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

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

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

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

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

File 11 of 14 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

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

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 12 of 14 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 13 of 14 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 14 of 14 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"incentive","type":"uint256"}],"name":"EvAuctionRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"itemHash","type":"bytes32"}],"name":"EvCancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"bool","name":"isRemoval","type":"bool"}],"name":"EvDelegate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"EvFailure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"EvFeeCapUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"orderSalt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settleSalt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"intent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegateType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"deadline","type":"uint256"},{"indexed":false,"internalType":"contract IERC20Upgradeable","name":"currency","type":"address"},{"indexed":false,"internalType":"bytes","name":"dataMask","type":"bytes"},{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct Market.OrderItem","name":"item","type":"tuple"},{"components":[{"internalType":"enum Market.Op","name":"op","type":"uint8"},{"internalType":"uint256","name":"orderIdx","type":"uint256"},{"internalType":"uint256","name":"itemIdx","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"internalType":"contract IDelegate","name":"executionDelegate","type":"address"},{"internalType":"bytes","name":"dataReplacement","type":"bytes"},{"internalType":"uint256","name":"bidIncentivePct","type":"uint256"},{"internalType":"uint256","name":"aucMinIncrementPct","type":"uint256"},{"internalType":"uint256","name":"aucIncDurationSecs","type":"uint256"},{"components":[{"internalType":"uint256","name":"percentage","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Market.Fee[]","name":"fees","type":"tuple[]"}],"indexed":false,"internalType":"struct Market.SettleDetail","name":"detail","type":"tuple"}],"name":"EvInventory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EvProfit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bool","name":"isRemoval","type":"bool"}],"name":"EvSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"RATE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"itemHashes","type":"bytes32[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCapPct","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeCapPct_","type":"uint256"},{"internalType":"address","name":"weth_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"inventoryStatus","outputs":[{"internalType":"enum Market.InvStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ongoingAuctions","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"netPrice","type":"uint256"},{"internalType":"uint256","name":"endAt","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"network","type":"uint256"},{"internalType":"uint256","name":"intent","type":"uint256"},{"internalType":"uint256","name":"delegateType","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"contract IERC20Upgradeable","name":"currency","type":"address"},{"internalType":"bytes","name":"dataMask","type":"bytes"},{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Market.OrderItem[]","name":"items","type":"tuple[]"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"uint8","name":"signVersion","type":"uint8"}],"internalType":"struct Market.Order[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum Market.Op","name":"op","type":"uint8"},{"internalType":"uint256","name":"orderIdx","type":"uint256"},{"internalType":"uint256","name":"itemIdx","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"internalType":"contract IDelegate","name":"executionDelegate","type":"address"},{"internalType":"bytes","name":"dataReplacement","type":"bytes"},{"internalType":"uint256","name":"bidIncentivePct","type":"uint256"},{"internalType":"uint256","name":"aucMinIncrementPct","type":"uint256"},{"internalType":"uint256","name":"aucIncDurationSecs","type":"uint256"},{"components":[{"internalType":"uint256","name":"percentage","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Market.Fee[]","name":"fees","type":"tuple[]"}],"internalType":"struct Market.SettleDetail[]","name":"details","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountToEth","type":"uint256"},{"internalType":"uint256","name":"amountToWeth","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"canFail","type":"bool"}],"internalType":"struct Market.SettleShared","name":"shared","type":"tuple"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct Market.RunInput","name":"input","type":"tuple"}],"name":"run","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"network","type":"uint256"},{"internalType":"uint256","name":"intent","type":"uint256"},{"internalType":"uint256","name":"delegateType","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"contract IERC20Upgradeable","name":"currency","type":"address"},{"internalType":"bytes","name":"dataMask","type":"bytes"},{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Market.OrderItem[]","name":"items","type":"tuple[]"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"uint8","name":"signVersion","type":"uint8"}],"internalType":"struct Market.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountToEth","type":"uint256"},{"internalType":"uint256","name":"amountToWeth","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"canFail","type":"bool"}],"internalType":"struct Market.SettleShared","name":"shared","type":"tuple"},{"components":[{"internalType":"enum Market.Op","name":"op","type":"uint8"},{"internalType":"uint256","name":"orderIdx","type":"uint256"},{"internalType":"uint256","name":"itemIdx","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bytes32","name":"itemHash","type":"bytes32"},{"internalType":"contract IDelegate","name":"executionDelegate","type":"address"},{"internalType":"bytes","name":"dataReplacement","type":"bytes"},{"internalType":"uint256","name":"bidIncentivePct","type":"uint256"},{"internalType":"uint256","name":"aucMinIncrementPct","type":"uint256"},{"internalType":"uint256","name":"aucIncDurationSecs","type":"uint256"},{"components":[{"internalType":"uint256","name":"percentage","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Market.Fee[]","name":"fees","type":"tuple[]"}],"internalType":"struct Market.SettleDetail","name":"detail","type":"tuple"}],"name":"run1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"toAdd","type":"address[]"},{"internalType":"address[]","name":"toRemove","type":"address[]"}],"name":"updateDelegates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"val","type":"uint256"}],"name":"updateFeeCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"toAdd","type":"address[]"},{"internalType":"address[]","name":"toRemove","type":"address[]"}],"name":"updateSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETHUpgradable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b5061446d806100206000396000f3fe6080604052600436106101235760003560e01c80638456cb59116100a0578063d95e3c5411610064578063d95e3c5414610335578063da35a26f14610355578063e59f739a14610375578063ea80591714610395578063f2fde38b1461040957600080fd5b80638456cb59146102985780638da5cb5b146102ad578063912c860c146102c257806395835fea146102ff5780639fb514671461031f57600080fd5b80633fc8cef3116100e75780633fc8cef3146101c3578063587cde1e146101fb5780635c975abb1461023b578063715018a614610253578063736c0d5b1461026857600080fd5b80630873c6ec1461012f5780632295f9bf14610159578063350b23691461017b578063357a150b1461019b5780633f4ba83a146101ae57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50610146620f424081565b6040519081526020015b60405180910390f35b34801561016557600080fd5b5061017961017436600461313a565b610429565b005b34801561018757600080fd5b5061017961019636600461329a565b6105dd565b6101796101a9366004613877565b610799565b3480156101ba57600080fd5b50610179610c3a565b3480156101cf57600080fd5b5060ce546101e3906001600160a01b031681565b6040516001600160a01b039091168152602001610150565b34801561020757600080fd5b5061022b610216366004613942565b60c96020526000908152604090205460ff1681565b6040519015158152602001610150565b34801561024757600080fd5b5060975460ff1661022b565b34801561025f57600080fd5b50610179610c73565b34801561027457600080fd5b5061022b610283366004613942565b60ca6020526000908152604090205460ff1681565b3480156102a457600080fd5b50610179610cac565b3480156102b957600080fd5b506101e3610ce3565b3480156102ce57600080fd5b506102f26102dd36600461395f565b60cb6020526000908152604090205460ff1681565b604051610150919061398e565b34801561030b57600080fd5b5061017961031a36600461395f565b610cf2565b34801561032b57600080fd5b5061014660cd5481565b34801561034157600080fd5b506101466103503660046139a8565b610d5c565b34801561036157600080fd5b50610179610370366004613a1d565b610db0565b34801561038157600080fd5b5061017961039036600461329a565b610ea2565b3480156103a157600080fd5b506103e06103b036600461395f565b60cc602052600090815260409020805460018201546002830154600390930154919290916001600160a01b031684565b604080519485526020850193909352918301526001600160a01b03166060820152608001610150565b34801561041557600080fd5b50610179610424366004613942565b611059565b600260015414156104555760405162461bcd60e51b815260040161044c90613a4d565b60405180910390fd5b600260015560975460ff161561047d5760405162461bcd60e51b815260040161044c90613a84565b42841161049c5760405162461bcd60e51b815260040161044c90613aae565b6000855186866040516020016104b493929190613ad8565b60405160208183030381529060405280519060200120905060006104da828686866110f9565b6001600160a01b038116600090815260ca602052604090205490915060ff166105155760405162461bcd60e51b815260040161044c90613b2f565b60005b87518110156105cf57600088828151811061053557610535613b5e565b602002602001015190506000600481111561055257610552613978565b600082815260cb602052604090205460ff16600481111561057557610575613978565b14156105bc57600081815260cb6020526040808220805460ff191660031790555182917f5b0b06d07e20243724d90e17a20034972f339eb28bd1c9437a71999bd15a1e7a91a25b50806105c781613b8a565b915050610518565b505060018055505050505050565b336105e6610ce3565b6001600160a01b03161461060c5760405162461bcd60e51b815260040161044c90613ba5565b60005b82518110156106d457600160ca600085848151811061063057610630613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f0127aee741cbb6bc48b5475b8eb3eb2e5d053809d551dedd517a0b5b52b80fd58382815181106106a2576106a2613b5e565b602002602001015160006040516106ba929190613bda565b60405180910390a1806106cc81613b8a565b91505061060f565b5060005b81518110156107945760ca60008383815181106106f7576106f7613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557f0127aee741cbb6bc48b5475b8eb3eb2e5d053809d551dedd517a0b5b52b80fd582828151811061076257610762613b5e565b6020026020010151600160405161077a929190613bda565b60405180910390a18061078c81613b8a565b9150506106d8565b505050565b600260015414156107bc5760405162461bcd60e51b815260040161044c90613a4d565b600260015560975460ff16156107e45760405162461bcd60e51b815260040161044c90613a84565b42816040015160200151116108345760405162461bcd60e51b81526020600482015260166024820152751a5b9c1d5d08191958591b1a5b99481c995858da195960521b604482015260640161044c565b8060400151608001516001600160a01b0316336001600160a01b0316146108955760405162461bcd60e51b81526020600482015260156024820152740e6cadcc8cae440c8decae640dcdee840dac2e8c6d605b1b604482015260640161044c565b61089e81611123565b60408101516060015134901561093f576040808301516060015160ce548251630d0e30db60e41b8152925191926001600160a01b039091169163d0e30db0918491600480830192600092919082900301818588803b1580156108ff57600080fd5b505af1158015610913573d6000803e3d6000fd5b505060ce5461093193506001600160a01b03169150339050836111b4565b61093b8183613bf5565b9150505b6040808301510151156109da57604080830151015160ce5461096c906001600160a01b0316333084611217565b60ce54604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b1580156109b257600080fd5b505af11580156109c6573d6000803e3d6000fd5b5050505080826109d69190613c0c565b9150505b60005b825151811015610a1f57610a0d83600001518281518110610a0057610a00613b5e565b6020026020010151611255565b80610a1781613b8a565b9150506109dd565b5060005b826020015151811015610bfc57600083602001518281518110610a4857610a48613b5e565b6020026020010151905060008460000151826020015181518110610a6e57610a6e613b5e565b60200260200101519050846040015160a0015115610bcb5760408086015190516336578f1560e21b8152309163d95e3c5491610ab09185918790600401613e46565b6020604051808303816000875af1925050508015610aeb575060408051601f3d908101601f19168201909252610ae891810190613f60565b60015b610bb957610af7613f79565b806308c379a01415610b565750610b0c613f95565b80610b175750610b58565b7f97c789f43a3e7ac27906b5fbdac832f54441771021fba06f71207d9be6d4b6238482604051610b4892919061401e565b60405180910390a150610be7565b505b3d808015610b82576040519150601f19603f3d011682016040523d82523d6000602084013e610b87565b606091505b507f97c789f43a3e7ac27906b5fbdac832f54441771021fba06f71207d9be6d4b6238482604051610b4892919061401e565b610bc38186613bf5565b945050610be7565b610bda818660400151846113ea565b610be49085613bf5565b93505b50508080610bf490613b8a565b915050610a23565b508015610c3257604051339082156108fc029083906000818181858888f19350505050158015610c30573d6000803e3d6000fd5b505b505060018055565b33610c43610ce3565b6001600160a01b031614610c695760405162461bcd60e51b815260040161044c90613ba5565b610c7161244b565b565b33610c7c610ce3565b6001600160a01b031614610ca25760405162461bcd60e51b815260040161044c90613ba5565b610c7160006124de565b33610cb5610ce3565b6001600160a01b031614610cdb5760405162461bcd60e51b815260040161044c90613ba5565b610c71612530565b6065546001600160a01b031690565b33610cfb610ce3565b6001600160a01b031614610d215760405162461bcd60e51b815260040161044c90613ba5565b60cd8190556040518181527f19fc3beddeea399f0966d5f8664ad94006f16a10fb28c4e2fe6fae62626b71289060200160405180910390a150565b6000333014610d9b5760405162461bcd60e51b815260206004820152600b60248201526a1d5b9cd859994818d85b1b60aa1b604482015260640161044c565b610da68484846113ea565b90505b9392505050565b600054610100900460ff16610dcb5760005460ff1615610dcf565b303b155b610e325760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161044c565b600054610100900460ff16158015610e54576000805461ffff19166101011790555b60cd83905560ce80546001600160a01b0319166001600160a01b038416179055610e7c612588565b610e846125b5565b610e8c6125e8565b8015610794576000805461ff0019169055505050565b33610eab610ce3565b6001600160a01b031614610ed15760405162461bcd60e51b815260040161044c90613ba5565b60005b8251811015610f9957600160c96000858481518110610ef557610ef5613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4a31a64b928a0e8aff42ef84d144ffe82d08cb41c8027060593135e2026899b2838281518110610f6757610f67613b5e565b60200260200101516000604051610f7f929190613bda565b60405180910390a180610f9181613b8a565b915050610ed4565b5060005b81518110156107945760c96000838381518110610fbc57610fbc613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557f4a31a64b928a0e8aff42ef84d144ffe82d08cb41c8027060593135e2026899b282828151811061102757611027613b5e565b6020026020010151600160405161103f929190613bda565b60405180910390a18061105181613b8a565b915050610f9d565b33611062610ce3565b6001600160a01b0316146110885760405162461bcd60e51b815260040161044c90613ba5565b6001600160a01b0381166110ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161044c565b6110f6816124de565b50565b600080600061110a87878787612618565b91509150611117816126fb565b5090505b949350505050565b60008160400151826020015151836020015160405160200161114793929190614037565b6040516020818303038152906040528051906020012090506000611179828460a00151856060015186608001516110f9565b6001600160a01b038116600090815260ca602052604090205490915060ff166107945760405162461bcd60e51b815260040161044c90613b2f565b6040516001600160a01b03831660248201526044810182905261079490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526128b1565b6040516001600160a01b038085166024830152831660448201526064810182905261124f9085906323b872dd60e01b906084016111e0565b50505050565b61018081015160009060ff166001141561133d5781516020808401516040808601516060870151608088015160a089015160c08a015160e08b01516101008c01518051975160009b6112ac9b909a999291016140b6565b60405160208183030381529060405280519060200120905061133561131e826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b8461016001518561012001518661014001516110f9565b915050611381565b60405162461bcd60e51b81526020600482015260196024820152783ab735b737bbb71039b4b3b730ba3ab932903b32b939b4b7b760391b604482015260640161044c565b81602001516001600160a01b0316816001600160a01b0316146113e65760405162461bcd60e51b815260206004820152601e60248201527f4f72646572207369676e617475726520646f6573206e6f74206d617463680000604482015260640161044c565b5050565b60008060009050600085610100015184604001518151811061140e5761140e613b5e565b6020026020010151905060006114248783612983565b9050846080015181146114745760405162461bcd60e51b81526020600482015260186024820152770d2e8cada40d0c2e6d040c8decae640dcdee840dac2e8c6d60431b604482015260640161044c565b468760400151146114b75760405162461bcd60e51b815260206004820152600d60248201526c77726f6e67206e6574776f726b60981b604482015260640161044c565b60a08501516001600160a01b0316158015906114ef575060a08501516001600160a01b0316600090815260c9602052604090205460ff165b61152e5760405162461bcd60e51b815260206004820152601060248201526f756e6b6e6f776e2064656c656761746560801b604482015260640161044c565b602082015160e0880151511580159061154c575060008660c0015151115b1561156457611564818760c001518a60e001516129dd565b60018651600781111561157957611579613978565b141561174757600082815260cb602052604081205460ff1660048111156115a2576115a2613978565b146115bf5760405162461bcd60e51b815260040161044c9061412d565b60018860600151146116045760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d195b9d08084f481cd95b1b60921b604482015260640161044c565b61160e8887612a84565b428860a00151116116315760405162461bcd60e51b815260040161044c90613aae565b8251606087015110156116565760405162461bcd60e51b815260040161044c9061415b565b61166e828960c0015189608001518960600151612b34565b93508560a001516001600160a01b031663bc553f0f89602001518960800151846040518463ffffffff1660e01b81526004016116ac9392919061417e565b6020604051808303816000875af11580156116cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ef91906141b3565b61170b5760405162461bcd60e51b815260040161044c906141d0565b6117298289602001518a60c00151898a606001518b60600151612b71565b600082815260cb60205260409020805460ff19166002179055612432565b60028651600781111561175c5761175c613978565b141561198657600082815260cb602052604081205460ff16600481111561178557611785613978565b146117a25760405162461bcd60e51b815260040161044c9061412d565b60038860600151146117e65760405162461bcd60e51b815260206004820152600d60248201526c696e74656e7420213d2062757960981b604482015260640161044c565b6117f08887612a84565b428860a00151116118135760405162461bcd60e51b815260040161044c90613aae565b60608601518351146118595760405162461bcd60e51b815260206004820152600f60248201526e0e0e4d2c6ca40dcdee840dac2e8c6d608b1b604482015260640161044c565b60c08801516001600160a01b03166118b35760405162461bcd60e51b815260206004820152601a60248201527f6e617469766520746f6b656e206e6f7420737570706f72746564000000000000604482015260640161044c565b6118cb828960c001518a602001518960600151612b34565b93508560a001516001600160a01b0316631672162688608001518a60200151846040518463ffffffff1660e01b81526004016119099392919061417e565b6020604051808303816000875af1158015611928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194c91906141b3565b6119685760405162461bcd60e51b815260040161044c906141d0565b6117298288608001518a60c00151898a606001518b60600151612b71565b60038651600781111561199b5761199b613978565b1415611a6c57600082815260cb602052604081205460ff1660048111156119c4576119c4613978565b14611a045760405162461bcd60e51b815260206004820152601060248201526f1d5b98589b19481d1bc818d85b98d95b60821b604482015260640161044c565b428860a0015111611a275760405162461bcd60e51b815260040161044c90613aae565b600082815260cb6020526040808220805460ff191660031790555183917f5b0b06d07e20243724d90e17a20034972f339eb28bd1c9437a71999bd15a1e7a91a2612432565b600486516007811115611a8157611a81613978565b1415611fa4576002886060015114611acf5760405162461bcd60e51b815260206004820152601160248201527034b73a32b73a10109e9030bab1ba34b7b760791b604482015260640161044c565b611ad98887612a84565b600082815260cc60205260408120600301546001600160a01b0316611ca157600083815260cb602052604081205460ff166004811115611b1b57611b1b613978565b14611b385760405162461bcd60e51b815260040161044c9061412d565b428960a0015111611b5b5760405162461bcd60e51b815260040161044c906141fa565b835160608801511015611b805760405162461bcd60e51b815260040161044c9061415b565b50604080516080808201835260608981018051845251602080850191825260a08e810151868801908152948e0180516001600160a01b0390811695880195865260008b815260cc85528981209851895594516001808a0191909155965160028901559451600390970180546001600160a01b0319169786169790971790965560cb8252868320805460ff1916861790558c0151908e01519451955163c23725f960e01b8152939592169363c23725f993611c4293919291908890600401614221565b6020604051808303816000875af1158015611c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8591906141b3565b611ca15760405162461bcd60e51b815260040161044c906141d0565b600083815260cc6020526040902060028101544210611cd25760405162461bcd60e51b815260040161044c906141fa565b611cea848b60c001518b608001518b60600151612b34565b955081611f63576001600085815260cb602052604090205460ff166004811115611d1657611d16613978565b14611d5a5760405162461bcd60e51b815260206004820152601460248201527337b93232b91034b9903737ba1030bab1ba34b7b760611b604482015260640161044c565b6101008801518154620f424091611d7091614255565b611d7a9190614274565b815460608a0151611d8b9190613bf5565b1015611dc45760405162461bcd60e51b81526020600482015260086024820152671d5b99195c989a5960c21b604482015260640161044c565b600181015460e089015160608a0151600091620f424091611de59190614255565b611def9190614274565b90506000611dfd8284613c0c565b1115611e7d5760c08c01516003840154611e2a91906001600160a01b0316611e258486613c0c565b612cfa565b60c08c0151600384015460405188927f681e2055b67e23ce693a446bd0567fb9df559ce6f82da4397482bad968551ac292611e74926001600160a01b039091169087908790614296565b60405180910390a25b60a08a015160208d0151600385015460808e015160405163c23725f960e01b81526001600160a01b039485169463c23725f994611ec39490939116918b90600401614221565b6020604051808303816000875af1158015611ee2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0691906141b3565b611f225760405162461bcd60e51b815260040161044c906141d0565b60608a0151808455611f35908290613bf5565b6001840155505060808901516003820180546001600160a01b0319166001600160a01b039092169190911790555b6002810154610120890151611f789042613c0c565b1115611f9d57876101200151816002016000828254611f979190613c0c565b90915550505b5050612432565b600686516007811115611fb957611fb9613978565b1480611fd75750600786516007811115611fd557611fd5613978565b145b156121f3576001600083815260cb602052604090205460ff16600481111561200157612001613978565b1461204e5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f742063616e63656c206e6f6e2d61756374696f6e206f7264657200604482015260640161044c565b600082815260cc602052604090206001810154156120e35760c08901516003820154600183015461208992916001600160a01b031690612cfa565b60c08901516003820154600183015460405186937f681e2055b67e23ce693a446bd0567fb9df559ce6f82da4397482bad968551ac2936120da9391926001600160a01b039091169190600090614296565b60405180910390a25b6120ed8988612a84565b60068751600781111561210257612102613978565b14156121a85760a087015160208a0151600383015460405163f477e4fd60e01b81526001600160a01b039384169363f477e4fd93612149939092911690879060040161417e565b6020604051808303816000875af1158015612168573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218c91906141b3565b6121a85760405162461bcd60e51b815260040161044c906141d0565b50600082815260cc60209081526040808320838155600181018490556002810184905560030180546001600160a01b031916905560cb9091529020805460ff19166004179055612432565b60058651600781111561220857612208613978565b14156123fd576001600083815260cb602052604090205460ff16600481111561223357612233613978565b1461228a5760405162461bcd60e51b815260206004820152602160248201527f63616e6e6f7420636f6d706c657465206e6f6e2d61756374696f6e206f7264656044820152603960f91b606482015260840161044c565b6122948887612a84565b600082815260cc6020526040902060028101544210156122f15760405162461bcd60e51b8152602060048201526018602482015277185d58dd1a5bdb881b9bdd08199a5b9a5cda1959081e595d60421b604482015260640161044c565b60a087015160208a01516003830154604051633672c91160e01b81526001600160a01b0393841693633672c91193612332939092911690879060040161417e565b6020604051808303816000875af1158015612351573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237591906141b3565b6123915760405162461bcd60e51b815260040161044c906141d0565b6123af838a602001518b60c001518a85600001548660010154612b71565b50600082815260cb60209081526040808320805460ff1916600290811790915560cc9092528220828155600181018390559081019190915560030180546001600160a01b0319169055612432565b60405162461bcd60e51b815260206004820152600a6024820152690756e6b6e6f776e206f760b41b604482015260640161044c565b61243f8289858a8a612d2c565b50919695505050505050565b60975460ff166124945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161044c565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60975460ff16156125535760405162461bcd60e51b815260040161044c90613a84565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124c13390565b600054610100900460ff166125af5760405162461bcd60e51b815260040161044c906142bf565b60018055565b600054610100900460ff166125dc5760405162461bcd60e51b815260040161044c906142bf565b6097805460ff19169055565b600054610100900460ff1661260f5760405162461bcd60e51b815260040161044c906142bf565b610c71336124de565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561264557506000905060036126f2565b8460ff16601b1415801561265d57508460ff16601c14155b1561266e57506000905060046126f2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156126c2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166126eb576000600192509250506126f2565b9150600090505b94509492505050565b600081600481111561270f5761270f613978565b14156127185750565b600181600481111561272c5761272c613978565b14156127755760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161044c565b600281600481111561278957612789613978565b14156127d75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161044c565b60038160048111156127eb576127eb613978565b14156128445760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161044c565b600481600481111561285857612858613978565b14156110f65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161044c565b6000612906826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612da39092919063ffffffff16565b805190915015610794578080602001905181019061292491906141b3565b6107945760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161044c565b81516020808401516040808601516060870151608088015160a089015160c08a015160e08b015195516000996129bf99909897918c910161430a565b60405160208183030381529060405280519060200120905092915050565b81518351146129eb57600080fd5b80518351146129f957600080fd5b60005b835181101561124f57818181518110612a1757612a17613b5e565b01602001516001600160f81b03191615612a7257828181518110612a3d57612a3d613b5e565b602001015160f81c60f81b848281518110612a5a57612a5a613b5e565b60200101906001600160f81b031916908160001a9053505b80612a7c81613b8a565b9150506129fc565b81608001518160a001516001600160a01b0316632c436e5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aef9190613f60565b146113e65760405162461bcd60e51b81526020600482015260156024820152743232b632b3b0ba34b7b7103a3cb8329032b93937b960591b604482015260640161044c565b60008115612b66576001600160a01b038416612b5157508061111b565b612b666001600160a01b038516843085611217565b506000949350505050565b80821015612baf5760405162461bcd60e51b815260206004820152600b60248201526a383934b1b29032b93937b960a91b604482015260640161044c565b806000805b85610140015151811015612c495760008661014001518281518110612bdb57612bdb613b5e565b60200260200101519050806000015183612bf59190613c0c565b92506000620f4240826000015188612c0d9190614255565b612c179190614274565b9050612c238186613bf5565b9450612c3489836020015183612cfa565b50508080612c4190613b8a565b915050612bb4565b508060cd541015612c955760405162461bcd60e51b81526020600482015260166024820152751d1bdd185b081999594818d85c08195e18d95959195960521b604482015260640161044c565b612ca0868884612cfa565b604080518981526001600160a01b0388811660208301528916818301526060810184905290517fe2c49856b032c255ae7e325d18109bc4e22a2804e2e49a017ec0f59f19cd447b9181900360800190a15050505050505050565b8015610794576001600160a01b038316612d18576107948282612db2565b6107946001600160a01b03841683836111b4565b847f3cbb63f144840e5b1b0a38a7c19211d2e89de4d7c5faf8b2d3c1776c302d1d33856020015184608001518760000151866000015189606001518a608001518b60a001518c60c001518d60e001518d8c604051612d949b9a99989796959493929190614379565b60405180910390a25050505050565b6060610da68484600085612ecb565b80471015612e025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161044c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612e4f576040519150601f19603f3d011682016040523d82523d6000602084013e612e54565b606091505b50509050806107945760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161044c565b606082471015612f2c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161044c565b843b612f7a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161044c565b600080866001600160a01b03168587604051612f969190614408565b60006040518083038185875af1925050503d8060008114612fd3576040519150601f19603f3d011682016040523d82523d6000602084013e612fd8565b606091505b5091509150612fe8828286612ff3565b979650505050505050565b60608315613002575081610da9565b8251156130125782518084602001fd5b8160405162461bcd60e51b815260040161044c9190614424565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156130615761306161302c565b60405250565b601f8201601f191681016001600160401b038111828210171561308c5761308c61302c565b6040525050565b6040516101a081016001600160401b03811182821017156130b6576130b661302c565b60405290565b60405161016081016001600160401b03811182821017156130b6576130b661302c565b60405160c081016001600160401b03811182821017156130b6576130b661302c565b60006001600160401b0382111561311a5761311a61302c565b5060051b60200190565b803560ff8116811461313557600080fd5b919050565b600080600080600060a0868803121561315257600080fd5b85356001600160401b0381111561316857600080fd5b8601601f8101881361317957600080fd5b8035602061318682613101565b6040516131938282613067565b83815260059390931b840182019282810191508b8411156131b357600080fd5b938201935b838510156131d1578435825293820193908201906131b8565b98505088013595506131e891505060408701613124565b94979396509394606081013594506080013592915050565b6001600160a01b03811681146110f657600080fd5b803561313581613200565b600082601f83011261323157600080fd5b8135602061323e82613101565b60405161324b8282613067565b83815260059390931b850182019282810191508684111561326b57600080fd5b8286015b8481101561328f57803561328281613200565b835291830191830161326f565b509695505050505050565b600080604083850312156132ad57600080fd5b82356001600160401b03808211156132c457600080fd5b6132d086838701613220565b935060208501359150808211156132e657600080fd5b506132f385828601613220565b9150509250929050565b600082601f83011261330e57600080fd5b81356001600160401b038111156133275761332761302c565b60405161333e601f8301601f191660200182613067565b81815284602083860101111561335357600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261338157600080fd5b8135602061338e82613101565b6040805161339c8382613067565b84815260059490941b86018301938381019250878511156133bc57600080fd5b8387015b8581101561343d5780356001600160401b03808211156133e05760008081fd5b90890190818b03601f19018513156133f85760008081fd5b845161340381613042565b878301358152858301358281111561341b5760008081fd5b6134298d8a838701016132fd565b828a015250865250509284019284016133c0565b50979650505050505050565b60006101a0828403121561345c57600080fd5b613464613093565b90508135815261347660208301613215565b602082015260408201356040820152606082013560608201526080820135608082015260a082013560a08201526134af60c08301613215565b60c082015260e08201356001600160401b03808211156134ce57600080fd5b6134da858386016132fd565b60e0840152610100915081840135818111156134f557600080fd5b61350186828701613370565b8385015250505061012080830135818301525061014080830135818301525061016061352e818401613124565b90820152610180613540838201613124565b9082015292915050565b600082601f83011261355b57600080fd5b8135602061356882613101565b6040516135758282613067565b83815260059390931b850182019282810191508684111561359557600080fd5b8286015b8481101561328f5780356001600160401b038111156135b85760008081fd5b6135c68986838b0101613449565b845250918301918301613599565b80356008811061313557600080fd5b600082601f8301126135f457600080fd5b8135602061360182613101565b6040805161360f8382613067565b84815260069490941b860183019383810192508785111561362f57600080fd5b8387015b8581101561343d5782818a03121561364b5760008081fd5b825161365681613042565b813581528582013561366781613200565b818701528452928401928201613633565b6000610160828403121561368b57600080fd5b6136936130bc565b905061369e826135d4565b8152602082013560208201526040820135604082015260608201356060820152608082013560808201526136d460a08301613215565b60a082015260c08201356001600160401b03808211156136f357600080fd5b6136ff858386016132fd565b60c084015260e08481013590840152610100808501359084015261012080850135908401526101409150818401358181111561373a57600080fd5b613746868287016135e3565b8385015250505092915050565b600082601f83011261376457600080fd5b8135602061377182613101565b60405161377e8282613067565b83815260059390931b850182019282810191508684111561379e57600080fd5b8286015b8481101561328f5780356001600160401b038111156137c15760008081fd5b6137cf8986838b0101613678565b8452509183019183016137a2565b80151581146110f657600080fd5b600060c082840312156137fd57600080fd5b60405160c081018181106001600160401b038211171561381f5761381f61302c565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013561385781613200565b608082015260a083013561386a816137dd565b60a0919091015292915050565b60006020828403121561388957600080fd5b81356001600160401b03808211156138a057600080fd5b9083019061016082860312156138b557600080fd5b6138bd6130df565b8235828111156138cc57600080fd5b6138d88782860161354a565b8252506020830135828111156138ed57600080fd5b6138f987828601613753565b60208301525061390c86604085016137eb565b6040820152610100830135606082015261012083013560808201526139346101408401613124565b60a082015295945050505050565b60006020828403121561395457600080fd5b8135610da981613200565b60006020828403121561397157600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106139a2576139a2613978565b91905290565b600080600061010084860312156139be57600080fd5b83356001600160401b03808211156139d557600080fd5b6139e187838801613449565b94506139f087602088016137eb565b935060e0860135915080821115613a0657600080fd5b50613a1386828701613678565b9150509250925092565b60008060408385031215613a3057600080fd5b823591506020830135613a4281613200565b809150509250929050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526010908201526f191958591b1a5b99481c995858da195960821b604082015260600190565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613b1957845183529383019391830191600101613afd565b5050809350505050826040830152949350505050565b60208082526015908201527424b7383aba1039b4b3b730ba3ab9329032b93937b960591b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415613b9e57613b9e613b74565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b039290921682521515602082015260400190565b600082821015613c0757613c07613b74565b500390565b60008219821115613c1f57613c1f613b74565b500190565b60005b83811015613c3f578181015183820152602001613c27565b8381111561124f5750506000910152565b60008151808452613c68816020860160208601613c24565b601f01601f19169290920160200192915050565b80518252600060208201516040602085015261111b6040850182613c50565b600081518084526020808501808196508360051b8101915082860160005b85811015613ce3578284038952613cd1848351613c7c565b98850198935090840190600101613cb9565b5091979650505050505050565b805182526020808201519083015260408082015190830152606080820151908301526080808201516001600160a01b03169083015260a0908101511515910152565b60088110613d4257613d42613978565b9052565b600081518084526020808501945080840160005b83811015613d8a578151805188528301516001600160a01b03168388015260409096019590820190600101613d5a565b509495945050505050565b6000610160613da5848451613d32565b6020830151602085015260408301516040850152606083015160608501526080830151608085015260a0830151613de760a08601826001600160a01b03169052565b5060c08301518160c0860152613dff82860182613c50565b91505060e083015160e08501526101008084015181860152506101208084015181860152506101408084015185830382870152613e3c8382613d46565b9695505050505050565b60006101008083528551818401526020860151610120613e70818601836001600160a01b03169052565b60408801516101408681019190915260608901516101608088019190915260808a01516101808089019190915260a08b01516101a0808a019190915260c08c01516001600160a01b03166101c08a015260e08c01516101e08a01919091529450613ede6102a0890186613c50565b958b015188870360ff19016102008a0152959450613efc8587613c9b565b9550838b0151610220890152828b0151610240890152818b01519450613f2861026089018660ff169052565b8a015160ff81166102808901529350613f4092505050565b50613f4e6020840186613cf0565b82810360e0840152613e3c8185613d95565b600060208284031215613f7257600080fd5b5051919050565b600060033d1115613f925760046000803e5060005160e01c5b90565b600060443d1015613fa35790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613fd257505050505090565b8285019150815181811115613fea5750505050505090565b843d87010160208285010111156140045750505050505090565b61401360208286010187613067565b509095945050505050565b828152604060208201526000610da66040830184613c50565b60006101008083016140498488613cf0565b60c0840186905260e084019190915283519081905261012080840191600581901b850190910190602080870160005b838110156140a75761011f19888603018652614095858351613d95565b95830195945090820190600101614078565b50929998505050505050505050565b60006101408c835260018060a01b03808d1660208501528b60408501528a60608501528960808501528860a085015280881660c0850152508060e084015261410081840187613c50565b90508461010084015282810361012084015261411c8185613c9b565b9d9c50505050505050505050505050565b6020808252601490820152736f7264657220616c72656164792065786973747360601b604082015260600190565b6020808252600990820152681d5b99195c9c185a5960ba1b604082015260600190565b6001600160a01b038481168252831660208201526060604082018190526000906141aa90830184613c50565b95945050505050565b6000602082840312156141c557600080fd5b8151610da9816137dd565b60208082526010908201526f3232b632b3b0ba34b7b71032b93937b960811b604082015260600190565b6020808252600d908201526c185d58dd1a5bdb88195b991959609a1b604082015260600190565b6001600160a01b038581168252848116602083015283166040820152608060608201819052600090613e3c90830184613c50565b600081600019048311821515161561426f5761426f613b74565b500290565b60008261429157634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006101208b835260018060a01b03808c1660208501528a60408501528960608501528860808501528760a085015280871660c0850152508060e084015261435481840186613c50565b90508281036101008401526143698185613c7c565b9c9b505050505050505050505050565b600061016060018060a01b03808f168452808e1660208501528c60408501528b60608501528a60808501528960a08501528860c085015280881660e085015250806101008401526143cc81840187613c50565b90508281036101208401526143e18186613c7c565b90508281036101408401526143f68185613d95565b9e9d5050505050505050505050505050565b6000825161441a818460208701613c24565b9190910192915050565b602081526000610da96020830184613c5056fea2646970667358221220aaaeebc4569931a66a81c066fc9b4e4aede3048327ada4fa8f5cb408471f1bf464736f6c634300080b0033

Deployed Bytecode

0x6080604052600436106101235760003560e01c80638456cb59116100a0578063d95e3c5411610064578063d95e3c5414610335578063da35a26f14610355578063e59f739a14610375578063ea80591714610395578063f2fde38b1461040957600080fd5b80638456cb59146102985780638da5cb5b146102ad578063912c860c146102c257806395835fea146102ff5780639fb514671461031f57600080fd5b80633fc8cef3116100e75780633fc8cef3146101c3578063587cde1e146101fb5780635c975abb1461023b578063715018a614610253578063736c0d5b1461026857600080fd5b80630873c6ec1461012f5780632295f9bf14610159578063350b23691461017b578063357a150b1461019b5780633f4ba83a146101ae57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50610146620f424081565b6040519081526020015b60405180910390f35b34801561016557600080fd5b5061017961017436600461313a565b610429565b005b34801561018757600080fd5b5061017961019636600461329a565b6105dd565b6101796101a9366004613877565b610799565b3480156101ba57600080fd5b50610179610c3a565b3480156101cf57600080fd5b5060ce546101e3906001600160a01b031681565b6040516001600160a01b039091168152602001610150565b34801561020757600080fd5b5061022b610216366004613942565b60c96020526000908152604090205460ff1681565b6040519015158152602001610150565b34801561024757600080fd5b5060975460ff1661022b565b34801561025f57600080fd5b50610179610c73565b34801561027457600080fd5b5061022b610283366004613942565b60ca6020526000908152604090205460ff1681565b3480156102a457600080fd5b50610179610cac565b3480156102b957600080fd5b506101e3610ce3565b3480156102ce57600080fd5b506102f26102dd36600461395f565b60cb6020526000908152604090205460ff1681565b604051610150919061398e565b34801561030b57600080fd5b5061017961031a36600461395f565b610cf2565b34801561032b57600080fd5b5061014660cd5481565b34801561034157600080fd5b506101466103503660046139a8565b610d5c565b34801561036157600080fd5b50610179610370366004613a1d565b610db0565b34801561038157600080fd5b5061017961039036600461329a565b610ea2565b3480156103a157600080fd5b506103e06103b036600461395f565b60cc602052600090815260409020805460018201546002830154600390930154919290916001600160a01b031684565b604080519485526020850193909352918301526001600160a01b03166060820152608001610150565b34801561041557600080fd5b50610179610424366004613942565b611059565b600260015414156104555760405162461bcd60e51b815260040161044c90613a4d565b60405180910390fd5b600260015560975460ff161561047d5760405162461bcd60e51b815260040161044c90613a84565b42841161049c5760405162461bcd60e51b815260040161044c90613aae565b6000855186866040516020016104b493929190613ad8565b60405160208183030381529060405280519060200120905060006104da828686866110f9565b6001600160a01b038116600090815260ca602052604090205490915060ff166105155760405162461bcd60e51b815260040161044c90613b2f565b60005b87518110156105cf57600088828151811061053557610535613b5e565b602002602001015190506000600481111561055257610552613978565b600082815260cb602052604090205460ff16600481111561057557610575613978565b14156105bc57600081815260cb6020526040808220805460ff191660031790555182917f5b0b06d07e20243724d90e17a20034972f339eb28bd1c9437a71999bd15a1e7a91a25b50806105c781613b8a565b915050610518565b505060018055505050505050565b336105e6610ce3565b6001600160a01b03161461060c5760405162461bcd60e51b815260040161044c90613ba5565b60005b82518110156106d457600160ca600085848151811061063057610630613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f0127aee741cbb6bc48b5475b8eb3eb2e5d053809d551dedd517a0b5b52b80fd58382815181106106a2576106a2613b5e565b602002602001015160006040516106ba929190613bda565b60405180910390a1806106cc81613b8a565b91505061060f565b5060005b81518110156107945760ca60008383815181106106f7576106f7613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557f0127aee741cbb6bc48b5475b8eb3eb2e5d053809d551dedd517a0b5b52b80fd582828151811061076257610762613b5e565b6020026020010151600160405161077a929190613bda565b60405180910390a18061078c81613b8a565b9150506106d8565b505050565b600260015414156107bc5760405162461bcd60e51b815260040161044c90613a4d565b600260015560975460ff16156107e45760405162461bcd60e51b815260040161044c90613a84565b42816040015160200151116108345760405162461bcd60e51b81526020600482015260166024820152751a5b9c1d5d08191958591b1a5b99481c995858da195960521b604482015260640161044c565b8060400151608001516001600160a01b0316336001600160a01b0316146108955760405162461bcd60e51b81526020600482015260156024820152740e6cadcc8cae440c8decae640dcdee840dac2e8c6d605b1b604482015260640161044c565b61089e81611123565b60408101516060015134901561093f576040808301516060015160ce548251630d0e30db60e41b8152925191926001600160a01b039091169163d0e30db0918491600480830192600092919082900301818588803b1580156108ff57600080fd5b505af1158015610913573d6000803e3d6000fd5b505060ce5461093193506001600160a01b03169150339050836111b4565b61093b8183613bf5565b9150505b6040808301510151156109da57604080830151015160ce5461096c906001600160a01b0316333084611217565b60ce54604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b1580156109b257600080fd5b505af11580156109c6573d6000803e3d6000fd5b5050505080826109d69190613c0c565b9150505b60005b825151811015610a1f57610a0d83600001518281518110610a0057610a00613b5e565b6020026020010151611255565b80610a1781613b8a565b9150506109dd565b5060005b826020015151811015610bfc57600083602001518281518110610a4857610a48613b5e565b6020026020010151905060008460000151826020015181518110610a6e57610a6e613b5e565b60200260200101519050846040015160a0015115610bcb5760408086015190516336578f1560e21b8152309163d95e3c5491610ab09185918790600401613e46565b6020604051808303816000875af1925050508015610aeb575060408051601f3d908101601f19168201909252610ae891810190613f60565b60015b610bb957610af7613f79565b806308c379a01415610b565750610b0c613f95565b80610b175750610b58565b7f97c789f43a3e7ac27906b5fbdac832f54441771021fba06f71207d9be6d4b6238482604051610b4892919061401e565b60405180910390a150610be7565b505b3d808015610b82576040519150601f19603f3d011682016040523d82523d6000602084013e610b87565b606091505b507f97c789f43a3e7ac27906b5fbdac832f54441771021fba06f71207d9be6d4b6238482604051610b4892919061401e565b610bc38186613bf5565b945050610be7565b610bda818660400151846113ea565b610be49085613bf5565b93505b50508080610bf490613b8a565b915050610a23565b508015610c3257604051339082156108fc029083906000818181858888f19350505050158015610c30573d6000803e3d6000fd5b505b505060018055565b33610c43610ce3565b6001600160a01b031614610c695760405162461bcd60e51b815260040161044c90613ba5565b610c7161244b565b565b33610c7c610ce3565b6001600160a01b031614610ca25760405162461bcd60e51b815260040161044c90613ba5565b610c7160006124de565b33610cb5610ce3565b6001600160a01b031614610cdb5760405162461bcd60e51b815260040161044c90613ba5565b610c71612530565b6065546001600160a01b031690565b33610cfb610ce3565b6001600160a01b031614610d215760405162461bcd60e51b815260040161044c90613ba5565b60cd8190556040518181527f19fc3beddeea399f0966d5f8664ad94006f16a10fb28c4e2fe6fae62626b71289060200160405180910390a150565b6000333014610d9b5760405162461bcd60e51b815260206004820152600b60248201526a1d5b9cd859994818d85b1b60aa1b604482015260640161044c565b610da68484846113ea565b90505b9392505050565b600054610100900460ff16610dcb5760005460ff1615610dcf565b303b155b610e325760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161044c565b600054610100900460ff16158015610e54576000805461ffff19166101011790555b60cd83905560ce80546001600160a01b0319166001600160a01b038416179055610e7c612588565b610e846125b5565b610e8c6125e8565b8015610794576000805461ff0019169055505050565b33610eab610ce3565b6001600160a01b031614610ed15760405162461bcd60e51b815260040161044c90613ba5565b60005b8251811015610f9957600160c96000858481518110610ef557610ef5613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4a31a64b928a0e8aff42ef84d144ffe82d08cb41c8027060593135e2026899b2838281518110610f6757610f67613b5e565b60200260200101516000604051610f7f929190613bda565b60405180910390a180610f9181613b8a565b915050610ed4565b5060005b81518110156107945760c96000838381518110610fbc57610fbc613b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557f4a31a64b928a0e8aff42ef84d144ffe82d08cb41c8027060593135e2026899b282828151811061102757611027613b5e565b6020026020010151600160405161103f929190613bda565b60405180910390a18061105181613b8a565b915050610f9d565b33611062610ce3565b6001600160a01b0316146110885760405162461bcd60e51b815260040161044c90613ba5565b6001600160a01b0381166110ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161044c565b6110f6816124de565b50565b600080600061110a87878787612618565b91509150611117816126fb565b5090505b949350505050565b60008160400151826020015151836020015160405160200161114793929190614037565b6040516020818303038152906040528051906020012090506000611179828460a00151856060015186608001516110f9565b6001600160a01b038116600090815260ca602052604090205490915060ff166107945760405162461bcd60e51b815260040161044c90613b2f565b6040516001600160a01b03831660248201526044810182905261079490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526128b1565b6040516001600160a01b038085166024830152831660448201526064810182905261124f9085906323b872dd60e01b906084016111e0565b50505050565b61018081015160009060ff166001141561133d5781516020808401516040808601516060870151608088015160a089015160c08a015160e08b01516101008c01518051975160009b6112ac9b909a999291016140b6565b60405160208183030381529060405280519060200120905061133561131e826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b8461016001518561012001518661014001516110f9565b915050611381565b60405162461bcd60e51b81526020600482015260196024820152783ab735b737bbb71039b4b3b730ba3ab932903b32b939b4b7b760391b604482015260640161044c565b81602001516001600160a01b0316816001600160a01b0316146113e65760405162461bcd60e51b815260206004820152601e60248201527f4f72646572207369676e617475726520646f6573206e6f74206d617463680000604482015260640161044c565b5050565b60008060009050600085610100015184604001518151811061140e5761140e613b5e565b6020026020010151905060006114248783612983565b9050846080015181146114745760405162461bcd60e51b81526020600482015260186024820152770d2e8cada40d0c2e6d040c8decae640dcdee840dac2e8c6d60431b604482015260640161044c565b468760400151146114b75760405162461bcd60e51b815260206004820152600d60248201526c77726f6e67206e6574776f726b60981b604482015260640161044c565b60a08501516001600160a01b0316158015906114ef575060a08501516001600160a01b0316600090815260c9602052604090205460ff165b61152e5760405162461bcd60e51b815260206004820152601060248201526f756e6b6e6f776e2064656c656761746560801b604482015260640161044c565b602082015160e0880151511580159061154c575060008660c0015151115b1561156457611564818760c001518a60e001516129dd565b60018651600781111561157957611579613978565b141561174757600082815260cb602052604081205460ff1660048111156115a2576115a2613978565b146115bf5760405162461bcd60e51b815260040161044c9061412d565b60018860600151146116045760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d195b9d08084f481cd95b1b60921b604482015260640161044c565b61160e8887612a84565b428860a00151116116315760405162461bcd60e51b815260040161044c90613aae565b8251606087015110156116565760405162461bcd60e51b815260040161044c9061415b565b61166e828960c0015189608001518960600151612b34565b93508560a001516001600160a01b031663bc553f0f89602001518960800151846040518463ffffffff1660e01b81526004016116ac9392919061417e565b6020604051808303816000875af11580156116cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ef91906141b3565b61170b5760405162461bcd60e51b815260040161044c906141d0565b6117298289602001518a60c00151898a606001518b60600151612b71565b600082815260cb60205260409020805460ff19166002179055612432565b60028651600781111561175c5761175c613978565b141561198657600082815260cb602052604081205460ff16600481111561178557611785613978565b146117a25760405162461bcd60e51b815260040161044c9061412d565b60038860600151146117e65760405162461bcd60e51b815260206004820152600d60248201526c696e74656e7420213d2062757960981b604482015260640161044c565b6117f08887612a84565b428860a00151116118135760405162461bcd60e51b815260040161044c90613aae565b60608601518351146118595760405162461bcd60e51b815260206004820152600f60248201526e0e0e4d2c6ca40dcdee840dac2e8c6d608b1b604482015260640161044c565b60c08801516001600160a01b03166118b35760405162461bcd60e51b815260206004820152601a60248201527f6e617469766520746f6b656e206e6f7420737570706f72746564000000000000604482015260640161044c565b6118cb828960c001518a602001518960600151612b34565b93508560a001516001600160a01b0316631672162688608001518a60200151846040518463ffffffff1660e01b81526004016119099392919061417e565b6020604051808303816000875af1158015611928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194c91906141b3565b6119685760405162461bcd60e51b815260040161044c906141d0565b6117298288608001518a60c00151898a606001518b60600151612b71565b60038651600781111561199b5761199b613978565b1415611a6c57600082815260cb602052604081205460ff1660048111156119c4576119c4613978565b14611a045760405162461bcd60e51b815260206004820152601060248201526f1d5b98589b19481d1bc818d85b98d95b60821b604482015260640161044c565b428860a0015111611a275760405162461bcd60e51b815260040161044c90613aae565b600082815260cb6020526040808220805460ff191660031790555183917f5b0b06d07e20243724d90e17a20034972f339eb28bd1c9437a71999bd15a1e7a91a2612432565b600486516007811115611a8157611a81613978565b1415611fa4576002886060015114611acf5760405162461bcd60e51b815260206004820152601160248201527034b73a32b73a10109e9030bab1ba34b7b760791b604482015260640161044c565b611ad98887612a84565b600082815260cc60205260408120600301546001600160a01b0316611ca157600083815260cb602052604081205460ff166004811115611b1b57611b1b613978565b14611b385760405162461bcd60e51b815260040161044c9061412d565b428960a0015111611b5b5760405162461bcd60e51b815260040161044c906141fa565b835160608801511015611b805760405162461bcd60e51b815260040161044c9061415b565b50604080516080808201835260608981018051845251602080850191825260a08e810151868801908152948e0180516001600160a01b0390811695880195865260008b815260cc85528981209851895594516001808a0191909155965160028901559451600390970180546001600160a01b0319169786169790971790965560cb8252868320805460ff1916861790558c0151908e01519451955163c23725f960e01b8152939592169363c23725f993611c4293919291908890600401614221565b6020604051808303816000875af1158015611c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8591906141b3565b611ca15760405162461bcd60e51b815260040161044c906141d0565b600083815260cc6020526040902060028101544210611cd25760405162461bcd60e51b815260040161044c906141fa565b611cea848b60c001518b608001518b60600151612b34565b955081611f63576001600085815260cb602052604090205460ff166004811115611d1657611d16613978565b14611d5a5760405162461bcd60e51b815260206004820152601460248201527337b93232b91034b9903737ba1030bab1ba34b7b760611b604482015260640161044c565b6101008801518154620f424091611d7091614255565b611d7a9190614274565b815460608a0151611d8b9190613bf5565b1015611dc45760405162461bcd60e51b81526020600482015260086024820152671d5b99195c989a5960c21b604482015260640161044c565b600181015460e089015160608a0151600091620f424091611de59190614255565b611def9190614274565b90506000611dfd8284613c0c565b1115611e7d5760c08c01516003840154611e2a91906001600160a01b0316611e258486613c0c565b612cfa565b60c08c0151600384015460405188927f681e2055b67e23ce693a446bd0567fb9df559ce6f82da4397482bad968551ac292611e74926001600160a01b039091169087908790614296565b60405180910390a25b60a08a015160208d0151600385015460808e015160405163c23725f960e01b81526001600160a01b039485169463c23725f994611ec39490939116918b90600401614221565b6020604051808303816000875af1158015611ee2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0691906141b3565b611f225760405162461bcd60e51b815260040161044c906141d0565b60608a0151808455611f35908290613bf5565b6001840155505060808901516003820180546001600160a01b0319166001600160a01b039092169190911790555b6002810154610120890151611f789042613c0c565b1115611f9d57876101200151816002016000828254611f979190613c0c565b90915550505b5050612432565b600686516007811115611fb957611fb9613978565b1480611fd75750600786516007811115611fd557611fd5613978565b145b156121f3576001600083815260cb602052604090205460ff16600481111561200157612001613978565b1461204e5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f742063616e63656c206e6f6e2d61756374696f6e206f7264657200604482015260640161044c565b600082815260cc602052604090206001810154156120e35760c08901516003820154600183015461208992916001600160a01b031690612cfa565b60c08901516003820154600183015460405186937f681e2055b67e23ce693a446bd0567fb9df559ce6f82da4397482bad968551ac2936120da9391926001600160a01b039091169190600090614296565b60405180910390a25b6120ed8988612a84565b60068751600781111561210257612102613978565b14156121a85760a087015160208a0151600383015460405163f477e4fd60e01b81526001600160a01b039384169363f477e4fd93612149939092911690879060040161417e565b6020604051808303816000875af1158015612168573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218c91906141b3565b6121a85760405162461bcd60e51b815260040161044c906141d0565b50600082815260cc60209081526040808320838155600181018490556002810184905560030180546001600160a01b031916905560cb9091529020805460ff19166004179055612432565b60058651600781111561220857612208613978565b14156123fd576001600083815260cb602052604090205460ff16600481111561223357612233613978565b1461228a5760405162461bcd60e51b815260206004820152602160248201527f63616e6e6f7420636f6d706c657465206e6f6e2d61756374696f6e206f7264656044820152603960f91b606482015260840161044c565b6122948887612a84565b600082815260cc6020526040902060028101544210156122f15760405162461bcd60e51b8152602060048201526018602482015277185d58dd1a5bdb881b9bdd08199a5b9a5cda1959081e595d60421b604482015260640161044c565b60a087015160208a01516003830154604051633672c91160e01b81526001600160a01b0393841693633672c91193612332939092911690879060040161417e565b6020604051808303816000875af1158015612351573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237591906141b3565b6123915760405162461bcd60e51b815260040161044c906141d0565b6123af838a602001518b60c001518a85600001548660010154612b71565b50600082815260cb60209081526040808320805460ff1916600290811790915560cc9092528220828155600181018390559081019190915560030180546001600160a01b0319169055612432565b60405162461bcd60e51b815260206004820152600a6024820152690756e6b6e6f776e206f760b41b604482015260640161044c565b61243f8289858a8a612d2c565b50919695505050505050565b60975460ff166124945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161044c565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60975460ff16156125535760405162461bcd60e51b815260040161044c90613a84565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124c13390565b600054610100900460ff166125af5760405162461bcd60e51b815260040161044c906142bf565b60018055565b600054610100900460ff166125dc5760405162461bcd60e51b815260040161044c906142bf565b6097805460ff19169055565b600054610100900460ff1661260f5760405162461bcd60e51b815260040161044c906142bf565b610c71336124de565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561264557506000905060036126f2565b8460ff16601b1415801561265d57508460ff16601c14155b1561266e57506000905060046126f2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156126c2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166126eb576000600192509250506126f2565b9150600090505b94509492505050565b600081600481111561270f5761270f613978565b14156127185750565b600181600481111561272c5761272c613978565b14156127755760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161044c565b600281600481111561278957612789613978565b14156127d75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161044c565b60038160048111156127eb576127eb613978565b14156128445760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161044c565b600481600481111561285857612858613978565b14156110f65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161044c565b6000612906826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612da39092919063ffffffff16565b805190915015610794578080602001905181019061292491906141b3565b6107945760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161044c565b81516020808401516040808601516060870151608088015160a089015160c08a015160e08b015195516000996129bf99909897918c910161430a565b60405160208183030381529060405280519060200120905092915050565b81518351146129eb57600080fd5b80518351146129f957600080fd5b60005b835181101561124f57818181518110612a1757612a17613b5e565b01602001516001600160f81b03191615612a7257828181518110612a3d57612a3d613b5e565b602001015160f81c60f81b848281518110612a5a57612a5a613b5e565b60200101906001600160f81b031916908160001a9053505b80612a7c81613b8a565b9150506129fc565b81608001518160a001516001600160a01b0316632c436e5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aef9190613f60565b146113e65760405162461bcd60e51b81526020600482015260156024820152743232b632b3b0ba34b7b7103a3cb8329032b93937b960591b604482015260640161044c565b60008115612b66576001600160a01b038416612b5157508061111b565b612b666001600160a01b038516843085611217565b506000949350505050565b80821015612baf5760405162461bcd60e51b815260206004820152600b60248201526a383934b1b29032b93937b960a91b604482015260640161044c565b806000805b85610140015151811015612c495760008661014001518281518110612bdb57612bdb613b5e565b60200260200101519050806000015183612bf59190613c0c565b92506000620f4240826000015188612c0d9190614255565b612c179190614274565b9050612c238186613bf5565b9450612c3489836020015183612cfa565b50508080612c4190613b8a565b915050612bb4565b508060cd541015612c955760405162461bcd60e51b81526020600482015260166024820152751d1bdd185b081999594818d85c08195e18d95959195960521b604482015260640161044c565b612ca0868884612cfa565b604080518981526001600160a01b0388811660208301528916818301526060810184905290517fe2c49856b032c255ae7e325d18109bc4e22a2804e2e49a017ec0f59f19cd447b9181900360800190a15050505050505050565b8015610794576001600160a01b038316612d18576107948282612db2565b6107946001600160a01b03841683836111b4565b847f3cbb63f144840e5b1b0a38a7c19211d2e89de4d7c5faf8b2d3c1776c302d1d33856020015184608001518760000151866000015189606001518a608001518b60a001518c60c001518d60e001518d8c604051612d949b9a99989796959493929190614379565b60405180910390a25050505050565b6060610da68484600085612ecb565b80471015612e025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161044c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612e4f576040519150601f19603f3d011682016040523d82523d6000602084013e612e54565b606091505b50509050806107945760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161044c565b606082471015612f2c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161044c565b843b612f7a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161044c565b600080866001600160a01b03168587604051612f969190614408565b60006040518083038185875af1925050503d8060008114612fd3576040519150601f19603f3d011682016040523d82523d6000602084013e612fd8565b606091505b5091509150612fe8828286612ff3565b979650505050505050565b60608315613002575081610da9565b8251156130125782518084602001fd5b8160405162461bcd60e51b815260040161044c9190614424565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156130615761306161302c565b60405250565b601f8201601f191681016001600160401b038111828210171561308c5761308c61302c565b6040525050565b6040516101a081016001600160401b03811182821017156130b6576130b661302c565b60405290565b60405161016081016001600160401b03811182821017156130b6576130b661302c565b60405160c081016001600160401b03811182821017156130b6576130b661302c565b60006001600160401b0382111561311a5761311a61302c565b5060051b60200190565b803560ff8116811461313557600080fd5b919050565b600080600080600060a0868803121561315257600080fd5b85356001600160401b0381111561316857600080fd5b8601601f8101881361317957600080fd5b8035602061318682613101565b6040516131938282613067565b83815260059390931b840182019282810191508b8411156131b357600080fd5b938201935b838510156131d1578435825293820193908201906131b8565b98505088013595506131e891505060408701613124565b94979396509394606081013594506080013592915050565b6001600160a01b03811681146110f657600080fd5b803561313581613200565b600082601f83011261323157600080fd5b8135602061323e82613101565b60405161324b8282613067565b83815260059390931b850182019282810191508684111561326b57600080fd5b8286015b8481101561328f57803561328281613200565b835291830191830161326f565b509695505050505050565b600080604083850312156132ad57600080fd5b82356001600160401b03808211156132c457600080fd5b6132d086838701613220565b935060208501359150808211156132e657600080fd5b506132f385828601613220565b9150509250929050565b600082601f83011261330e57600080fd5b81356001600160401b038111156133275761332761302c565b60405161333e601f8301601f191660200182613067565b81815284602083860101111561335357600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261338157600080fd5b8135602061338e82613101565b6040805161339c8382613067565b84815260059490941b86018301938381019250878511156133bc57600080fd5b8387015b8581101561343d5780356001600160401b03808211156133e05760008081fd5b90890190818b03601f19018513156133f85760008081fd5b845161340381613042565b878301358152858301358281111561341b5760008081fd5b6134298d8a838701016132fd565b828a015250865250509284019284016133c0565b50979650505050505050565b60006101a0828403121561345c57600080fd5b613464613093565b90508135815261347660208301613215565b602082015260408201356040820152606082013560608201526080820135608082015260a082013560a08201526134af60c08301613215565b60c082015260e08201356001600160401b03808211156134ce57600080fd5b6134da858386016132fd565b60e0840152610100915081840135818111156134f557600080fd5b61350186828701613370565b8385015250505061012080830135818301525061014080830135818301525061016061352e818401613124565b90820152610180613540838201613124565b9082015292915050565b600082601f83011261355b57600080fd5b8135602061356882613101565b6040516135758282613067565b83815260059390931b850182019282810191508684111561359557600080fd5b8286015b8481101561328f5780356001600160401b038111156135b85760008081fd5b6135c68986838b0101613449565b845250918301918301613599565b80356008811061313557600080fd5b600082601f8301126135f457600080fd5b8135602061360182613101565b6040805161360f8382613067565b84815260069490941b860183019383810192508785111561362f57600080fd5b8387015b8581101561343d5782818a03121561364b5760008081fd5b825161365681613042565b813581528582013561366781613200565b818701528452928401928201613633565b6000610160828403121561368b57600080fd5b6136936130bc565b905061369e826135d4565b8152602082013560208201526040820135604082015260608201356060820152608082013560808201526136d460a08301613215565b60a082015260c08201356001600160401b03808211156136f357600080fd5b6136ff858386016132fd565b60c084015260e08481013590840152610100808501359084015261012080850135908401526101409150818401358181111561373a57600080fd5b613746868287016135e3565b8385015250505092915050565b600082601f83011261376457600080fd5b8135602061377182613101565b60405161377e8282613067565b83815260059390931b850182019282810191508684111561379e57600080fd5b8286015b8481101561328f5780356001600160401b038111156137c15760008081fd5b6137cf8986838b0101613678565b8452509183019183016137a2565b80151581146110f657600080fd5b600060c082840312156137fd57600080fd5b60405160c081018181106001600160401b038211171561381f5761381f61302c565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013561385781613200565b608082015260a083013561386a816137dd565b60a0919091015292915050565b60006020828403121561388957600080fd5b81356001600160401b03808211156138a057600080fd5b9083019061016082860312156138b557600080fd5b6138bd6130df565b8235828111156138cc57600080fd5b6138d88782860161354a565b8252506020830135828111156138ed57600080fd5b6138f987828601613753565b60208301525061390c86604085016137eb565b6040820152610100830135606082015261012083013560808201526139346101408401613124565b60a082015295945050505050565b60006020828403121561395457600080fd5b8135610da981613200565b60006020828403121561397157600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106139a2576139a2613978565b91905290565b600080600061010084860312156139be57600080fd5b83356001600160401b03808211156139d557600080fd5b6139e187838801613449565b94506139f087602088016137eb565b935060e0860135915080821115613a0657600080fd5b50613a1386828701613678565b9150509250925092565b60008060408385031215613a3057600080fd5b823591506020830135613a4281613200565b809150509250929050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526010908201526f191958591b1a5b99481c995858da195960821b604082015260600190565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613b1957845183529383019391830191600101613afd565b5050809350505050826040830152949350505050565b60208082526015908201527424b7383aba1039b4b3b730ba3ab9329032b93937b960591b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415613b9e57613b9e613b74565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b039290921682521515602082015260400190565b600082821015613c0757613c07613b74565b500390565b60008219821115613c1f57613c1f613b74565b500190565b60005b83811015613c3f578181015183820152602001613c27565b8381111561124f5750506000910152565b60008151808452613c68816020860160208601613c24565b601f01601f19169290920160200192915050565b80518252600060208201516040602085015261111b6040850182613c50565b600081518084526020808501808196508360051b8101915082860160005b85811015613ce3578284038952613cd1848351613c7c565b98850198935090840190600101613cb9565b5091979650505050505050565b805182526020808201519083015260408082015190830152606080820151908301526080808201516001600160a01b03169083015260a0908101511515910152565b60088110613d4257613d42613978565b9052565b600081518084526020808501945080840160005b83811015613d8a578151805188528301516001600160a01b03168388015260409096019590820190600101613d5a565b509495945050505050565b6000610160613da5848451613d32565b6020830151602085015260408301516040850152606083015160608501526080830151608085015260a0830151613de760a08601826001600160a01b03169052565b5060c08301518160c0860152613dff82860182613c50565b91505060e083015160e08501526101008084015181860152506101208084015181860152506101408084015185830382870152613e3c8382613d46565b9695505050505050565b60006101008083528551818401526020860151610120613e70818601836001600160a01b03169052565b60408801516101408681019190915260608901516101608088019190915260808a01516101808089019190915260a08b01516101a0808a019190915260c08c01516001600160a01b03166101c08a015260e08c01516101e08a01919091529450613ede6102a0890186613c50565b958b015188870360ff19016102008a0152959450613efc8587613c9b565b9550838b0151610220890152828b0151610240890152818b01519450613f2861026089018660ff169052565b8a015160ff81166102808901529350613f4092505050565b50613f4e6020840186613cf0565b82810360e0840152613e3c8185613d95565b600060208284031215613f7257600080fd5b5051919050565b600060033d1115613f925760046000803e5060005160e01c5b90565b600060443d1015613fa35790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613fd257505050505090565b8285019150815181811115613fea5750505050505090565b843d87010160208285010111156140045750505050505090565b61401360208286010187613067565b509095945050505050565b828152604060208201526000610da66040830184613c50565b60006101008083016140498488613cf0565b60c0840186905260e084019190915283519081905261012080840191600581901b850190910190602080870160005b838110156140a75761011f19888603018652614095858351613d95565b95830195945090820190600101614078565b50929998505050505050505050565b60006101408c835260018060a01b03808d1660208501528b60408501528a60608501528960808501528860a085015280881660c0850152508060e084015261410081840187613c50565b90508461010084015282810361012084015261411c8185613c9b565b9d9c50505050505050505050505050565b6020808252601490820152736f7264657220616c72656164792065786973747360601b604082015260600190565b6020808252600990820152681d5b99195c9c185a5960ba1b604082015260600190565b6001600160a01b038481168252831660208201526060604082018190526000906141aa90830184613c50565b95945050505050565b6000602082840312156141c557600080fd5b8151610da9816137dd565b60208082526010908201526f3232b632b3b0ba34b7b71032b93937b960811b604082015260600190565b6020808252600d908201526c185d58dd1a5bdb88195b991959609a1b604082015260600190565b6001600160a01b038581168252848116602083015283166040820152608060608201819052600090613e3c90830184613c50565b600081600019048311821515161561426f5761426f613b74565b500290565b60008261429157634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006101208b835260018060a01b03808c1660208501528a60408501528960608501528860808501528760a085015280871660c0850152508060e084015261435481840186613c50565b90508281036101008401526143698185613c7c565b9c9b505050505050505050505050565b600061016060018060a01b03808f168452808e1660208501528c60408501528b60608501528a60808501528960a08501528860c085015280881660e085015250806101008401526143cc81840187613c50565b90508281036101208401526143e18186613c7c565b90508281036101408401526143f68185613d95565b9e9d5050505050505050505050505050565b6000825161441a818460208701613c24565b9190910192915050565b602081526000610da96020830184613c5056fea2646970667358221220aaaeebc4569931a66a81c066fc9b4e4aede3048327ada4fa8f5cb408471f1bf464736f6c634300080b0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.