ETH Price: $2,118.92 (+2.92%)

Contract

0xfF7a903e86b10AaEB8Da65CeF0eBc07eA3F9354b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set End153220222022-08-11 17:31:161310 days ago1660239076IN
0xfF7a903e...eA3F9354b
0 ETH0.0020526957.41156165
Buy153091952022-08-09 17:05:471312 days ago1660064747IN
0xfF7a903e...eA3F9354b
0 ETH0.0053375636.16309987
Set Merkle Root152768932022-08-04 16:13:301317 days ago1659629610IN
0xfF7a903e...eA3F9354b
0 ETH0.0007269217.86456658
Set Merkle Root152717672022-08-03 21:06:541317 days ago1659560814IN
0xfF7a903e...eA3F9354b
0 ETH0.0006742215.50271799
New Sale152266632022-07-27 20:21:111324 days ago1658953271IN
0xfF7a903e...eA3F9354b
0 ETH0.0110596345.42801802
Buy151969512022-07-23 5:06:471329 days ago1658552807IN
0xfF7a903e...eA3F9354b
0 ETH0.0013845311.45127619
Buy151948812022-07-22 21:25:151329 days ago1658525115IN
0xfF7a903e...eA3F9354b
0 ETH0.0041395530
Set End151808002022-07-20 17:20:171332 days ago1658337617IN
0xfF7a903e...eA3F9354b
0 ETH0.0025918272.49035147
Set Merkle Root151807872022-07-20 17:16:521332 days ago1658337412IN
0xfF7a903e...eA3F9354b
0 ETH0.0028417169.83635905
Set Merkle Root151807792022-07-20 17:13:461332 days ago1658337226IN
0xfF7a903e...eA3F9354b
0 ETH0.0024008555.20354247
Buy151743302022-07-19 17:12:151333 days ago1658250735IN
0xfF7a903e...eA3F9354b
0.325 ETH0.0042344634.51745445
Set End151666252022-07-18 12:29:521334 days ago1658147392IN
0xfF7a903e...eA3F9354b
0 ETH0.0007610421.2855491
Buy151480502022-07-15 15:23:381337 days ago1657898618IN
0xfF7a903e...eA3F9354b
0.00001 ETH0.0046448143.98249698
Set Merkle Root151479682022-07-15 15:05:491337 days ago1657897549IN
0xfF7a903e...eA3F9354b
0 ETH0.00338777.87832648
Buy151391632022-07-14 6:47:161338 days ago1657781236IN
0xfF7a903e...eA3F9354b
0.264042 ETH0.0024123219.66229523
Buy151372352022-07-13 23:30:581338 days ago1657755058IN
0xfF7a903e...eA3F9354b
0.361 ETH0.0070457757.43494075
Buy151357262022-07-13 17:56:291338 days ago1657734989IN
0xfF7a903e...eA3F9354b
0.18354517 ETH0.0018489815.07089364
Buy151352872022-07-13 16:20:451339 days ago1657729245IN
0xfF7a903e...eA3F9354b
0.1 ETH0.0036442329.70425089
Buy151352052022-07-13 16:05:421339 days ago1657728342IN
0xfF7a903e...eA3F9354b
0.1 ETH0.007051157.46719528
Buy151347122022-07-13 14:10:581339 days ago1657721458IN
0xfF7a903e...eA3F9354b
1 ETH0.0035019428.53652632
Buy151332032022-07-13 8:24:531339 days ago1657700693IN
0xfF7a903e...eA3F9354b
0.001 ETH0.0028778417.46432993
Set Merkle Root151331722022-07-13 8:17:341339 days ago1657700254IN
0xfF7a903e...eA3F9354b
0 ETH0.0006382814.67620505
Set Start151311502022-07-13 0:41:031339 days ago1657672863IN
0xfF7a903e...eA3F9354b
0 ETH0.0008197222.87485067
Set Start151310812022-07-13 0:24:061339 days ago1657671846IN
0xfF7a903e...eA3F9354b
0 ETH0.0012352934.47182876
Set Start151310002022-07-13 0:03:141339 days ago1657670594IN
0xfF7a903e...eA3F9354b
0 ETH0.000385710.76322693
View all transactions

Latest 11 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer151743302022-07-19 17:12:151333 days ago1658250735
0xfF7a903e...eA3F9354b
0.325 ETH
Transfer151480502022-07-15 15:23:381337 days ago1657898618
0xfF7a903e...eA3F9354b
0.00001 ETH
Transfer151391632022-07-14 6:47:161338 days ago1657781236
0xfF7a903e...eA3F9354b
0.264042 ETH
Transfer151372352022-07-13 23:30:581338 days ago1657755058
0xfF7a903e...eA3F9354b
0.361 ETH
Transfer151357262022-07-13 17:56:291338 days ago1657734989
0xfF7a903e...eA3F9354b
0.18354517 ETH
Transfer151352872022-07-13 16:20:451339 days ago1657729245
0xfF7a903e...eA3F9354b
0.1 ETH
Transfer151352052022-07-13 16:05:421339 days ago1657728342
0xfF7a903e...eA3F9354b
0.1 ETH
Transfer151347122022-07-13 14:10:581339 days ago1657721458
0xfF7a903e...eA3F9354b
1 ETH
Transfer151332032022-07-13 8:24:531339 days ago1657700693
0xfF7a903e...eA3F9354b
0.001 ETH
Transfer151291572022-07-12 17:22:081340 days ago1657646528
0xfF7a903e...eA3F9354b
0.00000928 ETH
Transfer151291522022-07-12 17:20:581340 days ago1657646458
0xfF7a903e...eA3F9354b
0.0001 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaleManager

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : 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 recipient; // the address that will receive sale proceeds
    address admin; // the address administering the sale
    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 (seconds past the epoch)
    uint endTime; // the time at which the sale will end, regardless of tokens raised (seconds past the epoch)
    string uri; // reference to off-chain sale configuration (e.g. IPFS URI)
    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;
  }

  // this struct has two many members for a public getter
  mapping (bytes32 => Sale) private sales;

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

  // public version
  string public constant VERSION = '1.2';

  event NewSale(
    bytes32 indexed saleId,
    bytes32 indexed merkleRoot,
    address indexed recipient,
    address admin,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint256 maxQueueTime,
    uint startTime,
    uint endTime,
    string uri,
    uint256 price,
    uint8 decimals
  );

  event Deploy(address paymentToken, uint8 paymentTokenDecimals, address priceOracle);
  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);
  event UpdateUri(bytes32 indexed saleId, string uri);

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

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

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

  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 getAdmin(bytes32 saleId) public validSale(saleId) view returns(address) {
    return(sales[saleId].admin);
  }

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

  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 getUri(bytes32 saleId) public validSale(saleId) view returns(string memory) {
    return sales[saleId].uri;
  }

  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) {
    /**
      Generate a randomish numeric value in the range [0, 2 ^ 160 - 1]

      This is not a truly random value:
      - miners can alter the previous block's hash by holding the transaction in the mempool
      - admins can choose when to submit the transaction
      - admins can repeatedly call setMerkleRoot()
    */
    return uint160(uint256(blockhash(block.number - 1))) ^ 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 admins 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)
      - admins can repeatedly set merkle roots (but admins 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 admin: only the admin can change sale configuration
  - all payments are sent to the the recipient
  */
  function newSale(
    address payable recipient,
    bytes32 merkleRoot,
    uint256 saleBuyLimit,
    uint256 userBuyLimit,
    uint startTime,
    uint endTime,
    uint160 maxQueueTime,
    string memory uri,
    uint256 price,
    uint8 decimals
  ) public returns(bytes32) {
    require(recipient != address(0), "recipient must not be zero address");
    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,
      recipient,
      saleBuyLimit,
      userBuyLimit,
      startTime,
      endTime,
      uri,
      price,
      decimals
    ));

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

    Sale storage s = sales[saleId];

    s.merkleRoot = merkleRoot;
    s.admin = msg.sender;
    s.recipient = recipient;
    s.saleBuyLimit = saleBuyLimit;
    s.userBuyLimit = userBuyLimit;
    s.startTime = startTime;
    s.endTime = endTime;
    s.price = price;
    s.decimals = decimals;
    s.uri = uri;
    s.maxQueueTime = maxQueueTime;
    s.randomValue = generateRandomishValue(merkleRoot);

    saleCount++;

    emit NewSale(
      saleId,
      s.merkleRoot,
      s.recipient,
      s.admin,
      s.saleBuyLimit,
      s.userBuyLimit,
      s.maxQueueTime,
      s.startTime,
      s.endTime,
      s.uri,
      s.price,
      s.decimals
    );

    return saleId;
  }

  function setStart(bytes32 saleId, uint startTime) public validSale(saleId) isAdmin(saleId) {
    // admin 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) isAdmin(saleId){
    // admin 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) isAdmin(saleId){
    require(!isOver(saleId), "cannot set merkle root once sale is over");
    sales[saleId].merkleRoot = merkleRoot;
    sales[saleId].randomValue = generateRandomishValue(merkleRoot);
    emit UpdateMerkleRoot(saleId, merkleRoot);
  }

  function setMaxQueueTime(bytes32 saleId, uint160 maxQueueTime) public validSale(saleId) isAdmin(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 setUriAndMerkleRoot(bytes32 saleId, bytes32 merkleRoot, string calldata uri) public validSale(saleId) isAdmin(saleId) {
    sales[saleId].uri = uri;
    setMerkleRoot(saleId, merkleRoot);
    emit UpdateUri(saleId, uri);
  }

  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].recipient, 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 recipient
    sales[saleId].recipient.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) isAdmin(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 isAdmin(saleId) {
    IERC20(tokenAddress).transfer(getRecipient(saleId), tokenAmount);
  }
}

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

File 3 of 7 : ReentrancyGuard.sol
// 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;
    }
}

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

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

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

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

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

60c0604052600060035560006004553480156200001b57600080fd5b5060405162003b8338038062003b838339810160408190526200003e9162000104565b60016000819055606084811b6001600160601b03191660805260f884901b7fff000000000000000000000000000000000000000000000000000000000000001660a05281546001600160a01b0319166001600160a01b0384811691821790935560408051938716845260ff861660208501528301527f38d1aed58aae630c8dc4b743a178514156b1d122d81b1034ba958fcc0082f25b910160405180910390a150505062000153565b80516001600160a01b0381168114620000ff57600080fd5b919050565b60008060006060848603121562000119578283fd5b6200012484620000e7565b9250602084015160ff811681146200013a578283fd5b91506200014a60408501620000e7565b90509250925092565b60805160601c60a05160f81c6139ef62000194600039600081816103c0015261186101526000818161036c0152818161241001526124f101526139ef6000f3fe60806040526004361061023b5760003560e01c8063a1e89aec1161012e578063c96c9d49116100ab578063ef8148b21161006f578063ef8148b214610702578063fb346eab14610722578063fbc6da7514610738578063fca513a814610758578063ffa1ad741461077657600080fd5b8063c96c9d4914610662578063ccc325c214610682578063dee5ab43146106a2578063e533196b146106c2578063eb28322e146106e257600080fd5b8063b94c69aa116100f2578063b94c69aa146105cf578063bac4dd88146105ef578063bc8bf0931461060f578063c83b55f314610622578063c95970be1461064257600080fd5b8063a1e89aec14610539578063a7206cd61461054f578063ad9a68651461056f578063b8211d901461058f578063b8f8a0b3146105af57600080fd5b80634f8b50b0116101bc5780637c35be7a116101805780637c35be7a146104a457806380c6e70a146104c45780638e15f473146104e4578063939d6065146104f9578063976b20501461051957600080fd5b80634f8b50b0146103f457806350fa4ff2146104245780635f0fe44614610444578063628f9fa01461046457806375edcbe01461048457600080fd5b8063231bedc711610203578063231bedc71461031a57806327e542301461033a5780633013ce291461035a57806331d98b3f1461038e578063325cd796146103ae57600080fd5b8063080d840c14610240578063087c2be71461027d578063089ed435146102aa5780630ad0607f146102d857806312105fea146102fa575b600080fd5b34801561024c57600080fd5b5061026061025b366004613182565b6107a5565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561028957600080fd5b5061029d610298366004613182565b61080b565b604051610274919061360d565b3480156102b657600080fd5b506102ca6102c5366004613182565b6108e9565b604051908152602001610274565b3480156102e457600080fd5b506102f86102f336600461319a565b610939565b005b34801561030657600080fd5b506102ca610315366004613182565b610a7f565b34801561032657600080fd5b50610260610335366004613182565b610ad2565b34801561034657600080fd5b506102f86103553660046132a4565b610b2b565b34801561036657600080fd5b506102607f000000000000000000000000000000000000000000000000000000000000000081565b34801561039a57600080fd5b506102ca6103a9366004613182565b610d0c565b3480156103ba57600080fd5b506103e27f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610274565b34801561040057600080fd5b5061041461040f366004613182565b610d5c565b6040519015158152602001610274565b34801561043057600080fd5b506102f861043f3660046132a4565b610dd3565b34801561045057600080fd5b506102ca61045f3660046132a4565b610ffc565b34801561047057600080fd5b506102ca61047f366004613182565b611041565b34801561049057600080fd5b506102f861049f3660046132a4565b611091565b3480156104b057600080fd5b506104146104bf366004613182565b6111ec565b3480156104d057600080fd5b506102606104df366004613182565b61127b565b3480156104f057600080fd5b506102ca6112d4565b34801561050557600080fd5b506102ca610514366004613182565b6113b8565b34801561052557600080fd5b506102ca61053436600461319a565b611408565b34801561054557600080fd5b506102ca60035481565b34801561055b57600080fd5b506102ca61056a366004613182565b61147c565b34801561057b57600080fd5b5061041461058a3660046131c9565b6114cd565b34801561059b57600080fd5b506102ca6105aa366004613182565b611566565b3480156105bb57600080fd5b506102f86105ca366004613223565b6115b6565b3480156105db57600080fd5b506102f86105ea36600461319a565b611690565b3480156105fb57600080fd5b506102ca61060a366004613182565b6117c9565b6102f861061d36600461325a565b6118ad565b34801561062e57600080fd5b506102ca61063d36600461319a565b611ddc565b34801561064e57600080fd5b506102f861065d3660046132c5565b611e43565b34801561066e57600080fd5b5061026061067d366004613182565b611f20565b34801561068e57600080fd5b506102ca61069d36600461319a565b611f36565b3480156106ae57600080fd5b506102f86106bd366004613340565b611fdf565b3480156106ce57600080fd5b506102ca6106dd36600461303d565b6125c7565b3480156106ee57600080fd5b506102ca6106fd366004613182565b612ab4565b34801561070e57600080fd5b506102ca61071d366004613182565b612b04565b34801561072e57600080fd5b506102ca60045481565b34801561074457600080fd5b50610260610753366004613182565b612b54565b34801561076457600080fd5b506001546001600160a01b0316610260565b34801561078257600080fd5b5061029d6040518060400160405280600381526020016218971960e91b81525081565b60008181526002602052604081206001015482906001600160a01b03166107e75760405162461bcd60e51b81526004016107de906136ee565b60405180910390fd5b6000838152600260205260409020600d01546001600160a01b031691505b50919050565b60008181526002602052604090206001015460609082906001600160a01b03166108475760405162461bcd60e51b81526004016107de906136ee565b6000838152600260205260409020600801805461086390613900565b80601f016020809104026020016040519081016040528092919081815260200182805461088f90613900565b80156108dc5780601f106108b1576101008083540402835291602001916108dc565b820191906000526020600020905b8154815290600101906020018083116108bf57829003601f168201915b5050505050915050919050565b60008181526002602052604081206001015482906001600160a01b03166109225760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206005015490565b60008281526002602052604090206001015482906001600160a01b03166109725760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146109ad5760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610a225760405162461bcd60e51b815260206004820152602c60248201527f63616e6e6f742061646a757374206d61782071756575652074696d652061667460448201526b65722073616c6520656e647360a01b60648201526084016107de565b6000848152600260209081526040918290206001600160a01b038616600c909101819055915191825285917f6039ca6720e37f558ee4c54ff612004deb49321831da1765375d1b0b6400881891015b60405180910390a250505050565b60008181526002602052604081206001015482906001600160a01b0316610ab85760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081206001015482906001600160a01b0316610b0b5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600301546001600160a01b031690565b60008281526002602052604090206001015482906001600160a01b0316610b645760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b03163314610b9f5760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610bff5760405162461bcd60e51b815260206004820152601960248201527f64697361626c65642061667465722073616c6520636c6f73650000000000000060448201526064016107de565b6000848152600260205260409020600701548310610c5f5760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016107de565b63f4865700831115610c835760405162461bcd60e51b81526004016107de90613667565b6000848152600260205260409020600c810154600790910154610ca79085906138bd565b11610cc45760405162461bcd60e51b81526004016107de9061369e565b600084815260026020526040908190206006018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d01190610a719086815260200190565b60008181526002602052604081206001015482906001600160a01b0316610d455760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206009015490565b60008181526002602052604081206001015482906001600160a01b0316610d955760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206007015442101580610dcc575060008381526002602052604090206004810154600b9091015410155b9392505050565b60008281526002602052604090206001015482906001600160a01b0316610e0c5760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b03163314610e475760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610ea75760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016107de565b428311610ef05760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107de565b63f4865700831115610f145760405162461bcd60e51b81526004016107de90613667565b6000848152600260205260409020600601548311610f745760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107de565b6000848152600260205260409020600c810154600690910154610f9790856138bd565b11610fb45760405162461bcd60e51b81526004016107de9061369e565b600084815260026020526040908190206007018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a690610a719086815260200190565b60008281526002602052604081206009810154600a9182015490916110249160ff16906137f3565b61102e908461389e565b611038919061379c565b90505b92915050565b60008181526002602052604081206001015482906001600160a01b031661107a5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600c015490565b60008281526002602052604090206001015482906001600160a01b03166110ca5760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146111055760405162461bcd60e51b81526004016107de90613640565b61110e84610d5c565b1561116c5760405162461bcd60e51b815260206004820152602860248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c656044820152671034b99037bb32b960c11b60648201526084016107de565b60008481526002602081905260409091200183905561118a83611f20565b600085815260026020908152604091829020600d0180546001600160a01b0319166001600160a01b0394909416939093179092555184815285917f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a9101610a71565b60008181526002602052604081206001015482906001600160a01b03166112255760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206006015442118015611255575060008381526002602052604090206007015442105b8015610dcc5750505060009081526002602052604090206004810154600b909101541090565b60008181526002602052604081206001015482906001600160a01b03166112b45760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600101546001600160a01b031690565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561132b57600080fd5b505afa15801561133f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113639190613391565b94509450945094509450600084136113ae5760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016107de565b5091949350505050565b60008181526002602052604081206001015482906001600160a01b03166113f15760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206006015490565b60008281526002602052604081206001015483906001600160a01b03166114415760405162461bcd60e51b81526004016107de906136ee565b60008481526002602090815260408083206001600160a01b0387168452600e01909152902054611472908590610ffc565b91505b5092915050565b60008181526002602052604081206001015482906001600160a01b03166114b55760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260208190526040909120015490565b6040516bffffffffffffffffffffffff19606085901b16602082015260009081906034016040516020818303038152906040528051906020012090506115498484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150612baa9050565b1561155857600191505061155e565b60009150505b949350505050565b60008181526002602052604081206001015482906001600160a01b031661159f5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600b015490565b60008381526002602052604090206001015483906001600160a01b031633146115f15760405162461bcd60e51b81526004016107de90613640565b826001600160a01b031663a9059cbb61160986612b54565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116899190613162565b5050505050565b60008281526002602052604090206001015482906001600160a01b03166116c95760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146117045760405162461bcd60e51b81526004016107de90613640565b6001600160a01b03831661176b5760405162461bcd60e51b815260206004820152602860248201527f436c61696d206d616e61676572206d7573742062652061206e6f6e2d7a65726f604482015267206164647265737360c01b60648201526084016107de565b60008481526002602052604080822060030180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561180e57600080fd5b505afa158015611822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184691906133e0565b611851906012613751565b61185c90600a6137f3565b6118877f0000000000000000000000000000000000000000000000000000000000000000600a6137f3565b61188f6112d4565b611899908561389e565b6118a3919061389e565b61103b919061379c565b60008381526002602052604090206001015483906001600160a01b03166118e65760405162461bcd60e51b81526004016107de906136ee565b6000848152600260205260409020600601548490421161193f5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107de565b600081815260026020526040902060070154421061198c5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107de565b60008181526002602052604090206004810154600b90910154106119de5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107de565b848484333214611a275760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107de565b6000838152600260208190526040909120015415611b17576000838152600260208190526040918290200154905163ad9a686560e01b8152309163ad9a686591611a7a91903390879087906004016135a9565b60206040518083038186803b158015611a9257600080fd5b505afa158015611aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aca9190613162565b1515600114611b175760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107de565b611b218333611f36565b600084815260026020526040902060060154611b3d90426138bd565b11611b7e5760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107de565b60026000541415611bd15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107de565b60026000908155611be1346117c9565b60008a81526002602090815260408083206005810154338552600e9091019092529091205491925090611c149083613739565b1115611c625760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107de565b60008981526002602052604090206004810154600b90910154611c859083613739565b1115611cd35760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107de565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015611d18573d6000803e3d6000fd5b506000898152600260209081526040808320338452600e0190915281208054839290611d45908490613739565b90915550506000898152600260205260408120600b018054839290611d6b908490613739565b925050819055508060046000828254611d849190613739565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f90611dc49085906001908e908e90613717565b60405180910390a35050600160005550505050505050565b60008281526002602052604081206001015483906001600160a01b0316611e155760405162461bcd60e51b81526004016107de906136ee565b505060009182526002602090815260408084206001600160a01b03939093168452600e909201905290205490565b60008481526002602052604090206001015484906001600160a01b0316611e7c5760405162461bcd60e51b81526004016107de906136ee565b60008581526002602052604090206001015485906001600160a01b03163314611eb75760405162461bcd60e51b81526004016107de90613640565b6000868152600260205260409020611ed3906008018585612ebc565b50611ede8686611091565b857f576e604c0ce80f5cc291a8dd68ecbb823e139b8f3063821e7f52275da64e384d8585604051611f109291906135de565b60405180910390a2505050505050565b600081611f2e6001436138bd565b401892915050565b60008281526002602052604081206001015483906001600160a01b0316611f6f5760405162461bcd60e51b81526004016107de906136ee565b6000848152600260205260409020600c0154611f8e5760009150611475565b6000848152600260205260408120600d810154600c909101546001600160a01b0391821686189291611fc09190613776565b9050611fcc8183613776565b6001600160a01b03169695505050505050565b60008481526002602052604090206001015484906001600160a01b03166120185760405162461bcd60e51b81526004016107de906136ee565b600085815260026020526040902060060154859042116120715760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107de565b60008181526002602052604090206007015442106120be5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107de565b60008181526002602052604090206004810154600b90910154106121105760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107de565b8584843332146121595760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107de565b6000838152600260208190526040909120015415612249576000838152600260208190526040918290200154905163ad9a686560e01b8152309163ad9a6865916121ac91903390879087906004016135a9565b60206040518083038186803b1580156121c457600080fd5b505afa1580156121d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fc9190613162565b15156001146122495760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107de565b6122538333611f36565b60008481526002602052604090206006015461226f90426138bd565b116122b05760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107de565b600260005414156123035760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107de565b600260008181558a8152602091825260408082206005810154338452600e909101909352902054612334908a613739565b11156123825760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107de565b60008981526002602052604090206004810154600b909101546123a5908a613739565b11156123f35760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107de565b604051636eb1769f60e11b815233600482015230602482015288907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561245a57600080fd5b505afa15801561246e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124929190613379565b10156124d45760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016107de565b60008981526002602052604090205461251c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116913391168b612bc0565b6000898152600260209081526040808320338452600e01909152812080548a9290612548908490613739565b90915550506000898152600260205260408120600b0180548a929061256e908490613739565b9250508190555087600460008282546125879190613739565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f90611dc4908c906000908d908d90613717565b60006001600160a01b038b1661262a5760405162461bcd60e51b815260206004820152602260248201527f726563697069656e74206d757374206e6f74206265207a65726f206164647265604482015261737360f01b60648201526084016107de565b63f486570087111561264e5760405162461bcd60e51b81526004016107de90613667565b63f48657008611156126725760405162461bcd60e51b81526004016107de90613667565b8587106126c15760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107de565b42861161270a5760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107de565b8888111561276a5760405162461bcd60e51b815260206004820152602760248201527f757365724275794c696d69742063616e6e6f74206578636565642073616c65426044820152661d5e531a5b5a5d60ca1b60648201526084016107de565b600088116127ba5760405162461bcd60e51b815260206004820152601860248201527f757365724275794c696d6974206d757374206265203e2030000000000000000060448201526064016107de565b6000891161280a5760405162461bcd60e51b815260206004820152601860248201527f73616c654275794c696d6974206d757374206265203e2030000000000000000060448201526064016107de565b6001600160a01b03851661281e88886138bd565b1161283b5760405162461bcd60e51b81526004016107de9061369e565b60008a8c8b8b8b8b8a8a8a60405160200161285e99989796959493929190613430565b60408051601f198184030181529181528151602092830120600081815260029093529120600101549091506001600160a01b0316156128f35760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016107de565b60006002600083815260200190815260200160002090508b8160020181905550338160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508c8160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a81600401819055508981600501819055508881600601819055508781600701819055508481600901819055508381600a0160006101000a81548160ff021916908360ff160217905550858160080190805190602001906129c7929190612f40565b506001600160a01b038716600c8201556129e08c611f20565b600d820180546001600160a01b0319166001600160a01b039290921691909117905560038054906000612a1283613935565b909155505080546002820154600183015460048401546005850154600c860154600687015460078801546009890154600a8a01546040516001600160a01b039a8b169a8d997f869b3bfe3edf3905a83981bbcdb5692a217e19b1868207a3b9e58a6bf471db4899612a9a9991909216979196909591949093919260088f019260ff16906134c3565b60405180910390a45090505b9a9950505050505050505050565b60008181526002602052604081206001015482906001600160a01b0316612aed5760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206007015490565b60008181526002602052604081206001015482906001600160a01b0316612b3d5760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206004015490565b60008181526002602052604081206001015482906001600160a01b0316612b8d5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020546001600160a01b031690565b600082612bb78584612c20565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c1a908590612cda565b50505050565b600081815b8451811015612cd2576000858281518110612c5057634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612c92576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612cbf565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612cca81613935565b915050612c25565b509392505050565b6000612d2f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612db19092919063ffffffff16565b805190915015612dac5780806020019051810190612d4d9190613162565b612dac5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107de565b505050565b606061155e848460008585843b612e0a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107de565b600080866001600160a01b03168587604051612e2691906134a7565b60006040518083038185875af1925050503d8060008114612e63576040519150601f19603f3d011682016040523d82523d6000602084013e612e68565b606091505b5091509150612e78828286612e83565b979650505050505050565b60608315612e92575081610dcc565b825115612ea25782518084602001fd5b8160405162461bcd60e51b81526004016107de919061360d565b828054612ec890613900565b90600052602060002090601f016020900481019282612eea5760008555612f30565b82601f10612f035782800160ff19823516178555612f30565b82800160010185558215612f30579182015b82811115612f30578235825591602001919060010190612f15565b50612f3c929150612fb4565b5090565b828054612f4c90613900565b90600052602060002090601f016020900481019282612f6e5760008555612f30565b82601f10612f8757805160ff1916838001178555612f30565b82800160010185558215612f30579182015b82811115612f30578251825591602001919060010190612f99565b5b80821115612f3c5760008155600101612fb5565b60008083601f840112612fda578081fd5b50813567ffffffffffffffff811115612ff1578182fd5b6020830191508360208260051b850101111561300c57600080fd5b9250929050565b803561301e816139aa565b919050565b805169ffffffffffffffffffff8116811461301e57600080fd5b6000806000806000806000806000806101408b8d03121561305c578586fd5b6130668b35613992565b8a35995060208b0135985060408b0135975060608b0135965060808b0135955060a08b0135945061309a60c08c0135613992565b60c08b0135935067ffffffffffffffff8060e08d013511156130ba578384fd5b60e08c01358c018d601f8201126130cf578485fd5b81813511156130e0576130e061397c565b6040518135601f01601f19908116603f011681019083821181831017156131095761310961397c565b81604052823581528f602084358501011115613123578687fd5b823560208401602083013791358201602001959095529350506101008b013591506131516101208c01613013565b90509295989b9194979a5092959850565b600060208284031215613173578081fd5b81518015158114610dcc578182fd5b600060208284031215613193578081fd5b5035919050565b600080604083850312156131ac578182fd5b8235915060208301356131be81613992565b809150509250929050565b600080600080606085870312156131de578384fd5b8435935060208501356131f081613992565b9250604085013567ffffffffffffffff81111561320b578283fd5b61321787828801612fc9565b95989497509550505050565b600080600060608486031215613237578283fd5b83359250602084013561324981613992565b929592945050506040919091013590565b60008060006040848603121561326e578283fd5b83359250602084013567ffffffffffffffff81111561328b578283fd5b61329786828701612fc9565b9497909650939450505050565b600080604083850312156132b6578182fd5b50508035926020909101359150565b600080600080606085870312156132da578182fd5b8435935060208501359250604085013567ffffffffffffffff808211156132ff578384fd5b818701915087601f830112613312578384fd5b813581811115613320578485fd5b886020828501011115613331578485fd5b95989497505060200194505050565b60008060008060608587031215613355578182fd5b8435935060208501359250604085013567ffffffffffffffff81111561320b578283fd5b60006020828403121561338a578081fd5b5051919050565b600080600080600060a086880312156133a8578283fd5b6133b186613023565b94506020860151935060408601519250606086015191506133d460808701613023565b90509295509295909350565b6000602082840312156133f1578081fd5b8151610dcc816139aa565b81835260006001600160fb1b03831115613414578081fd5b8260051b80836020870137939093016020019283525090919050565b8981526bffffffffffffffffffffffff198960601b166020820152876034820152866054820152856074820152846094820152600084516134788160b48501602089016138d4565b60b492019182019390935260f89190911b6001600160f81b03191660d482015260d50198975050505050505050565b600082516134b98184602087016138d4565b9190910192915050565b600061012060018060a01b038c16835260208b818501528a60408501528960608501528860808501528760a08501528160c085015282875484600182811c91508083168061351257607f831692505b85831081141561353057634e487b7160e01b88526022600452602488fd5b9588018281526020019580801561354e576001811461355f57613589565b60ff19851688528688019550613589565b60008d815260209020895b858110156135835781548a82015290840190880161356a565b89019650505b505050505060e0850187905260ff86166101008601529250612aa6915050565b8481526001600160a01b03841660208201526060604082018190526000906135d490830184866133fc565b9695505050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000825180602084015261362c8160408501602087016138d4565b601f01601f19169190910160400192915050565b6020808252600d908201526c36bab9ba1031329030b236b4b760991b604082015260600190565b6020808252601c908201527f6d61783a203431303234343438303020284a616e203120323130302900000000604082015260600190565b60208082526030908201527f73616c65206d757374206265206f70656e20666f72206c6f6e6765722074686160408201526f6e206d61782071756575652074696d6560801b606082015260800190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b84815283151560208201526060604082015260006135d46060830184866133fc565b6000821982111561374c5761374c613950565b500190565b600060ff821660ff84168060ff0382111561376e5761376e613950565b019392505050565b60006001600160a01b038381168061379057613790613966565b92169190910492915050565b6000826137ab576137ab613966565b500490565b600181815b808511156137eb5781600019048211156137d1576137d1613950565b808516156137de57918102915b93841c93908002906137b5565b509250929050565b600061103860ff84168360008261380c5750600161103b565b816138195750600061103b565b816001811461382f576002811461383957613855565b600191505061103b565b60ff84111561384a5761384a613950565b50506001821b61103b565b5060208310610133831016604e8410600b8410161715613878575081810a61103b565b61388283836137b0565b806000190482111561389657613896613950565b029392505050565b60008160001904831182151516156138b8576138b8613950565b500290565b6000828210156138cf576138cf613950565b500390565b60005b838110156138ef5781810151838201526020016138d7565b83811115612c1a5750506000910152565b600181811c9082168061391457607f821691505b6020821081141561080557634e487b7160e01b600052602260045260246000fd5b600060001982141561394957613949613950565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146139a757600080fd5b50565b60ff811681146139a757600080fdfea2646970667358221220e8952f2eb435f035e269444caae041d1cb10abaa4791e6f79c43380a82609e6864736f6c63430008040033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x60806040526004361061023b5760003560e01c8063a1e89aec1161012e578063c96c9d49116100ab578063ef8148b21161006f578063ef8148b214610702578063fb346eab14610722578063fbc6da7514610738578063fca513a814610758578063ffa1ad741461077657600080fd5b8063c96c9d4914610662578063ccc325c214610682578063dee5ab43146106a2578063e533196b146106c2578063eb28322e146106e257600080fd5b8063b94c69aa116100f2578063b94c69aa146105cf578063bac4dd88146105ef578063bc8bf0931461060f578063c83b55f314610622578063c95970be1461064257600080fd5b8063a1e89aec14610539578063a7206cd61461054f578063ad9a68651461056f578063b8211d901461058f578063b8f8a0b3146105af57600080fd5b80634f8b50b0116101bc5780637c35be7a116101805780637c35be7a146104a457806380c6e70a146104c45780638e15f473146104e4578063939d6065146104f9578063976b20501461051957600080fd5b80634f8b50b0146103f457806350fa4ff2146104245780635f0fe44614610444578063628f9fa01461046457806375edcbe01461048457600080fd5b8063231bedc711610203578063231bedc71461031a57806327e542301461033a5780633013ce291461035a57806331d98b3f1461038e578063325cd796146103ae57600080fd5b8063080d840c14610240578063087c2be71461027d578063089ed435146102aa5780630ad0607f146102d857806312105fea146102fa575b600080fd5b34801561024c57600080fd5b5061026061025b366004613182565b6107a5565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561028957600080fd5b5061029d610298366004613182565b61080b565b604051610274919061360d565b3480156102b657600080fd5b506102ca6102c5366004613182565b6108e9565b604051908152602001610274565b3480156102e457600080fd5b506102f86102f336600461319a565b610939565b005b34801561030657600080fd5b506102ca610315366004613182565b610a7f565b34801561032657600080fd5b50610260610335366004613182565b610ad2565b34801561034657600080fd5b506102f86103553660046132a4565b610b2b565b34801561036657600080fd5b506102607f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561039a57600080fd5b506102ca6103a9366004613182565b610d0c565b3480156103ba57600080fd5b506103e27f000000000000000000000000000000000000000000000000000000000000000681565b60405160ff9091168152602001610274565b34801561040057600080fd5b5061041461040f366004613182565b610d5c565b6040519015158152602001610274565b34801561043057600080fd5b506102f861043f3660046132a4565b610dd3565b34801561045057600080fd5b506102ca61045f3660046132a4565b610ffc565b34801561047057600080fd5b506102ca61047f366004613182565b611041565b34801561049057600080fd5b506102f861049f3660046132a4565b611091565b3480156104b057600080fd5b506104146104bf366004613182565b6111ec565b3480156104d057600080fd5b506102606104df366004613182565b61127b565b3480156104f057600080fd5b506102ca6112d4565b34801561050557600080fd5b506102ca610514366004613182565b6113b8565b34801561052557600080fd5b506102ca61053436600461319a565b611408565b34801561054557600080fd5b506102ca60035481565b34801561055b57600080fd5b506102ca61056a366004613182565b61147c565b34801561057b57600080fd5b5061041461058a3660046131c9565b6114cd565b34801561059b57600080fd5b506102ca6105aa366004613182565b611566565b3480156105bb57600080fd5b506102f86105ca366004613223565b6115b6565b3480156105db57600080fd5b506102f86105ea36600461319a565b611690565b3480156105fb57600080fd5b506102ca61060a366004613182565b6117c9565b6102f861061d36600461325a565b6118ad565b34801561062e57600080fd5b506102ca61063d36600461319a565b611ddc565b34801561064e57600080fd5b506102f861065d3660046132c5565b611e43565b34801561066e57600080fd5b5061026061067d366004613182565b611f20565b34801561068e57600080fd5b506102ca61069d36600461319a565b611f36565b3480156106ae57600080fd5b506102f86106bd366004613340565b611fdf565b3480156106ce57600080fd5b506102ca6106dd36600461303d565b6125c7565b3480156106ee57600080fd5b506102ca6106fd366004613182565b612ab4565b34801561070e57600080fd5b506102ca61071d366004613182565b612b04565b34801561072e57600080fd5b506102ca60045481565b34801561074457600080fd5b50610260610753366004613182565b612b54565b34801561076457600080fd5b506001546001600160a01b0316610260565b34801561078257600080fd5b5061029d6040518060400160405280600381526020016218971960e91b81525081565b60008181526002602052604081206001015482906001600160a01b03166107e75760405162461bcd60e51b81526004016107de906136ee565b60405180910390fd5b6000838152600260205260409020600d01546001600160a01b031691505b50919050565b60008181526002602052604090206001015460609082906001600160a01b03166108475760405162461bcd60e51b81526004016107de906136ee565b6000838152600260205260409020600801805461086390613900565b80601f016020809104026020016040519081016040528092919081815260200182805461088f90613900565b80156108dc5780601f106108b1576101008083540402835291602001916108dc565b820191906000526020600020905b8154815290600101906020018083116108bf57829003601f168201915b5050505050915050919050565b60008181526002602052604081206001015482906001600160a01b03166109225760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206005015490565b60008281526002602052604090206001015482906001600160a01b03166109725760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146109ad5760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610a225760405162461bcd60e51b815260206004820152602c60248201527f63616e6e6f742061646a757374206d61782071756575652074696d652061667460448201526b65722073616c6520656e647360a01b60648201526084016107de565b6000848152600260209081526040918290206001600160a01b038616600c909101819055915191825285917f6039ca6720e37f558ee4c54ff612004deb49321831da1765375d1b0b6400881891015b60405180910390a250505050565b60008181526002602052604081206001015482906001600160a01b0316610ab85760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600a015460ff1690565b60008181526002602052604081206001015482906001600160a01b0316610b0b5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600301546001600160a01b031690565b60008281526002602052604090206001015482906001600160a01b0316610b645760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b03163314610b9f5760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610bff5760405162461bcd60e51b815260206004820152601960248201527f64697361626c65642061667465722073616c6520636c6f73650000000000000060448201526064016107de565b6000848152600260205260409020600701548310610c5f5760405162461bcd60e51b815260206004820152601b60248201527f73616c65207374617274206d757374207072656365646520656e64000000000060448201526064016107de565b63f4865700831115610c835760405162461bcd60e51b81526004016107de90613667565b6000848152600260205260409020600c810154600790910154610ca79085906138bd565b11610cc45760405162461bcd60e51b81526004016107de9061369e565b600084815260026020526040908190206006018490555184907f141c96c7f9bc751630fe1c6e1459ac982a755dda2a919f4c7218397df988d01190610a719086815260200190565b60008181526002602052604081206001015482906001600160a01b0316610d455760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206009015490565b60008181526002602052604081206001015482906001600160a01b0316610d955760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206007015442101580610dcc575060008381526002602052604090206004810154600b9091015410155b9392505050565b60008281526002602052604090206001015482906001600160a01b0316610e0c5760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b03163314610e475760405162461bcd60e51b81526004016107de90613640565b6000848152600260205260409020600701544210610ea75760405162461bcd60e51b815260206004820152601a60248201527f64697361626c65642061667465722073616c6520636c6f73657300000000000060448201526064016107de565b428311610ef05760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107de565b63f4865700831115610f145760405162461bcd60e51b81526004016107de90613667565b6000848152600260205260409020600601548311610f745760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107de565b6000848152600260205260409020600c810154600690910154610f9790856138bd565b11610fb45760405162461bcd60e51b81526004016107de9061369e565b600084815260026020526040908190206007018490555184907fa1d69aa21ab2424b05b137a387320de036a0b226f4a0d6317ea2430d99ff27a690610a719086815260200190565b60008281526002602052604081206009810154600a9182015490916110249160ff16906137f3565b61102e908461389e565b611038919061379c565b90505b92915050565b60008181526002602052604081206001015482906001600160a01b031661107a5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600c015490565b60008281526002602052604090206001015482906001600160a01b03166110ca5760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146111055760405162461bcd60e51b81526004016107de90613640565b61110e84610d5c565b1561116c5760405162461bcd60e51b815260206004820152602860248201527f63616e6e6f7420736574206d65726b6c6520726f6f74206f6e63652073616c656044820152671034b99037bb32b960c11b60648201526084016107de565b60008481526002602081905260409091200183905561118a83611f20565b600085815260026020908152604091829020600d0180546001600160a01b0319166001600160a01b0394909416939093179092555184815285917f5c25e09dfc956c1695410327dbad0359e07b240db96ced50d429a2edb560614a9101610a71565b60008181526002602052604081206001015482906001600160a01b03166112255760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206006015442118015611255575060008381526002602052604090206007015442105b8015610dcc5750505060009081526002602052604090206004810154600b909101541090565b60008181526002602052604081206001015482906001600160a01b03166112b45760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600101546001600160a01b031690565b600080600080600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561132b57600080fd5b505afa15801561133f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113639190613391565b94509450945094509450600084136113ae5760405162461bcd60e51b815260206004820152600e60248201526d6e6567617469766520707269636560901b60448201526064016107de565b5091949350505050565b60008181526002602052604081206001015482906001600160a01b03166113f15760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206006015490565b60008281526002602052604081206001015483906001600160a01b03166114415760405162461bcd60e51b81526004016107de906136ee565b60008481526002602090815260408083206001600160a01b0387168452600e01909152902054611472908590610ffc565b91505b5092915050565b60008181526002602052604081206001015482906001600160a01b03166114b55760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260208190526040909120015490565b6040516bffffffffffffffffffffffff19606085901b16602082015260009081906034016040516020818303038152906040528051906020012090506115498484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250859150612baa9050565b1561155857600191505061155e565b60009150505b949350505050565b60008181526002602052604081206001015482906001600160a01b031661159f5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020600b015490565b60008381526002602052604090206001015483906001600160a01b031633146115f15760405162461bcd60e51b81526004016107de90613640565b826001600160a01b031663a9059cbb61160986612b54565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116899190613162565b5050505050565b60008281526002602052604090206001015482906001600160a01b03166116c95760405162461bcd60e51b81526004016107de906136ee565b60008381526002602052604090206001015483906001600160a01b031633146117045760405162461bcd60e51b81526004016107de90613640565b6001600160a01b03831661176b5760405162461bcd60e51b815260206004820152602860248201527f436c61696d206d616e61676572206d7573742062652061206e6f6e2d7a65726f604482015267206164647265737360c01b60648201526084016107de565b60008481526002602052604080822060030180546001600160a01b0319166001600160a01b0387169081179091559051909186917fa238e2b81a1e21f7426993fcac7cc40d45cf7f22c8d58a2345e65c7a1ed06e729190a350505050565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561180e57600080fd5b505afa158015611822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184691906133e0565b611851906012613751565b61185c90600a6137f3565b6118877f0000000000000000000000000000000000000000000000000000000000000006600a6137f3565b61188f6112d4565b611899908561389e565b6118a3919061389e565b61103b919061379c565b60008381526002602052604090206001015483906001600160a01b03166118e65760405162461bcd60e51b81526004016107de906136ee565b6000848152600260205260409020600601548490421161193f5760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107de565b600081815260026020526040902060070154421061198c5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107de565b60008181526002602052604090206004810154600b90910154106119de5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107de565b848484333214611a275760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107de565b6000838152600260208190526040909120015415611b17576000838152600260208190526040918290200154905163ad9a686560e01b8152309163ad9a686591611a7a91903390879087906004016135a9565b60206040518083038186803b158015611a9257600080fd5b505afa158015611aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aca9190613162565b1515600114611b175760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107de565b611b218333611f36565b600084815260026020526040902060060154611b3d90426138bd565b11611b7e5760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107de565b60026000541415611bd15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107de565b60026000908155611be1346117c9565b60008a81526002602090815260408083206005810154338552600e9091019092529091205491925090611c149083613739565b1115611c625760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107de565b60008981526002602052604090206004810154600b90910154611c859083613739565b1115611cd35760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107de565b6000898152600260205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015611d18573d6000803e3d6000fd5b506000898152600260209081526040808320338452600e0190915281208054839290611d45908490613739565b90915550506000898152600260205260408120600b018054839290611d6b908490613739565b925050819055508060046000828254611d849190613739565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f90611dc49085906001908e908e90613717565b60405180910390a35050600160005550505050505050565b60008281526002602052604081206001015483906001600160a01b0316611e155760405162461bcd60e51b81526004016107de906136ee565b505060009182526002602090815260408084206001600160a01b03939093168452600e909201905290205490565b60008481526002602052604090206001015484906001600160a01b0316611e7c5760405162461bcd60e51b81526004016107de906136ee565b60008581526002602052604090206001015485906001600160a01b03163314611eb75760405162461bcd60e51b81526004016107de90613640565b6000868152600260205260409020611ed3906008018585612ebc565b50611ede8686611091565b857f576e604c0ce80f5cc291a8dd68ecbb823e139b8f3063821e7f52275da64e384d8585604051611f109291906135de565b60405180910390a2505050505050565b600081611f2e6001436138bd565b401892915050565b60008281526002602052604081206001015483906001600160a01b0316611f6f5760405162461bcd60e51b81526004016107de906136ee565b6000848152600260205260409020600c0154611f8e5760009150611475565b6000848152600260205260408120600d810154600c909101546001600160a01b0391821686189291611fc09190613776565b9050611fcc8183613776565b6001600160a01b03169695505050505050565b60008481526002602052604090206001015484906001600160a01b03166120185760405162461bcd60e51b81526004016107de906136ee565b600085815260026020526040902060060154859042116120715760405162461bcd60e51b81526020600482015260146024820152731cd85b19481b9bdd081cdd185c9d1959081e595d60621b60448201526064016107de565b60008181526002602052604090206007015442106120be5760405162461bcd60e51b815260206004820152600a6024820152691cd85b1948195b99195960b21b60448201526064016107de565b60008181526002602052604090206004810154600b90910154106121105760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b60448201526064016107de565b8584843332146121595760405162461bcd60e51b81526020600482015260146024820152734d75737420627579207769746820616e20454f4160601b60448201526064016107de565b6000838152600260208190526040909120015415612249576000838152600260208190526040918290200154905163ad9a686560e01b8152309163ad9a6865916121ac91903390879087906004016135a9565b60206040518083038186803b1580156121c457600080fd5b505afa1580156121d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fc9190613162565b15156001146122495760405162461bcd60e51b8152602060048201526019602482015278626164206d65726b6c652070726f6f6620666f722073616c6560381b60448201526064016107de565b6122538333611f36565b60008481526002602052604090206006015461226f90426138bd565b116122b05760405162461bcd60e51b81526020600482015260116024820152701b9bdd081e5bdd5c881d1d5c9b881e595d607a1b60448201526064016107de565b600260005414156123035760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107de565b600260008181558a8152602091825260408082206005810154338452600e909101909352902054612334908a613739565b11156123825760405162461bcd60e51b815260206004820152601b60248201527f7075726368617365206578636565647320796f7572206c696d6974000000000060448201526064016107de565b60008981526002602052604090206004810154600b909101546123a5908a613739565b11156123f35760405162461bcd60e51b815260206004820152601b60248201527f707572636861736520657863656564732073616c65206c696d6974000000000060448201526064016107de565b604051636eb1769f60e11b815233600482015230602482015288907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561245a57600080fd5b505afa15801561246e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124929190613379565b10156124d45760405162461bcd60e51b8152602060048201526011602482015270616c6c6f77616e636520746f6f206c6f7760781b60448201526064016107de565b60008981526002602052604090205461251c906001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488116913391168b612bc0565b6000898152600260209081526040808320338452600e01909152812080548a9290612548908490613739565b90915550506000898152600260205260408120600b0180548a929061256e908490613739565b9250508190555087600460008282546125879190613739565b909155505060405133908a907f626774f7294b3079307930cbec9061bd3e7342694936faae16b870083853337f90611dc4908c906000908d908d90613717565b60006001600160a01b038b1661262a5760405162461bcd60e51b815260206004820152602260248201527f726563697069656e74206d757374206e6f74206265207a65726f206164647265604482015261737360f01b60648201526084016107de565b63f486570087111561264e5760405162461bcd60e51b81526004016107de90613667565b63f48657008611156126725760405162461bcd60e51b81526004016107de90613667565b8587106126c15760405162461bcd60e51b815260206004820152601e60248201527f73616c65206d757374207374617274206265666f726520697420656e6473000060448201526064016107de565b42861161270a5760405162461bcd60e51b815260206004820152601760248201527673616c65206d75737420656e6420696e2066757475726560481b60448201526064016107de565b8888111561276a5760405162461bcd60e51b815260206004820152602760248201527f757365724275794c696d69742063616e6e6f74206578636565642073616c65426044820152661d5e531a5b5a5d60ca1b60648201526084016107de565b600088116127ba5760405162461bcd60e51b815260206004820152601860248201527f757365724275794c696d6974206d757374206265203e2030000000000000000060448201526064016107de565b6000891161280a5760405162461bcd60e51b815260206004820152601860248201527f73616c654275794c696d6974206d757374206265203e2030000000000000000060448201526064016107de565b6001600160a01b03851661281e88886138bd565b1161283b5760405162461bcd60e51b81526004016107de9061369e565b60008a8c8b8b8b8b8a8a8a60405160200161285e99989796959493929190613430565b60408051601f198184030181529181528151602092830120600081815260029093529120600101549091506001600160a01b0316156128f35760405162461bcd60e51b815260206004820152602b60248201527f612073616c65207769746820746865736520706172616d657465727320616c7260448201526a656164792065786973747360a81b60648201526084016107de565b60006002600083815260200190815260200160002090508b8160020181905550338160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508c8160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a81600401819055508981600501819055508881600601819055508781600701819055508481600901819055508381600a0160006101000a81548160ff021916908360ff160217905550858160080190805190602001906129c7929190612f40565b506001600160a01b038716600c8201556129e08c611f20565b600d820180546001600160a01b0319166001600160a01b039290921691909117905560038054906000612a1283613935565b909155505080546002820154600183015460048401546005850154600c860154600687015460078801546009890154600a8a01546040516001600160a01b039a8b169a8d997f869b3bfe3edf3905a83981bbcdb5692a217e19b1868207a3b9e58a6bf471db4899612a9a9991909216979196909591949093919260088f019260ff16906134c3565b60405180910390a45090505b9a9950505050505050505050565b60008181526002602052604081206001015482906001600160a01b0316612aed5760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206007015490565b60008181526002602052604081206001015482906001600160a01b0316612b3d5760405162461bcd60e51b81526004016107de906136ee565b505060009081526002602052604090206004015490565b60008181526002602052604081206001015482906001600160a01b0316612b8d5760405162461bcd60e51b81526004016107de906136ee565b50506000908152600260205260409020546001600160a01b031690565b600082612bb78584612c20565b14949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c1a908590612cda565b50505050565b600081815b8451811015612cd2576000858281518110612c5057634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612c92576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612cbf565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612cca81613935565b915050612c25565b509392505050565b6000612d2f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612db19092919063ffffffff16565b805190915015612dac5780806020019051810190612d4d9190613162565b612dac5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107de565b505050565b606061155e848460008585843b612e0a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107de565b600080866001600160a01b03168587604051612e2691906134a7565b60006040518083038185875af1925050503d8060008114612e63576040519150601f19603f3d011682016040523d82523d6000602084013e612e68565b606091505b5091509150612e78828286612e83565b979650505050505050565b60608315612e92575081610dcc565b825115612ea25782518084602001fd5b8160405162461bcd60e51b81526004016107de919061360d565b828054612ec890613900565b90600052602060002090601f016020900481019282612eea5760008555612f30565b82601f10612f035782800160ff19823516178555612f30565b82800160010185558215612f30579182015b82811115612f30578235825591602001919060010190612f15565b50612f3c929150612fb4565b5090565b828054612f4c90613900565b90600052602060002090601f016020900481019282612f6e5760008555612f30565b82601f10612f8757805160ff1916838001178555612f30565b82800160010185558215612f30579182015b82811115612f30578251825591602001919060010190612f99565b5b80821115612f3c5760008155600101612fb5565b60008083601f840112612fda578081fd5b50813567ffffffffffffffff811115612ff1578182fd5b6020830191508360208260051b850101111561300c57600080fd5b9250929050565b803561301e816139aa565b919050565b805169ffffffffffffffffffff8116811461301e57600080fd5b6000806000806000806000806000806101408b8d03121561305c578586fd5b6130668b35613992565b8a35995060208b0135985060408b0135975060608b0135965060808b0135955060a08b0135945061309a60c08c0135613992565b60c08b0135935067ffffffffffffffff8060e08d013511156130ba578384fd5b60e08c01358c018d601f8201126130cf578485fd5b81813511156130e0576130e061397c565b6040518135601f01601f19908116603f011681019083821181831017156131095761310961397c565b81604052823581528f602084358501011115613123578687fd5b823560208401602083013791358201602001959095529350506101008b013591506131516101208c01613013565b90509295989b9194979a5092959850565b600060208284031215613173578081fd5b81518015158114610dcc578182fd5b600060208284031215613193578081fd5b5035919050565b600080604083850312156131ac578182fd5b8235915060208301356131be81613992565b809150509250929050565b600080600080606085870312156131de578384fd5b8435935060208501356131f081613992565b9250604085013567ffffffffffffffff81111561320b578283fd5b61321787828801612fc9565b95989497509550505050565b600080600060608486031215613237578283fd5b83359250602084013561324981613992565b929592945050506040919091013590565b60008060006040848603121561326e578283fd5b83359250602084013567ffffffffffffffff81111561328b578283fd5b61329786828701612fc9565b9497909650939450505050565b600080604083850312156132b6578182fd5b50508035926020909101359150565b600080600080606085870312156132da578182fd5b8435935060208501359250604085013567ffffffffffffffff808211156132ff578384fd5b818701915087601f830112613312578384fd5b813581811115613320578485fd5b886020828501011115613331578485fd5b95989497505060200194505050565b60008060008060608587031215613355578182fd5b8435935060208501359250604085013567ffffffffffffffff81111561320b578283fd5b60006020828403121561338a578081fd5b5051919050565b600080600080600060a086880312156133a8578283fd5b6133b186613023565b94506020860151935060408601519250606086015191506133d460808701613023565b90509295509295909350565b6000602082840312156133f1578081fd5b8151610dcc816139aa565b81835260006001600160fb1b03831115613414578081fd5b8260051b80836020870137939093016020019283525090919050565b8981526bffffffffffffffffffffffff198960601b166020820152876034820152866054820152856074820152846094820152600084516134788160b48501602089016138d4565b60b492019182019390935260f89190911b6001600160f81b03191660d482015260d50198975050505050505050565b600082516134b98184602087016138d4565b9190910192915050565b600061012060018060a01b038c16835260208b818501528a60408501528960608501528860808501528760a08501528160c085015282875484600182811c91508083168061351257607f831692505b85831081141561353057634e487b7160e01b88526022600452602488fd5b9588018281526020019580801561354e576001811461355f57613589565b60ff19851688528688019550613589565b60008d815260209020895b858110156135835781548a82015290840190880161356a565b89019650505b505050505060e0850187905260ff86166101008601529250612aa6915050565b8481526001600160a01b03841660208201526060604082018190526000906135d490830184866133fc565b9695505050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000825180602084015261362c8160408501602087016138d4565b601f01601f19169190910160400192915050565b6020808252600d908201526c36bab9ba1031329030b236b4b760991b604082015260600190565b6020808252601c908201527f6d61783a203431303234343438303020284a616e203120323130302900000000604082015260600190565b60208082526030908201527f73616c65206d757374206265206f70656e20666f72206c6f6e6765722074686160408201526f6e206d61782071756575652074696d6560801b606082015260800190565b6020808252600f908201526e1a5b9d985b1a59081cd85b19481a59608a1b604082015260600190565b84815283151560208201526060604082015260006135d46060830184866133fc565b6000821982111561374c5761374c613950565b500190565b600060ff821660ff84168060ff0382111561376e5761376e613950565b019392505050565b60006001600160a01b038381168061379057613790613966565b92169190910492915050565b6000826137ab576137ab613966565b500490565b600181815b808511156137eb5781600019048211156137d1576137d1613950565b808516156137de57918102915b93841c93908002906137b5565b509250929050565b600061103860ff84168360008261380c5750600161103b565b816138195750600061103b565b816001811461382f576002811461383957613855565b600191505061103b565b60ff84111561384a5761384a613950565b50506001821b61103b565b5060208310610133831016604e8410600b8410161715613878575081810a61103b565b61388283836137b0565b806000190482111561389657613896613950565b029392505050565b60008160001904831182151516156138b8576138b8613950565b500290565b6000828210156138cf576138cf613950565b500390565b60005b838110156138ef5781810151838201526020016138d7565b83811115612c1a5750506000910152565b600181811c9082168061391457607f821691505b6020821081141561080557634e487b7160e01b600052602260045260246000fd5b600060001982141561394957613949613950565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146139a757600080fd5b50565b60ff811681146139a757600080fdfea2646970667358221220e8952f2eb435f035e269444caae041d1cb10abaa4791e6f79c43380a82609e6864736f6c63430008040033

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

000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000060000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : _paymentToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : _paymentTokenDecimals (uint8): 6
Arg [2] : _priceOracle (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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