ETH Price: $2,122.17 (-0.14%)

Contract

0x4F23D4DB040552fB6d4Df265Bd73dC35bA3Cc026
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw Funds175295342023-06-21 17:30:471003 days ago1687368647IN
0x4F23D4DB...5bA3Cc026
0 ETH0.0016477541.51781197
Withdraw Funds175295262023-06-21 17:29:111003 days ago1687368551IN
0x4F23D4DB...5bA3Cc026
0 ETH0.0011152436.12583394
Refund Users175294972023-06-21 17:23:231003 days ago1687368203IN
0x4F23D4DB...5bA3Cc026
0 ETH0.1643464239.70334301
Bid175294852023-06-21 17:20:591003 days ago1687368059IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0035194743.49054256
Bid175294852023-06-21 17:20:591003 days ago1687368059IN
0x4F23D4DB...5bA3Cc026
1.55 ETH0.0035372343.69054256
Bid175294842023-06-21 17:20:471003 days ago1687368047IN
0x4F23D4DB...5bA3Cc026
0.64 ETH0.003523243.51727168
Bid175294842023-06-21 17:20:471003 days ago1687368047IN
0x4F23D4DB...5bA3Cc026
0.31 ETH0.0034936543.51727168
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0036740945.38101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0.31 ETH0.0036740945.38101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
5.12 ETH0.0036740945.38101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
2.88 ETH0.0028980745.38101052
Claim Tokens175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0 ETH0.0032041745.38101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0 ETH0.0036902845.58101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0.62 ETH0.0077140495.28101052
Bid175294832023-06-21 17:20:351003 days ago1687368035IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.01176209145.28101052
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
1.28 ETH0.0036701645.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0028949745.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.62 ETH0.0036701645.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0036701645.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.96 ETH0.0036696245.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0036701645.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0044145745.33251524
Claim Tokens175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0 ETH0.0024557945.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0036701645.33251524
Bid175294822023-06-21 17:20:231003 days ago1687368023IN
0x4F23D4DB...5bA3Cc026
0.32 ETH0.0028949745.33251524
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer175295342023-06-21 17:30:471003 days ago1687368647
0x4F23D4DB...5bA3Cc026
130.39644398 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.01266666 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.01266666 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.07997685 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.19869999 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.01266666 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00844444 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.04222222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.02111111 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00422222 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00844444 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.02533333 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.01688888 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00844444 ETH
Transfer175294972023-06-21 17:23:231003 days ago1687368203
0x4F23D4DB...5bA3Cc026
0.00844444 ETH
View All Internal Transactions
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:
DutchAuction

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
/**
 * @title Dutch Auction Contract
 * @author arod.studio and Fingerprints DAO
 * @notice This contract implements a Dutch Auction for NFTs (Non-Fungible Tokens).
 * The auction starts at a high price, decreasing over time until a bid is made or
 * a reserve price is reached. Users bid for a quantity of NFTs. They can withdraw
 * their funds after the auction, or claim a refund if conditions are met.
 * Additionally, users can claim additional NFTs using their prospective refunds
 * while the auction is ongoing.
 * The auction can be paused, unpaused, and configured by an admin.
 * Security features like reentrancy guard, overflow/underflow checks,
 * and signature verification are included.
 *
 * NOTE: The original contract has been modified to support merkle tree based discounts
 * in the form of increasing the amount that a user eligible for a discount is refunded.
 *
 *
 * SPDX-License-Identifier: MIT
 */
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {IDelegateCash} from "./IDelegateCash.sol";

import "./IDutchAuction.sol";
import "./INFT.sol";

// import "hardhat/console.sol";

/**
 * @title Dutch Auction Contract
 * @dev This contract manages a dutch auction for NFT tokens. Users can bid,
 * claim refunds, claim tokens, and admins can refund users.
 * The contract is pausable and non-reentrant for safety.
 */
contract DutchAuction is IDutchAuction, AccessControl, Pausable, ReentrancyGuard {
  /// @notice EIP712 Domain Hash
  bytes32 public immutable eip712DomainHash;

  /// @notice NFT contract address
  INFT public nftContractAddress;

  /// @notice Signer address
  address public signerAddress;

  /// @notice Treasury address that will receive funds
  address public treasuryAddress;

  /// @dev Settled Price in wei
  uint256 private _settledPriceInWei;

  /// @dev Auction Config
  Config private _config;

  /// @dev Total minted tokens
  uint32 private _totalMinted;

  /// @dev Funds withdrawn or not
  bool private _withdrawn;

  /// @dev Mapping of user address to User data
  mapping(address => User) private _userData;

  /// @dev Mapping of user address to nonce
  mapping(address => uint256) private _nonces;

  /// @dev Merkle root holding allowed discount addresses
  bytes32 public discountMerkleRoot;

  /// @dev Delegate cash contract address
  IDelegateCash public delegateCash;

  modifier validConfig() {
    if (_config.startTime == 0) revert ConfigNotSet();
    _;
  }

  modifier validTime() {
    Config memory config = _config;
    if (block.timestamp > config.endTime || block.timestamp < config.startTime)
      revert InvalidStartEndTime(config.startTime, config.endTime);
    _;
  }

  /// @notice DutchAuction Constructor
  /// @param _nftAddress NFT contract address
  /// @param _signerAddress Signer address
  /// @param _treasuryAddress Treasury address
  /// @param _discountMerkleRoot Merkle root for discounts
  /// @param _delegateCash Delegate cash address
  constructor(
    address _nftAddress,
    address _signerAddress,
    address _treasuryAddress,
    bytes32 _discountMerkleRoot,
    address _delegateCash
  ) {
    nftContractAddress = INFT(_nftAddress);
    signerAddress = _signerAddress;
    treasuryAddress = _treasuryAddress;
    discountMerkleRoot = _discountMerkleRoot;
    delegateCash = IDelegateCash(_delegateCash);

    _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);

    uint256 chainId;
    assembly {
      chainId := chainid()
    }
    eip712DomainHash = keccak256(
      abi.encode(
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
        keccak256(bytes("Fingerprints DAO Dutch Auction")),
        keccak256(bytes("1")),
        chainId,
        address(this)
      )
    );
  }

  /// @notice Set auction config
  /// @dev Only admin can set auction config
  /// @param startAmountInWei Auction start amount in wei
  /// @param endAmountInWei Auction end amount in wei
  /// @param limitInWei Maximum amount users can use to purchase NFTs
  /// @param refundDelayTime Delay time which users need to wait to claim refund after the auction ends
  /// @param startTime Auction start time
  /// @param endTime Auction end time
  function setConfig(
    uint256 startAmountInWei,
    uint256 endAmountInWei,
    uint216 limitInWei,
    uint32 refundDelayTime,
    uint64 startTime,
    uint64 endTime
  ) external onlyRole(DEFAULT_ADMIN_ROLE) {
    if (_config.startTime != 0 && _config.startTime <= block.timestamp) revert ConfigAlreadySet();

    if (startTime == 0 || startTime >= endTime) revert InvalidStartEndTime(startTime, endTime);
    if (startAmountInWei == 0 || startAmountInWei <= endAmountInWei) revert InvalidAmountInWei();
    if (limitInWei == 0) revert InvalidAmountInWei();

    _config = Config({
      startAmountInWei: startAmountInWei,
      endAmountInWei: endAmountInWei,
      limitInWei: limitInWei,
      refundDelayTime: refundDelayTime,
      startTime: startTime,
      endTime: endTime
    });
  }

  /**
   * @dev Sets the merkle root for discounts.
   *
   * Requirements:
   * - Caller must have the DEFAULT_ADMIN_ROLE.
   *
   * @param root The new merkle root.
   */
  function setDiscountMerkleRoot(bytes32 root) external onlyRole(DEFAULT_ADMIN_ROLE) {
    discountMerkleRoot = root;
  }

  /**
   * @dev Sets the address of the NFT contract.
   *
   * Requirements:
   * - Caller must have the DEFAULT_ADMIN_ROLE.
   * - New address must not be the zero address.
   *
   * @param newAddress The address of the new NFT contract.
   */
  function setNftContractAddress(address newAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {
    require(newAddress != address(0), "Invalid address: zero address not allowed");
    nftContractAddress = INFT(newAddress);
  }

  /**
   * @dev Sets the signer address.
   *
   * Requirements:
   * - Caller must have the DEFAULT_ADMIN_ROLE.
   * - New address must not be the zero address.
   *
   * @param newAddress The address of the new signer.
   */
  function setSignerAddress(address newAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {
    require(newAddress != address(0), "Invalid address: zero address not allowed");
    signerAddress = newAddress;
  }

  /// @notice Sets treasury address
  /// @param _treasuryAddress New treasury address
  function setTreasuryAddress(address _treasuryAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {
    require(_treasuryAddress != address(0), "Invalid address: zero address not allowed");
    treasuryAddress = _treasuryAddress;
  }

  /// @notice Pause the auction
  function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {
    _pause();
  }

  /// @notice Unpause the auction
  function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
    _unpause();
  }

  /// @notice Get auction config
  /// @return config Auction config
  function getConfig() external view returns (Config memory) {
    return _config;
  }

  /// @notice Get user data
  /// @param user User address
  /// @return User struct
  function getUserData(address user) external view returns (User memory) {
    return _userData[user];
  }

  /// @notice Get auction's settled price
  /// @return price Auction's settled price
  function getSettledPriceInWei() external view returns (uint256) {
    return _settledPriceInWei;
  }

  /// @notice Get auction's current price
  /// @return price Auction's current price
  function getCurrentPriceInWei() public view returns (uint256) {
    Config memory config = _config; // storage to memory
    // Return startAmountInWei if auction not started
    if (block.timestamp <= config.startTime) return config.startAmountInWei;
    // Return endAmountInWei if auction ended
    if (block.timestamp >= config.endTime) return config.endAmountInWei;

    // Declare variables to derive in the subsequent unchecked scope.
    uint256 duration;
    uint256 elapsed;
    uint256 remaining;

    // Skip underflow checks as startTime <= block.timestamp < endTime.
    unchecked {
      // Derive the duration for the order and place it on the stack.
      duration = config.endTime - config.startTime;

      // Derive time elapsed since the order started & place on stack.
      elapsed = block.timestamp - config.startTime;

      // Derive time remaining until order expires and place on stack.
      remaining = duration - elapsed;
    }

    return (config.startAmountInWei * remaining + config.endAmountInWei * elapsed) / duration;
  }

  /// @notice Get user's nonce for signature verification
  /// @param user User address
  /// @return nonce User's nonce
  function getNonce(address user) external view returns (uint256) {
    return _nonces[user];
  }

  /// @dev Return user's current nonce and increase it
  /// @param user User address
  /// @return current Current nonce
  function useNonce(address user) internal returns (uint256 current) {
    current = _nonces[user];
    ++_nonces[user];
  }

  /// @notice Make bid to purchase NFTs
  /// @param qty Amount of tokens to purchase
  /// @param deadline Timestamp when the signature expires
  /// @param signature Signature to verify user's purchase
  /// @param vaultAddress Address of vault being delegated for
  function bid(
    uint32 qty,
    uint256 deadline,
    bytes memory signature,
    address vaultAddress
  ) external payable nonReentrant whenNotPaused validConfig validTime {
    address requester = msg.sender;

    if (vaultAddress != address(0) && vaultAddress != msg.sender) {
      bool isDelegateValid = delegateCash.checkDelegateForContract(
        msg.sender,
        vaultAddress,
        address(nftContractAddress)
      );
      require(isDelegateValid, "invalid delegate-vault pairing");
      requester = vaultAddress;
    }

    if (block.timestamp > deadline) revert BidExpired(deadline);
    if (qty < 1) revert InvalidQuantity();

    bytes32 hashStruct = keccak256(
      abi.encode(
        keccak256("Bid(address account,uint32 qty,uint256 nonce,uint256 deadline)"),
        requester,
        qty,
        useNonce(requester),
        deadline
      )
    );

    bytes32 hash = keccak256(abi.encodePacked("\x19\x01", eip712DomainHash, hashStruct));

    address recoveredSigner = ECDSA.recover(hash, signature);
    if (signerAddress != recoveredSigner) revert InvalidSignature();

    uint32 available = nftContractAddress.maxSupply() - uint16(nftContractAddress.totalSupply());

    if (qty > available) {
      revert MaxSupplyReached();
    }

    uint256 price = getCurrentPriceInWei();
    uint256 payment = qty * price;
    if (msg.value < payment) revert NotEnoughValue();

    User storage bidder = _userData[requester]; // get user's current bid total
    bidder.contribution = bidder.contribution + uint216(payment);
    bidder.tokensBidded = bidder.tokensBidded + qty;

    if (bidder.contribution > _config.limitInWei) revert PurchaseLimitReached();

    _totalMinted += qty;

    // _settledPriceInWei is always the minimum price of all the bids' unit price
    if (price < _settledPriceInWei || _settledPriceInWei == 0) {
      _settledPriceInWei = price;
    }

    if (msg.value > payment) {
      uint256 refundInWei = msg.value - payment;
      (bool success, ) = requester.call{value: refundInWei}("");
      if (!success) revert TransferFailed();
    }
    // mint tokens to user
    _mintTokens(requester, qty);

    emit Bid(requester, qty, price);
  }

  /// @notice Return user's claimable tokens count
  /// @param user User address
  /// @return claimable Claimable tokens count
  function getClaimableTokens(address user) public view returns (uint32 claimable) {
    User storage bidder = _userData[user]; // get user's current bid total
    uint256 price = getCurrentPriceInWei();
    claimable = uint32(bidder.contribution / price) - bidder.tokensBidded;
    uint32 available = nftContractAddress.maxSupply() - uint16(nftContractAddress.totalSupply());
    if (claimable > available) claimable = available;
  }

  /// @notice Claim additional NFTs without additional payment
  /// @param amount Number of tokens to claim
  /// @param vaultAddress Address to check
  function claimTokens(
    uint32 amount,
    address vaultAddress
  ) external nonReentrant whenNotPaused validConfig validTime {
    address requester = msg.sender;

    if (vaultAddress != address(0) && vaultAddress != msg.sender) {
      bool isDelegateValid = delegateCash.checkDelegateForContract(
        msg.sender,
        vaultAddress,
        address(nftContractAddress)
      );
      require(isDelegateValid, "invalid delegate-vault pairing");
      requester = vaultAddress;
    }

    User storage bidder = _userData[requester]; // get user's current bid total
    uint256 price = getCurrentPriceInWei();
    uint32 claimable = getClaimableTokens(requester);
    if (amount > claimable) amount = claimable;
    if (amount == 0) revert NothingToClaim();

    bidder.tokensBidded = bidder.tokensBidded + amount;
    _totalMinted += amount;

    // _settledPriceInWei is always the minimum price of all the bids' unit price
    if (price < _settledPriceInWei) {
      _settledPriceInWei = price;
    }

    _mintTokens(requester, amount);

    emit Claim(requester, amount);
  }

  /// @notice Admin withdraw funds
  /// @dev Only admin can withdraw funds
  function withdrawFunds() external nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) {
    if (_config.endTime >= block.timestamp) revert NotEnded();

    (bool success, ) = treasuryAddress.call{value: address(this).balance}("");
    if (!success) revert TransferFailed();
  }

  /**
   * @notice Allows a participant to claim their refund after the auction ends.
   * Refund is calculated based on the difference between their contribution and the final settled price.
   * This function can only be called after the refund delay time has passed post-auction end.
   * Note: If the function reverts with 'ClaimRefundNotReady', it means the refund delay time has not passed yet.
   */
  function claimRefund(
    address vaultAddress,
    bytes32[] calldata proof
  ) external nonReentrant whenNotPaused validConfig onlyRole(DEFAULT_ADMIN_ROLE) {
    Config memory config = _config;
    if (config.endTime + config.refundDelayTime >= block.timestamp) revert ClaimRefundNotReady();

    _claimRefund(vaultAddress, proof);
  }

  /**
   * @notice Admin-enforced claim of refunds for a list of user addresses.
   * This function is identical to `claimRefund` but allows an admin to force
   * users to claim their refund.
   * Note: If the function reverts with 'ClaimRefundNotReady', it means the refund delay time has not passed yet.
   * @param accounts An array of addresses for which refunds will be claimed.
   */
  function refundUsers(
    address[] memory accounts,
    bytes32[][] calldata proofs
  ) external nonReentrant whenNotPaused validConfig onlyRole(DEFAULT_ADMIN_ROLE) {
    if (accounts.length != proofs.length) revert InvalidProofsLength();

    uint256 length = accounts.length;
    for (uint256 i; i != length; ++i) {
      _claimRefund(accounts[i], proofs[i]);
    }
  }

  /**
   * @dev Internal function for applying discounts.
   * The function returns the discounted final cost for the user, effectively increasing their rebate.
   * @param buyer Address of the user receiving the discount.
   * @param cost Total, non discounted cost for the user.
   * @param proof Merkle proof for the user's address and discount.
   * @return discountedCost Discounted cost for the user.
   */
  function _applyDiscount(
    address buyer,
    uint256 cost,
    bytes32[] calldata proof
  ) internal view returns (uint256) {
    require(discountMerkleRoot != bytes32(0), "Merkle root not set");

    uint256 discountedCost = cost;

    uint16[5] memory discountBps = [2500, 2250, 2000, 1500, 1000];

    for (uint256 i = 0; i < discountBps.length; i++) {
      bytes32 leaf = keccak256(abi.encodePacked(buyer, discountBps[i]));
      if (MerkleProof.verify(proof, discountMerkleRoot, leaf)) {
        uint256 discount = (cost * discountBps[i]) / 10000;
        discountedCost = cost - discount;
        break;
      }
    }

    return discountedCost;
  }

  /**
   * @dev Internal function for processing refunds.
   * The function calculates the refund as the user's total contribution minus the amount spent on bidding.
   * It then sends the refund (if any) to the user's account.
   * Note: If the function reverts with 'UserAlreadyClaimed', it means the user has already claimed their refund.
   * @param account Address of the user claiming the refund.
   */
  function _claimRefund(address account, bytes32[] calldata proof) internal {
    User storage user = _userData[account];
    if (user.refundClaimed) revert UserAlreadyClaimed();
    user.refundClaimed = true;
    uint256 refundInWei = user.contribution -
      _applyDiscount(account, (_settledPriceInWei * user.tokensBidded), proof);
    if (refundInWei > 0) {
      (bool success, ) = account.call{value: refundInWei}("");
      if (!success) revert TransferFailed();
      emit ClaimRefund(account, refundInWei);
    }
  }

  /**
   * @dev Internal function to mint a specified quantity of NFTs for a recipient.
   * This function mints 'qty' number of NFTs to the 'to' address.
   * @param to Recipient address.
   * @param qty Number of NFTs to mint.
   */
  function _mintTokens(address to, uint32 qty) internal {
    for (uint32 i; i != qty; ++i) {
      nftContractAddress.mint(to);
    }
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

        if (totalHashes > 0) {
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

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

        if (totalHashes > 0) {
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

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

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

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

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

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

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

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

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

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

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

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

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

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

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

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

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

interface IDelegateCash {
  function checkDelegateForContract(
    address hot,
    address cold,
    address contractAddress
  ) external view returns (bool);
}

File 15 of 16 : IDutchAuction.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/// @title Dutch Auction Interface
/// @dev Defines the methods and structures for the Dutch Auction contract.
interface IDutchAuction {
  /// Errors
  /// @dev Emitted when trying to interact with the contract before its config is set.
  error ConfigNotSet();

  /// @dev Emitted when trying to set the contract config when it's already been set.
  error ConfigAlreadySet();

  /// @dev Emitted when the amount of wei provided is invalid.
  error InvalidAmountInWei();

  /// @dev Emitted when the start or end time is invalid.
  error InvalidStartEndTime(uint64 startTime, uint64 endTime);

  /// @dev Emitted when the quantity provided is invalid.
  error InvalidQuantity();

  /// @dev Emitted when trying to interact with the contract before the auction has ended.
  error NotEnded();

  /// @dev Emitted when the value provided is not enough for the desired action.
  error NotEnoughValue();

  /// @dev Emitted when trying to request a refund when not eligible.
  error NotRefundable();

  /// @dev Emitted when trying to interact with the contract before the auction has started.
  error NotStarted();

  /// @dev Emitted when a transfer fails.
  error TransferFailed();

  /// @dev Emitted when a user tries to claim a refund that they've already claimed.
  error UserAlreadyClaimed();

  /// @dev Emitted when a bid has expired.
  error BidExpired(uint256 deadline);

  /// @dev Emitted when the provided signature is invalid.
  error InvalidSignature();

  /// @dev Emitted when the purchase limit is reached.
  error PurchaseLimitReached();

  /// @dev Emitted when trying to claim a refund before the refund time is ready.
  error ClaimRefundNotReady();

  /// @dev Emitted when there's nothing to claim.
  error NothingToClaim();

  /// @dev Emitted when funds have already been withdrawn.
  error AlreadyWithdrawn();

  /// @dev Emitted when the max supply is reached.
  error MaxSupplyReached();

  /// @dev Emitted when the proof length is invalid when claiming users refunds.
  error InvalidProofsLength();

  /// @dev Represents a user in the auction

  struct User {
    /// @notice The total amount of ETH contributed by the user.
    uint216 contribution;
    /// @notice The total number of tokens bidded by the user.
    uint32 tokensBidded;
    /// @notice A flag indicating if the user has claimed a refund.
    bool refundClaimed;
  }

  /// @dev Represents the auction configuration
  struct Config {
    /// @notice The initial amount per token in wei when the auction starts.
    uint256 startAmountInWei;
    /// @notice The final amount per token in wei when the auction ends.
    uint256 endAmountInWei;
    /// @notice The maximum contribution allowed per user in wei.
    uint216 limitInWei;
    /// @notice The delay time for a refund to be available.
    uint32 refundDelayTime;
    /// @notice The start time of the auction.
    uint64 startTime;
    /// @notice The end time of the auction.
    uint64 endTime;
  }
  /// @dev Emitted when a user claims a refund.
  /// @param user The address of the user claiming the refund.
  /// @param refundInWei The amount of the refund in Wei.
  event ClaimRefund(address user, uint256 refundInWei);

  /// @dev Emitted when a user places a bid.
  /// @param user The address of the user placing the bid.
  /// @param qty The quantity of tokens the user is bidding for.
  /// @param price The total price of the bid in Wei.
  event Bid(address user, uint32 qty, uint256 price);

  /// @dev Emitted when a user claims their tokens after the auction.
  /// @param user The address of the user claiming the tokens.
  /// @param qty The quantity of tokens claimed.
  event Claim(address user, uint32 qty);
}

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

interface INFT {
  function maxSupply() external view returns (uint16);

  function totalSupply() external view returns (uint256);

  function mint(address to) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 500,
    "details": {
      "yul": true,
      "yulDetails": {
        "stackAllocation": true,
        "optimizerSteps": "dhfoDgvulfnTUtnIf"
      }
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"address","name":"_signerAddress","type":"address"},{"internalType":"address","name":"_treasuryAddress","type":"address"},{"internalType":"bytes32","name":"_discountMerkleRoot","type":"bytes32"},{"internalType":"address","name":"_delegateCash","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyWithdrawn","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"BidExpired","type":"error"},{"inputs":[],"name":"ClaimRefundNotReady","type":"error"},{"inputs":[],"name":"ConfigAlreadySet","type":"error"},{"inputs":[],"name":"ConfigNotSet","type":"error"},{"inputs":[],"name":"InvalidAmountInWei","type":"error"},{"inputs":[],"name":"InvalidProofsLength","type":"error"},{"inputs":[],"name":"InvalidQuantity","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"}],"name":"InvalidStartEndTime","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"NotEnded","type":"error"},{"inputs":[],"name":"NotEnoughValue","type":"error"},{"inputs":[],"name":"NotRefundable","type":"error"},{"inputs":[],"name":"NotStarted","type":"error"},{"inputs":[],"name":"NothingToClaim","type":"error"},{"inputs":[],"name":"PurchaseLimitReached","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UserAlreadyClaimed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint32","name":"qty","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Bid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint32","name":"qty","type":"uint32"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"refundInWei","type":"uint256"}],"name":"ClaimRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"vaultAddress","type":"address"}],"name":"bid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"vaultAddress","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claimRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"amount","type":"uint32"},{"internalType":"address","name":"vaultAddress","type":"address"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegateCash","outputs":[{"internalType":"contract IDelegateCash","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712DomainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getClaimableTokens","outputs":[{"internalType":"uint32","name":"claimable","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"internalType":"uint256","name":"startAmountInWei","type":"uint256"},{"internalType":"uint256","name":"endAmountInWei","type":"uint256"},{"internalType":"uint216","name":"limitInWei","type":"uint216"},{"internalType":"uint32","name":"refundDelayTime","type":"uint32"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"}],"internalType":"struct IDutchAuction.Config","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPriceInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSettledPriceInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserData","outputs":[{"components":[{"internalType":"uint216","name":"contribution","type":"uint216"},{"internalType":"uint32","name":"tokensBidded","type":"uint32"},{"internalType":"bool","name":"refundClaimed","type":"bool"}],"internalType":"struct IDutchAuction.User","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftContractAddress","outputs":[{"internalType":"contract INFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"bytes32[][]","name":"proofs","type":"bytes32[][]"}],"name":"refundUsers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startAmountInWei","type":"uint256"},{"internalType":"uint256","name":"endAmountInWei","type":"uint256"},{"internalType":"uint216","name":"limitInWei","type":"uint216"},{"internalType":"uint32","name":"refundDelayTime","type":"uint32"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"setDiscountMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setNftContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasuryAddress","type":"address"}],"name":"setTreasuryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b506040516200352938038062003529833981016040819052620000349162000297565b6001805460ff19168155600255600380546001600160a01b038088166001600160a01b0319928316179092556004805487841690831617905560058054868416908316179055600e849055600f8054928416929091169190911790556200009d60003362000187565b604080518082018252601e81527f46696e6765727072696e74732044414f2044757463682041756374696f6e00006020918201528151808301835260018152603160f81b90820152905146916200015f917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f917f61dbc1394fbea737270d3630c8c6bb5e5f2e96104eb5a57770a5904f9f0a770f917fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69186913091016200032e565b60408051601f1981840301815291905280516020909101206080525062000384945050505050565b62000193828262000197565b5050565b620001a382826200021f565b62000193576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001db3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff165b92915050565b60006001600160a01b03821662000244565b62000267816200024a565b81146200027357600080fd5b50565b805162000244816200025c565b8062000267565b8051620002448162000283565b600080600080600060a08688031215620002b457620002b4600080fd5b6000620002c2888862000276565b9550506020620002d58882890162000276565b9450506040620002e88882890162000276565b9350506060620002fb888289016200028a565b92505060806200030e8882890162000276565b9150509295509295909350565b805b82525050565b6200031d816200024a565b60a081016200033e82886200031b565b6200034d60208301876200031b565b6200035c60408301866200031b565b6200036b60608301856200031b565b6200037a608083018462000323565b9695505050505050565b608051613182620003a7600039600081816106810152610d9d01526131826000f3fe6080604052600436106101e35760003560e01c80636605bfda11610102578063b8699c0011610095578063d547741f11610064578063d547741f1461062f578063da31d6401461064f578063f94dc4bc1461066f578063ffc9896b146106a357600080fd5b8063b8699c001461051d578063c38a0e3a1461053d578063c3f909d41461055d578063c5f956af1461060f57600080fd5b806394856295116100d157806394856295146104a6578063a217fddf146104d3578063a5e1803a146104e8578063aae282e1146104fd57600080fd5b80636605bfda1461040d5780636912ab681461042d5780638456cb591461044d57806391d148541461046257600080fd5b80632f2ff15d1161017a5780633f4ba83a116101495780633f4ba83a1461039d57806340d34133146103b25780635b7633d0146103c85780635c975abb146103f557600080fd5b80632f2ff15d146103355780633140d4d01461035557806336568abe1461036a57806339ba19df1461038a57600080fd5b80631b831ead116101b65780631b831ead1461028057806324600fc3146102ad578063248a9ca3146102c25780632d0335ab146102ff57600080fd5b806301ffc9a7146101e8578063046dc1661461021e57806312090b92146102405780631abae68614610260575b600080fd5b3480156101f457600080fd5b506102086102033660046122ee565b61073a565b6040516102159190612319565b60405180910390f35b34801561022a57600080fd5b5061023e61023936600461234c565b610771565b005b34801561024c57600080fd5b5061023e61025b3660046124ba565b6107ce565b34801561026c57600080fd5b5061023e61027b36600461253f565b6108aa565b34801561028c57600080fd5b506102a061029b36600461234c565b6108bb565b604051610215919061256c565b3480156102b957600080fd5b5061023e610a29565b3480156102ce57600080fd5b506102f26102dd36600461253f565b60009081526020819052604090206001015490565b6040516102159190612580565b34801561030b57600080fd5b506102f261031a36600461234c565b6001600160a01b03166000908152600d602052604090205490565b34801561034157600080fd5b5061023e61035036600461258e565b610af1565b34801561036157600080fd5b506006546102f2565b34801561037657600080fd5b5061023e61038536600461258e565b610b16565b61023e610398366004612671565b610b4c565b3480156103a957600080fd5b5061023e61118f565b3480156103be57600080fd5b506102f2600e5481565b3480156103d457600080fd5b506004546103e8906001600160a01b031681565b60405161021591906126f8565b34801561040157600080fd5b5060015460ff16610208565b34801561041957600080fd5b5061023e61042836600461234c565b6111a5565b34801561043957600080fd5b5061023e61044836600461273a565b6111f9565b34801561045957600080fd5b5061023e6113a8565b34801561046e57600080fd5b5061020861047d36600461258e565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156104b257600080fd5b50600f546104c6906001600160a01b031681565b60405161021591906127e3565b3480156104df57600080fd5b506102f2600081565b3480156104f457600080fd5b506102f26113bb565b34801561050957600080fd5b506003546104c6906001600160a01b031681565b34801561052957600080fd5b5061023e6105383660046127f1565b6114a7565b34801561054957600080fd5b5061023e610558366004612815565b61159a565b34801561056957600080fd5b506106026040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a082015290565b60405161021591906128c0565b34801561061b57600080fd5b506005546103e8906001600160a01b031681565b34801561063b57600080fd5b5061023e61064a36600461258e565b61187c565b34801561065b57600080fd5b5061023e61066a36600461234c565b6118a1565b34801561067b57600080fd5b506102f27f000000000000000000000000000000000000000000000000000000000000000081565b3480156106af57600080fd5b5061072d6106be36600461234c565b6040805160608082018352600080835260208084018290529284018190526001600160a01b03949094168452600c82529282902082519384018352546001600160d81b0381168452600160d81b810463ffffffff1691840191909152600160f81b900460ff1615159082015290565b6040516102159190612900565b60006001600160e01b03198216637965db0b60e01b148061076b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061077c816118f5565b6001600160a01b0382166107ab5760405162461bcd60e51b81526004016107a290612954565b60405180910390fd5b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b6107d66118ff565b6107de611926565b600a546001600160401b031660000361080a57604051632b38492f60e21b815260040160405180910390fd5b6000610815816118f5565b835182146108365760405163cabe24fb60e01b815260040160405180910390fd5b835160005b8181146108985761088886828151811061085757610857612964565b602002602001015186868481811061087157610871612964565b9050602002810190610883919061297a565b611949565b610891816129e2565b905061083b565b5050506108a56001600255565b505050565b60006108b5816118f5565b50600e55565b6001600160a01b0381166000908152600c60205260408120816108dc6113bb565b825490915063ffffffff600160d81b820416906109039083906001600160d81b0316612a11565b61090d9190612a25565b92506000600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190612a50565b600360009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ff9190612a86565b610a099190612aa7565b61ffff16905063ffffffff8416811015610a21578093505b505050919050565b610a316118ff565b6000610a3c816118f5565b600a5442600160401b9091046001600160401b031610610a6f57604051631a6031a360e31b815260040160405180910390fd5b6005546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610abc576040519150601f19603f3d011682016040523d82523d6000602084013e610ac1565b606091505b5050905080610ae3576040516312171d8360e31b815260040160405180910390fd5b5050610aef6001600255565b565b600082815260208190526040902060010154610b0c816118f5565b6108a58383611a9f565b6001600160a01b0381163314610b3e5760405162461bcd60e51b81526004016107a290612b1d565b610b488282611b3d565b5050565b610b546118ff565b610b5c611926565b600a546001600160401b0316600003610b8857604051632b38492f60e21b815260040160405180910390fd5b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a08201819052421180610c02575080608001516001600160401b031642105b15610c2c5780608001518160a00151604051631cc766af60e31b81526004016107a2929190612b2d565b336001600160a01b03831615801590610c4e57506001600160a01b0383163314155b15610cf357600f5460035460405163090c9a2d60e41b81526000926001600160a01b03908116926390c9a2d092610c8e9233928a92911690600401612b48565b602060405180830381865afa158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf9190612b83565b905080610cee5760405162461bcd60e51b81526004016107a290612bd8565b839150505b84421115610d165784604051633929997b60e21b81526004016107a29190612580565b60018663ffffffff161015610d3e5760405163524f409b60e01b815260040160405180910390fd5b60007fbde5b049b9c34cfddf80ff8a2bd0ae7b3ae1a700018308b5da09c1d08a52640b8288610d6c85611bbc565b89604051602001610d81959493929190612be8565b60405160208183030381529060405280519060200120905060007f000000000000000000000000000000000000000000000000000000000000000082604051602001610dce929190612c34565b6040516020818303038152906040528051906020012090506000610df28288611be9565b6004549091506001600160a01b03808316911614610e2357604051638baa579f60e01b815260040160405180910390fd5b600354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610e6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e919190612a50565b600360009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f089190612a86565b610f129190612aa7565b61ffff16905063ffffffff8a16811015610f3f5760405163d05cb60960e01b815260040160405180910390fd5b6000610f496113bb565b90506000610f5d8263ffffffff8e16612c56565b905080341015610f8057604051630717c22560e51b815260040160405180910390fd5b6001600160a01b0387166000908152600c602052604090208054610fae9083906001600160d81b0316612c6d565b81547fffffffffff000000000000000000000000000000000000000000000000000000166001600160d81b039190911617808255610ffa908e90600160d81b900463ffffffff16612c90565b815463ffffffff91909116600160d81b0263ffffffff60d81b198216811783556009546001600160d81b0390811691811692169190911711156110505760405163177b678560e21b815260040160405180910390fd5b600b80548e919060009061106b90849063ffffffff16612c90565b92506101000a81548163ffffffff021916908363ffffffff1602179055506006548310806110995750600654155b156110a45760068390555b813411156111315760006110b88334612cb0565b90506000896001600160a01b03168260405160006040518083038185875af1925050503d8060008114611107576040519150601f19603f3d011682016040523d82523d6000602084013e61110c565b606091505b505090508061112e576040516312171d8360e31b815260040160405180910390fd5b50505b61113b888e611c0d565b7f43a38e744536f08873c3f07e3c07fd5ec7024950b6c0bf43d9c0af85330b958c888e8560405161116e93929190612cc3565b60405180910390a15050505050505050506111896001600255565b50505050565b600061119a816118f5565b6111a2611c96565b50565b60006111b0816118f5565b6001600160a01b0382166111d65760405162461bcd60e51b81526004016107a290612954565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000611204816118f5565b600a546001600160401b03161580159061122b5750600a54426001600160401b0390911611155b156112495760405163c7c5196560e01b815260040160405180910390fd5b6001600160401b03831615806112715750816001600160401b0316836001600160401b031610155b15611293578282604051631cc766af60e31b81526004016107a2929190612b2d565b8615806112a05750858711155b156112be57604051633ba6548960e21b815260040160405180910390fd5b846001600160d81b03166000036112e857604051633ba6548960e21b815260040160405180910390fd5b506040805160c081018252878152602081018790526001600160d81b039590951690850181905263ffffffff93909316606085018190526001600160401b03928316608086018190529190921660a0909401849052600795909555600893909355600980547fff0000000000000000000000000000000000000000000000000000000000000016909117600160d81b90930292909217909155600a80546fffffffffffffffffffffffffffffffff1916909217600160401b909102179055565b60006113b3816118f5565b6111a2611ce2565b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b0380821660808401819052600160401b9092041660a083015260009190421161142c5751919050565b8060a001516001600160401b031642106114495760200151919050565b608081015160a08201516020830151908290036001600160401b03908116921642039081830390839061147d908490612c56565b855161148a908490612c56565b6114949190612ceb565b61149e9190612a11565b94505050505090565b6114af6118ff565b6114b7611926565b600a546001600160401b03166000036114e357604051632b38492f60e21b815260040160405180910390fd5b60006114ee816118f5565b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff1660608201819052600a546001600160401b038082166080850152600160401b9091041660a08301819052429161155c91612cfe565b6001600160401b03161061158357604051637ad7415760e01b815260040160405180910390fd5b61158e858585611949565b50506108a56001600255565b6115a26118ff565b6115aa611926565b600a546001600160401b03166000036115d657604051632b38492f60e21b815260040160405180910390fd5b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a08201819052421180611650575080608001516001600160401b031642105b1561167a5780608001518160a00151604051631cc766af60e31b81526004016107a2929190612b2d565b336001600160a01b0383161580159061169c57506001600160a01b0383163314155b1561174157600f5460035460405163090c9a2d60e41b81526000926001600160a01b03908116926390c9a2d0926116dc9233928a92911690600401612b48565b602060405180830381865afa1580156116f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171d9190612b83565b90508061173c5760405162461bcd60e51b81526004016107a290612bd8565b839150505b6001600160a01b0381166000908152600c60205260408120906117626113bb565b9050600061176f846108bb565b90508063ffffffff168763ffffffff161115611789578096505b8663ffffffff166000036117b0576040516312d37ee560e31b815260040160405180910390fd5b82546117ca908890600160d81b900463ffffffff16612c90565b835463ffffffff60d81b1916600160d81b63ffffffff92831602178455600b805489926000916117fc91859116612c90565b92506101000a81548163ffffffff021916908363ffffffff16021790555060065482101561182a5760068290555b6118348488611c0d565b7f3277c6a632144167148bd5eb3d53bad7d8e63fb07e362ae5edd17ed755fbe68c8488604051611865929190612d21565b60405180910390a15050505050610b486001600255565b600082815260208190526040902060010154611897816118f5565b6108a58383611b3d565b60006118ac816118f5565b6001600160a01b0382166118d25760405162461bcd60e51b81526004016107a290612954565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b6111a28133611d1d565b60028054036119205760405162461bcd60e51b81526004016107a290612d6e565b60028055565b60015460ff1615610aef5760405162461bcd60e51b81526004016107a290612db0565b6001600160a01b0383166000908152600c602052604090208054600160f81b900460ff161561198b57604051638246991960e01b815260040160405180910390fd5b8054600160f81b6001600160f81b03909116178082556006546000916119cc9187916119c591600160d81b90910463ffffffff1690612c56565b8686611d90565b82546119e191906001600160d81b0316612cb0565b90508015611a98576000856001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a36576040519150601f19603f3d011682016040523d82523d6000602084013e611a3b565b606091505b5050905080611a5d576040516312171d8360e31b815260040160405180910390fd5b7f8f42ffc9d9a2a561d3428041520b29bd3ef146b26d709b2243575defc10bd0478683604051611a8e929190612dc0565b60405180910390a1505b5050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610b48576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611af93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610b48576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0381166000908152600d60205260408120805491611be0836129e2565b90915550919050565b6000806000611bf88585611ee4565b91509150611c0581611f29565b509392505050565b60005b8163ffffffff168163ffffffff16146108a5576003546040516335313c2160e11b81526001600160a01b0390911690636a62784290611c539086906004016126f8565b600060405180830381600087803b158015611c6d57600080fd5b505af1158015611c81573d6000803e3d6000fd5b5050505080611c8f90612ddb565b9050611c10565b611c9e611fd8565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051611cd891906126f8565b60405180910390a1565b611cea611926565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611ccb565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610b4857611d4e81611ffa565b611d5983602061200c565b604051602001611d6a929190612e3d565b60408051601f198184030181529082905262461bcd60e51b82526107a291600401612ed1565b600e54600090611db25760405162461bcd60e51b81526004016107a290612f14565b6040805160a0810182526109c481526108ca60208201526107d0918101919091526105dc60608201526103e86080820152849060005b6005811015611ed657600088838360058110611e0657611e06612964565b6020020151604051602001611e1c929190612f65565b604051602081830303815290604052805190602001209050611e7587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e54915084905061218b565b15611ec3576000612710848460058110611e9157611e91612964565b6020020151611ea49061ffff168b612c56565b611eae9190612a11565b9050611eba818a612cb0565b94505050611ed6565b5080611ece816129e2565b915050611de8565b50909150505b949350505050565b6000808251604103611f1a5760208301516040840151606085015160001a611f0e878285856121a1565b94509450505050611f22565b506000905060025b9250929050565b6000816004811115611f3d57611f3d612f85565b03611f455750565b6001816004811115611f5957611f59612f85565b03611f765760405162461bcd60e51b81526004016107a290612fcd565b6002816004811115611f8a57611f8a612f85565b03611fa75760405162461bcd60e51b81526004016107a29061300f565b6003816004811115611fbb57611fbb612f85565b036111a25760405162461bcd60e51b81526004016107a29061305c565b60015460ff16610aef5760405162461bcd60e51b81526004016107a29061309e565b606061076b6001600160a01b03831660145b6060600061201b836002612c56565b612026906002612ceb565b6001600160401b0381111561203d5761203d61236d565b6040519080825280601f01601f191660200182016040528015612067576020820181803683370190505b509050600360fc1b8160008151811061208257612082612964565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106120b1576120b1612964565b60200101906001600160f81b031916908160001a90535060006120d5846002612c56565b6120e0906001612ceb565b90505b6001811115612165577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061212157612121612964565b1a60f81b82828151811061213757612137612964565b60200101906001600160f81b031916908160001a90535060049490941c9361215e816130ae565b90506120e3565b5083156121845760405162461bcd60e51b81526004016107a2906130f5565b9392505050565b6000826121988584612258565b14949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156121d8575060009050600361224f565b6000600187878787604051600081526020016040526040516121fd949392919061310e565b6020604051602081039080840390855afa15801561221f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166122485760006001925092505061224f565b9150600090505b94509492505050565b600081815b8451811015611c05576122898286838151811061227c5761227c612964565b602002602001015161229d565b915080612295816129e2565b91505061225d565b60008183106122b9576000828152602084905260409020612184565b6000838152602083905260409020612184565b6001600160e01b031981165b81146111a257600080fd5b803561076b816122cc565b60006020828403121561230357612303600080fd5b6000611edc84846122e3565b8015155b82525050565b6020810161076b828461230f565b60006001600160a01b03821661076b565b6122d881612327565b803561076b81612338565b60006020828403121561236157612361600080fd5b6000611edc8484612341565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156123a8576123a861236d565b6040525050565b60006123ba60405190565b90506123c68282612383565b919050565b60006001600160401b038211156123e4576123e461236d565b5060209081020190565b60006124016123fc846123cb565b6123af565b8381529050602080820190840283018581111561242057612420600080fd5b835b81811015612442576124348782612341565b835260209283019201612422565b5050509392505050565b600082601f83011261246057612460600080fd5b8135611edc8482602086016123ee565b60008083601f84011261248557612485600080fd5b5081356001600160401b0381111561249f5761249f600080fd5b602083019150836020820283011115611f2257611f22600080fd5b6000806000604084860312156124d2576124d2600080fd5b83356001600160401b038111156124eb576124eb600080fd5b6124f78682870161244c565b93505060208401356001600160401b0381111561251657612516600080fd5b61252286828701612470565b92509250509250925092565b806122d8565b803561076b8161252e565b60006020828403121561255457612554600080fd5b6000611edc8484612534565b63ffffffff8116612313565b6020810161076b8284612560565b80612313565b6020810161076b828461257a565b600080604083850312156125a4576125a4600080fd5b60006125b08585612534565b92505060206125c185828601612341565b9150509250929050565b63ffffffff81166122d8565b803561076b816125cb565b60006001600160401b038211156125fb576125fb61236d565b601f19601f8301165b60200192915050565b82818337506000910152565b60006126276123fc846125e2565b90508281526020810184848401111561264257612642600080fd5b611c0584828561260d565b600082601f83011261266157612661600080fd5b8135611edc848260208601612619565b6000806000806080858703121561268a5761268a600080fd5b600061269687876125d7565b94505060206126a787828801612534565b93505060408501356001600160401b038111156126c6576126c6600080fd5b6126d28782880161264d565b92505060606126e387828801612341565b91505092959194509250565b61231381612327565b6020810161076b82846126ef565b6001600160d81b0381166122d8565b803561076b81612706565b6001600160401b0381166122d8565b803561076b81612720565b60008060008060008060c0878903121561275657612756600080fd5b60006127628989612534565b965050602061277389828a01612534565b955050604061278489828a01612715565b945050606061279589828a016125d7565b93505060806127a689828a0161272f565b92505060a06127b789828a0161272f565b9150509295509295509295565b600061076b82612327565b600061076b826127c4565b612313816127cf565b6020810161076b82846127da565b60008060006040848603121561280957612809600080fd5b60006124f78686612341565b6000806040838503121561282b5761282b600080fd5b60006125b085856125d7565b6001600160d81b038116612313565b6001600160401b038116612313565b8051612861838261257a565b506020810151612874602084018261257a565b5060408101516128876040840182612837565b50606081015161289a6060840182612560565b5060808101516128ad6080840182612846565b5060a08101516108a560a0840182612846565b60c0810161076b8284612855565b80516128da8382612837565b5060208101516128ed6020840182612560565b5060408101516108a5604084018261230f565b6060810161076b82846128ce565b60298152602081017f496e76616c696420616464726573733a207a65726f2061646472657373206e6f8152681d08185b1b1bddd95960ba1b602082015290505b60400190565b6020808252810161076b8161290e565b634e487b7160e01b600052603260045260246000fd5b6000808335601e193685900301811261299557612995600080fd5b830191505080356001600160401b038111156129b3576129b3600080fd5b60209182019181023603821315611f2257611f22600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016129f4576129f46129cc565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082612a2057612a206129fb565b500490565b63ffffffff91821691908116908282039081111561076b5761076b6129cc565b805161076b8161252e565b600060208284031215612a6557612a65600080fd5b6000611edc8484612a45565b61ffff81166122d8565b805161076b81612a71565b600060208284031215612a9b57612a9b600080fd5b6000611edc8484612a7b565b61ffff91821691908116908282039081111561076b5761076b6129cc565b602f8152602081017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581527f20726f6c657320666f722073656c6600000000000000000000000000000000006020820152905061294e565b6020808252810161076b81612ac5565b60408101612b3b8285612846565b6121846020830184612846565b60608101612b5682866126ef565b612b6360208301856126ef565b611edc60408301846126ef565b8015156122d8565b805161076b81612b70565b600060208284031215612b9857612b98600080fd5b6000611edc8484612b78565b601e8152602081017f696e76616c69642064656c65676174652d7661756c742070616972696e670000815290505b60200190565b6020808252810161076b81612ba4565b60a08101612bf6828861257a565b612c0360208301876126ef565b612c106040830186612560565b612c1d606083018561257a565b612c2a608083018461257a565b9695505050505050565b61190160f01b8152600201612c49818461257a565b602001612604818361257a565b818102811582820484141761076b5761076b6129cc565b6001600160d81b0391821691908116908282019081111561076b5761076b6129cc565b63ffffffff91821691908116908282019081111561076b5761076b6129cc565b8181038181111561076b5761076b6129cc565b60608101612cd182866126ef565b612cde6020830185612560565b611edc604083018461257a565b8082018082111561076b5761076b6129cc565b6001600160401b0391821691908116908282019081111561076b5761076b6129cc565b60408101612d2f82856126ef565b6121846020830184612560565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050612bd2565b6020808252810161076b81612d3c565b60108152602081017f5061757361626c653a207061757365640000000000000000000000000000000081529050612bd2565b6020808252810161076b81612d7e565b60408101612dce82856126ef565b612184602083018461257a565b63ffffffff16600063fffffffe1982016129f4576129f46129cc565b60005b83811015612e12578181015183820152602001612dfa565b50506000910152565b6000612e25825190565b612e33818560208601612df7565b9290920192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152601701612e6d8184612e1b565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000815260110190506121848183612e1b565b6000612ea9825190565b808452602084019350612ec0818560208601612df7565b601f01601f19169290920192915050565b602080825281016121848184612e9f565b60138152602081017f4d65726b6c6520726f6f74206e6f74207365740000000000000000000000000081529050612bd2565b6020808252810161076b81612ee2565b600061076b8260601b90565b600061076b82612f24565b612313612f4782612327565b612f30565b600061076b8260f01b90565b61231361ffff8216612f4c565b612f6f8184612f3b565b601401612f7c8183612f58565b60020192915050565b634e487b7160e01b600052602160045260246000fd5b60188152602081017f45434453413a20696e76616c6964207369676e6174757265000000000000000081529050612bd2565b6020808252810161076b81612f9b565b601f8152602081017f45434453413a20696e76616c6964207369676e6174757265206c656e6774680081529050612bd2565b6020808252810161076b81612fdd565b60228152602081017f45434453413a20696e76616c6964207369676e6174757265202773272076616c815261756560f01b6020820152905061294e565b6020808252810161076b8161301f565b60148152602081017f5061757361626c653a206e6f742070617573656400000000000000000000000081529050612bd2565b6020808252810161076b8161306c565b6000816130bd576130bd6129cc565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e749101908152612bd2565b6020808252810161076b816130c5565b60ff8116612313565b6080810161311c828761257a565b6131296020830186613105565b613136604083018561257a565b613143606083018461257a565b9594505050505056fea2646970667358221220e57bc839740a1b41569c0e8fe8474e88bc3d4ced702f712c178a5741b1454e1664736f6c63430008110033000000000000000000000000ccbe56ea12b845a281431290f202196864f2f576000000000000000000000000589b6c421c55260fc5e4117bd893f57ed7bd44cd00000000000000000000000065c7432e6662a96f4e999603991d5e929e57f60a732341b607560d8adc12ae69978a611e52d84bc60deb98e3b0fde01f5519906f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b

Deployed Bytecode

0x6080604052600436106101e35760003560e01c80636605bfda11610102578063b8699c0011610095578063d547741f11610064578063d547741f1461062f578063da31d6401461064f578063f94dc4bc1461066f578063ffc9896b146106a357600080fd5b8063b8699c001461051d578063c38a0e3a1461053d578063c3f909d41461055d578063c5f956af1461060f57600080fd5b806394856295116100d157806394856295146104a6578063a217fddf146104d3578063a5e1803a146104e8578063aae282e1146104fd57600080fd5b80636605bfda1461040d5780636912ab681461042d5780638456cb591461044d57806391d148541461046257600080fd5b80632f2ff15d1161017a5780633f4ba83a116101495780633f4ba83a1461039d57806340d34133146103b25780635b7633d0146103c85780635c975abb146103f557600080fd5b80632f2ff15d146103355780633140d4d01461035557806336568abe1461036a57806339ba19df1461038a57600080fd5b80631b831ead116101b65780631b831ead1461028057806324600fc3146102ad578063248a9ca3146102c25780632d0335ab146102ff57600080fd5b806301ffc9a7146101e8578063046dc1661461021e57806312090b92146102405780631abae68614610260575b600080fd5b3480156101f457600080fd5b506102086102033660046122ee565b61073a565b6040516102159190612319565b60405180910390f35b34801561022a57600080fd5b5061023e61023936600461234c565b610771565b005b34801561024c57600080fd5b5061023e61025b3660046124ba565b6107ce565b34801561026c57600080fd5b5061023e61027b36600461253f565b6108aa565b34801561028c57600080fd5b506102a061029b36600461234c565b6108bb565b604051610215919061256c565b3480156102b957600080fd5b5061023e610a29565b3480156102ce57600080fd5b506102f26102dd36600461253f565b60009081526020819052604090206001015490565b6040516102159190612580565b34801561030b57600080fd5b506102f261031a36600461234c565b6001600160a01b03166000908152600d602052604090205490565b34801561034157600080fd5b5061023e61035036600461258e565b610af1565b34801561036157600080fd5b506006546102f2565b34801561037657600080fd5b5061023e61038536600461258e565b610b16565b61023e610398366004612671565b610b4c565b3480156103a957600080fd5b5061023e61118f565b3480156103be57600080fd5b506102f2600e5481565b3480156103d457600080fd5b506004546103e8906001600160a01b031681565b60405161021591906126f8565b34801561040157600080fd5b5060015460ff16610208565b34801561041957600080fd5b5061023e61042836600461234c565b6111a5565b34801561043957600080fd5b5061023e61044836600461273a565b6111f9565b34801561045957600080fd5b5061023e6113a8565b34801561046e57600080fd5b5061020861047d36600461258e565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156104b257600080fd5b50600f546104c6906001600160a01b031681565b60405161021591906127e3565b3480156104df57600080fd5b506102f2600081565b3480156104f457600080fd5b506102f26113bb565b34801561050957600080fd5b506003546104c6906001600160a01b031681565b34801561052957600080fd5b5061023e6105383660046127f1565b6114a7565b34801561054957600080fd5b5061023e610558366004612815565b61159a565b34801561056957600080fd5b506106026040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a082015290565b60405161021591906128c0565b34801561061b57600080fd5b506005546103e8906001600160a01b031681565b34801561063b57600080fd5b5061023e61064a36600461258e565b61187c565b34801561065b57600080fd5b5061023e61066a36600461234c565b6118a1565b34801561067b57600080fd5b506102f27fee07bbfa5a567f031dde94a400ea92f008f9d2f42130677b734bcf4ce7188a4a81565b3480156106af57600080fd5b5061072d6106be36600461234c565b6040805160608082018352600080835260208084018290529284018190526001600160a01b03949094168452600c82529282902082519384018352546001600160d81b0381168452600160d81b810463ffffffff1691840191909152600160f81b900460ff1615159082015290565b6040516102159190612900565b60006001600160e01b03198216637965db0b60e01b148061076b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061077c816118f5565b6001600160a01b0382166107ab5760405162461bcd60e51b81526004016107a290612954565b60405180910390fd5b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b6107d66118ff565b6107de611926565b600a546001600160401b031660000361080a57604051632b38492f60e21b815260040160405180910390fd5b6000610815816118f5565b835182146108365760405163cabe24fb60e01b815260040160405180910390fd5b835160005b8181146108985761088886828151811061085757610857612964565b602002602001015186868481811061087157610871612964565b9050602002810190610883919061297a565b611949565b610891816129e2565b905061083b565b5050506108a56001600255565b505050565b60006108b5816118f5565b50600e55565b6001600160a01b0381166000908152600c60205260408120816108dc6113bb565b825490915063ffffffff600160d81b820416906109039083906001600160d81b0316612a11565b61090d9190612a25565b92506000600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190612a50565b600360009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ff9190612a86565b610a099190612aa7565b61ffff16905063ffffffff8416811015610a21578093505b505050919050565b610a316118ff565b6000610a3c816118f5565b600a5442600160401b9091046001600160401b031610610a6f57604051631a6031a360e31b815260040160405180910390fd5b6005546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610abc576040519150601f19603f3d011682016040523d82523d6000602084013e610ac1565b606091505b5050905080610ae3576040516312171d8360e31b815260040160405180910390fd5b5050610aef6001600255565b565b600082815260208190526040902060010154610b0c816118f5565b6108a58383611a9f565b6001600160a01b0381163314610b3e5760405162461bcd60e51b81526004016107a290612b1d565b610b488282611b3d565b5050565b610b546118ff565b610b5c611926565b600a546001600160401b0316600003610b8857604051632b38492f60e21b815260040160405180910390fd5b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a08201819052421180610c02575080608001516001600160401b031642105b15610c2c5780608001518160a00151604051631cc766af60e31b81526004016107a2929190612b2d565b336001600160a01b03831615801590610c4e57506001600160a01b0383163314155b15610cf357600f5460035460405163090c9a2d60e41b81526000926001600160a01b03908116926390c9a2d092610c8e9233928a92911690600401612b48565b602060405180830381865afa158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf9190612b83565b905080610cee5760405162461bcd60e51b81526004016107a290612bd8565b839150505b84421115610d165784604051633929997b60e21b81526004016107a29190612580565b60018663ffffffff161015610d3e5760405163524f409b60e01b815260040160405180910390fd5b60007fbde5b049b9c34cfddf80ff8a2bd0ae7b3ae1a700018308b5da09c1d08a52640b8288610d6c85611bbc565b89604051602001610d81959493929190612be8565b60405160208183030381529060405280519060200120905060007fee07bbfa5a567f031dde94a400ea92f008f9d2f42130677b734bcf4ce7188a4a82604051602001610dce929190612c34565b6040516020818303038152906040528051906020012090506000610df28288611be9565b6004549091506001600160a01b03808316911614610e2357604051638baa579f60e01b815260040160405180910390fd5b600354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610e6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e919190612a50565b600360009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f089190612a86565b610f129190612aa7565b61ffff16905063ffffffff8a16811015610f3f5760405163d05cb60960e01b815260040160405180910390fd5b6000610f496113bb565b90506000610f5d8263ffffffff8e16612c56565b905080341015610f8057604051630717c22560e51b815260040160405180910390fd5b6001600160a01b0387166000908152600c602052604090208054610fae9083906001600160d81b0316612c6d565b81547fffffffffff000000000000000000000000000000000000000000000000000000166001600160d81b039190911617808255610ffa908e90600160d81b900463ffffffff16612c90565b815463ffffffff91909116600160d81b0263ffffffff60d81b198216811783556009546001600160d81b0390811691811692169190911711156110505760405163177b678560e21b815260040160405180910390fd5b600b80548e919060009061106b90849063ffffffff16612c90565b92506101000a81548163ffffffff021916908363ffffffff1602179055506006548310806110995750600654155b156110a45760068390555b813411156111315760006110b88334612cb0565b90506000896001600160a01b03168260405160006040518083038185875af1925050503d8060008114611107576040519150601f19603f3d011682016040523d82523d6000602084013e61110c565b606091505b505090508061112e576040516312171d8360e31b815260040160405180910390fd5b50505b61113b888e611c0d565b7f43a38e744536f08873c3f07e3c07fd5ec7024950b6c0bf43d9c0af85330b958c888e8560405161116e93929190612cc3565b60405180910390a15050505050505050506111896001600255565b50505050565b600061119a816118f5565b6111a2611c96565b50565b60006111b0816118f5565b6001600160a01b0382166111d65760405162461bcd60e51b81526004016107a290612954565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000611204816118f5565b600a546001600160401b03161580159061122b5750600a54426001600160401b0390911611155b156112495760405163c7c5196560e01b815260040160405180910390fd5b6001600160401b03831615806112715750816001600160401b0316836001600160401b031610155b15611293578282604051631cc766af60e31b81526004016107a2929190612b2d565b8615806112a05750858711155b156112be57604051633ba6548960e21b815260040160405180910390fd5b846001600160d81b03166000036112e857604051633ba6548960e21b815260040160405180910390fd5b506040805160c081018252878152602081018790526001600160d81b039590951690850181905263ffffffff93909316606085018190526001600160401b03928316608086018190529190921660a0909401849052600795909555600893909355600980547fff0000000000000000000000000000000000000000000000000000000000000016909117600160d81b90930292909217909155600a80546fffffffffffffffffffffffffffffffff1916909217600160401b909102179055565b60006113b3816118f5565b6111a2611ce2565b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b0380821660808401819052600160401b9092041660a083015260009190421161142c5751919050565b8060a001516001600160401b031642106114495760200151919050565b608081015160a08201516020830151908290036001600160401b03908116921642039081830390839061147d908490612c56565b855161148a908490612c56565b6114949190612ceb565b61149e9190612a11565b94505050505090565b6114af6118ff565b6114b7611926565b600a546001600160401b03166000036114e357604051632b38492f60e21b815260040160405180910390fd5b60006114ee816118f5565b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff1660608201819052600a546001600160401b038082166080850152600160401b9091041660a08301819052429161155c91612cfe565b6001600160401b03161061158357604051637ad7415760e01b815260040160405180910390fd5b61158e858585611949565b50506108a56001600255565b6115a26118ff565b6115aa611926565b600a546001600160401b03166000036115d657604051632b38492f60e21b815260040160405180910390fd5b6040805160c081018252600754815260085460208201526009546001600160d81b03811692820192909252600160d81b90910463ffffffff166060820152600a546001600160401b038082166080840152600160401b9091041660a08201819052421180611650575080608001516001600160401b031642105b1561167a5780608001518160a00151604051631cc766af60e31b81526004016107a2929190612b2d565b336001600160a01b0383161580159061169c57506001600160a01b0383163314155b1561174157600f5460035460405163090c9a2d60e41b81526000926001600160a01b03908116926390c9a2d0926116dc9233928a92911690600401612b48565b602060405180830381865afa1580156116f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171d9190612b83565b90508061173c5760405162461bcd60e51b81526004016107a290612bd8565b839150505b6001600160a01b0381166000908152600c60205260408120906117626113bb565b9050600061176f846108bb565b90508063ffffffff168763ffffffff161115611789578096505b8663ffffffff166000036117b0576040516312d37ee560e31b815260040160405180910390fd5b82546117ca908890600160d81b900463ffffffff16612c90565b835463ffffffff60d81b1916600160d81b63ffffffff92831602178455600b805489926000916117fc91859116612c90565b92506101000a81548163ffffffff021916908363ffffffff16021790555060065482101561182a5760068290555b6118348488611c0d565b7f3277c6a632144167148bd5eb3d53bad7d8e63fb07e362ae5edd17ed755fbe68c8488604051611865929190612d21565b60405180910390a15050505050610b486001600255565b600082815260208190526040902060010154611897816118f5565b6108a58383611b3d565b60006118ac816118f5565b6001600160a01b0382166118d25760405162461bcd60e51b81526004016107a290612954565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b6111a28133611d1d565b60028054036119205760405162461bcd60e51b81526004016107a290612d6e565b60028055565b60015460ff1615610aef5760405162461bcd60e51b81526004016107a290612db0565b6001600160a01b0383166000908152600c602052604090208054600160f81b900460ff161561198b57604051638246991960e01b815260040160405180910390fd5b8054600160f81b6001600160f81b03909116178082556006546000916119cc9187916119c591600160d81b90910463ffffffff1690612c56565b8686611d90565b82546119e191906001600160d81b0316612cb0565b90508015611a98576000856001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a36576040519150601f19603f3d011682016040523d82523d6000602084013e611a3b565b606091505b5050905080611a5d576040516312171d8360e31b815260040160405180910390fd5b7f8f42ffc9d9a2a561d3428041520b29bd3ef146b26d709b2243575defc10bd0478683604051611a8e929190612dc0565b60405180910390a1505b5050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610b48576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611af93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610b48576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0381166000908152600d60205260408120805491611be0836129e2565b90915550919050565b6000806000611bf88585611ee4565b91509150611c0581611f29565b509392505050565b60005b8163ffffffff168163ffffffff16146108a5576003546040516335313c2160e11b81526001600160a01b0390911690636a62784290611c539086906004016126f8565b600060405180830381600087803b158015611c6d57600080fd5b505af1158015611c81573d6000803e3d6000fd5b5050505080611c8f90612ddb565b9050611c10565b611c9e611fd8565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051611cd891906126f8565b60405180910390a1565b611cea611926565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611ccb565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610b4857611d4e81611ffa565b611d5983602061200c565b604051602001611d6a929190612e3d565b60408051601f198184030181529082905262461bcd60e51b82526107a291600401612ed1565b600e54600090611db25760405162461bcd60e51b81526004016107a290612f14565b6040805160a0810182526109c481526108ca60208201526107d0918101919091526105dc60608201526103e86080820152849060005b6005811015611ed657600088838360058110611e0657611e06612964565b6020020151604051602001611e1c929190612f65565b604051602081830303815290604052805190602001209050611e7587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e54915084905061218b565b15611ec3576000612710848460058110611e9157611e91612964565b6020020151611ea49061ffff168b612c56565b611eae9190612a11565b9050611eba818a612cb0565b94505050611ed6565b5080611ece816129e2565b915050611de8565b50909150505b949350505050565b6000808251604103611f1a5760208301516040840151606085015160001a611f0e878285856121a1565b94509450505050611f22565b506000905060025b9250929050565b6000816004811115611f3d57611f3d612f85565b03611f455750565b6001816004811115611f5957611f59612f85565b03611f765760405162461bcd60e51b81526004016107a290612fcd565b6002816004811115611f8a57611f8a612f85565b03611fa75760405162461bcd60e51b81526004016107a29061300f565b6003816004811115611fbb57611fbb612f85565b036111a25760405162461bcd60e51b81526004016107a29061305c565b60015460ff16610aef5760405162461bcd60e51b81526004016107a29061309e565b606061076b6001600160a01b03831660145b6060600061201b836002612c56565b612026906002612ceb565b6001600160401b0381111561203d5761203d61236d565b6040519080825280601f01601f191660200182016040528015612067576020820181803683370190505b509050600360fc1b8160008151811061208257612082612964565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106120b1576120b1612964565b60200101906001600160f81b031916908160001a90535060006120d5846002612c56565b6120e0906001612ceb565b90505b6001811115612165577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061212157612121612964565b1a60f81b82828151811061213757612137612964565b60200101906001600160f81b031916908160001a90535060049490941c9361215e816130ae565b90506120e3565b5083156121845760405162461bcd60e51b81526004016107a2906130f5565b9392505050565b6000826121988584612258565b14949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156121d8575060009050600361224f565b6000600187878787604051600081526020016040526040516121fd949392919061310e565b6020604051602081039080840390855afa15801561221f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166122485760006001925092505061224f565b9150600090505b94509492505050565b600081815b8451811015611c05576122898286838151811061227c5761227c612964565b602002602001015161229d565b915080612295816129e2565b91505061225d565b60008183106122b9576000828152602084905260409020612184565b6000838152602083905260409020612184565b6001600160e01b031981165b81146111a257600080fd5b803561076b816122cc565b60006020828403121561230357612303600080fd5b6000611edc84846122e3565b8015155b82525050565b6020810161076b828461230f565b60006001600160a01b03821661076b565b6122d881612327565b803561076b81612338565b60006020828403121561236157612361600080fd5b6000611edc8484612341565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156123a8576123a861236d565b6040525050565b60006123ba60405190565b90506123c68282612383565b919050565b60006001600160401b038211156123e4576123e461236d565b5060209081020190565b60006124016123fc846123cb565b6123af565b8381529050602080820190840283018581111561242057612420600080fd5b835b81811015612442576124348782612341565b835260209283019201612422565b5050509392505050565b600082601f83011261246057612460600080fd5b8135611edc8482602086016123ee565b60008083601f84011261248557612485600080fd5b5081356001600160401b0381111561249f5761249f600080fd5b602083019150836020820283011115611f2257611f22600080fd5b6000806000604084860312156124d2576124d2600080fd5b83356001600160401b038111156124eb576124eb600080fd5b6124f78682870161244c565b93505060208401356001600160401b0381111561251657612516600080fd5b61252286828701612470565b92509250509250925092565b806122d8565b803561076b8161252e565b60006020828403121561255457612554600080fd5b6000611edc8484612534565b63ffffffff8116612313565b6020810161076b8284612560565b80612313565b6020810161076b828461257a565b600080604083850312156125a4576125a4600080fd5b60006125b08585612534565b92505060206125c185828601612341565b9150509250929050565b63ffffffff81166122d8565b803561076b816125cb565b60006001600160401b038211156125fb576125fb61236d565b601f19601f8301165b60200192915050565b82818337506000910152565b60006126276123fc846125e2565b90508281526020810184848401111561264257612642600080fd5b611c0584828561260d565b600082601f83011261266157612661600080fd5b8135611edc848260208601612619565b6000806000806080858703121561268a5761268a600080fd5b600061269687876125d7565b94505060206126a787828801612534565b93505060408501356001600160401b038111156126c6576126c6600080fd5b6126d28782880161264d565b92505060606126e387828801612341565b91505092959194509250565b61231381612327565b6020810161076b82846126ef565b6001600160d81b0381166122d8565b803561076b81612706565b6001600160401b0381166122d8565b803561076b81612720565b60008060008060008060c0878903121561275657612756600080fd5b60006127628989612534565b965050602061277389828a01612534565b955050604061278489828a01612715565b945050606061279589828a016125d7565b93505060806127a689828a0161272f565b92505060a06127b789828a0161272f565b9150509295509295509295565b600061076b82612327565b600061076b826127c4565b612313816127cf565b6020810161076b82846127da565b60008060006040848603121561280957612809600080fd5b60006124f78686612341565b6000806040838503121561282b5761282b600080fd5b60006125b085856125d7565b6001600160d81b038116612313565b6001600160401b038116612313565b8051612861838261257a565b506020810151612874602084018261257a565b5060408101516128876040840182612837565b50606081015161289a6060840182612560565b5060808101516128ad6080840182612846565b5060a08101516108a560a0840182612846565b60c0810161076b8284612855565b80516128da8382612837565b5060208101516128ed6020840182612560565b5060408101516108a5604084018261230f565b6060810161076b82846128ce565b60298152602081017f496e76616c696420616464726573733a207a65726f2061646472657373206e6f8152681d08185b1b1bddd95960ba1b602082015290505b60400190565b6020808252810161076b8161290e565b634e487b7160e01b600052603260045260246000fd5b6000808335601e193685900301811261299557612995600080fd5b830191505080356001600160401b038111156129b3576129b3600080fd5b60209182019181023603821315611f2257611f22600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016129f4576129f46129cc565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082612a2057612a206129fb565b500490565b63ffffffff91821691908116908282039081111561076b5761076b6129cc565b805161076b8161252e565b600060208284031215612a6557612a65600080fd5b6000611edc8484612a45565b61ffff81166122d8565b805161076b81612a71565b600060208284031215612a9b57612a9b600080fd5b6000611edc8484612a7b565b61ffff91821691908116908282039081111561076b5761076b6129cc565b602f8152602081017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581527f20726f6c657320666f722073656c6600000000000000000000000000000000006020820152905061294e565b6020808252810161076b81612ac5565b60408101612b3b8285612846565b6121846020830184612846565b60608101612b5682866126ef565b612b6360208301856126ef565b611edc60408301846126ef565b8015156122d8565b805161076b81612b70565b600060208284031215612b9857612b98600080fd5b6000611edc8484612b78565b601e8152602081017f696e76616c69642064656c65676174652d7661756c742070616972696e670000815290505b60200190565b6020808252810161076b81612ba4565b60a08101612bf6828861257a565b612c0360208301876126ef565b612c106040830186612560565b612c1d606083018561257a565b612c2a608083018461257a565b9695505050505050565b61190160f01b8152600201612c49818461257a565b602001612604818361257a565b818102811582820484141761076b5761076b6129cc565b6001600160d81b0391821691908116908282019081111561076b5761076b6129cc565b63ffffffff91821691908116908282019081111561076b5761076b6129cc565b8181038181111561076b5761076b6129cc565b60608101612cd182866126ef565b612cde6020830185612560565b611edc604083018461257a565b8082018082111561076b5761076b6129cc565b6001600160401b0391821691908116908282019081111561076b5761076b6129cc565b60408101612d2f82856126ef565b6121846020830184612560565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050612bd2565b6020808252810161076b81612d3c565b60108152602081017f5061757361626c653a207061757365640000000000000000000000000000000081529050612bd2565b6020808252810161076b81612d7e565b60408101612dce82856126ef565b612184602083018461257a565b63ffffffff16600063fffffffe1982016129f4576129f46129cc565b60005b83811015612e12578181015183820152602001612dfa565b50506000910152565b6000612e25825190565b612e33818560208601612df7565b9290920192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152601701612e6d8184612e1b565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000815260110190506121848183612e1b565b6000612ea9825190565b808452602084019350612ec0818560208601612df7565b601f01601f19169290920192915050565b602080825281016121848184612e9f565b60138152602081017f4d65726b6c6520726f6f74206e6f74207365740000000000000000000000000081529050612bd2565b6020808252810161076b81612ee2565b600061076b8260601b90565b600061076b82612f24565b612313612f4782612327565b612f30565b600061076b8260f01b90565b61231361ffff8216612f4c565b612f6f8184612f3b565b601401612f7c8183612f58565b60020192915050565b634e487b7160e01b600052602160045260246000fd5b60188152602081017f45434453413a20696e76616c6964207369676e6174757265000000000000000081529050612bd2565b6020808252810161076b81612f9b565b601f8152602081017f45434453413a20696e76616c6964207369676e6174757265206c656e6774680081529050612bd2565b6020808252810161076b81612fdd565b60228152602081017f45434453413a20696e76616c6964207369676e6174757265202773272076616c815261756560f01b6020820152905061294e565b6020808252810161076b8161301f565b60148152602081017f5061757361626c653a206e6f742070617573656400000000000000000000000081529050612bd2565b6020808252810161076b8161306c565b6000816130bd576130bd6129cc565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e749101908152612bd2565b6020808252810161076b816130c5565b60ff8116612313565b6080810161311c828761257a565b6131296020830186613105565b613136604083018561257a565b613143606083018461257a565b9594505050505056fea2646970667358221220e57bc839740a1b41569c0e8fe8474e88bc3d4ced702f712c178a5741b1454e1664736f6c63430008110033

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

000000000000000000000000ccbe56ea12b845a281431290f202196864f2f576000000000000000000000000589b6c421c55260fc5e4117bd893f57ed7bd44cd00000000000000000000000065c7432e6662a96f4e999603991d5e929e57f60a732341b607560d8adc12ae69978a611e52d84bc60deb98e3b0fde01f5519906f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b

-----Decoded View---------------
Arg [0] : _nftAddress (address): 0xCcBE56eA12B845A281431290F202196864F2f576
Arg [1] : _signerAddress (address): 0x589b6C421C55260fC5E4117Bd893f57eD7bd44cD
Arg [2] : _treasuryAddress (address): 0x65C7432E6662A96f4e999603991d5E929E57f60A
Arg [3] : _discountMerkleRoot (bytes32): 0x732341b607560d8adc12ae69978a611e52d84bc60deb98e3b0fde01f5519906f
Arg [4] : _delegateCash (address): 0x00000000000076A84feF008CDAbe6409d2FE638B

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000ccbe56ea12b845a281431290f202196864f2f576
Arg [1] : 000000000000000000000000589b6c421c55260fc5e4117bd893f57ed7bd44cd
Arg [2] : 00000000000000000000000065c7432e6662a96f4e999603991d5e929e57f60a
Arg [3] : 732341b607560d8adc12ae69978a611e52d84bc60deb98e3b0fde01f5519906f
Arg [4] : 00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b


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.