false
true
0

Contract Address Details

0x000047203100A45635029eC21bbBec5EC53Cb6f6

Contract Name
SaleManager
Creator
0x132c50–3a29a7 at 0x370f92–507338
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
26347950
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
SaleManager




Optimization enabled
true
Compiler version
v0.8.4+commit.c7e474f2




Optimization runs
200
EVM Version
istanbul




Verified at
2026-04-22T01:58:51.937379Z

Constructor Arguments

000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Arg [0] (address) : 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] (uint8) : 6
Arg [2] (address) : 0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419

              

contracts/SaleManager.sol

pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract SaleManager is ReentrancyGuard {
  using SafeERC20 for IERC20;

  AggregatorV3Interface priceOracle;
  IERC20 public immutable paymentToken;
  uint8 public immutable paymentTokenDecimals;

  struct Sale {
    address payable seller; // the address that will receive sale proceeds
    bytes32 merkleRoot; // the merkle root used for proving access
    address claimManager; // address where purchased tokens can be claimed (optional)
    uint256 saleBuyLimit;  // max tokens that can be spent in total
    uint256 userBuyLimit;  // max tokens that can be spent per user
    uint startTime; // the time at which the sale starts
    uint endTime; // the time at which the sale will end, regardless of tokens raised
    string name; // the name of the asset being sold, e.g. "New Crypto Token"
    string symbol; // the symbol of the asset being sold, e.g. "NCT"
    uint256 price; // the price of the asset (eg if 1.0 NCT == $1.23 of USDC: 1230000)
    uint8 decimals; // the number of decimals in the asset being sold, e.g. 18
    uint256 totalSpent; // total purchases denominated in payment token
    uint256 maxQueueTime; // what is the maximum length of time a user could wait in the queue after the sale starts?
    uint160 randomValue; // reasonably random value: xor of merkle root and blockhash for transaction setting merkle root
    mapping(address => uint256) spent;
  }

  mapping (bytes32 => Sale) public sales;

  // global metrics
  uint256 public saleCount = 0;
  uint256 public totalSpent = 0;

  event NewSale(
    bytes32 indexed saleId,
    bytes32 indexed merkleRoot,
    address indexed seller,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint256 maxQueueTime,
    uint startTime,
    uint endTime,
    string name,
    string symbol,
    uint256 price,
    uint8 decimals
  );

  event UpdateStart(bytes32 indexed saleId, uint startTime);
  event UpdateEnd(bytes32 indexed saleId, uint endTime);
  event UpdateMerkleRoot(bytes32 indexed saleId, bytes32 merkleRoot);
  event UpdateMaxQueueTime(bytes32 indexed saleId, uint256 maxQueueTime);
  event Buy(bytes32 indexed saleId, address indexed buyer, uint256 value, bool native, bytes32[] proof);
  event RegisterClaimManager(bytes32 indexed saleId, address indexed claimManager);

  constructor(
    address _paymentToken,
    uint8 _paymentTokenDecimals,
    address _priceOracle
  ) {
    paymentToken = IERC20(_paymentToken);
    paymentTokenDecimals = _paymentTokenDecimals;
    priceOracle = AggregatorV3Interface(_priceOracle);
  }

  modifier validSale (bytes32 saleId) {
    // if the seller is address(0) there is no sale struct at this saleId
    require(
      sales[saleId].seller != address(0),
      "invalid sale id"
    );
    _;
  }

  modifier isSeller(bytes32 saleId) {
    // msg.sender is never address(0) so this handles uninitialized sales
    require(
      sales[saleId].seller == msg.sender,
      "must be seller"
    );
    _;
  }

  modifier canAccessSale(bytes32 saleId, bytes32[] calldata proof) {
    // make sure the buyer is an EOA
    require((msg.sender == tx.origin), "Must buy with an EOA");

    // If the merkle root is non-zero this is a private sale and requires a valid proof
    if (sales[saleId].merkleRoot != bytes32(0)) {
      require(
        this._isAllowed(
          sales[saleId].merkleRoot,
          msg.sender,
          proof
        ) == true,
        "bad merkle proof for sale"
      );
    }

    // Reduce congestion by randomly assigning each user a delay time in a virtual queue based on comparing their address and a random value
    // if sale.maxQueueTime == 0 the delay is 0
    require(block.timestamp - sales[saleId].startTime > getFairQueueTime(saleId, msg.sender), "not your turn yet");

    _;
  }

  modifier requireOpen(bytes32 saleId) {
    require(block.timestamp > sales[saleId].startTime, "sale not started yet");
    require(block.timestamp < sales[saleId].endTime, "sale ended");
    require(sales[saleId].totalSpent < sales[saleId].saleBuyLimit, "sale over");
    _;
  }

  // Get current price from chainlink oracle
  function getLatestPrice() public view returns (uint) {
    (
        uint80 roundID,
        int price,
        uint startedAt,
        uint timeStamp,
        uint80 answeredInRound
    ) = priceOracle.latestRoundData();

    require(price > 0, "negative price");
    return uint(price);
  }

  // Accessor functions
  function getSeller(bytes32 saleId) public validSale(saleId) view returns(address) {
    return(sales[saleId].seller);
  }

  function getMerkleRoot(bytes32 saleId) public validSale(saleId) view returns(bytes32) {
    return(sales[saleId].merkleRoot);
  }

  function getPriceOracle() public view returns(address) {
    return address(priceOracle);
  }

  function getClaimManager(bytes32 saleId) public validSale(saleId) view returns(address) {
    return (sales[saleId].claimManager);
  }


  function getSaleBuyLimit(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return(sales[saleId].saleBuyLimit);
  }

  function getUserBuyLimit(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return(sales[saleId].userBuyLimit);
  }

  function getStartTime(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].startTime);
  }

  function getEndTime(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].endTime);
  }

  function getName(bytes32 saleId) public validSale(saleId) view returns(string memory) {
    return(sales[saleId].name);
  }

  function getSymbol(bytes32 saleId) public validSale(saleId) view returns(string memory) {
    return(sales[saleId].symbol);
  }

  function getPrice(bytes32 saleId) public validSale(saleId) view returns(uint) {
    return(sales[saleId].price);
  }

  function getDecimals(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return (sales[saleId].decimals);
  }

  function getTotalSpent(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return (sales[saleId].totalSpent);
  }

  function getRandomValue(bytes32 saleId) public validSale(saleId) view returns(uint160) {
    return sales[saleId].randomValue;
  }

  function getMaxQueueTime(bytes32 saleId) public validSale(saleId) view returns(uint256) {
    return sales[saleId].maxQueueTime;
  }

  function generateRandomishValue(bytes32 merkleRoot) public view returns(uint160) {
    /**
      This is not a truly random value:
      - miners can alter the block hash
      - sellers can repeatedly call setMerkleRoot()
    */
    return uint160(uint256(blockhash(0))) ^ uint160(uint256(merkleRoot));
  }

  function getFairQueueTime(bytes32 saleId, address buyer) public validSale(saleId) view returns(uint) {
    /**
      Get the delay in seconds that a specific buyer must wait after the sale begins in order to buy tokens in the sale

      Buyers cannot exploit the fair queue when:
      - The sale is private (merkle root != bytes32(0))
      - Each eligible buyer gets exactly one address in the merkle root

      Although miners and sellers can minimize the delay for an arbitrary address, these are not significant threats
      - the economic opportunity to miners is zero or relatively small (only specific addresses can participate in private sales, and a better queue postion does not imply high returns)
      - sellers can repeatedly set merkle roots (but sellers already control the tokens being sold!)

    */
    if (sales[saleId].maxQueueTime == 0) {
      // there is no delay: all addresses may participate immediately
      return 0;
    }

    // calculate a distance between the random value and the user's address using the XOR distance metric (c.f. Kademlia)
    uint160 distance = uint160(buyer) ^ sales[saleId].randomValue;

    // calculate a speed at which the queue is exhausted such that all users complete the queue by sale.maxQueueTime
    uint160 distancePerSecond = type(uint160).max / uint160(sales[saleId].maxQueueTime);
    // return the delay (seconds)
    return distance / distancePerSecond;
  }

  function spentToBought(bytes32 saleId, uint256 spent) public view returns (uint256) {
    // Convert tokens spent (e.g. 10,000,000 USDC = $10) to tokens bought (e.g. 8.13e18) at a price of $1.23/NCT
    // convert an integer value of tokens spent to an integer value of tokens bought
    return (spent * 10 ** sales[saleId].decimals ) / (sales[saleId].price);
  }

  function nativeToPaymentToken(uint256 nativeValue) public view returns (uint256) {
    // convert a payment in the native token (eg ETH) to an integer value of the payment token
    return (nativeValue * getLatestPrice() * 10 ** paymentTokenDecimals) / (10 ** (priceOracle.decimals() + 18));
  }

  function getSpent(
      bytes32 saleId,
      address userAddress
    ) public validSale(saleId) view returns(uint256) {
    // returns the amount spent by this user in paymentToken
    return(sales[saleId].spent[userAddress]);
  }

  function getBought(
      bytes32 saleId,
      address userAddress
    ) public validSale(saleId) view returns(uint256) {
    // returns the amount bought by this user in the new token being sold
    return(spentToBought(saleId, sales[saleId].spent[userAddress]));
  }

  function isOpen(bytes32 saleId) public validSale(saleId) view returns(bool) {
    // is the sale currently open?
    return(
      block.timestamp > sales[saleId].startTime
      && block.timestamp < sales[saleId].endTime
      && sales[saleId].totalSpent < sales[saleId].saleBuyLimit
    );
  }

  function isOver(bytes32 saleId) public validSale(saleId) view returns(bool) {
    // is the sale permanently over?
    return(
      block.timestamp >= sales[saleId].endTime || sales[saleId].totalSpent >= sales[saleId].saleBuyLimit
    );
  }

  /**
  sale setup and config
  - the address calling this method is the seller: all payments are sent to this address
  - only the seller can change sale configuration
  */
  function newSale(
    bytes32 merkleRoot,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint startTime,
    uint endTime,
    uint160 maxQueueTime,
    string calldata name,
    string calldata symbol,
    uint256 price,
    uint8 decimals
  ) public returns(bytes32) {
    require(startTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(endTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(startTime < endTime, "sale must start before it ends");
    require(endTime > block.timestamp, "sale must end in future");
    require(userBuyLimit <= saleBuyLimit, "userBuyLimit cannot exceed saleBuyLimit");
    require(userBuyLimit > 0, "userBuyLimit must be > 0");
    require(saleBuyLimit > 0, "saleBuyLimit must be > 0");
    require(endTime - startTime > maxQueueTime, "sale must be open for longer than max queue time");

    // Generate a reorg-resistant sale ID
    bytes32 saleId = keccak256(abi.encodePacked(
      merkleRoot,
      msg.sender,
      saleBuyLimit,
      userBuyLimit,
      startTime,
      endTime,
      name,
      symbol,
      price,
      decimals
    ));

    // This ensures the Sale struct wasn't already created (msg.sender will never be the zero address)
    require(sales[saleId].seller == address(0), "a sale with these parameters already exists");

    Sale storage s = sales[saleId];

    s.merkleRoot = merkleRoot;
    s.seller = payable(msg.sender);
    s.saleBuyLimit = saleBuyLimit;
    s.userBuyLimit = userBuyLimit;
    s.startTime = startTime;
    s.endTime = endTime;
    s.name = name;
    s.symbol = symbol;
    s.price = price;
    s.decimals = decimals;
    s.maxQueueTime = maxQueueTime;
    s.randomValue = generateRandomishValue(merkleRoot);

    saleCount++;

    emit NewSale(saleId,
      s.merkleRoot,
      s.seller,
      s.saleBuyLimit,
      s.userBuyLimit,
      s.maxQueueTime,
      s.startTime,
      s.endTime,
      s.name,
      s.symbol,
      s.price,
      s.decimals
    );

    return saleId;
  }

  function setStart(bytes32 saleId, uint startTime) public validSale(saleId) isSeller(saleId) {
    // seller can update start time until the sale starts
    require(block.timestamp < sales[saleId].endTime, "disabled after sale close");
    require(startTime < sales[saleId].endTime, "sale start must precede end");
    require(startTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(sales[saleId].endTime - startTime > sales[saleId].maxQueueTime, "sale must be open for longer than max queue time");

    sales[saleId].startTime = startTime;
    emit UpdateStart(saleId, startTime);
  }

  function setEnd(bytes32 saleId, uint endTime) public validSale(saleId) isSeller(saleId){
    // seller can update end time until the sale ends
    require(block.timestamp < sales[saleId].endTime, "disabled after sale closes");
    require(endTime > block.timestamp, "sale must end in future");
    require(endTime <= 4102444800, "max: 4102444800 (Jan 1 2100)");
    require(sales[saleId].startTime < endTime, "sale must start before it ends");
    require(endTime - sales[saleId].startTime > sales[saleId].maxQueueTime, "sale must be open for longer than max queue time");

    sales[saleId].endTime = endTime;
    emit UpdateEnd(saleId, endTime);
  }

  function setMerkleRoot(bytes32 saleId, bytes32 merkleRoot) public validSale(saleId) isSeller(saleId){
    require(!isOpen(saleId) && !isOver(saleId), "cannot set merkle root once sale opens");
    sales[saleId].merkleRoot = merkleRoot;
    sales[saleId].randomValue = generateRandomishValue(merkleRoot);
    emit UpdateMerkleRoot(saleId, merkleRoot);
  }

  function setMaxQueueTime(bytes32 saleId, uint160 maxQueueTime) public validSale(saleId) isSeller(saleId) {
    // the queue time may be adjusted after the sale begins
    require(sales[saleId].endTime > block.timestamp, "cannot adjust max queue time after sale ends");
    sales[saleId].maxQueueTime = maxQueueTime;
    emit UpdateMaxQueueTime(saleId, maxQueueTime);
  }

  function _isAllowed(
      bytes32 root,
      address account,
      bytes32[] calldata proof
  ) external pure returns (bool) {
    // check if the account is in the merkle tree
    bytes32 leaf = keccak256(abi.encodePacked(account));
    if (MerkleProof.verify(proof, root, leaf)) {
      return true;
    }
    return false;
  }

  // pay with the payment token (eg USDC)
  function buy(
    bytes32 saleId,
    uint256 tokenQuantity,
    bytes32[] calldata proof
  ) public validSale(saleId) requireOpen(saleId) canAccessSale(saleId, proof) nonReentrant {
    // make sure the purchase would not break any sale limits
    require(
      tokenQuantity + sales[saleId].spent[msg.sender] <= sales[saleId].userBuyLimit,
      "purchase exceeds your limit"
    );

    require(
      tokenQuantity + sales[saleId].totalSpent <= sales[saleId].saleBuyLimit,
      "purchase exceeds sale limit"
    );

    require(paymentToken.allowance(msg.sender, address(this)) >= tokenQuantity, "allowance too low");

    // move the funds
    paymentToken.safeTransferFrom(msg.sender, sales[saleId].seller, tokenQuantity);

    // effects after interaction: we need a reentrancy guard
    sales[saleId].spent[msg.sender] += tokenQuantity;
    sales[saleId].totalSpent += tokenQuantity;
    totalSpent += tokenQuantity;

    emit Buy(saleId, msg.sender, tokenQuantity, false, proof);
  }

  // pay with the native token
  function buy(
    bytes32 saleId,
    bytes32[] calldata proof
  ) public payable validSale(saleId) requireOpen(saleId) canAccessSale(saleId, proof) nonReentrant {
    // convert to the equivalent payment token value from wei
    uint256 tokenQuantity = nativeToPaymentToken(msg.value);

    // make sure the purchase would not break any sale limits
    require(
      tokenQuantity + sales[saleId].spent[msg.sender] <= sales[saleId].userBuyLimit,
      "purchase exceeds your limit"
    );

    require(
      tokenQuantity + sales[saleId].totalSpent <= sales[saleId].saleBuyLimit,
      "purchase exceeds sale limit"
    );

    // forward the eth to the seller
    sales[saleId].seller.transfer(msg.value);

    // account for the purchase in equivalent payment token value
    sales[saleId].spent[msg.sender] += tokenQuantity;
    sales[saleId].totalSpent += tokenQuantity;
    totalSpent += tokenQuantity;

    // flag this payment as using the native token
    emit Buy(saleId, msg.sender, tokenQuantity, true, proof);
  }

  // Tell users where they can claim tokens
  function registerClaimManager(bytes32 saleId, address claimManager) public validSale(saleId) isSeller(saleId) {
    require(claimManager != address(0), "Claim manager must be a non-zero address");
    sales[saleId].claimManager = claimManager;
    emit RegisterClaimManager(saleId, claimManager);
  }

  function recoverERC20(bytes32 saleId, address tokenAddress, uint256 tokenAmount) public isSeller(saleId) {
    IERC20(tokenAddress).transfer(msg.sender, tokenAmount);
  }
}
        

/MerkleProof.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

/

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

/

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

/interfaces/AggregatorV3Interface.sol

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

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/SaleManager.sol":"SaleManager"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_paymentToken","internalType":"address"},{"type":"uint8","name":"_paymentTokenDecimals","internalType":"uint8"},{"type":"address","name":"_priceOracle","internalType":"address"}]},{"type":"event","name":"Buy","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"address","name":"buyer","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false},{"type":"bool","name":"native","internalType":"bool","indexed":false},{"type":"bytes32[]","name":"proof","internalType":"bytes32[]","indexed":false}],"anonymous":false},{"type":"event","name":"NewSale","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"merkleRoot","internalType":"bytes32","indexed":true},{"type":"address","name":"seller","internalType":"address","indexed":true},{"type":"uint256","name":"saleBuyLimit","internalType":"uint256","indexed":false},{"type":"uint256","name":"userBuyLimit","internalType":"uint256","indexed":false},{"type":"uint256","name":"maxQueueTime","internalType":"uint256","indexed":false},{"type":"uint256","name":"startTime","internalType":"uint256","indexed":false},{"type":"uint256","name":"endTime","internalType":"uint256","indexed":false},{"type":"string","name":"name","internalType":"string","indexed":false},{"type":"string","name":"symbol","internalType":"string","indexed":false},{"type":"uint256","name":"price","internalType":"uint256","indexed":false},{"type":"uint8","name":"decimals","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"RegisterClaimManager","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"address","name":"claimManager","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"UpdateEnd","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"uint256","name":"endTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UpdateMaxQueueTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"uint256","name":"maxQueueTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UpdateMerkleRoot","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"merkleRoot","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"UpdateStart","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32","indexed":true},{"type":"uint256","name":"startTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"pure","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"_isAllowed","inputs":[{"type":"bytes32","name":"root","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"},{"type":"bytes32[]","name":"proof","internalType":"bytes32[]"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"buy","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"bytes32[]","name":"proof","internalType":"bytes32[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"buy","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"uint256","name":"tokenQuantity","internalType":"uint256"},{"type":"bytes32[]","name":"proof","internalType":"bytes32[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint160","name":"","internalType":"uint160"}],"name":"generateRandomishValue","inputs":[{"type":"bytes32","name":"merkleRoot","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBought","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getClaimManager","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDecimals","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getEndTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getFairQueueTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"address","name":"buyer","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLatestPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMaxQueueTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getMerkleRoot","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getName","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPrice","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPriceOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint160","name":"","internalType":"uint160"}],"name":"getRandomValue","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getSaleBuyLimit","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getSeller","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getSpent","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getStartTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getSymbol","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalSpent","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUserBuyLimit","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOpen","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOver","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nativeToPaymentToken","inputs":[{"type":"uint256","name":"nativeValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"newSale","inputs":[{"type":"bytes32","name":"merkleRoot","internalType":"bytes32"},{"type":"uint256","name":"saleBuyLimit","internalType":"uint256"},{"type":"uint256","name":"userBuyLimit","internalType":"uint256"},{"type":"uint256","name":"startTime","internalType":"uint256"},{"type":"uint256","name":"endTime","internalType":"uint256"},{"type":"uint160","name":"maxQueueTime","internalType":"uint160"},{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"symbol","internalType":"string"},{"type":"uint256","name":"price","internalType":"uint256"},{"type":"uint8","name":"decimals","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"paymentToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"paymentTokenDecimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"registerClaimManager","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"address","name":"claimManager","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"saleCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"seller","internalType":"address payable"},{"type":"bytes32","name":"merkleRoot","internalType":"bytes32"},{"type":"address","name":"claimManager","internalType":"address"},{"type":"uint256","name":"saleBuyLimit","internalType":"uint256"},{"type":"uint256","name":"userBuyLimit","internalType":"uint256"},{"type":"uint256","name":"startTime","internalType":"uint256"},{"type":"uint256","name":"endTime","internalType":"uint256"},{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"symbol","internalType":"string"},{"type":"uint256","name":"price","internalType":"uint256"},{"type":"uint8","name":"decimals","internalType":"uint8"},{"type":"uint256","name":"totalSpent","internalType":"uint256"},{"type":"uint256","name":"maxQueueTime","internalType":"uint256"},{"type":"uint160","name":"randomValue","internalType":"uint160"}],"name":"sales","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setEnd","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"uint256","name":"endTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxQueueTime","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"uint160","name":"maxQueueTime","internalType":"uint160"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMerkleRoot","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"bytes32","name":"merkleRoot","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStart","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"uint256","name":"startTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"spentToBought","inputs":[{"type":"bytes32","name":"saleId","internalType":"bytes32"},{"type":"uint256","name":"spent","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSpent","inputs":[]}]
              

Contract Creation Code

0x60c0604052600060035560006004553480156200001b57600080fd5b5060405162003a3638038062003a368339810160408190526200003e91620000c0565b6001600081905560609390931b6001600160601b03191660805260f89190911b7fff000000000000000000000000000000000000000000000000000000000000001660a05281546001600160a01b0319166001600160a01b039091161790556200010f565b80516001600160a01b0381168114620000bb57600080fd5b919050565b600080600060608486031215620000d5578283fd5b620000e084620000a3565b9250602084015160ff81168114620000f6578283fd5b91506200010660408501620000a3565b90509250925092565b60805160601c60a05160f81c6138e662000150600039600081816103c20152611def01526000818161036e0152818161289d015261297e01526138e66000f3fe6080604052600436106102305760003560e01c80637e44e5041161012e578063bac4dd88116100ab578063dee5ab431161006f578063dee5ab43146106f3578063eb28322e14610713578063ef8148b214610733578063fb346eab14610753578063fca513a81461076957600080fd5b8063bac4dd881461065e578063bc8bf0931461067e578063c83b55f314610691578063c96c9d49146106b1578063ccc325c2146106d357600080fd5b8063a7206cd6116100f2578063a7206cd6146105be578063ad9a6865146105de578063b8211d90146105fe578063b8f8a0b31461061e578063b94c69aa1461063e57600080fd5b80637e44e504146105335780638e15f47314610553578063939d606514610568578063976b205014610588578063a1e89aec146105a857600080fd5b8063325cd796116101bc5780635f0fe446116101805780635f0fe44614610493578063628f9fa0146104b35780636e1f5193146104d357806375edcbe0146104f35780637c35be7a1461051357600080fd5b8063325cd796146103b05780634f8b50b0146103f657806350fa4ff21461042657806354b8d5e3146104465780635cfac8371461047357600080fd5b806312105fea1161020357806312105fea146102fc578063231bedc71461031c57806327e542301461033c5780633013ce291461035c57806331d98b3f1461039057600080fd5b8063080d840c14610235578063089ed435146102725780630ad0607f146102a05780630c2afd72146102c2575b600080fd5b34801561024157600080fd5b50610255610250366004612f78565b610787565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004612f78565b6107ea565b604051908152602001610269565b3480156102ac57600080fd5b506102c06102bb3660046130bb565b610837565b005b3480156102ce57600080fd5b506102e26102dd366004612f78565b610977565b6040516102699e9d9c9b9a999897969594939291906133ee565b34801561030857600080fd5b50610292610317366004612f78565b610b0d565b34801561032857600080fd5b50610255610337366004612f78565b610b5d565b34801561034857600080fd5b506102c061035736600461309a565b610bb4565b34801561036857600080fd5b506102557f000000000000000000000000000000000000000000000000000000000000000081565b34801561039c57600080fd5b506102926103ab366004612f78565b610d8f565b3480156103bc57600080fd5b506103e47f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610269565b34801561040257600080fd5b50610416610411366004612f78565b610ddc565b6040519015158152602001610269565b34801561043257600080fd5b506102c061044136600461309a565b610e50565b34801561045257600080fd5b50610466610461366004612f78565b611073565b60405161026991906134d2565b34801561047f57600080fd5b5061046661048e366004612f78565b61114e565b34801561049f57600080fd5b506102926104ae36600461309a565b6111a3565b3480156104bf57600080fd5b506102926104ce366004612f78565b6111e8565b3480156104df57600080fd5b506102926104ee366004613106565b611235565b3480156104ff57600080fd5b506102c061050e36600461309a565b611660565b34801561051f57600080fd5b5061041661052e366004612f78565b6117af565b34801561053f57600080fd5b5061025561054e366004612f78565b61183b565b34801561055f57600080fd5b5061029261188e565b34801561057457600080fd5b50610292610583366004612f78565b611972565b34801561059457600080fd5b506102926105a3366004612f90565b6119bf565b3480156105b457600080fd5b5061029260035481565b3480156105ca57600080fd5b506102926105d9366004612f78565b611a30565b3480156105ea57600080fd5b506104166105f9366004612fbf565b611a7d565b34801561060a57600080fd5b50610292610619366004612f78565b611b16565b34801561062a57600080fd5b506102c0610639366004613019565b611b63565b34801561064a57600080fd5b506102c0610659366004612f90565b611c22565b34801561066a57600080fd5b50610292610679366004612f78565b611d57565b6102c061068c366004613050565b611e3b565b34801561069d57600080fd5b506102926106ac366004612f90565b612366565b3480156106bd57600080fd5b506102556106cc366004612f78565b6000401890565b3480156106df57600080fd5b506102926106ee366004612f90565b6123ca565b3480156106ff57600080fd5b506102c061070e3660046130cd565b612470565b34801561071f57600080fd5b5061029261072e366004612f78565b612a54565b34801561073f57600080fd5b5061029261074e366004612f78565b612aa1565b34801561075f57600080fd5b5061029260045481565b34801561077557600080fd5b506001546001600160a01b0316610255565b60008181526002602052604081205482906001600160a01b03166107c65760405162461bcd60e51b81526004016107bd90613594565b60405180910390fd5b6000838152600260205260409020600d01546001600160a01b031691505b50919050565b60008181526002602052604081205482906001600160a01b03166108205760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206004015490565b60008281526002602052604090205482906001600160a01b031661086d5760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b031633146108a55760405162461bcd60e51b81526004016107bd9061351c565b600084815260026020526040902060060154421061091a5760405162461bcd60e51b815260206004820152602c60248201527f63616e6e6f742061646a757374206d61782071756575652074696d652061667460448201526b65722073616c6520656e647360a01b60648201526084016107bd565b6000848152600260209081526040918290206001600160a01b038616600c909101819055915191825285917f6039ca6720e37f558ee4c54ff612004deb49321831da1765375d1b0b6400881891015b60405180910390a250505050565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870180546001600160a01b039788169998969097169694959394929391926109d09061380d565b80601f01602080910402602001604051908101604052809291908181526020018280546109fc9061380d565b8015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b505050505090806008018054610a5e9061380d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8a9061380d565b8015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506009840154600a850154600b860154600c870154600d909701549596929560ff909216945092506001600160a01b03168e565b60008181526002602052604081205482906001600160a01b0316610b435760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081205482906001600160a01b0316610b935760405162461bcd60e51b81526004016107bd90613594565b5050600090815260026020819052604090912001546001600160a01b031690565b60008281526002602052604090205482906001600160a01b0316610bea5760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314610c225760405162461bcd60e51b81526004016107bd9061351c565b6000848152600260205260409020600601544210610c825760405162461bcd60e51b815260206004820152601960248201527f64697361626c65642061667465722073616c6520636c6f73650000000000000060448201526064016107bd565b6000848152600260205260409020600601548310610ce25760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016107bd565b63f4865700831115610d065760405162461bcd60e51b81526004016107bd906134e5565b6000848152600260205260409020600c810154600690910154610d2a9085906137ca565b11610d475760405162461bcd60e51b81526004016107bd90613544565b600084815260026020526040908190206005018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d011906109699086815260200190565b60008181526002602052604081205482906001600160a01b0316610dc55760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206009015490565b60008181526002602052604081205482906001600160a01b0316610e125760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090206006015442101580610e49575060008381526002602052604090206003810154600b9091015410155b9392505050565b60008281526002602052604090205482906001600160a01b0316610e865760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314610ebe5760405162461bcd60e51b81526004016107bd9061351c565b6000848152600260205260409020600601544210610f1e5760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016107bd565b428311610f675760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107bd565b63f4865700831115610f8b5760405162461bcd60e51b81526004016107bd906134e5565b6000848152600260205260409020600501548311610feb5760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107bd565b6000848152600260205260409020600c81015460059091015461100e90856137ca565b1161102b5760405162461bcd60e51b81526004016107bd90613544565b600084815260026020526040908190206006018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a6906109699086815260200190565b60008181526002602052604090205460609082906001600160a01b03166110ac5760405162461bcd60e51b81526004016107bd90613594565b600083815260026020526040902060070180546110c89061380d565b80601f01602080910402602001604051908101604052809291908181526020018280546110f49061380d565b80156111415780601f1061111657610100808354040283529160200191611141565b820191906000526020600020905b81548152906001019060200180831161112457829003601f168201915b5050505050915050919050565b60008181526002602052604090205460609082906001600160a01b03166111875760405162461bcd60e51b81526004016107bd90613594565b600083815260026020526040902060080180546110c89061380d565b60008281526002602052604081206009810154600a9182015490916111cb9160ff1690613700565b6111d590846137ab565b6111df91906136a9565b90505b92915050565b60008181526002602052604081205482906001600160a01b031661121e5760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600c015490565b600063f48657008a111561125b5760405162461bcd60e51b81526004016107bd906134e5565b63f486570089111561127f5760405162461bcd60e51b81526004016107bd906134e5565b888a106112ce5760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107bd565b4289116113175760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107bd565b8b8b11156113775760405162461bcd60e51b815260206004820152602760248201527f757365724275794c696d69742063616e6e6f74206578636565642073616c65426044820152661d5e531a5b5a5d60ca1b60648201526084016107bd565b60008b116113c75760405162461bcd60e51b815260206004820152601860248201527f757365724275794c696d6974206d757374206265203e2030000000000000000060448201526064016107bd565b60008c116114175760405162461bcd60e51b815260206004820152601860248201527f73616c654275794c696d6974206d757374206265203e2030000000000000000060448201526064016107bd565b6001600160a01b03881661142b8b8b6137ca565b116114485760405162461bcd60e51b81526004016107bd90613544565b60008d338e8e8e8e8d8d8d8d8d8d6040516020016114719c9b9a99989796959493929190613358565b60408051601f198184030181529181528151602092830120600081815260029093529120549091506001600160a01b0316156115035760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016107bd565b6000818152600260205260409020600181018f905580546001600160a01b03191633178155600381018e9055600481018d9055600581018c9055600681018b9055611552600782018a8a612e00565b50611561600882018888612e00565b5060098101859055600a8101805460ff191660ff86161790556001600160a01b038a16600c8201556000408f18600d820180546001600160a01b0319166001600160a01b0392909216919091179055600380549060006115c083613842565b90915550508054600182015460038301546004840154600c850154600586015460068701546009880154600a8901546040516001600160a01b03909916988b977ff667a34969fd3115f7321eddaedfadeceb95791812ad5c3019a787087640c46497611646979196909591949093919260078e019260088f01929160ff909116906135df565b60405180910390a4509d9c50505050505050505050505050565b60008281526002602052604090205482906001600160a01b03166116965760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b031633146116ce5760405162461bcd60e51b81526004016107bd9061351c565b6116d7846117af565b1580156116ea57506116e884610ddc565b155b6117455760405162461bcd60e51b815260206004820152602660248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c65604482015265206f70656e7360d01b60648201526084016107bd565b600084815260026020908152604080832060018101879055600d0180546001600160a01b031916934087186001600160a01b031693909317909255905184815285917f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a9101610969565b60008181526002602052604081205482906001600160a01b03166117e55760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090206005015442118015611815575060008381526002602052604090206006015442105b8015610e495750505060009081526002602052604090206003810154600b909101541090565b60008181526002602052604081205482906001600160a01b03166118715760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020546001600160a01b031690565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156118e557600080fd5b505afa1580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d91906131ef565b94509450945094509450600084136119685760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016107bd565b5091949350505050565b60008181526002602052604081205482906001600160a01b03166119a85760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206005015490565b60008281526002602052604081205483906001600160a01b03166119f55760405162461bcd60e51b81526004016107bd90613594565b60008481526002602090815260408083206001600160a01b0387168452600e01909152902054611a269085906111a3565b91505b5092915050565b60008181526002602052604081205482906001600160a01b0316611a665760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206001015490565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050611af98484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150612aee9050565b15611b08576001915050611b0e565b60009150505b949350505050565b60008181526002602052604081205482906001600160a01b0316611b4c5760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600b015490565b60008381526002602052604090205483906001600160a01b03163314611b9b5760405162461bcd60e51b81526004016107bd9061351c565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb90604401602060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1b9190612f58565b5050505050565b60008281526002602052604090205482906001600160a01b0316611c585760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314611c905760405162461bcd60e51b81526004016107bd9061351c565b6001600160a01b038316611cf75760405162461bcd60e51b815260206004820152602860248201527f436c61696d206d616e61676572206d7573742062652061206e6f6e2d7a65726f604482015267206164647265737360c01b60648201526084016107bd565b600084815260026020819052604080832090910180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b158015611d9c57600080fd5b505afa158015611db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd4919061323e565b611ddf90601261365e565b611dea90600a613700565b611e157f0000000000000000000000000000000000000000000000000000000000000000600a613700565b611e1d61188e565b611e2790856137ab565b611e3191906137ab565b6111e291906136a9565b60008381526002602052604090205483906001600160a01b0316611e715760405162461bcd60e51b81526004016107bd90613594565b60008481526002602052604090206005015484904211611eca5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107bd565b6000818152600260205260409020600601544210611f175760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107bd565b60008181526002602052604090206003810154600b9091015410611f695760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107bd565b848484333214611fb25760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107bd565b600083815260026020526040902060010154156120a1576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591612004919033908790879060040161349d565b60206040518083038186803b15801561201c57600080fd5b505afa158015612030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120549190612f58565b15156001146120a15760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107bd565b6120ab83336123ca565b6000848152600260205260409020600501546120c790426137ca565b116121085760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107bd565b6002600054141561215b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bd565b6002600090815561216b34611d57565b60008a81526002602090815260408083206004810154338552600e909101909252909120549192509061219e9083613646565b11156121ec5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107bd565b60008981526002602052604090206003810154600b9091015461220f9083613646565b111561225d5760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107bd565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156122a2573d6000803e3d6000fd5b506000898152600260209081526040808320338452600e01909152812080548392906122cf908490613646565b90915550506000898152600260205260408120600b0180548392906122f5908490613646565b92505081905550806004600082825461230e9190613646565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061234e9085906001908e908e906135bd565b60405180910390a35050600160005550505050505050565b60008281526002602052604081205483906001600160a01b031661239c5760405162461bcd60e51b81526004016107bd90613594565b505060009182526002602090815260408084206001600160a01b03939093168452600e909201905290205490565b60008281526002602052604081205483906001600160a01b03166124005760405162461bcd60e51b81526004016107bd90613594565b6000848152600260205260409020600c015461241f5760009150611a29565b6000848152600260205260408120600d810154600c909101546001600160a01b03918216861892916124519190613683565b905061245d8183613683565b6001600160a01b03169695505050505050565b60008481526002602052604090205484906001600160a01b03166124a65760405162461bcd60e51b81526004016107bd90613594565b600085815260026020526040902060050154859042116124ff5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107bd565b600081815260026020526040902060060154421061254c5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107bd565b60008181526002602052604090206003810154600b909101541061259e5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107bd565b8584843332146125e75760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107bd565b600083815260026020526040902060010154156126d6576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591612639919033908790879060040161349d565b60206040518083038186803b15801561265157600080fd5b505afa158015612665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126899190612f58565b15156001146126d65760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107bd565b6126e083336123ca565b6000848152600260205260409020600501546126fc90426137ca565b1161273d5760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107bd565b600260005414156127905760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bd565b600260008181558a8152602091825260408082206004810154338452600e9091019093529020546127c1908a613646565b111561280f5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107bd565b60008981526002602052604090206003810154600b90910154612832908a613646565b11156128805760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107bd565b604051636eb1769f60e11b815233600482015230602482015288907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dd62ed3e9060440160206040518083038186803b1580156128e757600080fd5b505afa1580156128fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291f91906131d7565b10156129615760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016107bd565b6000898152600260205260409020546129a9906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116913391168b612b04565b6000898152600260209081526040808320338452600e01909152812080548a92906129d5908490613646565b90915550506000898152600260205260408120600b0180548a92906129fb908490613646565b925050819055508760046000828254612a149190613646565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061234e908c906000908d908d906135bd565b60008181526002602052604081205482906001600160a01b0316612a8a5760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206006015490565b60008181526002602052604081205482906001600160a01b0316612ad75760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206003015490565b600082612afb8584612b64565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612b5e908590612c1e565b50505050565b600081815b8451811015612c16576000858281518110612b9457634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612bd6576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612c03565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612c0e81613842565b915050612b69565b509392505050565b6000612c73826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612cf59092919063ffffffff16565b805190915015612cf05780806020019051810190612c919190612f58565b612cf05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107bd565b505050565b6060611b0e848460008585843b612d4e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107bd565b600080866001600160a01b03168587604051612d6a91906133d2565b60006040518083038185875af1925050503d8060008114612da7576040519150601f19603f3d011682016040523d82523d6000602084013e612dac565b606091505b5091509150612dbc828286612dc7565b979650505050505050565b60608315612dd6575081610e49565b825115612de65782518084602001fd5b8160405162461bcd60e51b81526004016107bd91906134d2565b828054612e0c9061380d565b90600052602060002090601f016020900481019282612e2e5760008555612e74565b82601f10612e475782800160ff19823516178555612e74565b82800160010185558215612e74579182015b82811115612e74578235825591602001919060010190612e59565b50612e80929150612e84565b5090565b5b80821115612e805760008155600101612e85565b60008083601f840112612eaa578182fd5b50813567ffffffffffffffff811115612ec1578182fd5b6020830191508360208260051b8501011115612edc57600080fd5b9250929050565b60008083601f840112612ef4578182fd5b50813567ffffffffffffffff811115612f0b578182fd5b602083019150836020828501011115612edc57600080fd5b8035612f2e81613889565b919050565b8035612f2e816138a1565b805169ffffffffffffffffffff81168114612f2e57600080fd5b600060208284031215612f69578081fd5b81518015158114610e49578182fd5b600060208284031215612f89578081fd5b5035919050565b60008060408385031215612fa2578081fd5b823591506020830135612fb481613889565b809150509250929050565b60008060008060608587031215612fd4578182fd5b843593506020850135612fe681613889565b9250604085013567ffffffffffffffff811115613001578283fd5b61300d87828801612e99565b95989497509550505050565b60008060006060848603121561302d578283fd5b83359250602084013561303f81613889565b929592945050506040919091013590565b600080600060408486031215613064578283fd5b83359250602084013567ffffffffffffffff811115613081578283fd5b61308d86828701612e99565b9497909650939450505050565b600080604083850312156130ac578182fd5b50508035926020909101359150565b60008060408385031215612fa2578182fd5b600080600080606085870312156130e2578384fd5b8435935060208501359250604085013567ffffffffffffffff811115613001578283fd5b6000806000806000806000806000806000806101408d8f031215613128578788fd5b8c359b5060208d01359a5060408d0135995060608d0135985060808d0135975061315460a08e01612f23565b965067ffffffffffffffff60c08e0135111561316e578586fd5b61317e8e60c08f01358f01612ee3565b909650945067ffffffffffffffff60e08e0135111561319b578384fd5b6131ab8e60e08f01358f01612ee3565b90945092506101008d013591506131c56101208e01612f33565b90509295989b509295989b509295989b565b6000602082840312156131e8578081fd5b5051919050565b600080600080600060a08688031215613206578283fd5b61320f86612f3e565b945060208601519350604086015192506060860151915061323260808701612f3e565b90509295509295909350565b60006020828403121561324f578081fd5b8151610e49816138a1565b81835260006001600160fb1b03831115613272578081fd5b8260051b80836020870137939093016020019283525090919050565b600081518084526132a68160208601602086016137e1565b601f01601f19169290920160200192915050565b8054600090600181811c90808316806132d457607f831692505b60208084108214156132f457634e487b7160e01b86526022600452602486fd5b8388526020880182801561330f57600181146133205761334b565b60ff1987168252828201975061334b565b60008981526020902060005b878110156133455781548482015290860190840161332c565b83019850505b5050505050505092915050565b8c81526bffffffffffffffffffffffff198c60601b1660208201528a6034820152896054820152886074820152876094820152858760b4830137600086820160b48101828152868882375060b49501948501939093525060f81b6001600160f81b03191660d48301525060d5019998505050505050505050565b600082516133e48184602087016137e1565b9190910192915050565b6001600160a01b038f81168252602082018f90528d1660408201528b60608201528a60808201528960a08201528860c08201526101c060e082015260006134396101c083018a61328e565b82810361010084015261344c818a61328e565b9150508661012083015261346661014083018760ff169052565b846101608301528361018083015261348a6101a08301846001600160a01b03169052565b9f9e505050505050505050505050505050565b8481526001600160a01b03841660208201526060604082018190526000906134c8908301848661325a565b9695505050505050565b6020815260006111df602083018461328e565b6020808252601c908201527f6d61783a203431303234343438303020284a616e203120323130302900000000604082015260600190565b6020808252600e908201526d36bab9ba1031329039b2b63632b960911b604082015260600190565b60208082526030908201527f73616c65206d757374206265206f70656e20666f72206c6f6e6765722074686160408201526f6e206d61782071756575652074696d6560801b606082015260800190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b84815283151560208201526060604082015260006134c860608301848661325a565b60006101208b83528a60208401528960408401528860608401528760808401528060a0840152613611818401886132ba565b905082810360c084015261362581876132ba565b9150508360e083015260ff83166101008301529a9950505050505050505050565b600082198211156136595761365961385d565b500190565b600060ff821660ff84168060ff0382111561367b5761367b61385d565b019392505050565b60006001600160a01b038381168061369d5761369d613873565b92169190910492915050565b6000826136b8576136b8613873565b500490565b600181815b808511156136f85781600019048211156136de576136de61385d565b808516156136eb57918102915b93841c93908002906136c2565b509250929050565b60006111df60ff841683600082613719575060016111e2565b81613726575060006111e2565b816001811461373c576002811461374657613762565b60019150506111e2565b60ff8411156137575761375761385d565b50506001821b6111e2565b5060208310610133831016604e8410600b8410161715613785575081810a6111e2565b61378f83836136bd565b80600019048211156137a3576137a361385d565b029392505050565b60008160001904831182151516156137c5576137c561385d565b500290565b6000828210156137dc576137dc61385d565b500390565b60005b838110156137fc5781810151838201526020016137e4565b83811115612b5e5750506000910152565b600181811c9082168061382157607f821691505b602082108114156107e457634e487b7160e01b600052602260045260246000fd5b60006000198214156138565761385661385d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461389e57600080fd5b50565b60ff8116811461389e57600080fdfea264697066735822122090c72e983472ed3e3bd20a68410795a967e32d2a9de0144e1d229b628e01680264736f6c63430008040033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed ByteCode

0x6080604052600436106102305760003560e01c80637e44e5041161012e578063bac4dd88116100ab578063dee5ab431161006f578063dee5ab43146106f3578063eb28322e14610713578063ef8148b214610733578063fb346eab14610753578063fca513a81461076957600080fd5b8063bac4dd881461065e578063bc8bf0931461067e578063c83b55f314610691578063c96c9d49146106b1578063ccc325c2146106d357600080fd5b8063a7206cd6116100f2578063a7206cd6146105be578063ad9a6865146105de578063b8211d90146105fe578063b8f8a0b31461061e578063b94c69aa1461063e57600080fd5b80637e44e504146105335780638e15f47314610553578063939d606514610568578063976b205014610588578063a1e89aec146105a857600080fd5b8063325cd796116101bc5780635f0fe446116101805780635f0fe44614610493578063628f9fa0146104b35780636e1f5193146104d357806375edcbe0146104f35780637c35be7a1461051357600080fd5b8063325cd796146103b05780634f8b50b0146103f657806350fa4ff21461042657806354b8d5e3146104465780635cfac8371461047357600080fd5b806312105fea1161020357806312105fea146102fc578063231bedc71461031c57806327e542301461033c5780633013ce291461035c57806331d98b3f1461039057600080fd5b8063080d840c14610235578063089ed435146102725780630ad0607f146102a05780630c2afd72146102c2575b600080fd5b34801561024157600080fd5b50610255610250366004612f78565b610787565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004612f78565b6107ea565b604051908152602001610269565b3480156102ac57600080fd5b506102c06102bb3660046130bb565b610837565b005b3480156102ce57600080fd5b506102e26102dd366004612f78565b610977565b6040516102699e9d9c9b9a999897969594939291906133ee565b34801561030857600080fd5b50610292610317366004612f78565b610b0d565b34801561032857600080fd5b50610255610337366004612f78565b610b5d565b34801561034857600080fd5b506102c061035736600461309a565b610bb4565b34801561036857600080fd5b506102557f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561039c57600080fd5b506102926103ab366004612f78565b610d8f565b3480156103bc57600080fd5b506103e47f000000000000000000000000000000000000000000000000000000000000000681565b60405160ff9091168152602001610269565b34801561040257600080fd5b50610416610411366004612f78565b610ddc565b6040519015158152602001610269565b34801561043257600080fd5b506102c061044136600461309a565b610e50565b34801561045257600080fd5b50610466610461366004612f78565b611073565b60405161026991906134d2565b34801561047f57600080fd5b5061046661048e366004612f78565b61114e565b34801561049f57600080fd5b506102926104ae36600461309a565b6111a3565b3480156104bf57600080fd5b506102926104ce366004612f78565b6111e8565b3480156104df57600080fd5b506102926104ee366004613106565b611235565b3480156104ff57600080fd5b506102c061050e36600461309a565b611660565b34801561051f57600080fd5b5061041661052e366004612f78565b6117af565b34801561053f57600080fd5b5061025561054e366004612f78565b61183b565b34801561055f57600080fd5b5061029261188e565b34801561057457600080fd5b50610292610583366004612f78565b611972565b34801561059457600080fd5b506102926105a3366004612f90565b6119bf565b3480156105b457600080fd5b5061029260035481565b3480156105ca57600080fd5b506102926105d9366004612f78565b611a30565b3480156105ea57600080fd5b506104166105f9366004612fbf565b611a7d565b34801561060a57600080fd5b50610292610619366004612f78565b611b16565b34801561062a57600080fd5b506102c0610639366004613019565b611b63565b34801561064a57600080fd5b506102c0610659366004612f90565b611c22565b34801561066a57600080fd5b50610292610679366004612f78565b611d57565b6102c061068c366004613050565b611e3b565b34801561069d57600080fd5b506102926106ac366004612f90565b612366565b3480156106bd57600080fd5b506102556106cc366004612f78565b6000401890565b3480156106df57600080fd5b506102926106ee366004612f90565b6123ca565b3480156106ff57600080fd5b506102c061070e3660046130cd565b612470565b34801561071f57600080fd5b5061029261072e366004612f78565b612a54565b34801561073f57600080fd5b5061029261074e366004612f78565b612aa1565b34801561075f57600080fd5b5061029260045481565b34801561077557600080fd5b506001546001600160a01b0316610255565b60008181526002602052604081205482906001600160a01b03166107c65760405162461bcd60e51b81526004016107bd90613594565b60405180910390fd5b6000838152600260205260409020600d01546001600160a01b031691505b50919050565b60008181526002602052604081205482906001600160a01b03166108205760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206004015490565b60008281526002602052604090205482906001600160a01b031661086d5760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b031633146108a55760405162461bcd60e51b81526004016107bd9061351c565b600084815260026020526040902060060154421061091a5760405162461bcd60e51b815260206004820152602c60248201527f63616e6e6f742061646a757374206d61782071756575652074696d652061667460448201526b65722073616c6520656e647360a01b60648201526084016107bd565b6000848152600260209081526040918290206001600160a01b038616600c909101819055915191825285917f6039ca6720e37f558ee4c54ff612004deb49321831da1765375d1b0b6400881891015b60405180910390a250505050565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870180546001600160a01b039788169998969097169694959394929391926109d09061380d565b80601f01602080910402602001604051908101604052809291908181526020018280546109fc9061380d565b8015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b505050505090806008018054610a5e9061380d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8a9061380d565b8015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506009840154600a850154600b860154600c870154600d909701549596929560ff909216945092506001600160a01b03168e565b60008181526002602052604081205482906001600160a01b0316610b435760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081205482906001600160a01b0316610b935760405162461bcd60e51b81526004016107bd90613594565b5050600090815260026020819052604090912001546001600160a01b031690565b60008281526002602052604090205482906001600160a01b0316610bea5760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314610c225760405162461bcd60e51b81526004016107bd9061351c565b6000848152600260205260409020600601544210610c825760405162461bcd60e51b815260206004820152601960248201527f64697361626c65642061667465722073616c6520636c6f73650000000000000060448201526064016107bd565b6000848152600260205260409020600601548310610ce25760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016107bd565b63f4865700831115610d065760405162461bcd60e51b81526004016107bd906134e5565b6000848152600260205260409020600c810154600690910154610d2a9085906137ca565b11610d475760405162461bcd60e51b81526004016107bd90613544565b600084815260026020526040908190206005018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d011906109699086815260200190565b60008181526002602052604081205482906001600160a01b0316610dc55760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206009015490565b60008181526002602052604081205482906001600160a01b0316610e125760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090206006015442101580610e49575060008381526002602052604090206003810154600b9091015410155b9392505050565b60008281526002602052604090205482906001600160a01b0316610e865760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314610ebe5760405162461bcd60e51b81526004016107bd9061351c565b6000848152600260205260409020600601544210610f1e5760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016107bd565b428311610f675760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107bd565b63f4865700831115610f8b5760405162461bcd60e51b81526004016107bd906134e5565b6000848152600260205260409020600501548311610feb5760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107bd565b6000848152600260205260409020600c81015460059091015461100e90856137ca565b1161102b5760405162461bcd60e51b81526004016107bd90613544565b600084815260026020526040908190206006018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a6906109699086815260200190565b60008181526002602052604090205460609082906001600160a01b03166110ac5760405162461bcd60e51b81526004016107bd90613594565b600083815260026020526040902060070180546110c89061380d565b80601f01602080910402602001604051908101604052809291908181526020018280546110f49061380d565b80156111415780601f1061111657610100808354040283529160200191611141565b820191906000526020600020905b81548152906001019060200180831161112457829003601f168201915b5050505050915050919050565b60008181526002602052604090205460609082906001600160a01b03166111875760405162461bcd60e51b81526004016107bd90613594565b600083815260026020526040902060080180546110c89061380d565b60008281526002602052604081206009810154600a9182015490916111cb9160ff1690613700565b6111d590846137ab565b6111df91906136a9565b90505b92915050565b60008181526002602052604081205482906001600160a01b031661121e5760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600c015490565b600063f48657008a111561125b5760405162461bcd60e51b81526004016107bd906134e5565b63f486570089111561127f5760405162461bcd60e51b81526004016107bd906134e5565b888a106112ce5760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107bd565b4289116113175760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107bd565b8b8b11156113775760405162461bcd60e51b815260206004820152602760248201527f757365724275794c696d69742063616e6e6f74206578636565642073616c65426044820152661d5e531a5b5a5d60ca1b60648201526084016107bd565b60008b116113c75760405162461bcd60e51b815260206004820152601860248201527f757365724275794c696d6974206d757374206265203e2030000000000000000060448201526064016107bd565b60008c116114175760405162461bcd60e51b815260206004820152601860248201527f73616c654275794c696d6974206d757374206265203e2030000000000000000060448201526064016107bd565b6001600160a01b03881661142b8b8b6137ca565b116114485760405162461bcd60e51b81526004016107bd90613544565b60008d338e8e8e8e8d8d8d8d8d8d6040516020016114719c9b9a99989796959493929190613358565b60408051601f198184030181529181528151602092830120600081815260029093529120549091506001600160a01b0316156115035760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016107bd565b6000818152600260205260409020600181018f905580546001600160a01b03191633178155600381018e9055600481018d9055600581018c9055600681018b9055611552600782018a8a612e00565b50611561600882018888612e00565b5060098101859055600a8101805460ff191660ff86161790556001600160a01b038a16600c8201556000408f18600d820180546001600160a01b0319166001600160a01b0392909216919091179055600380549060006115c083613842565b90915550508054600182015460038301546004840154600c850154600586015460068701546009880154600a8901546040516001600160a01b03909916988b977ff667a34969fd3115f7321eddaedfadeceb95791812ad5c3019a787087640c46497611646979196909591949093919260078e019260088f01929160ff909116906135df565b60405180910390a4509d9c50505050505050505050505050565b60008281526002602052604090205482906001600160a01b03166116965760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b031633146116ce5760405162461bcd60e51b81526004016107bd9061351c565b6116d7846117af565b1580156116ea57506116e884610ddc565b155b6117455760405162461bcd60e51b815260206004820152602660248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c65604482015265206f70656e7360d01b60648201526084016107bd565b600084815260026020908152604080832060018101879055600d0180546001600160a01b031916934087186001600160a01b031693909317909255905184815285917f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a9101610969565b60008181526002602052604081205482906001600160a01b03166117e55760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090206005015442118015611815575060008381526002602052604090206006015442105b8015610e495750505060009081526002602052604090206003810154600b909101541090565b60008181526002602052604081205482906001600160a01b03166118715760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020546001600160a01b031690565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156118e557600080fd5b505afa1580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d91906131ef565b94509450945094509450600084136119685760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016107bd565b5091949350505050565b60008181526002602052604081205482906001600160a01b03166119a85760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206005015490565b60008281526002602052604081205483906001600160a01b03166119f55760405162461bcd60e51b81526004016107bd90613594565b60008481526002602090815260408083206001600160a01b0387168452600e01909152902054611a269085906111a3565b91505b5092915050565b60008181526002602052604081205482906001600160a01b0316611a665760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206001015490565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050611af98484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150612aee9050565b15611b08576001915050611b0e565b60009150505b949350505050565b60008181526002602052604081205482906001600160a01b0316611b4c5760405162461bcd60e51b81526004016107bd90613594565b50506000908152600260205260409020600b015490565b60008381526002602052604090205483906001600160a01b03163314611b9b5760405162461bcd60e51b81526004016107bd9061351c565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb90604401602060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1b9190612f58565b5050505050565b60008281526002602052604090205482906001600160a01b0316611c585760405162461bcd60e51b81526004016107bd90613594565b60008381526002602052604090205483906001600160a01b03163314611c905760405162461bcd60e51b81526004016107bd9061351c565b6001600160a01b038316611cf75760405162461bcd60e51b815260206004820152602860248201527f436c61696d206d616e61676572206d7573742062652061206e6f6e2d7a65726f604482015267206164647265737360c01b60648201526084016107bd565b600084815260026020819052604080832090910180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b158015611d9c57600080fd5b505afa158015611db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd4919061323e565b611ddf90601261365e565b611dea90600a613700565b611e157f0000000000000000000000000000000000000000000000000000000000000006600a613700565b611e1d61188e565b611e2790856137ab565b611e3191906137ab565b6111e291906136a9565b60008381526002602052604090205483906001600160a01b0316611e715760405162461bcd60e51b81526004016107bd90613594565b60008481526002602052604090206005015484904211611eca5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107bd565b6000818152600260205260409020600601544210611f175760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107bd565b60008181526002602052604090206003810154600b9091015410611f695760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107bd565b848484333214611fb25760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107bd565b600083815260026020526040902060010154156120a1576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591612004919033908790879060040161349d565b60206040518083038186803b15801561201c57600080fd5b505afa158015612030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120549190612f58565b15156001146120a15760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107bd565b6120ab83336123ca565b6000848152600260205260409020600501546120c790426137ca565b116121085760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107bd565b6002600054141561215b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bd565b6002600090815561216b34611d57565b60008a81526002602090815260408083206004810154338552600e909101909252909120549192509061219e9083613646565b11156121ec5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107bd565b60008981526002602052604090206003810154600b9091015461220f9083613646565b111561225d5760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107bd565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156122a2573d6000803e3d6000fd5b506000898152600260209081526040808320338452600e01909152812080548392906122cf908490613646565b90915550506000898152600260205260408120600b0180548392906122f5908490613646565b92505081905550806004600082825461230e9190613646565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061234e9085906001908e908e906135bd565b60405180910390a35050600160005550505050505050565b60008281526002602052604081205483906001600160a01b031661239c5760405162461bcd60e51b81526004016107bd90613594565b505060009182526002602090815260408084206001600160a01b03939093168452600e909201905290205490565b60008281526002602052604081205483906001600160a01b03166124005760405162461bcd60e51b81526004016107bd90613594565b6000848152600260205260409020600c015461241f5760009150611a29565b6000848152600260205260408120600d810154600c909101546001600160a01b03918216861892916124519190613683565b905061245d8183613683565b6001600160a01b03169695505050505050565b60008481526002602052604090205484906001600160a01b03166124a65760405162461bcd60e51b81526004016107bd90613594565b600085815260026020526040902060050154859042116124ff5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107bd565b600081815260026020526040902060060154421061254c5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107bd565b60008181526002602052604090206003810154600b909101541061259e5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107bd565b8584843332146125e75760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107bd565b600083815260026020526040902060010154156126d6576000838152600260205260409081902060010154905163ad9a686560e01b8152309163ad9a686591612639919033908790879060040161349d565b60206040518083038186803b15801561265157600080fd5b505afa158015612665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126899190612f58565b15156001146126d65760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107bd565b6126e083336123ca565b6000848152600260205260409020600501546126fc90426137ca565b1161273d5760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107bd565b600260005414156127905760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bd565b600260008181558a8152602091825260408082206004810154338452600e9091019093529020546127c1908a613646565b111561280f5760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107bd565b60008981526002602052604090206003810154600b90910154612832908a613646565b11156128805760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107bd565b604051636eb1769f60e11b815233600482015230602482015288907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03169063dd62ed3e9060440160206040518083038186803b1580156128e757600080fd5b505afa1580156128fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291f91906131d7565b10156129615760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016107bd565b6000898152600260205260409020546129a9906001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488116913391168b612b04565b6000898152600260209081526040808320338452600e01909152812080548a92906129d5908490613646565b90915550506000898152600260205260408120600b0180548a92906129fb908490613646565b925050819055508760046000828254612a149190613646565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f9061234e908c906000908d908d906135bd565b60008181526002602052604081205482906001600160a01b0316612a8a5760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206006015490565b60008181526002602052604081205482906001600160a01b0316612ad75760405162461bcd60e51b81526004016107bd90613594565b505060009081526002602052604090206003015490565b600082612afb8584612b64565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612b5e908590612c1e565b50505050565b600081815b8451811015612c16576000858281518110612b9457634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612bd6576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612c03565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612c0e81613842565b915050612b69565b509392505050565b6000612c73826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612cf59092919063ffffffff16565b805190915015612cf05780806020019051810190612c919190612f58565b612cf05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107bd565b505050565b6060611b0e848460008585843b612d4e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107bd565b600080866001600160a01b03168587604051612d6a91906133d2565b60006040518083038185875af1925050503d8060008114612da7576040519150601f19603f3d011682016040523d82523d6000602084013e612dac565b606091505b5091509150612dbc828286612dc7565b979650505050505050565b60608315612dd6575081610e49565b825115612de65782518084602001fd5b8160405162461bcd60e51b81526004016107bd91906134d2565b828054612e0c9061380d565b90600052602060002090601f016020900481019282612e2e5760008555612e74565b82601f10612e475782800160ff19823516178555612e74565b82800160010185558215612e74579182015b82811115612e74578235825591602001919060010190612e59565b50612e80929150612e84565b5090565b5b80821115612e805760008155600101612e85565b60008083601f840112612eaa578182fd5b50813567ffffffffffffffff811115612ec1578182fd5b6020830191508360208260051b8501011115612edc57600080fd5b9250929050565b60008083601f840112612ef4578182fd5b50813567ffffffffffffffff811115612f0b578182fd5b602083019150836020828501011115612edc57600080fd5b8035612f2e81613889565b919050565b8035612f2e816138a1565b805169ffffffffffffffffffff81168114612f2e57600080fd5b600060208284031215612f69578081fd5b81518015158114610e49578182fd5b600060208284031215612f89578081fd5b5035919050565b60008060408385031215612fa2578081fd5b823591506020830135612fb481613889565b809150509250929050565b60008060008060608587031215612fd4578182fd5b843593506020850135612fe681613889565b9250604085013567ffffffffffffffff811115613001578283fd5b61300d87828801612e99565b95989497509550505050565b60008060006060848603121561302d578283fd5b83359250602084013561303f81613889565b929592945050506040919091013590565b600080600060408486031215613064578283fd5b83359250602084013567ffffffffffffffff811115613081578283fd5b61308d86828701612e99565b9497909650939450505050565b600080604083850312156130ac578182fd5b50508035926020909101359150565b60008060408385031215612fa2578182fd5b600080600080606085870312156130e2578384fd5b8435935060208501359250604085013567ffffffffffffffff811115613001578283fd5b6000806000806000806000806000806000806101408d8f031215613128578788fd5b8c359b5060208d01359a5060408d0135995060608d0135985060808d0135975061315460a08e01612f23565b965067ffffffffffffffff60c08e0135111561316e578586fd5b61317e8e60c08f01358f01612ee3565b909650945067ffffffffffffffff60e08e0135111561319b578384fd5b6131ab8e60e08f01358f01612ee3565b90945092506101008d013591506131c56101208e01612f33565b90509295989b509295989b509295989b565b6000602082840312156131e8578081fd5b5051919050565b600080600080600060a08688031215613206578283fd5b61320f86612f3e565b945060208601519350604086015192506060860151915061323260808701612f3e565b90509295509295909350565b60006020828403121561324f578081fd5b8151610e49816138a1565b81835260006001600160fb1b03831115613272578081fd5b8260051b80836020870137939093016020019283525090919050565b600081518084526132a68160208601602086016137e1565b601f01601f19169290920160200192915050565b8054600090600181811c90808316806132d457607f831692505b60208084108214156132f457634e487b7160e01b86526022600452602486fd5b8388526020880182801561330f57600181146133205761334b565b60ff1987168252828201975061334b565b60008981526020902060005b878110156133455781548482015290860190840161332c565b83019850505b5050505050505092915050565b8c81526bffffffffffffffffffffffff198c60601b1660208201528a6034820152896054820152886074820152876094820152858760b4830137600086820160b48101828152868882375060b49501948501939093525060f81b6001600160f81b03191660d48301525060d5019998505050505050505050565b600082516133e48184602087016137e1565b9190910192915050565b6001600160a01b038f81168252602082018f90528d1660408201528b60608201528a60808201528960a08201528860c08201526101c060e082015260006134396101c083018a61328e565b82810361010084015261344c818a61328e565b9150508661012083015261346661014083018760ff169052565b846101608301528361018083015261348a6101a08301846001600160a01b03169052565b9f9e505050505050505050505050505050565b8481526001600160a01b03841660208201526060604082018190526000906134c8908301848661325a565b9695505050505050565b6020815260006111df602083018461328e565b6020808252601c908201527f6d61783a203431303234343438303020284a616e203120323130302900000000604082015260600190565b6020808252600e908201526d36bab9ba1031329039b2b63632b960911b604082015260600190565b60208082526030908201527f73616c65206d757374206265206f70656e20666f72206c6f6e6765722074686160408201526f6e206d61782071756575652074696d6560801b606082015260800190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b84815283151560208201526060604082015260006134c860608301848661325a565b60006101208b83528a60208401528960408401528860608401528760808401528060a0840152613611818401886132ba565b905082810360c084015261362581876132ba565b9150508360e083015260ff83166101008301529a9950505050505050505050565b600082198211156136595761365961385d565b500190565b600060ff821660ff84168060ff0382111561367b5761367b61385d565b019392505050565b60006001600160a01b038381168061369d5761369d613873565b92169190910492915050565b6000826136b8576136b8613873565b500490565b600181815b808511156136f85781600019048211156136de576136de61385d565b808516156136eb57918102915b93841c93908002906136c2565b509250929050565b60006111df60ff841683600082613719575060016111e2565b81613726575060006111e2565b816001811461373c576002811461374657613762565b60019150506111e2565b60ff8411156137575761375761385d565b50506001821b6111e2565b5060208310610133831016604e8410600b8410161715613785575081810a6111e2565b61378f83836136bd565b80600019048211156137a3576137a361385d565b029392505050565b60008160001904831182151516156137c5576137c561385d565b500290565b6000828210156137dc576137dc61385d565b500390565b60005b838110156137fc5781810151838201526020016137e4565b83811115612b5e5750506000910152565b600181811c9082168061382157607f821691505b602082108114156107e457634e487b7160e01b600052602260045260246000fd5b60006000198214156138565761385661385d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461389e57600080fd5b50565b60ff8116811461389e57600080fdfea264697066735822122090c72e983472ed3e3bd20a68410795a967e32d2a9de0144e1d229b628e01680264736f6c63430008040033