ETH Price: $2,956.14 (+0.23%)

Contract

0x5B8C52f4ebdb7C1eb01405a6E03916BBa2A974c9
 

Overview

ETH Balance

0.05212 ETH

ETH Value

$154.07 (@ $2,956.14/ETH)

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Cancel Order155352272025-02-18 12:04:29340 days ago1739880269IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000001340.00140961
Cancel Order155352172025-02-18 12:04:09340 days ago1739880249IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000001230.00140535
Cancel Order152241942025-02-11 7:16:43347 days ago1739258203IN
0x5B8C52f4...Ba2A974c9
0 ETH0.00000030.00464548
Cancel Order151293792025-02-09 2:36:13349 days ago1739068573IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000050.00158726
Cancel Order151293712025-02-09 2:35:57349 days ago1739068557IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000080.00157676
Cancel Order150675152025-02-07 16:14:05350 days ago1738944845IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000005490.00118567
Cancel Order150674982025-02-07 16:13:31350 days ago1738944811IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000006410.0011878
Cancel Order150674892025-02-07 16:13:13350 days ago1738944793IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000005690.00118719
Cancel Order150674842025-02-07 16:13:03350 days ago1738944783IN
0x5B8C52f4...Ba2A974c9
0 ETH0.00000510.00118843
Cancel Order148857192025-02-03 11:14:13355 days ago1738581253IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000190.00337573
Cancel Order148857142025-02-03 11:14:03355 days ago1738581243IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000190.00338421
Cancel Order148857052025-02-03 11:13:45355 days ago1738581225IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000190.00339766
Cancel Order148856572025-02-03 11:12:09355 days ago1738581129IN
0x5B8C52f4...Ba2A974c9
0 ETH0.00000020.00346678
Cancel Order148788222025-02-03 7:24:19355 days ago1738567459IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00581189
Cancel Order148788112025-02-03 7:23:57355 days ago1738567437IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00582607
Cancel Order148788062025-02-03 7:23:47355 days ago1738567427IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00583725
Cancel Order148787962025-02-03 7:23:27355 days ago1738567407IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00586269
Cancel Order148787912025-02-03 7:23:17355 days ago1738567397IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000360.00585851
Cancel Order148787562025-02-03 7:22:07355 days ago1738567327IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00589345
Cancel Order148787462025-02-03 7:21:47355 days ago1738567307IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00588516
Cancel Order148787402025-02-03 7:21:35355 days ago1738567295IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00589196
Cancel Order148787272025-02-03 7:21:09355 days ago1738567269IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00586207
Cancel Order148787232025-02-03 7:21:01355 days ago1738567261IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00587396
Cancel Order148787182025-02-03 7:20:51355 days ago1738567251IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000350.00585896
Cancel Order147613242025-01-31 14:07:43358 days ago1738332463IN
0x5B8C52f4...Ba2A974c9
0 ETH0.000000240.00159395
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Exchange

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
/**                                                                                                                                     
    ______            __                  
   / ____/___ _____  / /_____ ________  __
  / /_  / __ `/ __ \/ __/ __ `/ ___/ / / /
 / __/ / /_/ / / / / /_/ /_/ (__  ) /_/ / 
/_/    \__,_/_/ /_/\__/\__,_/____/\__, /  
                                 /____/   

**/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./interfaces/IBlast.sol";
import "./interfaces/IBlastPoints.sol";
import "./interfaces/IExecutionDelegate.sol";
import "./interfaces/IExchange.sol";
import "./libraries/OrderLib.sol";

contract Exchange is IExchange, EIP712, Ownable2Step, ReentrancyGuard {
    /* Constants */
    uint256 public constant INVERSE_BASIS_POINT = 10000;

    /* Variables */
    mapping(bytes32 orderHash => bool) public cancelledOrFilled;
    mapping(address collection => bool) public whitelistedCollections;
    mapping(address paymentToken => bool) public whitelistedPaymentTokens;
    mapping(address paymentToken => uint256 minimumPrice) public minimumPricePerPaymentToken;
    uint256 public protocolFeeBps;
    address public protocolFeeRecipient;
    IExecutionDelegate public executionDelegate;

    modifier onlyEOA() {
        require(msg.sender == tx.origin, "Function can only be called by an EOA");
        _;
    }

    /**
     * @notice Contract constructor
     * @param _protocolFeeRecipient Address to receive protocol fees
     * @param _protocolFeeBps Protocol fee basis points
     * @param _executionDelegate Address of the execution delegate contract
     */
    constructor(
        address _protocolFeeRecipient,
        uint256 _protocolFeeBps,
        address _executionDelegate
    ) EIP712("Exchange", "1") Ownable(msg.sender) {
        IBlast(0x4300000000000000000000000000000000000002).configureClaimableGas();
        IBlast(0x4300000000000000000000000000000000000002).configureGovernor(msg.sender);
        IBlastPoints(0x2536FE9ab3F511540F2f9e2eC2A805005C3Dd800).configurePointsOperator(msg.sender);

        _setProtocolFeeRecipient(_protocolFeeRecipient);
        _setProtocolFeeBps(_protocolFeeBps);
        _setExecutionDelegate(_executionDelegate);
    }

    /**
     * @notice Executes a buy operation for a sell order
     * @dev Verifies the validity of the sell order and executes funds and token transfer
     * @param sellOrder The sell order to match with
     * @param sellerSignature Signature of the seller to validate the order
     */
    function buy(
        OrderLib.Order calldata sellOrder,
        bytes calldata sellerSignature
    ) public payable nonReentrant onlyEOA {
        _buy(sellOrder, sellerSignature);
    }

    /**
     * @notice Executes multiple buy transactions in one call.
     * @dev Iterates over `sellOrders` and `sellerSignatures`, executing each through `_buy`.
     * @param sellOrders Array of sell orders, each following `OrderLib.Order` structure.
     * @param sellerSignatures Array of signatures, each corresponding to a sell order in `sellOrders`.
     */
    function batchBuy(
        OrderLib.Order[] calldata sellOrders,
        bytes[] calldata sellerSignatures
    ) public payable nonReentrant onlyEOA {
        require(sellOrders.length == sellerSignatures.length, "Array length mismatch");

        uint256 totalEthSpending;
        for (uint256 i = 0; i < sellOrders.length; i++) {
            // REVIEW: not a huge fan of this, let see if we can find a better way.
            // This also involves changing _executeFundsTransfer require from == to >=
            if (sellOrders[i].paymentToken == address(0)) {
                totalEthSpending += sellOrders[i].price;
                require(totalEthSpending <= msg.value, "Insufficient ETH sent");
            }
            _buy(sellOrders[i], sellerSignatures[i]);
        }
    }

    /**
     * @notice Allows a seller to execute a sell operation for a buy order
     * @dev Verifies the validity of the buy order and executes funds and token transfer
     * @param buyOrder The buy order to match with
     * @param buyerSignature Signature of the buyer to validate the order
     * @param tokenId The ID of the token being sold
     * @param merkleProof The merkle proof verifying the tokenId belongs to the merkle root in the buy order
     */
    function sell(
        OrderLib.Order calldata buyOrder,
        bytes calldata buyerSignature,
        uint256 tokenId,
        bytes32[] calldata merkleProof
    ) public payable nonReentrant onlyEOA {
        require(buyOrder.paymentToken != address(0), "payment token can not be ETH for buy order");
        require(buyOrder.side == OrderLib.Side.Buy, "order must be a buy");
        require(buyOrder.expirationTime > block.timestamp, "order expired");
        require(buyOrder.trader != address(0), "order trader is 0");
        require(buyOrder.price >= minimumPricePerPaymentToken[buyOrder.paymentToken], "price bellow minimumPrice");
        require(buyOrder.salt > 100_000, "salt should be above 100_000");

        bytes32 buyOrderHash = OrderLib._hashOrder(buyOrder);
        require(cancelledOrFilled[buyOrderHash] == false, "buy order cancelled or filled");

        bytes32 buyOrderDigest = _hashTypedDataV4(buyOrderHash);
        address buyOrderSigner = ECDSA.recover(buyOrderDigest, buyerSignature);
        require(buyOrderSigner == buyOrder.trader, "invalid signature");

        require(_verifyTokenId(buyOrder.merkleRoot, merkleProof, tokenId), "invalid tokenId");

        cancelledOrFilled[buyOrderHash] = true;

        _executeFundsTransfer(buyOrder.trader, msg.sender, buyOrder.paymentToken, buyOrder.price);

        _executeTokenTransfer(buyOrder.collection, msg.sender, buyOrder.trader, tokenId);

        emit Sell(
            msg.sender, // Seller's address
            buyOrder, // The buy order details
            tokenId, // The ID of the token being sold
            buyOrderHash // The hash of the buy order
        );
    }

    /**
     * @notice Cancels an order, preventing it from being executed
     * @dev Sets the order's hash in the `cancelledOrFilled` mapping to true
     * @param order The order to cancel
     */
    function cancelOrder(OrderLib.Order calldata order) public {
        require(order.trader == msg.sender, "msg.sender is not the trader");

        bytes32 orderHash = OrderLib._hashOrder(order);
        cancelledOrFilled[orderHash] = true;

        emit CancelOrder(orderHash);
    }

    /**
     * @notice Whitelists a payment token, allowing it to be used in transactions
     * @dev Only callable by the contract owner. This function adds a payment token to the list of tokens
     * that can be used for buying and selling on the exchange. Emits a `NewWhitelistedPaymentToken` event on success.
     * @param _paymentToken The address of the ERC-20 payment token to whitelist
     */
    function whiteListPaymentToken(address _paymentToken, uint256 _minimumPrice) public onlyOwner {
        whitelistedPaymentTokens[_paymentToken] = true;
        _setMinimumPricePerPaymentToken(_paymentToken, _minimumPrice);

        emit NewWhitelistedPaymentToken(_paymentToken);
    }

    /**
     * @notice Removes a payment token from the whitelist, preventing it from being used in future transactions
     * @dev Only callable by the contract owner. This function removes a payment token from the list of tokens
     * that are allowed for transactions. Emits an `UnWhitelistedPaymentToken` event on success.
     * @param _paymentToken The address of the ERC-20 payment token to remove from the whitelist
     */
    function unWhiteListPaymentToken(address _paymentToken) public onlyOwner {
        whitelistedPaymentTokens[_paymentToken] = false;

        emit UnWhitelistedPaymentToken(_paymentToken);
    }

    /**
     * @notice Whitelists a collection, allowing its tokens to be traded on the exchange
     * @dev Only callable by the contract owner. This function adds a collection to the list of NFT collections
     * that can be bought and sold on the exchange. Emits a `NewWhitelistedCollection` event on success.
     * @param _collection The address of the ERC-721 token collection to whitelist
     */
    function whiteListCollection(address _collection) public onlyOwner {
        whitelistedCollections[_collection] = true;

        emit NewWhitelistedCollection(_collection);
    }

    /**
     * @notice Removes a collection from the whitelist, preventing its tokens from being traded on the exchange
     * @dev Only callable by the contract owner. This function removes a collection from the list of collections
     * that are allowed to be traded. Emits an `UnWhitelistedCollection` event on success.
     * @param _collection The address of the ERC-721 token collection to remove from the whitelist
     */
    function unWhiteListCollection(address _collection) public onlyOwner {
        whitelistedCollections[_collection] = false;

        emit UnWhitelistedCollection(_collection);
    }

    /**
     * @notice Sets a new protocol fee in basis points
     * @param _protocolFeeBps The new protocol fee in basis points
     */
    function setProtocolFeeBps(uint256 _protocolFeeBps) public onlyOwner {
        _setProtocolFeeBps(_protocolFeeBps);
    }

    /**
     * @notice Sets a new protocol fee recipient address
     * @param _protocolFeeRecipient The address of the new protocol fee recipient
     */
    function setProtocolFeeRecipient(address _protocolFeeRecipient) public onlyOwner {
        _setProtocolFeeRecipient(_protocolFeeRecipient);
    }

    /**
     * @notice Sets a new execution delegate address
     * @param _executionDelegate The address of the new execution delegate
     */
    function setExecutionDelegate(address _executionDelegate) public onlyOwner {
        _setExecutionDelegate(_executionDelegate);
    }

    /**
     * @notice Sets a new minimum price for a certain payment token
     * @param paymentToken The address of the payment token
     * @param minimuPrice The new minimum price
     */
    function setMinimumPricePerPaymentToken(address paymentToken, uint256 minimuPrice) public onlyOwner {
        _setMinimumPricePerPaymentToken(paymentToken, minimuPrice);
    }

    /**
     * @notice Function to get the Domain Separator
     * @return bytes32: EIP712 Domain Separator
     */
    function domainSeparator() external view returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev Function to retrieve funds mistakenly sent to the mint contract.
     * @param paymentToken ERC20 token address, or zero for Ether.
     * @param to Recipient's address.
     * @param amount Transfer amount.
     */
    function saveFunds(address paymentToken, address to, uint256 amount) public onlyOwner {
        if (paymentToken == address(0)) {
            payable(to).transfer(amount);
        } else {
            IERC20(paymentToken).transfer(to, amount);
        }
    }

    /**
     * @notice Internal function that executes a buy operation for a sell order
     * @dev Verifies the validity of the sell order and executes funds and token transfer
     * @param sellOrder The sell order to match with
     * @param sellerSignature Signature of the seller to validate the order
     */
    function _buy(OrderLib.Order calldata sellOrder, bytes calldata sellerSignature) internal {
        require(sellOrder.side == OrderLib.Side.Sell, "order must be a sell");
        require(sellOrder.expirationTime > block.timestamp, "order expired");
        require(sellOrder.trader != address(0), "order trader is 0");
        require(sellOrder.price >= minimumPricePerPaymentToken[sellOrder.paymentToken], "price bellow minimumPrice");
        require(sellOrder.salt > 100_000, "salt should be above 100_000");

        bytes32 sellOrderHash = OrderLib._hashOrder(sellOrder);
        require(cancelledOrFilled[sellOrderHash] == false, "sell order cancelled or filled");

        bytes32 sellOrderDigest = _hashTypedDataV4(sellOrderHash);
        address sellOrderSigner = ECDSA.recover(sellOrderDigest, sellerSignature);
        require(sellOrderSigner == sellOrder.trader, "invalid signature");

        cancelledOrFilled[sellOrderHash] = true;

        _executeFundsTransfer(msg.sender, sellOrder.trader, sellOrder.paymentToken, sellOrder.price);

        _executeTokenTransfer(sellOrder.collection, sellOrder.trader, msg.sender, sellOrder.tokenId);

        emit Buy(msg.sender, sellOrder, sellOrderHash);
    }

    /**
     * @notice Internal function to set a new protocol fee in basis points
     * @param _protocolFeeBps The new protocol fee in basis points
     */
    function _setProtocolFeeBps(uint256 _protocolFeeBps) internal {
        require(_protocolFeeBps <= INVERSE_BASIS_POINT, "protocol fee above 100%");
        protocolFeeBps = _protocolFeeBps;

        emit NewProtocolFeeBps(_protocolFeeBps);
    }

    /**
     * @notice Internal function to set a new protocol fee recipient address
     * @param _protocolFeeRecipient The address of the new protocol fee recipient
     */
    function _setProtocolFeeRecipient(address _protocolFeeRecipient) internal {
        require(_protocolFeeRecipient != address(0), "protocol fee recipient can't be address 0");
        protocolFeeRecipient = _protocolFeeRecipient;

        emit NewProtocolFeeRecipient(_protocolFeeRecipient);
    }

    /**
     * @notice Internal function to set a new execution delegate address
     * @param _executionDelegate The address of the new execution delegate
     */
    function _setExecutionDelegate(address _executionDelegate) internal {
        require(_executionDelegate != address(0), "excution delegate can't be address 0");
        executionDelegate = IExecutionDelegate(_executionDelegate);

        emit NewExecutionDelegate(_executionDelegate);
    }

    /**
     * @notice Internal function to set a new minimum price for a certain payment token
     * @param paymentToken The address of the payment token
     * @param minimuPrice The new minimum price
     */
    function _setMinimumPricePerPaymentToken(address paymentToken, uint256 minimuPrice) internal {
        minimumPricePerPaymentToken[paymentToken] = minimuPrice;

        emit NewMinimumPricePerPaymentToken(paymentToken, minimuPrice);
    }

    /**
     * @dev Execute all ERC20 token / ETH transfers associated with an order match (fees and buyer => seller transfer)
     * @param from from
     * @param to to
     * @param paymentToken payment token
     * @param price price
     */
    function _executeFundsTransfer(address from, address to, address paymentToken, uint256 price) internal {
        if (paymentToken == address(0)) {
            require(msg.value >= price, "Incorrect ETH amount");
        }

        /* Take fee. */
        uint256 receiveAmount = _transferFees(paymentToken, from, price);

        /* Transfer remainder to seller. */
        _transferTo(paymentToken, from, to, receiveAmount);
    }

    /**
     * @dev fee is paid in the payment token specified in the order
     * @param paymentToken address of token to pay in
     * @param from address to charge fees
     * @param price price of token
     */
    function _transferFees(address paymentToken, address from, uint256 price) internal returns (uint256) {
        uint256 protocolFee = (price * protocolFeeBps) / INVERSE_BASIS_POINT;
        _transferTo(paymentToken, from, protocolFeeRecipient, protocolFee);

        require(protocolFee <= price, "Total amount of fees are more than the price");

        /* Amount that will be received by seller. */
        uint256 receiveAmount = price - protocolFee;
        return (receiveAmount);
    }

    /**
     * @dev Transfer amount in ETH or ERC20
     * @param paymentToken address of token to pay in
     * @param from token sender
     * @param to token recipient
     * @param amount amount to transfer
     */
    function _transferTo(address paymentToken, address from, address to, uint256 amount) internal {
        if (amount == 0) {
            return;
        }

        if (paymentToken == address(0)) {
            /* Transfer funds in ETH. */
            payable(to).transfer(amount);
        } else if (whitelistedPaymentTokens[paymentToken]) {
            /* Transfer ERC20. */
            executionDelegate.transferERC20(paymentToken, from, to, amount);
        } else {
            revert("Invalid payment token");
        }
    }

    /**
     * @dev Execute call through delegate proxy
     * @param collection collection contract address
     * @param from from
     * @param to to
     * @param tokenId tokenId
     */
    function _executeTokenTransfer(address collection, address from, address to, uint256 tokenId) internal {
        /* Assert collection is whitelisted */
        require(whitelistedCollections[collection], "Collection is not whitelisted");

        /* Call execution delegate. */
        executionDelegate.transferERC721Unsafe(collection, from, to, tokenId);
    }

    /**
     * @dev Verifies the validity of a token ID against a given Merkle root using a Merkle proof.
     * @param merkleRoot The root of the Merkle tree.
     * @param merkleProof An array of bytes32 values that represent the Merkle proof.
     * @param tokenId The token ID to verify.
     * @return bool Returns true if the token ID is valid and belongs to the Merkle tree defined by the root, otherwise false.
     */
    function _verifyTokenId(
        bytes32 merkleRoot,
        bytes32[] calldata merkleProof,
        uint256 tokenId
    ) internal pure returns (bool) {
        bytes32 leaf = keccak256(abi.encodePacked(tokenId));
        return MerkleProof.verify(merkleProof, merkleRoot, leaf);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.20;

import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

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

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

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

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
        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.
            /// @solidity memory-safe-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 {
            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        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]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError, bytes32) {
        // 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, s);
        }

        // 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, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

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

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

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.20;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the Merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates Merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     *@dev The multiproof provided is not valid.
     */
    error MerkleProofInvalidMultiproof();

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

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

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

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

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 1) {
            revert MerkleProofInvalidMultiproof();
        }

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

        if (totalHashes > 0) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 1) {
            revert MerkleProofInvalidMultiproof();
        }

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

        if (totalHashes > 0) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Sorts the pair (a, b) and hashes the result.
     */
    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    /**
     * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
     */
    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

pragma solidity ^0.8.20;

enum YieldMode {
    AUTOMATIC,
    VOID,
    CLAIMABLE
}

enum GasMode {
    VOID,
    CLAIMABLE
}

interface IBlast {
    // configure
    function configureContract(address contractAddress, YieldMode _yield, GasMode gasMode, address governor) external;

    function configure(YieldMode _yield, GasMode gasMode, address governor) external;

    // base configuration options
    function configureClaimableYield() external;

    function configureClaimableYieldOnBehalf(address contractAddress) external;

    function configureAutomaticYield() external;

    function configureAutomaticYieldOnBehalf(address contractAddress) external;

    function configureVoidYield() external;

    function configureVoidYieldOnBehalf(address contractAddress) external;

    function configureClaimableGas() external;

    function configureClaimableGasOnBehalf(address contractAddress) external;

    function configureVoidGas() external;

    function configureVoidGasOnBehalf(address contractAddress) external;

    function configureGovernor(address _governor) external;

    function configureGovernorOnBehalf(address _newGovernor, address contractAddress) external;

    // claim yield
    function claimYield(address contractAddress, address recipientOfYield, uint256 amount) external returns (uint256);

    function claimAllYield(address contractAddress, address recipientOfYield) external returns (uint256);

    // claim gas
    function claimAllGas(address contractAddress, address recipientOfGas) external returns (uint256);

    function claimGasAtMinClaimRate(
        address contractAddress,
        address recipientOfGas,
        uint256 minClaimRateBips
    ) external returns (uint256);

    function claimMaxGas(address contractAddress, address recipientOfGas) external returns (uint256);

    function claimGas(
        address contractAddress,
        address recipientOfGas,
        uint256 gasToClaim,
        uint256 gasSecondsToConsume
    ) external returns (uint256);

    // read functions
    function readClaimableYield(address contractAddress) external view returns (uint256);

    function readYieldConfiguration(address contractAddress) external view returns (uint8);

    function readGasParams(
        address contractAddress
    ) external view returns (uint256 etherSeconds, uint256 etherBalance, uint256 lastUpdated, GasMode);

    function governorMap(address input) external view returns (address);
}

pragma solidity ^0.8.20;

interface IBlastPoints {
    function configurePointsOperator(address operator) external;
    function configurePointsOperatorOnBehalf(address contractAddress, address operator) external;
    function operators(address input) external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IExecutionDelegate {
    event ApproveContract(address _contract);
    event DenyContract(address _contract);

    event RevokeApproval(address user);
    event GrantApproval(address user);

    function approveContract(address _contract) external;

    function denyContract(address _contract) external;

    function revokeApproval() external;

    function grantApproval() external;

    function mintFantasyCard(address collection, address to) external;

    function burnFantasyCard(address collection, uint256 tokenId) external;

    function transferERC721Unsafe(address collection, address from, address to, uint256 tokenId) external;

    function transferERC721(address collection, address from, address to, uint256 tokenId) external;

    function transferERC1155(address collection, address from, address to, uint256 tokenId, uint256 amount) external;

    function transferERC20(address token, address from, address to, uint256 amount) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "../libraries/OrderLib.sol";

interface IExchange {
    /* Events */
    event Buy(address indexed buyer, OrderLib.Order sell, bytes32 sellOrderHash);
    event Sell(address indexed seller, OrderLib.Order buyOrder, uint256 tokenId, bytes32 buyOrderHash);
    event CancelOrder(bytes32 orderHash);
    event NewWhitelistedPaymentToken(address paymentToken);
    event UnWhitelistedPaymentToken(address paymentToken);
    event NewWhitelistedCollection(address collection);
    event UnWhitelistedCollection(address collection);
    event NewProtocolFeeRecipient(address protocolFeeRecipient);
    event NewProtocolFeeBps(uint256 protocolFeeBps);
    event NewExecutionDelegate(address executionDelegate);
    event NewMinimumPricePerPaymentToken(address paymentToken, uint256 minimuPrice);

    /* Functions */
    function buy(OrderLib.Order calldata sellOrder, bytes calldata sellerSignature) external payable;

    function sell(
        OrderLib.Order calldata buyOrder,
        bytes calldata buyerSignature,
        uint256 tokenId,
        bytes32[] calldata merkleProof
    ) external payable;

    function cancelOrder(OrderLib.Order calldata order) external;

    function whiteListPaymentToken(address _paymentToken, uint256 _minimumPrice) external;

    function unWhiteListPaymentToken(address _paymentToken) external;

    function whiteListCollection(address _collection) external;

    function unWhiteListCollection(address _collection) external;

    function setProtocolFeeBps(uint256 _protocolFeeBps) external;

    function setProtocolFeeRecipient(address _protocolFeeRecipient) external;

    function setExecutionDelegate(address _executionDelegate) external;

    function domainSeparator() external view returns (bytes32);

    function saveFunds(address paymentToken, address to, uint256 amount) external;
}

pragma solidity ^0.8.20;

library OrderLib {
    bytes32 public constant ORDER_TYPEHASH =
        keccak256(
            "Order(address trader,uint8 side,address collection,uint256 tokenId,address paymentToken,uint256 price,uint256 expirationTime,bytes32 merkleRoot,uint256 salt)"
        );

    /// @dev Enum representing the side of the order: Buy or Sell
    enum Side {
        Buy,
        Sell
    }

    /// @dev Structure to represent an order
    /// @param trader Address of the trader placing the order
    /// @param side Side of the order, either Buy or Sell
    /// @param collection Address of the NFT collection
    /// @param tokenId Token ID within the collection (only used for Sell orders)
    /// @param paymentToken Address of the token used for payment
    /// @param price Price of the order
    /// @param expirationTime Expiration time of the order
    /// @param merkleRoot Merkle root of the order (only used for Buy orders)
    /// @param salt A unique value to ensure hash uniqueness
    struct Order {
        address trader;
        Side side;
        address collection;
        uint256 tokenId;
        address paymentToken;
        uint256 price;
        uint256 expirationTime;
        bytes32 merkleRoot;
        uint256 salt;
    }

    /// @dev Internal function to hash an order
    /// @param order The order to hash
    /// @return The hash of the order
    function _hashOrder(Order calldata order) public pure returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    ORDER_TYPEHASH,
                    order.trader,
                    order.side,
                    order.collection,
                    order.tokenId,
                    order.paymentToken,
                    order.price,
                    order.expirationTime,
                    order.merkleRoot,
                    order.salt
                )
            );
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

import {Strings} from "../Strings.sol";

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.20;

import {StorageSlot} from "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 15 of 21 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        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_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "remappings": [
    "@std/=lib/forge-std/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@VRGDAs/=lib/VRGDAs/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "VRGDAs/=lib/VRGDAs/src/",
    "ds-test/=lib/VRGDAs/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/VRGDAs/lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {
    "src/libraries/OrderLib.sol": {
      "OrderLib": "0xc55560B655aCE499716c4B29cf696De6E2Aad907"
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_protocolFeeRecipient","type":"address"},{"internalType":"uint256","name":"_protocolFeeBps","type":"uint256"},{"internalType":"address","name":"_executionDelegate","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"indexed":false,"internalType":"struct OrderLib.Order","name":"sell","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"sellOrderHash","type":"bytes32"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"CancelOrder","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"executionDelegate","type":"address"}],"name":"NewExecutionDelegate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"paymentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minimuPrice","type":"uint256"}],"name":"NewMinimumPricePerPaymentToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"protocolFeeBps","type":"uint256"}],"name":"NewProtocolFeeBps","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"protocolFeeRecipient","type":"address"}],"name":"NewProtocolFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"NewWhitelistedCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"paymentToken","type":"address"}],"name":"NewWhitelistedPaymentToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"indexed":false,"internalType":"struct OrderLib.Order","name":"buyOrder","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"buyOrderHash","type":"bytes32"}],"name":"Sell","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"UnWhitelistedCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"paymentToken","type":"address"}],"name":"UnWhitelistedPaymentToken","type":"event"},{"inputs":[],"name":"INVERSE_BASIS_POINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct OrderLib.Order[]","name":"sellOrders","type":"tuple[]"},{"internalType":"bytes[]","name":"sellerSignatures","type":"bytes[]"}],"name":"batchBuy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct OrderLib.Order","name":"sellOrder","type":"tuple"},{"internalType":"bytes","name":"sellerSignature","type":"bytes"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct OrderLib.Order","name":"order","type":"tuple"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"cancelledOrFilled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executionDelegate","outputs":[{"internalType":"contract IExecutionDelegate","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"}],"name":"minimumPricePerPaymentToken","outputs":[{"internalType":"uint256","name":"minimumPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"saveFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"trader","type":"address"},{"internalType":"enum OrderLib.Side","name":"side","type":"uint8"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct OrderLib.Order","name":"buyOrder","type":"tuple"},{"internalType":"bytes","name":"buyerSignature","type":"bytes"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"sell","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_executionDelegate","type":"address"}],"name":"setExecutionDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"minimuPrice","type":"uint256"}],"name":"setMinimumPricePerPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_protocolFeeBps","type":"uint256"}],"name":"setProtocolFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolFeeRecipient","type":"address"}],"name":"setProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"unWhiteListCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"}],"name":"unWhiteListPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"whiteListCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_minimumPrice","type":"uint256"}],"name":"whiteListPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"whitelistedCollections","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"}],"name":"whitelistedPaymentTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

6101606040523480156200001257600080fd5b506040516200309f3803806200309f8339810160408190526200003591620005d1565b604080518082018252600881526745786368616e676560c01b602080830191909152825180840190935260018352603160f81b9083015233916200007b826000620002cc565b610120526200008c816001620002cc565b61014052815160208084019190912060e052815190820120610100524660a0526200011a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526001600160a01b0381166200015357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200015e8162000305565b5060016004819055507343000000000000000000000000000000000000026001600160a01b0316634e606c476040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620001b757600080fd5b505af1158015620001cc573d6000803e3d6000fd5b5050604051631d70c8d360e31b8152336004820152734300000000000000000000000000000000000002925063eb8646989150602401600060405180830381600087803b1580156200021d57600080fd5b505af115801562000232573d6000803e3d6000fd5b50506040516336b91f2b60e01b8152336004820152732536fe9ab3f511540f2f9e2ec2a805005c3dd80092506336b91f2b9150602401600060405180830381600087803b1580156200028357600080fd5b505af115801562000298573d6000803e3d6000fd5b50505050620002ad836200032360201b60201c565b620002b882620003e2565b620002c3816200046c565b505050620007f8565b6000602083511015620002ec57620002e4836200051f565b9050620002ff565b81620002f98482620006b7565b5060ff90505b92915050565b600380546001600160a01b0319169055620003208162000562565b50565b6001600160a01b0381166200038d5760405162461bcd60e51b815260206004820152602960248201527f70726f746f636f6c2066656520726563697069656e742063616e27742062652060448201526806164647265737320360bc1b60648201526084016200014a565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f8cffb07faa2874440346743bdc0a86b06c3335cc47dc49b327d10e77b73ceb10906020015b60405180910390a150565b612710811115620004365760405162461bcd60e51b815260206004820152601760248201527f70726f746f636f6c206665652061626f7665203130302500000000000000000060448201526064016200014a565b60098190556040518181527fe3df5699bfea6c5e79b13439ac3e6cd4169e4ca8909c154cd8e68007b72653ff90602001620003d7565b6001600160a01b038116620004d05760405162461bcd60e51b8152602060048201526024808201527f6578637574696f6e2064656c65676174652063616e27742062652061646472656044820152630737320360e41b60648201526084016200014a565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527ff9a0f356a7ef079355de09d32ce45cc3cfabc8f118681c19a17501f005a376ac90602001620003d7565b600080829050601f815111156200054d578260405163305a27a960e01b81526004016200014a919062000783565b80516200055a82620007d3565b179392505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b0381168114620005cc57600080fd5b919050565b600080600060608486031215620005e757600080fd5b620005f284620005b4565b9250602084015191506200060960408501620005b4565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200063d57607f821691505b6020821081036200065e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620006b257600081815260208120601f850160051c810160208610156200068d5750805b601f850160051c820191505b81811015620006ae5782815560010162000699565b5050505b505050565b81516001600160401b03811115620006d357620006d362000612565b620006eb81620006e4845462000628565b8462000664565b602080601f8311600181146200072357600084156200070a5750858301515b600019600386901b1c1916600185901b178555620006ae565b600085815260208120601f198616915b82811015620007545788860151825594840194600190910190840162000733565b5085821015620007735787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b81811015620007b25785810183015185820160400152820162000794565b506000604082860101526040601f19601f8301168501019250505092915050565b805160208083015191908110156200065e5760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161284c6200085360003960006119390152600061190c01526000611b7601526000611b4e01526000611aa901526000611ad301526000611afd015261284c6000f3fe6080604052600436106101b65760003560e01c806384b0196e116100ec578063d4936dab1161008a578063e521cb9211610064578063e521cb92146104e8578063f2fde38b14610508578063f66a679914610528578063f698da251461054857600080fd5b8063d4936dab1461047a578063df695abb1461049a578063e30c3978146104ca57600080fd5b8063a0920294116100c6578063a092029414610404578063c0417e5814610417578063cae6047f14610437578063d00bd1601461044d57600080fd5b806384b0196e1461039e5780638da5cb5b146103c6578063986c9b20146103e457600080fd5b80634f05cbd81161015957806364df049e1161013357806364df049e1461031c578063715018a61461035457806379ba509714610369578063844ed6561461037e57600080fd5b80634f05cbd81461028c5780635511f319146102cc5780635e48091b146102fc57600080fd5b80631335a29b116101955780631335a29b1461020357806313aaf2661461022357806326b986e21461024357806335659fb81461026357600080fd5b8062cb1eef146101bb578063037c9be2146101d05780630c03ecb3146101f0575b600080fd5b6101ce6101c9366004612214565b61055d565b005b3480156101dc57600080fd5b506101ce6101eb3660046122bf565b610a8a565b6101ce6101fe3660046122da565b610a9e565b34801561020f57600080fd5b506101ce61021e3660046122bf565b610c2e565b34801561022f57600080fd5b506101ce61023e3660046122bf565b610c8e565b34801561024f57600080fd5b506101ce61025e366004612375565b610ce7565b34801561026f57600080fd5b5061027960095481565b6040519081526020015b60405180910390f35b34801561029857600080fd5b506102bc6102a73660046122bf565b60066020526000908152604090205460ff1681565b6040519015158152602001610283565b3480156102d857600080fd5b506102bc6102e736600461239f565b60056020526000908152604090205460ff1681565b34801561030857600080fd5b506101ce6103173660046123b8565b610cfd565b34801561032857600080fd5b50600a5461033c906001600160a01b031681565b6040516001600160a01b039091168152602001610283565b34801561036057600080fd5b506101ce610dc1565b34801561037557600080fd5b506101ce610dd5565b34801561038a57600080fd5b506101ce610399366004612375565b610e16565b3480156103aa57600080fd5b506103b3610e8c565b604051610283979695949392919061243a565b3480156103d257600080fd5b506002546001600160a01b031661033c565b3480156103f057600080fd5b50600b5461033c906001600160a01b031681565b6101ce6104123660046124d0565b610ed2565b34801561042357600080fd5b506101ce61043236600461239f565b610f0e565b34801561044357600080fd5b5061027961271081565b34801561045957600080fd5b506102796104683660046122bf565b60086020526000908152604090205481565b34801561048657600080fd5b506101ce6104953660046122bf565b610f1f565b3480156104a657600080fd5b506102bc6104b53660046122bf565b60076020526000908152604090205460ff1681565b3480156104d657600080fd5b506003546001600160a01b031661033c565b3480156104f457600080fd5b506101ce6105033660046122bf565b610f7b565b34801561051457600080fd5b506101ce6105233660046122bf565b610f8c565b34801561053457600080fd5b506101ce610543366004612526565b610ffd565b34801561055457600080fd5b5061027961112a565b610565611139565b33321461058d5760405162461bcd60e51b815260040161058490612543565b60405180910390fd5b600061059f60a08801608089016122bf565b6001600160a01b0316036106085760405162461bcd60e51b815260206004820152602a60248201527f7061796d656e7420746f6b656e2063616e206e6f742062652045544820666f7260448201526910313abc9037b93232b960b11b6064820152608401610584565b600061061a60408801602089016125ad565b600181111561062b5761062b612588565b1461066e5760405162461bcd60e51b81526020600482015260136024820152726f72646572206d75737420626520612062757960681b6044820152606401610584565b428660c00135116106b15760405162461bcd60e51b815260206004820152600d60248201526c1bdc99195c88195e1c1a5c9959609a1b6044820152606401610584565b60006106c060208801886122bf565b6001600160a01b03160361070a5760405162461bcd60e51b815260206004820152601160248201527006f7264657220747261646572206973203607c1b6044820152606401610584565b6008600061071e60a0890160808a016122bf565b6001600160a01b03166001600160a01b03168152602001908152602001600020548660a00135101561078e5760405162461bcd60e51b815260206004820152601960248201527870726963652062656c6c6f77206d696e696d756d507269636560381b6044820152606401610584565b620186a0866101000135116107e55760405162461bcd60e51b815260206004820152601c60248201527f73616c742073686f756c642062652061626f7665203130305f303030000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061081f908a9060040161266e565b602060405180830381865af415801561083c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610860919061267d565b60008181526005602052604090205490915060ff16156108c25760405162461bcd60e51b815260206004820152601d60248201527f627579206f726465722063616e63656c6c6564206f722066696c6c65640000006044820152606401610584565b60006108cd82611163565b905060006109118289898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119692505050565b905061092060208a018a6122bf565b6001600160a01b0316816001600160a01b0316146109745760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610584565b6109848960e001358686896111c0565b6109c25760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a59081d1bdad95b9259608a1b6044820152606401610584565b6000838152600560209081526040909120805460ff19166001179055610a09906109ee908b018b6122bf565b336109ff60a08d0160808e016122bf565b8c60a00135611238565b610a30610a1c60608b0160408c016122bf565b33610a2a60208d018d6122bf565b896112af565b336001600160a01b03167fd787cf372c9f960b5be92b833473c375b88b8ed771eb0430c148dd0d5394ae498a8886604051610a6d93929190612696565b60405180910390a2505050610a826001600455565b505050505050565b610a92611393565b610a9b816113c0565b50565b610aa6611139565b333214610ac55760405162461bcd60e51b815260040161058490612543565b828114610b0c5760405162461bcd60e51b8152602060048201526015602482015274082e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b6044820152606401610584565b6000805b84811015610c1c576000868683818110610b2c57610b2c6126b8565b905061012002016080016020810190610b4591906122bf565b6001600160a01b031603610bc557858582818110610b6557610b656126b8565b9050610120020160a0013582610b7b91906126e4565b915034821115610bc55760405162461bcd60e51b8152602060048201526015602482015274125b9cdd59999a58da595b9d08115512081cd95b9d605a1b6044820152606401610584565b610c0a868683818110610bda57610bda6126b8565b90506101200201858584818110610bf357610bf36126b8565b9050602002810190610c0591906126f7565b611470565b80610c148161273e565b915050610b10565b5050610c286001600455565b50505050565b610c36611393565b6001600160a01b038116600081815260076020908152604091829020805460ff1916905590519182527f4c6fd91065e8d31d24cda1d90f8b82eaa2010a9452fdb957414cbf7f1b2a9d2891015b60405180910390a150565b610c96611393565b6001600160a01b038116600081815260066020908152604091829020805460ff1916905590519182527fed3eb8d0fbd0827cb7352b2abfeab8e86a413218ac1a55e47044db2c764ec1de9101610c83565b610cef611393565b610cf9828261189b565b5050565b610d05611393565b6001600160a01b038316610d49576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610c28573d6000803e3d6000fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190612757565b505050565b610dc9611393565b610dd360006118ec565b565b60035433906001600160a01b03168114610e0d5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610584565b610a9b816118ec565b610e1e611393565b6001600160a01b0382166000908152600760205260409020805460ff19166001179055610e4b828261189b565b6040516001600160a01b03831681527fe3386e7adc83fe97b97006a6efa49534fcda477311fc8dc97c8bc09cd0bbee22906020015b60405180910390a15050565b600060608060008060006060610ea0611905565b610ea8611932565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b610eda611139565b333214610ef95760405162461bcd60e51b815260040161058490612543565b610f04838383611470565b610dbc6001600455565b610f16611393565b610a9b8161195f565b610f27611393565b6001600160a01b038116600081815260066020908152604091829020805460ff1916600117905590519182527f76e6d03d02c9b0a17e526874d022dad842ea72d3f29bb68e3c69647728c796119101610c83565b610f83611393565b610a9b816119e6565b610f94611393565b600380546001600160a01b0383166001600160a01b03199091168117909155610fc56002546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b3361100b60208301836122bf565b6001600160a01b0316146110615760405162461bcd60e51b815260206004820152601c60248201527f6d73672e73656e646572206973206e6f742074686520747261646572000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061109b90859060040161266e565b602060405180830381865af41580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc919061267d565b60008181526005602052604090819020805460ff19166001179055519091507f42c76c81a7cba1b9c861353909a184e20747ab960332628dabcbb5852fc5cbb590610e809083815260200190565b6000611134611a9c565b905090565b60026004540361115c57604051633ee5aeb560e01b815260040160405180910390fd5b6002600455565b6000611190611170611a9c565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b6000806000806111a68686611bc7565b9250925092506111b68282611c14565b5090949350505050565b600080826040516020016111d691815260200190565b60405160208183030381529060405280519060200120905061122e8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150611ccd9050565b9695505050505050565b6001600160a01b03821661128d578034101561128d5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0811551208185b5bdd5b9d60621b6044820152606401610584565b600061129a838684611ce3565b90506112a883868684611d8f565b5050505050565b6001600160a01b03841660009081526006602052604090205460ff166113175760405162461bcd60e51b815260206004820152601d60248201527f436f6c6c656374696f6e206973206e6f742077686974656c69737465640000006044820152606401610584565b600b546040516365396d4760e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018490529091169063ca72da8e90608401600060405180830381600087803b15801561137557600080fd5b505af1158015611389573d6000803e3d6000fd5b5050505050505050565b6002546001600160a01b03163314610dd35760405163118cdaa760e01b8152336004820152602401610584565b6001600160a01b0381166114225760405162461bcd60e51b8152602060048201526024808201527f6578637574696f6e2064656c65676174652063616e27742062652061646472656044820152630737320360e41b6064820152608401610584565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527ff9a0f356a7ef079355de09d32ce45cc3cfabc8f118681c19a17501f005a376ac90602001610c83565b600161148260408501602086016125ad565b600181111561149357611493612588565b146114d75760405162461bcd60e51b81526020600482015260146024820152731bdc99195c881b5d5cdd0818994818481cd95b1b60621b6044820152606401610584565b428360c001351161151a5760405162461bcd60e51b815260206004820152600d60248201526c1bdc99195c88195e1c1a5c9959609a1b6044820152606401610584565b600061152960208501856122bf565b6001600160a01b0316036115735760405162461bcd60e51b815260206004820152601160248201527006f7264657220747261646572206973203607c1b6044820152606401610584565b6008600061158760a08601608087016122bf565b6001600160a01b03166001600160a01b03168152602001908152602001600020548360a0013510156115f75760405162461bcd60e51b815260206004820152601960248201527870726963652062656c6c6f77206d696e696d756d507269636560381b6044820152606401610584565b620186a08361010001351161164e5760405162461bcd60e51b815260206004820152601c60248201527f73616c742073686f756c642062652061626f7665203130305f303030000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061168890879060040161266e565b602060405180830381865af41580156116a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c9919061267d565b60008181526005602052604090205490915060ff161561172b5760405162461bcd60e51b815260206004820152601e60248201527f73656c6c206f726465722063616e63656c6c6564206f722066696c6c656400006044820152606401610584565b600061173682611163565b9050600061177a8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119692505050565b905061178960208701876122bf565b6001600160a01b0316816001600160a01b0316146117dd5760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610584565b6000838152600560209081526040909120805460ff1916600117905561182590339061180b908901896122bf565b61181b60a08a0160808b016122bf565b8960a00135611238565b61185061183860608801604089016122bf565b61184560208901896122bf565b3389606001356112af565b336001600160a01b03167fb197f0b7d29f585d30223a9c287a1309a7c3371a57036eb30995ae25ba906dae878560405161188b929190612779565b60405180910390a2505050505050565b6001600160a01b038216600081815260086020908152604091829020849055815192835282018390527f7bd14f449dd3a601079f46c5829da4eac44c22202595245a76c7c3dbc7e5b3f99101610e80565b600380546001600160a01b0319169055610a9b81611ebb565b60606111347f00000000000000000000000000000000000000000000000000000000000000006000611f0d565b60606111347f00000000000000000000000000000000000000000000000000000000000000006001611f0d565b6127108111156119b15760405162461bcd60e51b815260206004820152601760248201527f70726f746f636f6c206665652061626f766520313030250000000000000000006044820152606401610584565b60098190556040518181527fe3df5699bfea6c5e79b13439ac3e6cd4169e4ca8909c154cd8e68007b72653ff90602001610c83565b6001600160a01b038116611a4e5760405162461bcd60e51b815260206004820152602960248201527f70726f746f636f6c2066656520726563697069656e742063616e27742062652060448201526806164647265737320360bc1b6064820152608401610584565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f8cffb07faa2874440346743bdc0a86b06c3335cc47dc49b327d10e77b73ceb1090602001610c83565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611af557507f000000000000000000000000000000000000000000000000000000000000000046145b15611b1f57507f000000000000000000000000000000000000000000000000000000000000000090565b611134604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103611c015760208401516040850151606086015160001a611bf388828585611fb8565b955095509550505050611c0d565b50508151600091506002905b9250925092565b6000826003811115611c2857611c28612588565b03611c31575050565b6001826003811115611c4557611c45612588565b03611c635760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611c7757611c77612588565b03611c985760405163fce698f760e01b815260048101829052602401610584565b6003826003811115611cac57611cac612588565b03610cf9576040516335e2f38360e21b815260048101829052602401610584565b600082611cda8584612087565b14949350505050565b60008061271060095484611cf79190612796565b611d0191906127ad565b600a54909150611d1e90869086906001600160a01b031684611d8f565b82811115611d835760405162461bcd60e51b815260206004820152602c60248201527f546f74616c20616d6f756e74206f66206665657320617265206d6f726520746860448201526b616e2074686520707269636560a01b6064820152608401610584565b600061122e82856127cf565b8015610c28576001600160a01b038416611ddf576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611dd9573d6000803e3d6000fd5b50610c28565b6001600160a01b03841660009081526007602052604090205460ff1615611e7b57600b5460405163368fa33960e21b81526001600160a01b03868116600483015285811660248301528481166044830152606482018490529091169063da3e8ce490608401600060405180830381600087803b158015611e5e57600080fd5b505af1158015611e72573d6000803e3d6000fd5b50505050610c28565b60405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103830bcb6b2b73a103a37b5b2b760591b6044820152606401610584565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff8314611f2757611f20836120d4565b9050611190565b818054611f33906127e2565b80601f0160208091040260200160405190810160405280929190818152602001828054611f5f906127e2565b8015611fac5780601f10611f8157610100808354040283529160200191611fac565b820191906000526020600020905b815481529060010190602001808311611f8f57829003601f168201915b50505050509050611190565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611ff3575060009150600390508261207d565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612047573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166120735750600092506001915082905061207d565b9250600091508190505b9450945094915050565b600081815b84518110156120cc576120b8828683815181106120ab576120ab6126b8565b6020026020010151612113565b9150806120c48161273e565b91505061208c565b509392505050565b606060006120e183612145565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600081831061212f57600082815260208490526040902061213e565b60008381526020839052604090205b9392505050565b600060ff8216601f81111561119057604051632cd44ac360e21b815260040160405180910390fd5b6000610120828403121561218057600080fd5b50919050565b60008083601f84011261219857600080fd5b50813567ffffffffffffffff8111156121b057600080fd5b6020830191508360208285010111156121c857600080fd5b9250929050565b60008083601f8401126121e157600080fd5b50813567ffffffffffffffff8111156121f957600080fd5b6020830191508360208260051b85010111156121c857600080fd5b600080600080600080610180878903121561222e57600080fd5b612238888861216d565b955061012087013567ffffffffffffffff8082111561225657600080fd5b6122628a838b01612186565b9097509550610140890135945061016089013591508082111561228457600080fd5b5061229189828a016121cf565b979a9699509497509295939492505050565b80356001600160a01b03811681146122ba57600080fd5b919050565b6000602082840312156122d157600080fd5b61213e826122a3565b600080600080604085870312156122f057600080fd5b843567ffffffffffffffff8082111561230857600080fd5b818701915087601f83011261231c57600080fd5b81358181111561232b57600080fd5b8860206101208302850101111561234157600080fd5b60209283019650945090860135908082111561235c57600080fd5b50612369878288016121cf565b95989497509550505050565b6000806040838503121561238857600080fd5b612391836122a3565b946020939093013593505050565b6000602082840312156123b157600080fd5b5035919050565b6000806000606084860312156123cd57600080fd5b6123d6846122a3565b92506123e4602085016122a3565b9150604084013590509250925092565b6000815180845260005b8181101561241a576020818501810151868301820152016123fe565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b881681526000602060e08184015261245a60e084018a6123f4565b838103604085015261246c818a6123f4565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156124be578351835292840192918401916001016124a2565b50909c9b505050505050505050505050565b600080600061014084860312156124e657600080fd5b6124f0858561216d565b925061012084013567ffffffffffffffff81111561250d57600080fd5b61251986828701612186565b9497909650939450505050565b6000610120828403121561253957600080fd5b61213e838361216d565b60208082526025908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920616040820152646e20454f4160d81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b8035600281106122ba57600080fd5b6000602082840312156125bf57600080fd5b61213e8261259e565b6001600160a01b03806125da836122a3565b1683526125e96020830161259e565b6002811061260757634e487b7160e01b600052602160045260246000fd5b602084015280612619604084016122a3565b1660408401525060608101356060830152612636608082016122a3565b6001600160a01b0316608083015260a0818101359083015260c0808201359083015260e0808201359083015261010090810135910152565b610120810161119082846125c8565b60006020828403121561268f57600080fd5b5051919050565b61016081016126a582866125c8565b6101208201939093526101400152919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611190576111906126ce565b6000808335601e1984360301811261270e57600080fd5b83018035915067ffffffffffffffff82111561272957600080fd5b6020019150368190038213156121c857600080fd5b600060018201612750576127506126ce565b5060010190565b60006020828403121561276957600080fd5b8151801515811461213e57600080fd5b610140810161278882856125c8565b826101208301529392505050565b8082028115828204841417611190576111906126ce565b6000826127ca57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611190576111906126ce565b600181811c908216806127f657607f821691505b60208210810361218057634e487b7160e01b600052602260045260246000fdfea26469706673582212205ac904ad31292e3abffb471a23b7226273c7119668dd7a9e53c244bb06d6e3e264736f6c634300081400330000000000000000000000008ab15fe88a00b03724ac91ee4ee1f998064f2e31000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000a11bf3a1b86a977e3beab2a2e20c67ffde9def7e

Deployed Bytecode

0x6080604052600436106101b65760003560e01c806384b0196e116100ec578063d4936dab1161008a578063e521cb9211610064578063e521cb92146104e8578063f2fde38b14610508578063f66a679914610528578063f698da251461054857600080fd5b8063d4936dab1461047a578063df695abb1461049a578063e30c3978146104ca57600080fd5b8063a0920294116100c6578063a092029414610404578063c0417e5814610417578063cae6047f14610437578063d00bd1601461044d57600080fd5b806384b0196e1461039e5780638da5cb5b146103c6578063986c9b20146103e457600080fd5b80634f05cbd81161015957806364df049e1161013357806364df049e1461031c578063715018a61461035457806379ba509714610369578063844ed6561461037e57600080fd5b80634f05cbd81461028c5780635511f319146102cc5780635e48091b146102fc57600080fd5b80631335a29b116101955780631335a29b1461020357806313aaf2661461022357806326b986e21461024357806335659fb81461026357600080fd5b8062cb1eef146101bb578063037c9be2146101d05780630c03ecb3146101f0575b600080fd5b6101ce6101c9366004612214565b61055d565b005b3480156101dc57600080fd5b506101ce6101eb3660046122bf565b610a8a565b6101ce6101fe3660046122da565b610a9e565b34801561020f57600080fd5b506101ce61021e3660046122bf565b610c2e565b34801561022f57600080fd5b506101ce61023e3660046122bf565b610c8e565b34801561024f57600080fd5b506101ce61025e366004612375565b610ce7565b34801561026f57600080fd5b5061027960095481565b6040519081526020015b60405180910390f35b34801561029857600080fd5b506102bc6102a73660046122bf565b60066020526000908152604090205460ff1681565b6040519015158152602001610283565b3480156102d857600080fd5b506102bc6102e736600461239f565b60056020526000908152604090205460ff1681565b34801561030857600080fd5b506101ce6103173660046123b8565b610cfd565b34801561032857600080fd5b50600a5461033c906001600160a01b031681565b6040516001600160a01b039091168152602001610283565b34801561036057600080fd5b506101ce610dc1565b34801561037557600080fd5b506101ce610dd5565b34801561038a57600080fd5b506101ce610399366004612375565b610e16565b3480156103aa57600080fd5b506103b3610e8c565b604051610283979695949392919061243a565b3480156103d257600080fd5b506002546001600160a01b031661033c565b3480156103f057600080fd5b50600b5461033c906001600160a01b031681565b6101ce6104123660046124d0565b610ed2565b34801561042357600080fd5b506101ce61043236600461239f565b610f0e565b34801561044357600080fd5b5061027961271081565b34801561045957600080fd5b506102796104683660046122bf565b60086020526000908152604090205481565b34801561048657600080fd5b506101ce6104953660046122bf565b610f1f565b3480156104a657600080fd5b506102bc6104b53660046122bf565b60076020526000908152604090205460ff1681565b3480156104d657600080fd5b506003546001600160a01b031661033c565b3480156104f457600080fd5b506101ce6105033660046122bf565b610f7b565b34801561051457600080fd5b506101ce6105233660046122bf565b610f8c565b34801561053457600080fd5b506101ce610543366004612526565b610ffd565b34801561055457600080fd5b5061027961112a565b610565611139565b33321461058d5760405162461bcd60e51b815260040161058490612543565b60405180910390fd5b600061059f60a08801608089016122bf565b6001600160a01b0316036106085760405162461bcd60e51b815260206004820152602a60248201527f7061796d656e7420746f6b656e2063616e206e6f742062652045544820666f7260448201526910313abc9037b93232b960b11b6064820152608401610584565b600061061a60408801602089016125ad565b600181111561062b5761062b612588565b1461066e5760405162461bcd60e51b81526020600482015260136024820152726f72646572206d75737420626520612062757960681b6044820152606401610584565b428660c00135116106b15760405162461bcd60e51b815260206004820152600d60248201526c1bdc99195c88195e1c1a5c9959609a1b6044820152606401610584565b60006106c060208801886122bf565b6001600160a01b03160361070a5760405162461bcd60e51b815260206004820152601160248201527006f7264657220747261646572206973203607c1b6044820152606401610584565b6008600061071e60a0890160808a016122bf565b6001600160a01b03166001600160a01b03168152602001908152602001600020548660a00135101561078e5760405162461bcd60e51b815260206004820152601960248201527870726963652062656c6c6f77206d696e696d756d507269636560381b6044820152606401610584565b620186a0866101000135116107e55760405162461bcd60e51b815260206004820152601c60248201527f73616c742073686f756c642062652061626f7665203130305f303030000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061081f908a9060040161266e565b602060405180830381865af415801561083c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610860919061267d565b60008181526005602052604090205490915060ff16156108c25760405162461bcd60e51b815260206004820152601d60248201527f627579206f726465722063616e63656c6c6564206f722066696c6c65640000006044820152606401610584565b60006108cd82611163565b905060006109118289898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119692505050565b905061092060208a018a6122bf565b6001600160a01b0316816001600160a01b0316146109745760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610584565b6109848960e001358686896111c0565b6109c25760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a59081d1bdad95b9259608a1b6044820152606401610584565b6000838152600560209081526040909120805460ff19166001179055610a09906109ee908b018b6122bf565b336109ff60a08d0160808e016122bf565b8c60a00135611238565b610a30610a1c60608b0160408c016122bf565b33610a2a60208d018d6122bf565b896112af565b336001600160a01b03167fd787cf372c9f960b5be92b833473c375b88b8ed771eb0430c148dd0d5394ae498a8886604051610a6d93929190612696565b60405180910390a2505050610a826001600455565b505050505050565b610a92611393565b610a9b816113c0565b50565b610aa6611139565b333214610ac55760405162461bcd60e51b815260040161058490612543565b828114610b0c5760405162461bcd60e51b8152602060048201526015602482015274082e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b6044820152606401610584565b6000805b84811015610c1c576000868683818110610b2c57610b2c6126b8565b905061012002016080016020810190610b4591906122bf565b6001600160a01b031603610bc557858582818110610b6557610b656126b8565b9050610120020160a0013582610b7b91906126e4565b915034821115610bc55760405162461bcd60e51b8152602060048201526015602482015274125b9cdd59999a58da595b9d08115512081cd95b9d605a1b6044820152606401610584565b610c0a868683818110610bda57610bda6126b8565b90506101200201858584818110610bf357610bf36126b8565b9050602002810190610c0591906126f7565b611470565b80610c148161273e565b915050610b10565b5050610c286001600455565b50505050565b610c36611393565b6001600160a01b038116600081815260076020908152604091829020805460ff1916905590519182527f4c6fd91065e8d31d24cda1d90f8b82eaa2010a9452fdb957414cbf7f1b2a9d2891015b60405180910390a150565b610c96611393565b6001600160a01b038116600081815260066020908152604091829020805460ff1916905590519182527fed3eb8d0fbd0827cb7352b2abfeab8e86a413218ac1a55e47044db2c764ec1de9101610c83565b610cef611393565b610cf9828261189b565b5050565b610d05611393565b6001600160a01b038316610d49576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610c28573d6000803e3d6000fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190612757565b505050565b610dc9611393565b610dd360006118ec565b565b60035433906001600160a01b03168114610e0d5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610584565b610a9b816118ec565b610e1e611393565b6001600160a01b0382166000908152600760205260409020805460ff19166001179055610e4b828261189b565b6040516001600160a01b03831681527fe3386e7adc83fe97b97006a6efa49534fcda477311fc8dc97c8bc09cd0bbee22906020015b60405180910390a15050565b600060608060008060006060610ea0611905565b610ea8611932565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b610eda611139565b333214610ef95760405162461bcd60e51b815260040161058490612543565b610f04838383611470565b610dbc6001600455565b610f16611393565b610a9b8161195f565b610f27611393565b6001600160a01b038116600081815260066020908152604091829020805460ff1916600117905590519182527f76e6d03d02c9b0a17e526874d022dad842ea72d3f29bb68e3c69647728c796119101610c83565b610f83611393565b610a9b816119e6565b610f94611393565b600380546001600160a01b0383166001600160a01b03199091168117909155610fc56002546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b3361100b60208301836122bf565b6001600160a01b0316146110615760405162461bcd60e51b815260206004820152601c60248201527f6d73672e73656e646572206973206e6f742074686520747261646572000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061109b90859060040161266e565b602060405180830381865af41580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc919061267d565b60008181526005602052604090819020805460ff19166001179055519091507f42c76c81a7cba1b9c861353909a184e20747ab960332628dabcbb5852fc5cbb590610e809083815260200190565b6000611134611a9c565b905090565b60026004540361115c57604051633ee5aeb560e01b815260040160405180910390fd5b6002600455565b6000611190611170611a9c565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b6000806000806111a68686611bc7565b9250925092506111b68282611c14565b5090949350505050565b600080826040516020016111d691815260200190565b60405160208183030381529060405280519060200120905061122e8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150611ccd9050565b9695505050505050565b6001600160a01b03821661128d578034101561128d5760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0811551208185b5bdd5b9d60621b6044820152606401610584565b600061129a838684611ce3565b90506112a883868684611d8f565b5050505050565b6001600160a01b03841660009081526006602052604090205460ff166113175760405162461bcd60e51b815260206004820152601d60248201527f436f6c6c656374696f6e206973206e6f742077686974656c69737465640000006044820152606401610584565b600b546040516365396d4760e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018490529091169063ca72da8e90608401600060405180830381600087803b15801561137557600080fd5b505af1158015611389573d6000803e3d6000fd5b5050505050505050565b6002546001600160a01b03163314610dd35760405163118cdaa760e01b8152336004820152602401610584565b6001600160a01b0381166114225760405162461bcd60e51b8152602060048201526024808201527f6578637574696f6e2064656c65676174652063616e27742062652061646472656044820152630737320360e41b6064820152608401610584565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527ff9a0f356a7ef079355de09d32ce45cc3cfabc8f118681c19a17501f005a376ac90602001610c83565b600161148260408501602086016125ad565b600181111561149357611493612588565b146114d75760405162461bcd60e51b81526020600482015260146024820152731bdc99195c881b5d5cdd0818994818481cd95b1b60621b6044820152606401610584565b428360c001351161151a5760405162461bcd60e51b815260206004820152600d60248201526c1bdc99195c88195e1c1a5c9959609a1b6044820152606401610584565b600061152960208501856122bf565b6001600160a01b0316036115735760405162461bcd60e51b815260206004820152601160248201527006f7264657220747261646572206973203607c1b6044820152606401610584565b6008600061158760a08601608087016122bf565b6001600160a01b03166001600160a01b03168152602001908152602001600020548360a0013510156115f75760405162461bcd60e51b815260206004820152601960248201527870726963652062656c6c6f77206d696e696d756d507269636560381b6044820152606401610584565b620186a08361010001351161164e5760405162461bcd60e51b815260206004820152601c60248201527f73616c742073686f756c642062652061626f7665203130305f303030000000006044820152606401610584565b6040516361425fc560e11b815260009073c55560b655ace499716c4b29cf696de6e2aad9079063c284bf8a9061168890879060040161266e565b602060405180830381865af41580156116a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c9919061267d565b60008181526005602052604090205490915060ff161561172b5760405162461bcd60e51b815260206004820152601e60248201527f73656c6c206f726465722063616e63656c6c6564206f722066696c6c656400006044820152606401610584565b600061173682611163565b9050600061177a8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119692505050565b905061178960208701876122bf565b6001600160a01b0316816001600160a01b0316146117dd5760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610584565b6000838152600560209081526040909120805460ff1916600117905561182590339061180b908901896122bf565b61181b60a08a0160808b016122bf565b8960a00135611238565b61185061183860608801604089016122bf565b61184560208901896122bf565b3389606001356112af565b336001600160a01b03167fb197f0b7d29f585d30223a9c287a1309a7c3371a57036eb30995ae25ba906dae878560405161188b929190612779565b60405180910390a2505050505050565b6001600160a01b038216600081815260086020908152604091829020849055815192835282018390527f7bd14f449dd3a601079f46c5829da4eac44c22202595245a76c7c3dbc7e5b3f99101610e80565b600380546001600160a01b0319169055610a9b81611ebb565b60606111347f45786368616e67650000000000000000000000000000000000000000000000086000611f0d565b60606111347f31000000000000000000000000000000000000000000000000000000000000016001611f0d565b6127108111156119b15760405162461bcd60e51b815260206004820152601760248201527f70726f746f636f6c206665652061626f766520313030250000000000000000006044820152606401610584565b60098190556040518181527fe3df5699bfea6c5e79b13439ac3e6cd4169e4ca8909c154cd8e68007b72653ff90602001610c83565b6001600160a01b038116611a4e5760405162461bcd60e51b815260206004820152602960248201527f70726f746f636f6c2066656520726563697069656e742063616e27742062652060448201526806164647265737320360bc1b6064820152608401610584565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f8cffb07faa2874440346743bdc0a86b06c3335cc47dc49b327d10e77b73ceb1090602001610c83565b6000306001600160a01b037f0000000000000000000000005b8c52f4ebdb7c1eb01405a6e03916bba2a974c916148015611af557507f0000000000000000000000000000000000000000000000000000000000013e3146145b15611b1f57507f0a3824f5586481f3459ae1252ca99d26cd1858e12ce4ef291dbb4b34f037a39890565b611134604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fddd112a261429abc594f5771eb08d7fa47bff456b2e5f1a47907b78573e33d96918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103611c015760208401516040850151606086015160001a611bf388828585611fb8565b955095509550505050611c0d565b50508151600091506002905b9250925092565b6000826003811115611c2857611c28612588565b03611c31575050565b6001826003811115611c4557611c45612588565b03611c635760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611c7757611c77612588565b03611c985760405163fce698f760e01b815260048101829052602401610584565b6003826003811115611cac57611cac612588565b03610cf9576040516335e2f38360e21b815260048101829052602401610584565b600082611cda8584612087565b14949350505050565b60008061271060095484611cf79190612796565b611d0191906127ad565b600a54909150611d1e90869086906001600160a01b031684611d8f565b82811115611d835760405162461bcd60e51b815260206004820152602c60248201527f546f74616c20616d6f756e74206f66206665657320617265206d6f726520746860448201526b616e2074686520707269636560a01b6064820152608401610584565b600061122e82856127cf565b8015610c28576001600160a01b038416611ddf576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611dd9573d6000803e3d6000fd5b50610c28565b6001600160a01b03841660009081526007602052604090205460ff1615611e7b57600b5460405163368fa33960e21b81526001600160a01b03868116600483015285811660248301528481166044830152606482018490529091169063da3e8ce490608401600060405180830381600087803b158015611e5e57600080fd5b505af1158015611e72573d6000803e3d6000fd5b50505050610c28565b60405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103830bcb6b2b73a103a37b5b2b760591b6044820152606401610584565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff8314611f2757611f20836120d4565b9050611190565b818054611f33906127e2565b80601f0160208091040260200160405190810160405280929190818152602001828054611f5f906127e2565b8015611fac5780601f10611f8157610100808354040283529160200191611fac565b820191906000526020600020905b815481529060010190602001808311611f8f57829003601f168201915b50505050509050611190565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611ff3575060009150600390508261207d565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612047573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166120735750600092506001915082905061207d565b9250600091508190505b9450945094915050565b600081815b84518110156120cc576120b8828683815181106120ab576120ab6126b8565b6020026020010151612113565b9150806120c48161273e565b91505061208c565b509392505050565b606060006120e183612145565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600081831061212f57600082815260208490526040902061213e565b60008381526020839052604090205b9392505050565b600060ff8216601f81111561119057604051632cd44ac360e21b815260040160405180910390fd5b6000610120828403121561218057600080fd5b50919050565b60008083601f84011261219857600080fd5b50813567ffffffffffffffff8111156121b057600080fd5b6020830191508360208285010111156121c857600080fd5b9250929050565b60008083601f8401126121e157600080fd5b50813567ffffffffffffffff8111156121f957600080fd5b6020830191508360208260051b85010111156121c857600080fd5b600080600080600080610180878903121561222e57600080fd5b612238888861216d565b955061012087013567ffffffffffffffff8082111561225657600080fd5b6122628a838b01612186565b9097509550610140890135945061016089013591508082111561228457600080fd5b5061229189828a016121cf565b979a9699509497509295939492505050565b80356001600160a01b03811681146122ba57600080fd5b919050565b6000602082840312156122d157600080fd5b61213e826122a3565b600080600080604085870312156122f057600080fd5b843567ffffffffffffffff8082111561230857600080fd5b818701915087601f83011261231c57600080fd5b81358181111561232b57600080fd5b8860206101208302850101111561234157600080fd5b60209283019650945090860135908082111561235c57600080fd5b50612369878288016121cf565b95989497509550505050565b6000806040838503121561238857600080fd5b612391836122a3565b946020939093013593505050565b6000602082840312156123b157600080fd5b5035919050565b6000806000606084860312156123cd57600080fd5b6123d6846122a3565b92506123e4602085016122a3565b9150604084013590509250925092565b6000815180845260005b8181101561241a576020818501810151868301820152016123fe565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b881681526000602060e08184015261245a60e084018a6123f4565b838103604085015261246c818a6123f4565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156124be578351835292840192918401916001016124a2565b50909c9b505050505050505050505050565b600080600061014084860312156124e657600080fd5b6124f0858561216d565b925061012084013567ffffffffffffffff81111561250d57600080fd5b61251986828701612186565b9497909650939450505050565b6000610120828403121561253957600080fd5b61213e838361216d565b60208082526025908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920616040820152646e20454f4160d81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b8035600281106122ba57600080fd5b6000602082840312156125bf57600080fd5b61213e8261259e565b6001600160a01b03806125da836122a3565b1683526125e96020830161259e565b6002811061260757634e487b7160e01b600052602160045260246000fd5b602084015280612619604084016122a3565b1660408401525060608101356060830152612636608082016122a3565b6001600160a01b0316608083015260a0818101359083015260c0808201359083015260e0808201359083015261010090810135910152565b610120810161119082846125c8565b60006020828403121561268f57600080fd5b5051919050565b61016081016126a582866125c8565b6101208201939093526101400152919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611190576111906126ce565b6000808335601e1984360301811261270e57600080fd5b83018035915067ffffffffffffffff82111561272957600080fd5b6020019150368190038213156121c857600080fd5b600060018201612750576127506126ce565b5060010190565b60006020828403121561276957600080fd5b8151801515811461213e57600080fd5b610140810161278882856125c8565b826101208301529392505050565b8082028115828204841417611190576111906126ce565b6000826127ca57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611190576111906126ce565b600181811c908216806127f657607f821691505b60208210810361218057634e487b7160e01b600052602260045260246000fdfea26469706673582212205ac904ad31292e3abffb471a23b7226273c7119668dd7a9e53c244bb06d6e3e264736f6c63430008140033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000008ab15fe88a00b03724ac91ee4ee1f998064f2e31000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000a11bf3a1b86a977e3beab2a2e20c67ffde9def7e

-----Decoded View---------------
Arg [0] : _protocolFeeRecipient (address): 0x8Ab15fE88a00b03724aC91EE4eE1f998064F2e31
Arg [1] : _protocolFeeBps (uint256): 300
Arg [2] : _executionDelegate (address): 0xA11Bf3A1b86A977e3beAb2a2E20c67ffDE9DEF7e

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000008ab15fe88a00b03724ac91ee4ee1f998064f2e31
Arg [1] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [2] : 000000000000000000000000a11bf3a1b86a977e3beab2a2e20c67ffde9def7e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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.