ETH Price: $3,247.99 (+0.22%)

Contract

0xf6E16C6424685D672d636B9146714CA9e9e458Da
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Lazy Listed ...199351742024-05-23 21:09:59232 days ago1716498599IN
0xf6E16C64...9e9e458Da
0 ETH0.0096495236.89672263
Buy Lazy Listed ...199208102024-05-21 20:56:59234 days ago1716325019IN
0xf6E16C64...9e9e458Da
0 ETH0.0030935811.82871484
Buy Lazy Listed ...199185872024-05-21 13:29:35234 days ago1716298175IN
0xf6E16C64...9e9e458Da
0 ETH0.004738818.12022955
Buy Lazy Listed ...199131822024-05-20 19:21:59235 days ago1716232919IN
0xf6E16C64...9e9e458Da
0 ETH0.0038608314.49506539
Buy Lazy Listed ...198847672024-05-16 19:57:11239 days ago1715889431IN
0xf6E16C64...9e9e458Da
0 ETH0.001234765.0510728
Buy Lazy Listed ...198846152024-05-16 19:26:35239 days ago1715887595IN
0xf6E16C64...9e9e458Da
0 ETH0.001359315.56057819
Buy Lazy Listed ...198845542024-05-16 19:14:23239 days ago1715886863IN
0xf6E16C64...9e9e458Da
0 ETH0.001247745.10468923
Buy Lazy Listed ...198844282024-05-16 18:49:11239 days ago1715885351IN
0xf6E16C64...9e9e458Da
0 ETH0.001125754.60538937
Buy Lazy Listed ...198843882024-05-16 18:41:11239 days ago1715884871IN
0xf6E16C64...9e9e458Da
0 ETH0.001343315.13633342
Buy Lazy Listed ...198842542024-05-16 18:13:59239 days ago1715883239IN
0xf6E16C64...9e9e458Da
0 ETH0.001314615.0261215
Buy Lazy Listed ...198841442024-05-16 17:51:47239 days ago1715881907IN
0xf6E16C64...9e9e458Da
0 ETH0.001886757.71854562
Buy Lazy Listed ...198840682024-05-16 17:36:23239 days ago1715880983IN
0xf6E16C64...9e9e458Da
0 ETH0.00134755.51253842
Buy Lazy Listed ...198839202024-05-16 17:06:35239 days ago1715879195IN
0xf6E16C64...9e9e458Da
0 ETH0.002100628.59346566
Buy Lazy Listed ...198838932024-05-16 17:00:59239 days ago1715878859IN
0xf6E16C64...9e9e458Da
0 ETH0.001925537.36286826
Buy Lazy Listed ...198838672024-05-16 16:55:47239 days ago1715878547IN
0xf6E16C64...9e9e458Da
0 ETH0.00190527.79366548
Buy Lazy Listed ...198838322024-05-16 16:48:35239 days ago1715878115IN
0xf6E16C64...9e9e458Da
0 ETH0.001880627.19014469
Buy Lazy Listed ...198838142024-05-16 16:44:59239 days ago1715877899IN
0xf6E16C64...9e9e458Da
0 ETH0.001933827.91150517
Buy Lazy Listed ...198837952024-05-16 16:41:11239 days ago1715877671IN
0xf6E16C64...9e9e458Da
0 ETH0.002233798.54120717
Buy Lazy Listed ...198837802024-05-16 16:38:11239 days ago1715877491IN
0xf6E16C64...9e9e458Da
0 ETH0.002170348.2978229
Buy Lazy Listed ...198837622024-05-16 16:34:35239 days ago1715877275IN
0xf6E16C64...9e9e458Da
0 ETH0.002142478.19239216
Buy Lazy Listed ...198837542024-05-16 16:32:47239 days ago1715877167IN
0xf6E16C64...9e9e458Da
0 ETH0.002162498.26895901
Buy Lazy Listed ...198837452024-05-16 16:30:59239 days ago1715877059IN
0xf6E16C64...9e9e458Da
0 ETH0.001775886.79032831
Buy Lazy Listed ...198837332024-05-16 16:28:35239 days ago1715876915IN
0xf6E16C64...9e9e458Da
0 ETH0.001581066.4677073
Buy Lazy Listed ...198836882024-05-16 16:19:23239 days ago1715876363IN
0xf6E16C64...9e9e458Da
0 ETH0.001615666.17711252
Buy Lazy Listed ...198836752024-05-16 16:16:47239 days ago1715876207IN
0xf6E16C64...9e9e458Da
0 ETH0.001884397.20455093
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LoveNFTMarketplace

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 25 : LoveMarketplace.sol
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IERC1155} from '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import {ERC1155Holder} from '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol';
import {IERC2981} from '@openzeppelin/contracts/interfaces/IERC2981.sol';
import {IERC165} from '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import {ILoveNFTMarketplace} from './interfaces/ILoveNFTMarketplace.sol';
import {ILoveNFTShared} from './interfaces/ILoveNFTShared.sol';
import {LoveRoles} from './lib/LoveRoles.sol';
import {TokenIdentifiers} from './lib/TokenIdentifiers.sol';

/* Love NFT Marketplace
    List NFT,
    Buy NFT,
    Offer NFT,
    Accept offer,
    Create auction,
    Bid place,
    & support Royalty
*/
contract LoveNFTMarketplace is ILoveNFTMarketplace, LoveRoles, ERC1155Holder, ReentrancyGuard {
  using TokenIdentifiers for uint256;
  using SafeERC20 for IERC20;

  uint256 public platformFee = 50;
  uint256 public constant LISTING_FEE = 1 ether;
  uint256 public constant MINIMUM_BUYING_FEE = 5 ether;
  uint256 public reservedBalance;
  address public feeReceiver;
  ILoveNFTShared private immutable loveNFTShared;
  IERC20 private immutable loveToken;

  constructor(address _loveToken, address _loveNFTShared, address tokenOwner) {
    transferOwnership(tokenOwner);
    loveToken = IERC20(_loveToken);
    loveNFTShared = ILoveNFTShared(_loveNFTShared);
  }

  // NFT => list struct
  mapping(bytes32 encodedNft => ListNFT listingStruct) private listNfts;

  // NFT => offerer address => offer price => offer struct
  mapping(bytes32 encodedNft => mapping(address offerer => mapping(uint256 price => OfferNFT offerStruct)))
    private offerNfts;

  // NFT => action struct
  mapping(bytes32 encodedNft => AuctionNFT auctionStruct) private auctionNfts;

  modifier onlyListedNFT(NFT calldata nft) {
    ListNFT memory listedNFT = listNfts[encodeNft(nft)];
    require(
      listedNFT.seller != address(0) && listedNFT.price > 0 && block.timestamp <= listedNFT.endTime,
      'not listed'
    );
    _;
  }

  modifier onAuction(NFT calldata nft) {
    NFT memory auctionNft = auctionNfts[encodeNft(nft)].nft;
    require(auctionNft.addr == nft.addr && auctionNft.tokenId == nft.tokenId, 'auction is not created');
    _;
  }

  modifier notOnAuction(NFT calldata nft) {
    AuctionNFT memory auction = auctionNfts[encodeNft(nft)];
    require(auction.nft.addr == address(0) || auction.success, 'auction already created');
    _;
  }

  modifier onlyOfferedNFT(OfferNFTParams calldata params) {
    OfferNFT memory offer = offerNfts[encodeNft(params.nft)][params.offerer][params.price];
    require(offer.offerer == params.offerer && offer.offerPrice == params.price, 'not offered');
    require(!offer.accepted, 'already accepted');
    _;
  }

  modifier minimumPrice(uint256 price) {
    require(price > MINIMUM_BUYING_FEE, 'price is less than the minimum commission');
    _;
  }

  /**
   * @notice List NFT on Marketplace
   * @param params The listing parameters (nft, tokenId, price, startTime, endTime)
   */
  function listNft(ListingParams calldata params) external minimumPrice(params.price) returns (uint256) {
    require(block.timestamp <= params.startTime && params.endTime > params.startTime, 'invalid time range');

    bytes32 encodedNft = encodeNft(params.nft);
    ListNFT memory listedNFT = listNfts[encodedNft];
    TokenType tokenType = _getTokenType(params.nft.addr);
    // If the NFT is already listed, the seller must be the same as the caller.
    if (listedNFT.seller != address(0)) {
      require(listedNFT.seller == msg.sender, 'not seller');
    } else {
      // Otherwise, the caller must be the owner of the NFT.
      _verifyOwnershipAndApproval(msg.sender, params.nft, tokenType);
      // The caller must have enough tokens for the platform fee.
      require(loveToken.balanceOf(msg.sender) >= LISTING_FEE, 'no tokens for platform fee');
      // The caller must transfer the NFT to the marketplace contract.
      _transferNFT(msg.sender, address(this), params.nft, tokenType);
      // The caller must transfer the platform fee to the marketplace contract.
      loveToken.safeTransferFrom(msg.sender, address(this), LISTING_FEE);
    }

    // Update the listing.
    listNfts[encodedNft] = ListNFT({
      nft: params.nft,
      tokenType: tokenType,
      price: params.price,
      seller: msg.sender,
      startTime: params.startTime,
      endTime: params.endTime
    });
    emit ListedNFT(params.nft.addr, params.nft.tokenId, params.price, msg.sender, params.startTime, params.endTime);
    return LISTING_FEE;
  }

  function getListedNFT(NFT calldata nft) external view returns (ListNFT memory) {
    return listNfts[encodeNft(nft)];
  }

  /**
   * @notice Cancel listed NFT
   * @param nft NFT address
   */
  function cancelListedNFT(NFT calldata nft) external onlyListedNFT(nft) {
    bytes32 encodedNft = encodeNft(nft);
    ListNFT memory listedNFT = listNfts[encodedNft];
    // Ensure the sender is the seller
    require(listedNFT.seller == msg.sender, 'not seller');

    delete listNfts[encodedNft];
    // Transfer the NFT back to the seller
    _transferNFT(address(this), msg.sender, nft, listedNFT.tokenType);

    emit CanceledListedNFT(
      listedNFT.nft.addr,
      listedNFT.nft.tokenId,
      listedNFT.price,
      listedNFT.seller,
      listedNFT.startTime,
      listedNFT.endTime
    );
  }

  function buyLazyListedNFT(
    ILoveNFTShared.MintRequest calldata params,
    bytes calldata signature
  ) external returns (uint256 priceWithRoyalty) {
    address creator = params.tokenId.tokenCreator();

    // calculate platform fee
    (uint256 amount, ) = calculateFeeAndAmount(params.price);
    // calculate royalty fee

    uint256 royaltyAmount = (params.price * params.royaltyFraction) / loveNFTShared.feeDenominator();

    TokenRoyaltyInfo memory royaltyInfo = TokenRoyaltyInfo(params.royaltyRecipient, royaltyAmount);

    loveToken.safeTransferFrom(msg.sender, address(this), params.price + royaltyInfo.royaltyAmount);

    if (royaltyInfo.royaltyReceiver == creator) {
      uint256 amountWithRoyalty = amount + royaltyInfo.royaltyAmount;
      loveToken.safeTransfer(creator, amountWithRoyalty);
    } else {
      _transferRoyalty(royaltyInfo, address(this));
      loveToken.safeTransfer(creator, amount);
    }

    // mint nft
    loveNFTShared.redeem(msg.sender, params, signature);

    emit BoughtNFT(address(loveNFTShared), params.tokenId, params.price, creator, msg.sender);

    return royaltyInfo.royaltyAmount + params.price;
  }

  /**
   * @notice Buy NFT on Marketplace
   * @param nft NFT address
   * @param price listed price
   * @return priceWithRoyalty price with fees
   */
  function buyNFT(NFT calldata nft, uint256 price) external onlyListedNFT(nft) returns (uint256 priceWithRoyalty) {
    bytes32 encodedNft = encodeNft(nft);
    ListNFT memory listedNft = listNfts[encodedNft];
    require(price >= listedNft.price, 'less than listed price');

    delete listNfts[encodedNft];
    TokenRoyaltyInfo memory royaltyInfo = _tryGetRoyaltyInfo(nft, price);
    _transferRoyalty(royaltyInfo, msg.sender);
    // remove nft from listing
    (uint256 amount, uint256 buyingFee) = calculateFeeAndAmount(price);
    // transfer platform fee to marketplace contract
    loveToken.safeTransferFrom(msg.sender, address(this), buyingFee);

    // Transfer payment to nft owner
    loveToken.safeTransferFrom(msg.sender, listedNft.seller, amount);

    // Transfer NFT to buyer
    _transferNFT(address(this), msg.sender, nft, listedNft.tokenType);

    emit BoughtNFT(nft.addr, nft.tokenId, price, listedNft.seller, msg.sender);
    return price + royaltyInfo.royaltyAmount;
  }

  /**
   * @notice Offer NFT on Marketplace
   * @param params OfferNFTParams
   * @return offerPriceWithRoyalty offer price with royalty
   */
  function offerNFT(
    OfferNFTParams calldata params
  ) external notOnAuction(params.nft) minimumPrice(params.price) returns (uint256) {
    // nft should be minted
    TokenType tokenType = _getTokenType(params.nft.addr);
    if (tokenType == TokenType.ERC721) {
      require(IERC721(params.nft.addr).ownerOf(params.nft.tokenId) != address(0), 'not exist');
    } else if (params.nft.addr == address(loveNFTShared)) {
      require(loveNFTShared.exists(params.nft.tokenId), 'not exist');
    }

    TokenRoyaltyInfo memory royaltyInfo = _tryGetRoyaltyInfo(params.nft, params.price);
    uint256 offerPriceWithRoyalty = params.price + royaltyInfo.royaltyAmount;

    reservedBalance += offerPriceWithRoyalty;

    loveToken.safeTransferFrom(msg.sender, address(this), offerPriceWithRoyalty);

    offerNfts[encodeNft(params.nft)][msg.sender][params.price] = OfferNFT({
      nft: params.nft,
      tokenType: tokenType,
      offerer: msg.sender,
      offerPrice: params.price,
      accepted: false,
      royaltyInfo: royaltyInfo
    });

    emit OfferedNFT(params.nft.addr, params.nft.tokenId, params.price, msg.sender);
    return offerPriceWithRoyalty;
  }

  /**
   * @notice Cancel offer
   * @param params The offer parameters (nft, tokenId, offerer, price)
   * @return offerPriceWithRoyalty offer price with royalty
   */
  function cancelOfferNFT(OfferNFTParams calldata params) external onlyOfferedNFT(params) returns (uint256) {
    require(params.offerer == msg.sender, 'not offerer');

    bytes32 encodedNft = encodeNft(params.nft);
    OfferNFT memory offer = offerNfts[encodedNft][params.offerer][params.price];
    delete offerNfts[encodedNft][params.offerer][params.price];

    uint256 offerPriceWithRoyalty = offer.offerPrice + offer.royaltyInfo.royaltyAmount;
    reservedBalance -= offerPriceWithRoyalty;

    loveToken.safeTransfer(offer.offerer, offerPriceWithRoyalty);

    emit CanceledOfferedNFT(offer.nft.addr, offer.nft.tokenId, offer.offerPrice, params.offerer);
    return offerPriceWithRoyalty;
  }

  /**
   * @notice Accept offer
   * @param params The offer parameters (nft, tokenId, offerer, price)
   * @return amount amount transfer to seller
   */
  function acceptOfferNFT(
    OfferNFTParams calldata params
  ) external onlyOfferedNFT(params) nonReentrant returns (uint256) {
    bytes32 encodedNft = encodeNft(params.nft);
    OfferNFT storage offer = offerNfts[encodedNft][params.offerer][params.price];
    ListNFT memory list = listNfts[encodedNft];
    address from = address(this);
    // If the NFT is listed, the seller is the owner of the NFT
    if (list.seller != address(0)) {
      require(msg.sender == list.seller, 'not listed owner');
      delete listNfts[encodedNft];
    } else {
      // If not, the seller is the owner of the NFT
      _verifyOwnershipAndApproval(msg.sender, params.nft, offer.tokenType);
      from = msg.sender;
    }

    TokenRoyaltyInfo memory royaltyInfo = offer.royaltyInfo;
    uint256 offerPriceWithRoyalty = params.price + royaltyInfo.royaltyAmount;

    // Release reserved balance
    reservedBalance -= offerPriceWithRoyalty;
    offer.accepted = true;

    // Calculate & Transfer platform fee
    (uint256 amount, ) = calculateFeeAndAmount(params.price);

    if (royaltyInfo.royaltyReceiver == msg.sender) {
      uint256 amountWithRoyalty = amount + royaltyInfo.royaltyAmount;
      loveToken.safeTransfer(msg.sender, amountWithRoyalty);
    } else {
      _transferRoyalty(royaltyInfo, address(this));
      loveToken.safeTransfer(msg.sender, amount);
    }

    // Transfer NFT to offerer
    _transferNFT(from, params.offerer, params.nft, offer.tokenType);

    emit AcceptedNFT(params.nft.addr, params.nft.tokenId, params.price, params.offerer, msg.sender);
    return amount;
  }

  /**
   * @notice Create auction for NFT
   * @dev This function allows users to create an auction for an NFT
   * @param params The auction parameters (nft, tokenId, initialPrice, minBidStep, startTime, endTime)
   */
  function createAuction(
    AuctionParams calldata params
  ) external notOnAuction(params.nft) minimumPrice(params.initialPrice) {
    TokenType tokenType = _getTokenType(params.nft.addr);
    // Verify if the caller is the owner of the NFT
    _verifyOwnershipAndApproval(msg.sender, params.nft, tokenType);

    require(loveToken.balanceOf(msg.sender) >= LISTING_FEE, 'no tokens for platform fee');
    // The caller must transfer the platform fee to the marketplace contract.
    loveToken.safeTransferFrom(msg.sender, address(this), LISTING_FEE);
    // Transfer the NFT from the caller to the contract
    _transferNFT(msg.sender, address(this), params.nft, tokenType);

    // Store the auction details in the auctionNfts mapping
    auctionNfts[encodeNft(params.nft)] = AuctionNFT({
      nft: params.nft,
      tokenType: tokenType,
      creator: msg.sender,
      initialPrice: params.initialPrice,
      minBidStep: params.minBidStep,
      startTime: params.startTime,
      endTime: params.endTime,
      lastBidder: address(0),
      highestBid: params.initialPrice,
      royaltyInfo: TokenRoyaltyInfo(address(0), 0),
      winner: address(0),
      success: false
    });

    emit CreatedAuction(
      params.nft.addr,
      params.nft.tokenId,
      params.initialPrice,
      params.minBidStep,
      params.startTime,
      params.endTime,
      msg.sender
    );
  }

  /**
   * @notice Cancel auction
   * @param nft NFT address
   */
  function cancelAuction(NFT calldata nft) external onAuction(nft) {
    bytes32 encodedNft = encodeNft(nft);
    AuctionNFT memory auction = auctionNfts[encodedNft];
    require(auction.creator == msg.sender, 'not auction creator');
    require(!auction.success, 'auction already success');
    require(auction.lastBidder == address(0), 'already have bidder');

    delete auctionNfts[encodedNft];

    _transferNFT(address(this), msg.sender, nft, auction.tokenType);

    emit CanceledAuction(nft.addr, nft.tokenId);
  }

  /**
   * @notice Place bid on auction
   * @param nft NFT address
   * @param bidPrice bid price (must be greater than highest bid + min bid step)
   * @return bidPriceWithRoyalty bid price with royalty
   */
  function bidPlace(NFT calldata nft, uint256 bidPrice) external onAuction(nft) nonReentrant returns (uint256) {
    AuctionNFT storage auction = auctionNfts[encodeNft(nft)];
    require(block.timestamp >= auction.startTime, 'auction not started');
    require(block.timestamp <= auction.endTime, 'auction ended');
    require(bidPrice >= auction.highestBid + auction.minBidStep, 'less than min bid price');

    TokenRoyaltyInfo memory royaltyInfo = _tryGetRoyaltyInfo(nft, bidPrice);
    uint256 lastBidPriceWithRoyalty = 0;
    uint256 bidPriceWithRoyalty = bidPrice + royaltyInfo.royaltyAmount;

    if (auction.lastBidder != address(0)) {
      address lastBidder = auction.lastBidder;
      uint256 lastBidPrice = auction.highestBid;
      // Transfer back to last bidder
      lastBidPriceWithRoyalty = lastBidPrice + auction.royaltyInfo.royaltyAmount;
      loveToken.safeTransfer(lastBidder, lastBidPriceWithRoyalty);
    }

    reservedBalance += bidPriceWithRoyalty - lastBidPriceWithRoyalty;
    // Set new highest bid price & bidder
    auction.lastBidder = msg.sender;
    auction.highestBid = bidPrice;
    auction.royaltyInfo = royaltyInfo;

    loveToken.safeTransferFrom(msg.sender, address(this), bidPriceWithRoyalty);

    emit PlacedBid(nft.addr, nft.tokenId, bidPrice, msg.sender);
    return bidPriceWithRoyalty;
  }

  /**
   * @notice Result auctions
   * @param nft NFT
   */
  function resultAuction(NFT calldata nft) external returns (uint256) {
    uint256 amount = _resultAuction(nft);
    reservedBalance -= amount;
    return amount;
  }

  /**
   * @notice Result multiple auctions
   * @param nfts NFT (nftAddres, tokenId)
   */
  function resultAuctions(NFT[] calldata nfts) external returns (uint256) {
    uint256 totalAmount = 0;

    for (uint256 i = 0; i < nfts.length; ++i) {
      // Result each auction and accumulate the amount transferred to the auction creator
      uint256 amount = _resultAuction(nfts[i]);
      totalAmount += amount;
    }
    reservedBalance -= totalAmount;
    return totalAmount;
  }

  /**
   * @notice Get auction info by NFT address and token id
   * @param nft NFT address
   * @return AuctionNFT struct
   */
  function getAuction(NFT calldata nft) external view returns (AuctionNFT memory) {
    return auctionNfts[encodeNft(nft)];
  }

  /**
   * @notice Transfer fee to fee receiver contract
   * @dev should set feeReceiver (updateFeeReceiver()) address before call this function
   * @param amount Fee amount
   */
  function transferFee(uint256 amount) external hasRole('admin') {
    require(feeReceiver != address(0), 'invalid feeReceiver address');
    require(getAvailableBalance() >= amount, 'insufficient balance (reserved)');
    loveToken.safeTransfer(feeReceiver, amount);
  }

  /**
   * @notice Set platform fee
   * @param newPlatformFee new platform fee
   */
  function setPlatformFee(uint256 newPlatformFee) external onlyOwner {
    platformFee = newPlatformFee;
    emit ChangedPlatformFee(newPlatformFee);
  }

  /**
   * @notice Set platform fee contract (LoveDrop)
   * @param newFeeReceiver new fee receiver address
   */
  function updateFeeReceiver(address newFeeReceiver) external onlyOwner {
    require(newFeeReceiver != address(0), 'invalid address');
    feeReceiver = newFeeReceiver;

    emit ChangedFeeReceiver(newFeeReceiver);
  }

  /**
   * @notice Calculate fee and amount
   * @param price price
   * @return amount amount transfer to seller
   * @return fee fee transfer to marketplace contract
   */
  function calculateFeeAndAmount(uint256 price) public view returns (uint256 amount, uint256 fee) {
    uint256 fee1e27 = (price * platformFee * 1e27) / 100;
    fee = fee1e27 / 1e27;
    if (fee < MINIMUM_BUYING_FEE) {
      fee = MINIMUM_BUYING_FEE;
    }
    return (price - fee, fee);
  }

  /**
   * @notice Get available balance
   * @return availableBalance available balance (not reserved)
   */
  function getAvailableBalance() public view returns (uint256 availableBalance) {
    return loveToken.balanceOf(address(this)) - reservedBalance;
  }

  function _resultAuction(NFT calldata nft) internal onAuction(nft) returns (uint256) {
    AuctionNFT storage auction = auctionNfts[encodeNft(nft)];
    require(!auction.success, 'already resulted');
    require(block.timestamp > auction.endTime, 'auction not ended');
    address creator = auction.creator;
    address winner = auction.lastBidder;
    uint256 highestBid = auction.highestBid;
    TokenType tokenType = auction.tokenType;
    if (winner == address(0)) {
      // If no one bid, transfer NFT back to creator
      delete auctionNfts[encodeNft(nft)];
      _transferNFT(address(this), creator, nft, tokenType);
      emit CanceledAuction(nft.addr, nft.tokenId);
      return 0;
    }

    auction.success = true;
    auction.winner = winner;
    TokenRoyaltyInfo memory royaltyInfo = auction.royaltyInfo;
    // Calculate royalty fee and transfer to recipient
    _transferRoyalty(royaltyInfo, address(this));

    // Calculate platform fee
    (uint256 amount, ) = calculateFeeAndAmount(highestBid);

    // Transfer to auction creator
    loveToken.safeTransfer(creator, amount);
    // Transfer NFT to the winner
    _transferNFT(address(this), winner, nft, auction.tokenType);

    emit ResultedAuction(nft.addr, nft.tokenId, creator, winner, highestBid, msg.sender);
    return highestBid + royaltyInfo.royaltyAmount;
  }

  function rescueTokens(NFT calldata nft, address receiver) external onlyOwner {
    bool isAuction = auctionNfts[encodeNft(nft)].creator != address(0);
    bool isListed = listNfts[encodeNft(nft)].seller != address(0);
    require(!isListed, 'nft is on sale');
    require(!isAuction, 'nft is on auction');
    TokenType tokenType = _getTokenType(nft.addr);
    _transferNFT(address(this), receiver, nft, tokenType);
  }

  function _tryGetRoyaltyInfo(
    NFT memory nft,
    uint256 price
  ) internal view returns (TokenRoyaltyInfo memory royaltyInfo) {
    if (IERC2981(nft.addr).supportsInterface(type(IERC2981).interfaceId)) {
      (address royaltyRecipient, uint256 amount) = IERC2981(nft.addr).royaltyInfo(nft.tokenId, price);
      if (amount > price / 5) amount = price / 5;
      royaltyInfo = TokenRoyaltyInfo(royaltyRecipient, amount);
    }
    return royaltyInfo;
  }

  function _transferRoyalty(TokenRoyaltyInfo memory royaltyInfo, address from) internal {
    if (royaltyInfo.royaltyReceiver != address(0) && royaltyInfo.royaltyAmount > 0) {
      if (from == address(this)) {
        loveToken.safeTransfer(royaltyInfo.royaltyReceiver, royaltyInfo.royaltyAmount);
      } else {
        loveToken.safeTransferFrom(from, royaltyInfo.royaltyReceiver, royaltyInfo.royaltyAmount);
      }
    }
  }

  function _getTokenType(address nftAddress) internal view returns (TokenType tokenType) {
    if (IERC165(nftAddress).supportsInterface(type(IERC1155).interfaceId)) {
      return TokenType.ERC1155;
    } else if (IERC165(nftAddress).supportsInterface(type(IERC721).interfaceId)) {
      return TokenType.ERC721;
    } else {
      revert('Invalid NFT type');
    }
  }

  function _verifyOwnershipAndApproval(address claimant, NFT memory nft, TokenType tokenType) internal view {
    bool isValid = false;
    if (tokenType == TokenType.ERC1155) {
      isValid =
        IERC1155(nft.addr).balanceOf(claimant, nft.tokenId) >= 1 &&
        IERC1155(nft.addr).isApprovedForAll(claimant, address(this));
    } else if (tokenType == TokenType.ERC721) {
      isValid =
        IERC721(nft.addr).ownerOf(nft.tokenId) == claimant &&
        (IERC721(nft.addr).getApproved(nft.tokenId) == address(this) ||
          IERC721(nft.addr).isApprovedForAll(claimant, address(this)));
    }
    require(isValid, 'not owner or approved tokens');
  }

  function _transferNFT(address from, address to, NFT calldata nft, TokenType tokenType) internal {
    if (tokenType == TokenType.ERC1155) {
      IERC1155(nft.addr).safeTransferFrom(from, to, nft.tokenId, 1, '');
    } else if (tokenType == TokenType.ERC721) {
      IERC721(nft.addr).transferFrom(from, to, nft.tokenId);
    }
  }

  function encodeNft(NFT calldata nft) internal pure returns (bytes32 encodedNft) {
    return keccak256(abi.encodePacked(nft.addr, nft.tokenId));
  }

  function onERC1155Received(
    address,
    address,
    uint256,
    uint256,
    bytes memory
  ) public virtual override returns (bytes4) {
    return this.onERC1155Received.selector;
  }
}

File 2 of 25 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 25 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

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

File 5 of 25 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 6 of 25 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 7 of 25 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 8 of 25 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 9 of 25 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 10 of 25 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 11 of 25 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 12 of 25 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 13 of 25 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 14 of 25 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 15 of 25 : Context.sol
// 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;
    }
}

File 16 of 25 : ERC165.sol
// 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;
    }
}

File 17 of 25 : IERC165.sol
// 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);
}

File 18 of 25 : Math.sol
// 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);
        }
    }
}

File 19 of 25 : SignedMath.sol
// 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);
        }
    }
}

File 20 of 25 : Strings.sol
// 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));
    }
}

File 21 of 25 : ILoveNFTMarketplace.sol
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {ILoveRoles} from './ILoveRoles.sol';
import {ILoveNFTShared} from './ILoveNFTShared.sol';

interface ILoveNFTMarketplace is ILoveRoles {
  enum TokenType {
    ERC721,
    ERC1155
  }

  struct NFT {
    address addr;
    uint256 tokenId;
  }

  struct ListingParams {
    NFT nft;
    uint256 price;
    uint256 startTime;
    uint256 endTime;
  }

  struct ListNFT {
    NFT nft;
    TokenType tokenType;
    address seller;
    uint256 price;
    uint256 startTime;
    uint256 endTime;
  }

  struct LazyListingParams {
    NFT nft;
    uint256 price;
    uint256 startTime;
    uint256 endTime;
    bytes32 uid;
  }

  struct OfferNFT {
    NFT nft;
    address offerer;
    uint256 offerPrice;
    TokenType tokenType;
    TokenRoyaltyInfo royaltyInfo;
    bool accepted;
  }

  struct OfferNFTParams {
    NFT nft;
    address offerer;
    uint256 price;
  }

  struct AuctionParams {
    NFT nft;
    uint256 initialPrice;
    uint256 minBidStep;
    uint256 startTime;
    uint256 endTime;
  }

  struct AuctionNFT {
    NFT nft;
    TokenType tokenType;
    address creator;
    uint256 initialPrice;
    uint256 minBidStep;
    uint256 startTime;
    uint256 endTime;
    address lastBidder;
    uint256 highestBid;
    TokenRoyaltyInfo royaltyInfo;
    address winner;
    bool success;
  }

  struct TokenRoyaltyInfo {
    address royaltyReceiver;
    uint256 royaltyAmount;
  }

  // events
  event ChangedPlatformFee(uint256 newValue);
  event ChangedFeeReceiver(address newFeeReceiver);

  event ListedNFT(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 price,
    address indexed seller,
    uint256 startTime,
    uint256 endTime
  );

  event CanceledListedNFT(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 price,
    address indexed seller,
    uint256 startTime,
    uint256 endTime
  );

  event BoughtNFT(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 price,
    address seller,
    address indexed buyer
  );
  event OfferedNFT(address indexed nftAddress, uint256 indexed tokenId, uint256 offerPrice, address indexed offerer);
  event CanceledOfferedNFT(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 offerPrice,
    address indexed offerer
  );
  event AcceptedNFT(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 offerPrice,
    address offerer,
    address indexed nftOwner
  );
  event CreatedAuction(
    address indexed nftAddress,
    uint256 indexed tokenId,
    uint256 price,
    uint256 minBidStep,
    uint256 startTime,
    uint256 endTime,
    address indexed creator
  );
  event PlacedBid(address indexed nftAddress, uint256 indexed tokenId, uint256 bidPrice, address indexed bidder);
  event CanceledAuction(address indexed nftAddress, uint256 indexed tokenId);

  event ResultedAuction(
    address indexed nftAddress,
    uint256 indexed tokenId,
    address creator,
    address indexed winner,
    uint256 price,
    address caller
  );

  function listNft(ListingParams calldata params) external returns (uint256);

  function getListedNFT(NFT calldata nft) external view returns (ListNFT memory);

  function cancelListedNFT(NFT calldata nft) external;

  function buyNFT(NFT calldata nft, uint256 price) external returns (uint256 priceWithRoyalty);

  function buyLazyListedNFT(
    ILoveNFTShared.MintRequest calldata params,
    bytes calldata signature
  ) external returns (uint256 priceWithRoyalty);

  function offerNFT(OfferNFTParams calldata params) external returns (uint256);

  function cancelOfferNFT(OfferNFTParams calldata params) external returns (uint256);

  function acceptOfferNFT(OfferNFTParams calldata params) external returns (uint256);

  function createAuction(AuctionParams calldata params) external;

  function cancelAuction(NFT calldata nft) external;

  function bidPlace(NFT calldata nft, uint256 bidPrice) external returns (uint256);

  function resultAuction(NFT calldata nft) external returns (uint256);

  function resultAuctions(NFT[] calldata nfts) external returns (uint256);

  function getAuction(NFT calldata nft) external view returns (AuctionNFT memory);

  function transferFee(uint256 amount) external;

  function setPlatformFee(uint256 newPlatformFee) external;

  function updateFeeReceiver(address newFeeReceiver) external;
}

File 22 of 25 : ILoveNFTShared.sol
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {IERC1155} from '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';
import {IERC2981} from '@openzeppelin/contracts/interfaces/IERC2981.sol';
import {IERC1155MetadataURI} from '@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol';

interface ILoveNFTShared is IERC1155, IERC1155MetadataURI, IERC2981 {
  struct MintRequest {
    uint256 tokenId;
    uint256 price;
    uint128 startTimestamp;
    uint128 endTimestamp;
    string uri;
    address royaltyRecipient;
    uint96 royaltyFraction;
    bytes32 uid;
  }

  function redeem(address account, MintRequest calldata _req, bytes calldata signature) external;

  function exists(uint256 tokenId) external view returns (bool);

  function feeDenominator() external pure returns (uint96);

  function decodeTokenId(uint256 tokenId) external pure returns (address, uint256, uint256);

  function encodeTokenId(address creator, uint256 index, uint256 collection) external pure returns (uint256);
}

File 23 of 25 : ILoveRoles.sol
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

interface ILoveRoles {
  function grantRole(address account, string calldata role) external;

  function revokeRole(address account, string calldata role) external;

  function checkRole(address accountToCheck, string calldata role) external view returns (bool);
}

File 24 of 25 : LoveRoles.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.18;

import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {ILoveRoles} from '../interfaces/ILoveRoles.sol';

abstract contract LoveRoles is ILoveRoles, Ownable {
  mapping(address user => mapping(string role => bool hasRole)) private users;

  event RoleGranted(address indexed account, string role);
  event RoleRevoked(address indexed account, string role);

  modifier hasRole(string memory role) {
    require(users[msg.sender][role] || msg.sender == owner(), 'account doesnt have this role');
    _;
  }

  function grantRole(address account, string calldata role) external onlyOwner {
    require(!users[account][role], 'role already granted');
    users[account][role] = true;

    emit RoleGranted(account, role);
  }

  function revokeRole(address account, string calldata role) external onlyOwner {
    require(users[account][role], 'role already revoked');
    users[account][role] = false;

    emit RoleRevoked(account, role);
  }

  function checkRole(address accountToCheck, string calldata role) external view returns (bool) {
    return users[accountToCheck][role];
  }
}

File 25 of 25 : TokenIdentifiers.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

import {Strings} from '@openzeppelin/contracts/utils/Strings.sol';

/*
    DESIGN NOTES:
    Token ids are a concatenation of:
   * creator: hex address of the creator of the token. 160 bits
   * index: Index for this token (the regular ID), up to 2^56 - 1. 56 bits
   * collection: Virtual collection id for this token, up to 2^40 - 1 (1 trillion).  40 bits

  */
/**
 * @title TokenIdentifiers
 * support for authentication and metadata for token ids
 */

library TokenIdentifiers {
  uint56 private constant MAX_INDEX = 0xFFFFFFFFFFFFFF;
  uint40 private constant MAX_COLLECTION = 0xFFFFFFFFFF;

  // Function to create a token ID based on creator, index, and supply
  function createTokenId(address creator, uint256 index, uint256 collection) internal pure returns (uint256) {
    // Concatenate the values into a single uint256 token ID
    uint256 tokenID = (uint256(uint160(creator)) << 96) | (uint256(index) << 40) | uint256(collection);
    return tokenID;
  }

  function tokenCreator(uint256 _id) internal pure returns (address) {
    return address(uint160(_id >> 96));
  }

  function tokenIndex(uint256 _id) internal pure returns (uint56) {
    return uint56((_id >> 40) & MAX_INDEX);
  }

  function tokenCollection(uint256 _id) internal pure returns (uint40) {
    return uint40(_id & MAX_COLLECTION);
  }

  // Function to extract creator, index, and supply from a token ID
  function decodeTokenId(uint256 _id) internal pure returns (address creator, uint56 index, uint40 collection) {
    creator = tokenCreator(_id);
    index = tokenIndex(_id);
    collection = tokenCollection(_id);
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_loveToken","type":"address"},{"internalType":"address","name":"_loveNFTShared","type":"address"},{"internalType":"address","name":"tokenOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerPrice","type":"uint256"},{"indexed":false,"internalType":"address","name":"offerer","type":"address"},{"indexed":true,"internalType":"address","name":"nftOwner","type":"address"}],"name":"AcceptedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"}],"name":"BoughtNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"CanceledAuction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"CanceledListedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerPrice","type":"uint256"},{"indexed":true,"internalType":"address","name":"offerer","type":"address"}],"name":"CanceledOfferedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"ChangedFeeReceiver","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ChangedPlatformFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minBidStep","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":true,"internalType":"address","name":"creator","type":"address"}],"name":"CreatedAuction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"ListedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerPrice","type":"uint256"},{"indexed":true,"internalType":"address","name":"offerer","type":"address"}],"name":"OfferedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bidPrice","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"}],"name":"PlacedBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"ResultedAuction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"role","type":"string"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"role","type":"string"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"LISTING_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_BUYING_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"address","name":"offerer","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.OfferNFTParams","name":"params","type":"tuple"}],"name":"acceptOfferNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"uint256","name":"bidPrice","type":"uint256"}],"name":"bidPlace","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint128","name":"startTimestamp","type":"uint128"},{"internalType":"uint128","name":"endTimestamp","type":"uint128"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint96","name":"royaltyFraction","type":"uint96"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct ILoveNFTShared.MintRequest","name":"params","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"buyLazyListedNFT","outputs":[{"internalType":"uint256","name":"priceWithRoyalty","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"buyNFT","outputs":[{"internalType":"uint256","name":"priceWithRoyalty","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"calculateFeeAndAmount","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"}],"name":"cancelAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"}],"name":"cancelListedNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"address","name":"offerer","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.OfferNFTParams","name":"params","type":"tuple"}],"name":"cancelOfferNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"accountToCheck","type":"address"},{"internalType":"string","name":"role","type":"string"}],"name":"checkRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"uint256","name":"minBidStep","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.AuctionParams","name":"params","type":"tuple"}],"name":"createAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"}],"name":"getAuction","outputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"enum ILoveNFTMarketplace.TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"uint256","name":"minBidStep","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"lastBidder","type":"address"},{"internalType":"uint256","name":"highestBid","type":"uint256"},{"components":[{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.TokenRoyaltyInfo","name":"royaltyInfo","type":"tuple"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"bool","name":"success","type":"bool"}],"internalType":"struct ILoveNFTMarketplace.AuctionNFT","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableBalance","outputs":[{"internalType":"uint256","name":"availableBalance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"}],"name":"getListedNFT","outputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"enum ILoveNFTMarketplace.TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.ListNFT","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"role","type":"string"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.ListingParams","name":"params","type":"tuple"}],"name":"listNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"address","name":"offerer","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.OfferNFTParams","name":"params","type":"tuple"}],"name":"offerNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"},{"internalType":"address","name":"receiver","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT","name":"nft","type":"tuple"}],"name":"resultAuction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ILoveNFTMarketplace.NFT[]","name":"nfts","type":"tuple[]"}],"name":"resultAuctions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"role","type":"string"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPlatformFee","type":"uint256"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"updateFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405260326003553480156200001657600080fd5b5060405162005858380380620058588339810160408190526200003991620001bb565b62000044336200006d565b60016002556200005481620000bd565b506001600160a01b0391821660a0521660805262000205565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620000c762000140565b6001600160a01b038116620001325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200013d816200006d565b50565b6000546001600160a01b031633146200019c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000129565b565b80516001600160a01b0381168114620001b657600080fd5b919050565b600080600060608486031215620001d157600080fd5b620001dc846200019e565b9250620001ec602085016200019e565b9150620001fc604085016200019e565b90509250925092565b60805160a05161558c620002cc600039600081816108b501528181610948015281816111230152818161161c01528181611660015281816120ab0152818161232301528181612779015281816127b401528181612a5a01528181612b3401528181612ea501528181612f0201528181612f46015281816133be01528181613755015281816138230152818161428e015281816142c901526145ce015260008181611f4f01528181611fa301528181612d9201528181612f840152613016015261558c6000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80638c0d1e521161011a578063b3f00674116100ad578063d42035611161007c578063d42035611461047e578063ef58594014610491578063f23a6e61146104b1578063f2fde38b146104d0578063ff604acf146104e357600080fd5b8063b3f006741461040d578063bc197c8114610420578063bddba4eb14610458578063c69bebe41461046b57600080fd5b8063a1aabda6116100e9578063a1aabda6146103ba578063a28ce5bd146103c3578063a3abb3d9146103d2578063a4a09290146103fa57600080fd5b80638c0d1e521461035c5780638da5cb5b1461036f57806398d506ab14610394578063996b7cab146103a757600080fd5b80632eae81421161019d57806343f8bf371161016c57806343f8bf371461030657806360bea21f1461032657806365cefe7c14610339578063715018a61461034c578063809dab6a1461035457600080fd5b80632eae8142146102ba5780632f168e9d146102cd5780634314a917146102e05780634390ca63146102f357600080fd5b806312e8e2c3116101d957806312e8e2c31461027c57806325b058081461028f57806326232a2e146102a25780632b86ae38146102ab57600080fd5b806301ffc9a71461020b57806308789521146102335780630988ca8c146102485780630c2e51ae1461025b575b600080fd5b61021e610219366004614a83565b6104f6565b60405190151581526020015b60405180910390f35b610246610241366004614b1d565b61052d565b005b61021e610256366004614b1d565b610649565b61026e610269366004614b8a565b61068d565b60405190815260200161022a565b61024661028a366004614bb5565b6109dd565b61024661029d366004614bce565b610a21565b61026e60035481565b61026e670de0b6b3a764000081565b61026e6102c8366004614bea565b610d17565b61026e6102db366004614bea565b6111c7565b6102466102ee366004614bce565b611730565b61026e610301366004614bce565b611ac0565b610319610314366004614bce565b611aec565b60405161022a9190614c34565b61026e610334366004614bea565b611c9e565b61026e610347366004614d18565b612282565b6102466122f1565b61026e612305565b61024661036a366004614d8d565b6123a5565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161022a565b61026e6103a2366004614b8a565b6124c1565b61026e6103b5366004614dc5565b612865565b61026e60045481565b61026e674563918244f4000081565b6103e56103e0366004614bb5565b612cf9565b6040805192835260208301919091520161022a565b61026e610408366004614dd7565b612d76565b60055461037c906001600160a01b031681565b61043f61042e366004614f68565b63bc197c8160e01b95945050505050565b6040516001600160e01b0319909116815260200161022a565b610246610466366004614b1d565b613082565b610246610479366004615016565b61319b565b61024661048c366004614bb5565b613239565b6104a461049f366004614bce565b6133eb565b60405161022a9190615033565b61043f6104bf366004615099565b63f23a6e6160e01b95945050505050565b6102466104de366004615016565b6134e6565b6102466104f1366004615102565b61355f565b60006001600160e01b03198216630271189760e51b148061052757506301ffc9a760e01b6001600160e01b03198316145b92915050565b610535613aea565b6001600160a01b03831660009081526001602052604090819020905161055e9084908490615114565b9081526040519081900360200190205460ff166105b95760405162461bcd60e51b81526020600482015260146024820152731c9bdb1948185b1c9958591e481c995d9bdad95960621b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526001602052604080822090516105e19085908590615114565b908152604051908190036020018120805492151560ff19909316929092179091556001600160a01b038416907f9f43a01c0d4ff5aff09b3b9b472df707ceefd3f948f8942f10fa1562a89213049061063c908590859061514d565b60405180910390a2505050565b6001600160a01b03831660009081526001602052604080822090516106719085908590615114565b9081526040519081900360200190205460ff1690509392505050565b60008260006008600061069f84613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b03168252600101548183015291506106dd90830183615016565b6001600160a01b031681600001516001600160a01b0316148015610708575081602001358160200151145b6107245760405162461bcd60e51b81526004016105b090615161565b61072c613ba3565b60006008600061073b88613b44565b8152602001908152602001600020905080600501544210156107955760405162461bcd60e51b8152602060048201526013602482015272185d58dd1a5bdb881b9bdd081cdd185c9d1959606a1b60448201526064016105b0565b80600601544211156107d95760405162461bcd60e51b815260206004820152600d60248201526c185d58dd1a5bdb88195b991959609a1b60448201526064016105b0565b806004015481600801546107ed91906151a7565b85101561083c5760405162461bcd60e51b815260206004820152601760248201527f6c657373207468616e206d696e2062696420707269636500000000000000000060448201526064016105b0565b6000610856610850368990038901896151ba565b87613bfa565b905060008082602001518861086b91906151a7565b60078501549091506001600160a01b0316156108df5760078401546008850154600a8601546001600160a01b03909216916108a690826151a7565b93506108dc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168386613d4e565b50505b6108e98282615212565b600460008282546108fa91906151a7565b9091555050600784018054336001600160a01b03199182168117909255600886018a905584516009870180549092166001600160a01b03918216179091556020850151600a870155610972917f0000000000000000000000000000000000000000000000000000000000000000909116903084613db6565b3360208a01803590610984908c615016565b6001600160a01b03167fee1a0230501a9dcbae451066086d830aee591f615be9ffe9a22908a17bae4bfe8b6040516109be91815260200190565b60405180910390a495505050506109d56001600255565b505092915050565b6109e5613aea565b60038190556040518181527f6010cf03b6e12d66f84ef928e1a14bdb853b594648e6b074b8fa3f659407e505906020015b60405180910390a150565b80600060066000610a3184613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff1690811115610a8e57610a8e614bfc565b6001811115610a9f57610a9f614bfc565b815260028201546001600160a01b0361010090910481166020830152600383015460408084019190915260048401546060840152600590930154608090920191909152908201519192501615801590610afc575060008160600151115b8015610b0c57508060a001514211155b610b455760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081b1a5cdd195960b21b60448201526064016105b0565b6000610b5084613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff1690811115610baf57610baf614bfc565b6001811115610bc057610bc0614bfc565b815260028201546001600160a01b036101009091048116602083015260038301546040808401919091526004840154606084015260059093015460809092019190915290820151919250163314610c465760405162461bcd60e51b815260206004820152600a6024820152693737ba1039b2b63632b960b11b60448201526064016105b0565b6000828152600660209081526040822080546001600160a01b0319168155600181018390556002810180546001600160a81b0319169055600381018390556004810183905560050191909155810151610ca490309033908890613df4565b60408082015182516020808201519151606080870151608088015160a0890151885192835294820152958601929092526001600160a01b0393841694929316917ffb08e5d69c419df44c760c7540d73292bef47ffdd651ae31b4b9236be25478f891015b60405180910390a45050505050565b60008181600781610d2784613b44565b81526020019081526020016000206000836040016020810190610d4a9190615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808801358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff90911690811115610dd457610dd4614bfc565b6001811115610de557610de5614bfc565b815260408051808201825260058401546001600160a01b03168152600684015460208281019190915283015260079092015460ff16151590820152909150610e339060608401908401615016565b6001600160a01b031681602001516001600160a01b0316148015610e5e575081606001358160400151145b610e985760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081bd999995c995960aa1b60448201526064016105b0565b8060a0015115610edd5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481858d8d95c1d195960821b60448201526064016105b0565b33610eee6060860160408701615016565b6001600160a01b031614610f325760405162461bcd60e51b815260206004820152600b60248201526a3737ba1037b33332b932b960a91b60448201526064016105b0565b6000610f3d85613b44565b6000818152600760205260408082209293509091908290610f649060608a01908a01615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808c01358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff90911690811115610fee57610fee614bfc565b6001811115610fff57610fff614bfc565b815260408051808201825260058401546001600160a01b0316815260068401546020828101919091528084019190915260079384015460ff161515928201929092526000868152929091528082209293506110609060608a01908a01615016565b6001600160a01b031681526020808201929092526040908101600090812060608a01358252835281812080546001600160a01b0319908116825560018201839055600282018054821690556003820183905560048201805460ff1990811690915560058301805490921690915560068201839055600790910180549091169055608084015190920151908301516110f791906151a7565b9050806004600082825461110b9190615212565b9091555050602082015161114a906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083613d4e565b61115a6060880160408901615016565b6001600160a01b03168260000151602001518360000151600001516001600160a01b03167f63f1b8de9be45201eebe0b3a58531e124aa1d9c543611fd4aa2020f835efbe8885604001516040516111b391815260200190565b60405180910390a4945050505b5050919050565b600081816007816111d784613b44565b815260200190815260200160002060008360400160208101906111fa9190615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808801358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff9091169081111561128457611284614bfc565b600181111561129557611295614bfc565b815260408051808201825260058401546001600160a01b03168152600684015460208281019190915283015260079092015460ff161515908201529091506112e39060608401908401615016565b6001600160a01b031681602001516001600160a01b031614801561130e575081606001358160400151145b6113485760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081bd999995c995960aa1b60448201526064016105b0565b8060a001511561138d5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481858d8d95c1d195960821b60448201526064016105b0565b611395613ba3565b60006113a085613b44565b60008181526007602052604080822092935090919082906113c79060608a01908a01615016565b6001600160a01b0390811682526020808301939093526040918201600090812060608b0135825284528281208682526006855283822084516101008101909552805490931660c0850190815260018085015460e08701529085526002840154919650919484019160ff9091169081111561144357611443614bfc565b600181111561145457611454614bfc565b815260028201546001600160a01b0361010090910481166020830152600383015460408084019190915260048401546060840152600590930154608090920191909152908201519192503091161561154a5781604001516001600160a01b0316336001600160a01b0316146114fe5760405162461bcd60e51b815260206004820152601060248201526f3737ba103634b9ba32b21037bbb732b960811b60448201526064016105b0565b600084815260066020526040812080546001600160a01b0319168155600181018290556002810180546001600160a81b031916905560038101829055600481018290556005015561156d565b61156a3361155d368b90038b018b6151ba565b600486015460ff16613f3e565b50335b6040805180820190915260058401546001600160a01b031681526006840154602082018190526000906115a49060608c01356151a7565b905080600460008282546115b89190615212565b909155505060078501805460ff1916600117905560006115db60608c0135612cf9565b509050336001600160a01b031683600001516001600160a01b03160361164957600083602001518261160d91906151a7565b90506116436001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383613d4e565b50611687565b6116538330614247565b6116876001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383613d4e565b6116aa8461169b60608e0160408f01615016565b60048901548e9060ff16613df4565b3360208c018035906116bc908e615016565b6001600160a01b03167fb74b122f793476356e38304aa6158223018c6637ed6b2425a91c83c4bac4115f8e606001358f60400160208101906116fe9190615016565b604080519283526001600160a01b0390911660208301520160405180910390a498505050505050506111c06001600255565b8060006008600061174084613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b031682526001015481830152915061177e90830183615016565b6001600160a01b031681600001516001600160a01b03161480156117a9575081602001358160200151145b6117c55760405162461bcd60e51b81526004016105b090615161565b60006117d084613b44565b600081815260086020908152604080832081516101c0810190925280546001600160a01b031661018083019081526001808301546101a0850152908352600282015495965093949193909284019160ff169081111561183157611831614bfc565b600181111561184257611842614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e086015280518082018252600987015484168152600a8701549281019290925292840152600b9093015480841661012084015260ff600160a01b909104161515610140909201919091528201519192501633146119365760405162461bcd60e51b81526020600482015260136024820152723737ba1030bab1ba34b7b71031b932b0ba37b960691b60448201526064016105b0565b806101600151156119895760405162461bcd60e51b815260206004820152601760248201527f61756374696f6e20616c7265616479207375636365737300000000000000000060448201526064016105b0565b60e08101516001600160a01b0316156119da5760405162461bcd60e51b815260206004820152601360248201527230b63932b0b23c903430bb32903134b23232b960691b60448201526064016105b0565b6000828152600860208181526040832080546001600160a01b03199081168255600182018590556002820180546001600160a81b031990811690915560038301869055600483018690556005830186905560068301869055600783018054831690559382018590556009820180549091169055600a810193909355600b90920180549091169055810151611a7390309033908890613df4565b60208501803590611a849087615016565b6001600160a01b03167f7ae0b2dad8211114d3703f3eae564996deaa436d58d3860aff659ddc284b58ec60405160405180910390a35050505050565b600080611acc836142f2565b90508060046000828254611ae09190615212565b90915550909392505050565b611b70604080516101c081018252600061018082018181526101a0830182905282526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052835180850190945281845283015290610120820190815260006020820181905260409091015290565b60086000611b7d84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff1690811115611bdc57611bdc614bfc565b6001811115611bed57611bed614bfc565b81526002820154610100908190046001600160a01b0390811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b90920154918216610120820152600160a01b90910460ff1615156101409091015292915050565b60008181600881611cae84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff1690811115611d0d57611d0d614bfc565b6001811115611d1e57611d1e614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b9092015480831661012083015260ff600160a01b90910416151561014090910152815151919250161580611ddd57508061016001515b611e235760405162461bcd60e51b8152602060048201526017602482015276185d58dd1a5bdb88185b1c9958591e4818dc99585d1959604a1b60448201526064016105b0565b8360600135674563918244f400008111611e4f5760405162461bcd60e51b81526004016105b090615225565b6000611e66611e616020880188615016565b614693565b90506000816001811115611e7c57611e7c614bfc565b03611f45576000611e906020880188615016565b6040516331a9108f60e11b8152602089013560048201526001600160a01b039190911690636352211e90602401602060405180830381865afa158015611eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efe919061526e565b6001600160a01b031603611f405760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016105b0565b61204e565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016611f7c6020880188615016565b6001600160a01b03160361204e57604051634f558e7960e01b8152602087013560048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634f558e7990602401602060405180830381865afa158015611ff2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612016919061528b565b61204e5760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016105b0565b600061206c612062368990038901896151ba565b8860600135613bfa565b905060008160200151886060013561208491906151a7565b9050806004600082825461209891906151a7565b909155506120d390506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084613db6565b6040805160c08101909152806120ee368b90038b018b6151ba565b81523360208201526060808b013560408301520184600181111561211457612114614bfc565b815260208101849052600060409091018190526007906121338b613b44565b815260208082019290925260409081016000908120338252835281812060608d8101358352908452908290208451805182546001600160a01b03199081166001600160a01b039283161784559186015160018085019190915595870151600284018054909316911617905591840151600383015583015160048201805492939192909160ff199091169083818111156121ce576121ce614bfc565b0217905550608082015180516005830180546001600160a01b0319166001600160a01b03909216919091179055602090810151600683015560a0909201516007909101805460ff191691151591909117905533908901803590612231908b615016565b6001600160a01b03167f527cfdddfc33a6d9f2322227fe65218bb4f9da4914c5813a4cedc78bc0f55c5a8b6060013560405161226f91815260200190565b60405180910390a4979650505050505050565b600080805b838110156122d15760006122b18686848181106122a6576122a66152ad565b9050604002016142f2565b90506122bd81846151a7565b925050806122ca906152c3565b9050612287565b5080600460008282546122e49190615212565b9091555090949350505050565b6122f9613aea565b61230360006147ce565b565b600480546040516370a0823160e01b815230928101929092526000917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612372573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239691906152dc565b6123a09190615212565b905090565b6123ad613aea565b6000806008816123bc86613b44565b8152602081019190915260400160009081206002015461010090046001600160a01b031691909114159150806006816123f487613b44565b815260208101919091526040016000206002015461010090046001600160a01b031614801591506124585760405162461bcd60e51b815260206004820152600e60248201526d6e6674206973206f6e2073616c6560901b60448201526064016105b0565b811561249a5760405162461bcd60e51b815260206004820152601160248201527037333a1034b99037b71030bab1ba34b7b760791b60448201526064016105b0565b60006124ac611e616020870187615016565b90506124ba30858784613df4565b5050505050565b6000826000600660006124d384613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff169081111561253057612530614bfc565b600181111561254157612541614bfc565b815260028201546001600160a01b036101009091048116602083015260038301546040808401919091526004840154606084015260059093015460809092019190915290820151919250161580159061259e575060008160600151115b80156125ae57508060a001514211155b6125e75760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081b1a5cdd195960b21b60448201526064016105b0565b60006125f286613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff169081111561265157612651614bfc565b600181111561266257612662614bfc565b8152600282015461010090046001600160a01b031660208201526003820154604082015260048201546060808301919091526005909201546080909101528101519091508610156126ee5760405162461bcd60e51b81526020600482015260166024820152756c657373207468616e206c697374656420707269636560501b60448201526064016105b0565b600082815260066020526040812080546001600160a01b0319168155600181018290556002810180546001600160a81b0319169055600381018290556004810182905560050181905561274f612749368a90038a018a6151ba565b88613bfa565b905061275b8133614247565b60008061276789612cf9565b90925090506127a16001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084613db6565b60408401516127dd906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690339085613db6565b6127ed30338c8760200151613df4565b3360208b018035906127ff908d615016565b60408088015181518e81526001600160a01b0391821660208201529216917f7ecd9705c4bad458d33cbb498a44bd1a8591b38703a9db6df94f1f390bc9bb1c910160405180910390a46020830151612857908a6151a7565b9a9950505050505050505050565b60008160400135674563918244f4000081116128935760405162461bcd60e51b81526004016105b090615225565b826060013542111580156128ae575082606001358360800135115b6128ef5760405162461bcd60e51b8152602060048201526012602482015271696e76616c69642074696d652072616e676560701b60448201526064016105b0565b60006128fa84613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff169081111561295957612959614bfc565b600181111561296a5761296a614bfc565b8152600282015461010090046001600160a01b031660208083019190915260038301546040830152600483015460608301526005909201546080909101529091506000906129be90611e6190880188615016565b60408301519091506001600160a01b031615612a225760408201516001600160a01b03163314612a1d5760405162461bcd60e51b815260206004820152600a6024820152693737ba1039b2b63632b960b11b60448201526064016105b0565b612b64565b612a3b33612a35368990038901896151ba565b83613f3e565b6040516370a0823160e01b8152336004820152670de0b6b3a7640000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612acd91906152dc565b1015612b1b5760405162461bcd60e51b815260206004820152601a60248201527f6e6f20746f6b656e7320666f7220706c6174666f726d2066656500000000000060448201526064016105b0565b612b2733308884613df4565b612b646001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330670de0b6b3a7640000613db6565b6040805160c0810190915280612b7f368990038901896151ba565b8152602001826001811115612b9657612b96614bfc565b815233602080830191909152604089810135818401526060808b0135908401526080808b0135930192909252600086815260068252919091208251805182546001600160a01b0319166001600160a01b039091161782558201516001808301919091559183015160028201805492939192909160ff19909116908381811115612c2157612c21614bfc565b021790555060408201516002820180546001600160a01b0390921661010002610100600160a81b0319909216919091179055606082015160038201556080820151600482015560a0909101516005909101553360208701803590612c859089615016565b6001600160a01b03167f36f968ca1dfee9f8ffd2bbc98ce38c681ac3d9bfb14ac469b0fa3c9a6b44550d89604001358a606001358b60800135604051612cde939291909283526020830191909152604082015260600190565b60405180910390a450670de0b6b3a764000095945050505050565b6000806000606460035485612d0e91906152f5565b612d24906b033b2e3c9fd0803ce80000006152f5565b612d2e919061530c565b9050612d466b033b2e3c9fd0803ce80000008261530c565b9150674563918244f40000821015612d6457674563918244f4000091505b612d6e8285615212565b925050915091565b6000833560601c81612d8b6020870135612cf9565b50905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663180b0d7e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e129190615343565b6001600160601b0316612e2b60e0890160c08a0161536b565b612e42906001600160601b031660208a01356152f5565b612e4c919061530c565b9050600060405180604001604052808960a0016020810190612e6e9190615016565b6001600160a01b03168152602001838152509050612ecd333083602001518b60200135612e9b91906151a7565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016929190613db6565b80516001600160a01b03808616911603612f2f576000816020015184612ef391906151a7565b9050612f296001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168683613d4e565b50612f6d565b612f398130614247565b612f6d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585613d4e565b604051631c7e53fd60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906371f94ff490612fbf9033908c908c908c906004016153e5565b600060405180830381600087803b158015612fd957600080fd5b505af1158015612fed573d6000803e3d6000fd5b5050604080516020808d013582526001600160a01b03898116918301919091523394508c3593507f000000000000000000000000000000000000000000000000000000000000000016917f7ecd9705c4bad458d33cbb498a44bd1a8591b38703a9db6df94f1f390bc9bb1c910160405180910390a48760200135816020015161307691906151a7565b98975050505050505050565b61308a613aea565b6001600160a01b0383166000908152600160205260409081902090516130b39084908490615114565b9081526040519081900360200190205460ff161561310a5760405162461bcd60e51b81526020600482015260146024820152731c9bdb1948185b1c9958591e4819dc985b9d195960621b60448201526064016105b0565b6001806000856001600160a01b03166001600160a01b031681526020019081526020016000208383604051613140929190615114565b908152604051908190036020018120805492151560ff19909316929092179091556001600160a01b038416907fb710f7d3e79cb091613cfea70444ea824ad23f2b1297bdea427bc6f097e346a89061063c908590859061514d565b6131a3613aea565b6001600160a01b0381166131eb5760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206164647265737360881b60448201526064016105b0565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527fce118ac8247ab22e55e5f2799d4f5dcf662d59fe0d207b98d6a89764ae81d48190602001610a16565b6040518060400160405280600581526020016430b236b4b760d91b81525060016000336001600160a01b03166001600160a01b031681526020019081526020016000208160405161328a91906154d9565b9081526040519081900360200190205460ff16806132b257506000546001600160a01b031633145b6132fe5760405162461bcd60e51b815260206004820152601d60248201527f6163636f756e7420646f65736e742068617665207468697320726f6c6500000060448201526064016105b0565b6005546001600160a01b03166133565760405162461bcd60e51b815260206004820152601b60248201527f696e76616c69642066656552656365697665722061646472657373000000000060448201526064016105b0565b8161335f612305565b10156133ad5760405162461bcd60e51b815260206004820152601f60248201527f696e73756666696369656e742062616c616e636520287265736572766564290060448201526064016105b0565b6005546133e7906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911684613d4e565b5050565b6040805161010081018252600060c0820181815260e08301829052825260208201819052918101829052606081018290526080810182905260a08101919091526006600061343884613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff169081111561349557613495614bfc565b60018111156134a6576134a6614bfc565b8152600282015461010090046001600160a01b03166020820152600382015460408201526004820154606082015260059091015460809091015292915050565b6134ee613aea565b6001600160a01b0381166135535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b0565b61355c816147ce565b50565b80600060088161356e84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff16908111156135cd576135cd614bfc565b60018111156135de576135de614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b9092015480831661012083015260ff600160a01b9091041615156101409091015281515191925016158061369d57508061016001515b6136e35760405162461bcd60e51b8152602060048201526017602482015276185d58dd1a5bdb88185b1c9958591e4818dc99585d1959604a1b60448201526064016105b0565b8260400135674563918244f40000811161370f5760405162461bcd60e51b81526004016105b090615225565b6000613721611e616020870187615016565b905061373633612a35368890038801886151ba565b6040516370a0823160e01b8152336004820152670de0b6b3a7640000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156137a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c891906152dc565b10156138165760405162461bcd60e51b815260206004820152601a60248201527f6e6f20746f6b656e7320666f7220706c6174666f726d2066656500000000000060448201526064016105b0565b6138536001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330670de0b6b3a7640000613db6565b61385f33308784613df4565b6040805161018081019091528061387b368890038801886151ba565b815260200182600181111561389257613892614bfc565b8152602001336001600160a01b031681526020018660400135815260200186606001358152602001866080013581526020018660a00135815260200160006001600160a01b0316815260200186604001358152602001604051806040016040528060006001600160a01b031681526020016000815250815260200160006001600160a01b03168152602001600015158152506008600061393488600001613b44565b81526020808201929092526040016000208251805182546001600160a01b0319166001600160a01b039091161782558201516001808301919091559183015160028201805492939192909160ff1990911690838181111561399757613997614bfc565b021790555060408201516002820180546001600160a01b03928316610100908102610100600160a81b031990921691909117909155606084015160038401556080840151600484015560a0840151600584015560c0840151600684015560e08401516007840180549184166001600160a01b031992831617905590840151600884015561012084015180516009850180549185169190931617909155602090810151600a840155610140840151600b9093018054610160909501511515600160a01b026001600160a81b031990951693909216929092179290921790915533908601803590613a869088615016565b6001600160a01b03167f5eacffdbd5cce2705a4746bb9e12d30b78923dfdc1ff8d9a4e211bb6eaea2c11886040013589606001358a608001358b60a00135604051610d08949392919093845260208401929092526040830152606082015260800190565b6000546001600160a01b031633146123035760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b0565b6000613b536020830183615016565b8260200135604051602001613b8692919060609290921b6bffffffffffffffffffffffff19168252601482015260340190565b604051602081830303815290604052805190602001209050919050565b6002805403613bf45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105b0565b60028055565b60408051808201825260008082526020820152835191516301ffc9a760e01b815263152a902d60e11b600482015290916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015613c5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7e919061528b565b15610527578251602084015160405163152a902d60e11b815260009283926001600160a01b0390911691632a55205a91613cc5918890600401918252602082015260400190565b6040805180830381865afa158015613ce1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d0591906154f5565b9092509050613d1560058561530c565b811115613d2a57613d2760058561530c565b90505b604080518082019091526001600160a01b0390921682526020820152905092915050565b6040516001600160a01b038316602482015260448101829052613db190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261481e565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613dee9085906323b872dd60e01b90608401613d7a565b50505050565b6001816001811115613e0857613e08614bfc565b03613ea357613e1a6020830183615016565b604051637921219560e11b81526001600160a01b0386811660048301528581166024830152602085013560448301526001606483015260a06084830152600060a4830152919091169063f242432a9060c401600060405180830381600087803b158015613e8657600080fd5b505af1158015613e9a573d6000803e3d6000fd5b50505050613dee565b6000816001811115613eb757613eb7614bfc565b03613dee57613ec96020830183615016565b6040516323b872dd60e01b81526001600160a01b03868116600483015285811660248301526020850135604483015291909116906323b872dd90606401600060405180830381600087803b158015613f2057600080fd5b505af1158015613f34573d6000803e3d6000fd5b5050505050505050565b60006001826001811115613f5457613f54614bfc565b036140645782516020840151604051627eeac760e11b81526001926001600160a01b03169162fdd58e91613fa09189916004016001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fe191906152dc565b1015801561405d5750825160405163e985e9c560e01b81526001600160a01b0386811660048301523060248301529091169063e985e9c590604401602060405180830381865afa158015614039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061405d919061528b565b90506141fa565b600082600181111561407857614078614bfc565b036141fa57825160208401516040516331a9108f60e11b815260048101919091526001600160a01b03868116921690636352211e90602401602060405180830381865afa1580156140cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140f1919061526e565b6001600160a01b03161480156141f757508251602084015160405163020604bf60e21b8152600481019190915230916001600160a01b03169063081812fc90602401602060405180830381865afa158015614150573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614174919061526e565b6001600160a01b031614806141f75750825160405163e985e9c560e01b81526001600160a01b0386811660048301523060248301529091169063e985e9c590604401602060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f7919061528b565b90505b80613dee5760405162461bcd60e51b815260206004820152601c60248201527f6e6f74206f776e6572206f7220617070726f76656420746f6b656e730000000060448201526064016105b0565b81516001600160a01b031615801590614264575060008260200151115b156133e757306001600160a01b038216036142b457815160208301516133e7916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691613d4e565b815160208301516133e7916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691849190613db6565b60008160006008600061430484613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b031682526001015481830152915061434290830183615016565b6001600160a01b031681600001516001600160a01b031614801561436d575081602001358160200151145b6143895760405162461bcd60e51b81526004016105b090615161565b60006008600061439887613b44565b8152602001908152602001600020905080600b0160149054906101000a900460ff16156143fa5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c995cdd5b1d195960821b60448201526064016105b0565b806006015442116144415760405162461bcd60e51b8152602060048201526011602482015270185d58dd1a5bdb881b9bdd08195b991959607a1b60448201526064016105b0565b6002810154600782015460088301546001600160a01b03610100840481169392169160ff168261456157600860006144788b613b44565b81526020810191909152604001600090812080546001600160a01b03199081168255600182018390556002820180546001600160a81b0319908116909155600383018490556004830184905560058301849055600683018490556007830180548316905560088301849055600983018054909216909155600a820192909255600b018054909116905561450d30858b84613df4565b6020890180359061451e908b615016565b6001600160a01b03167f7ae0b2dad8211114d3703f3eae564996deaa436d58d3860aff659ddc284b58ec60405160405180910390a36000975050505050506111c0565b600b850180546001600160a01b038086166001600160a81b031990921691909117600160a01b179091556040805180820190915260098701549091168152600a86015460208201526145b38130614247565b60006145be84612cf9565b5090506145f56001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168783613d4e565b600287015461460c90309087908e9060ff16613df4565b6001600160a01b03851660208c01803590614627908e615016565b604080516001600160a01b038b81168252602082018a90523382840152915192909116917f69b9e47c169c6463a921b70743b7d6705d5ee0b376296ae9bf0b1a3678fb3f5d9181900360600190a4602082015161468490856151a7565b9b9a5050505050505050505050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526000906001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156146e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614705919061528b565b1561471257506001919050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa15801561475d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614781919061528b565b1561478e57506000919050565b60405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204e4654207479706560801b60448201526064016105b0565b919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000614873826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148f39092919063ffffffff16565b9050805160001480614894575080806020019051810190614894919061528b565b613db15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105b0565b6060614902848460008561490a565b949350505050565b60608247101561496b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105b0565b600080866001600160a01b0316858760405161498791906154d9565b60006040518083038185875af1925050503d80600081146149c4576040519150601f19603f3d011682016040523d82523d6000602084013e6149c9565b606091505b50915091506149da878383876149e5565b979650505050505050565b60608315614a54578251600003614a4d576001600160a01b0385163b614a4d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b0565b5081614902565b6149028383815115614a695781518083602001fd5b8060405162461bcd60e51b81526004016105b09190615523565b600060208284031215614a9557600080fd5b81356001600160e01b031981168114614aad57600080fd5b9392505050565b6001600160a01b038116811461355c57600080fd5b80356147c981614ab4565b60008083601f840112614ae657600080fd5b50813567ffffffffffffffff811115614afe57600080fd5b602083019150836020828501011115614b1657600080fd5b9250929050565b600080600060408486031215614b3257600080fd5b8335614b3d81614ab4565b9250602084013567ffffffffffffffff811115614b5957600080fd5b614b6586828701614ad4565b9497909650939450505050565b600060408284031215614b8457600080fd5b50919050565b60008060608385031215614b9d57600080fd5b614ba78484614b72565b946040939093013593505050565b600060208284031215614bc757600080fd5b5035919050565b600060408284031215614be057600080fd5b614aad8383614b72565b600060808284031215614b8457600080fd5b634e487b7160e01b600052602160045260246000fd5b60028110614c3057634e487b7160e01b600052602160045260246000fd5b9052565b815180516001600160a01b03168252602090810151908201526101c081016020830151614c646040840182614c12565b5060408301516001600160a01b03811660608401525060608301516080830152608083015160a083015260a083015160c083015260c083015160e083015260e0830151610100614cbe818501836001600160a01b03169052565b840151610120848101919091528401519050610140614cf28185018380516001600160a01b03168252602090810151910152565b8401516001600160a01b0316610180840152506101609092015115156101a09091015290565b60008060208385031215614d2b57600080fd5b823567ffffffffffffffff80821115614d4357600080fd5b818501915085601f830112614d5757600080fd5b813581811115614d6657600080fd5b8660208260061b8501011115614d7b57600080fd5b60209290920196919550909350505050565b60008060608385031215614da057600080fd5b614daa8484614b72565b91506040830135614dba81614ab4565b809150509250929050565b600060a08284031215614b8457600080fd5b600080600060408486031215614dec57600080fd5b833567ffffffffffffffff80821115614e0457600080fd5b908501906101008288031215614e1957600080fd5b90935060208501359080821115614e2f57600080fd5b50614b6586828701614ad4565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614e7b57614e7b614e3c565b604052919050565b600082601f830112614e9457600080fd5b8135602067ffffffffffffffff821115614eb057614eb0614e3c565b8160051b614ebf828201614e52565b9283528481018201928281019087851115614ed957600080fd5b83870192505b848310156149da57823582529183019190830190614edf565b600082601f830112614f0957600080fd5b813567ffffffffffffffff811115614f2357614f23614e3c565b614f36601f8201601f1916602001614e52565b818152846020838601011115614f4b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215614f8057600080fd5b8535614f8b81614ab4565b94506020860135614f9b81614ab4565b9350604086013567ffffffffffffffff80821115614fb857600080fd5b614fc489838a01614e83565b94506060880135915080821115614fda57600080fd5b614fe689838a01614e83565b93506080880135915080821115614ffc57600080fd5b5061500988828901614ef8565b9150509295509295909350565b60006020828403121561502857600080fd5b8135614aad81614ab4565b815180516001600160a01b031682526020908101519082015260e0810160208301516150626040840182614c12565b5060018060a01b03604084015116606083015260608301516080830152608083015160a083015260a083015160c083015292915050565b600080600080600060a086880312156150b157600080fd5b85356150bc81614ab4565b945060208601356150cc81614ab4565b93506040860135925060608601359150608086013567ffffffffffffffff8111156150f657600080fd5b61500988828901614ef8565b600060c08284031215614b8457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081526000614902602083018486615124565b602080825260169082015275185d58dd1a5bdb881a5cc81b9bdd0818dc99585d195960521b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561052757610527615191565b6000604082840312156151cc57600080fd5b6040516040810181811067ffffffffffffffff821117156151ef576151ef614e3c565b60405282356151fd81614ab4565b81526020928301359281019290925250919050565b8181038181111561052757610527615191565b60208082526029908201527f7072696365206973206c657373207468616e20746865206d696e696d756d206360408201526837b6b6b4b9b9b4b7b760b91b606082015260800190565b60006020828403121561528057600080fd5b8151614aad81614ab4565b60006020828403121561529d57600080fd5b81518015158114614aad57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016152d5576152d5615191565b5060010190565b6000602082840312156152ee57600080fd5b5051919050565b808202811582820484141761052757610527615191565b60008261532957634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b038116811461355c57600080fd5b60006020828403121561535557600080fd5b8151614aad8161532e565b80356147c98161532e565b60006020828403121561537d57600080fd5b8135614aad8161532e565b80356001600160801b03811681146147c957600080fd5b6000808335601e198436030181126153b657600080fd5b830160208101925035905067ffffffffffffffff8111156153d657600080fd5b803603821315614b1657600080fd5b60018060a01b0385168152606060208201528335606082015260208401356080820152600061541660408601615388565b6001600160801b0380821660a08501528061543360608901615388565b1660c08501525050615448608086018661539f565b6101008060e086015261546061016086018385615124565b925061546e60a08901614ac9565b6001600160a01b0316908501525061548860c08701615360565b6001600160601b031661012084015260e086013561014084015282810360408401526149da818587615124565b60005b838110156154d05781810151838201526020016154b8565b50506000910152565b600082516154eb8184602087016154b5565b9190910192915050565b6000806040838503121561550857600080fd5b825161551381614ab4565b6020939093015192949293505050565b60208152600082518060208401526155428160408501602087016154b5565b601f01601f1916919091016040019291505056fea2646970667358221220f591586e65eb5ed9c26c2f0b3bdfff2a468c5912d1e768040e1c25c5c5aa8d5164736f6c63430008120033000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d820000000000000000000000000d6f043296c9e950ae5aaf8add002358cd24bd46

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c80638c0d1e521161011a578063b3f00674116100ad578063d42035611161007c578063d42035611461047e578063ef58594014610491578063f23a6e61146104b1578063f2fde38b146104d0578063ff604acf146104e357600080fd5b8063b3f006741461040d578063bc197c8114610420578063bddba4eb14610458578063c69bebe41461046b57600080fd5b8063a1aabda6116100e9578063a1aabda6146103ba578063a28ce5bd146103c3578063a3abb3d9146103d2578063a4a09290146103fa57600080fd5b80638c0d1e521461035c5780638da5cb5b1461036f57806398d506ab14610394578063996b7cab146103a757600080fd5b80632eae81421161019d57806343f8bf371161016c57806343f8bf371461030657806360bea21f1461032657806365cefe7c14610339578063715018a61461034c578063809dab6a1461035457600080fd5b80632eae8142146102ba5780632f168e9d146102cd5780634314a917146102e05780634390ca63146102f357600080fd5b806312e8e2c3116101d957806312e8e2c31461027c57806325b058081461028f57806326232a2e146102a25780632b86ae38146102ab57600080fd5b806301ffc9a71461020b57806308789521146102335780630988ca8c146102485780630c2e51ae1461025b575b600080fd5b61021e610219366004614a83565b6104f6565b60405190151581526020015b60405180910390f35b610246610241366004614b1d565b61052d565b005b61021e610256366004614b1d565b610649565b61026e610269366004614b8a565b61068d565b60405190815260200161022a565b61024661028a366004614bb5565b6109dd565b61024661029d366004614bce565b610a21565b61026e60035481565b61026e670de0b6b3a764000081565b61026e6102c8366004614bea565b610d17565b61026e6102db366004614bea565b6111c7565b6102466102ee366004614bce565b611730565b61026e610301366004614bce565b611ac0565b610319610314366004614bce565b611aec565b60405161022a9190614c34565b61026e610334366004614bea565b611c9e565b61026e610347366004614d18565b612282565b6102466122f1565b61026e612305565b61024661036a366004614d8d565b6123a5565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161022a565b61026e6103a2366004614b8a565b6124c1565b61026e6103b5366004614dc5565b612865565b61026e60045481565b61026e674563918244f4000081565b6103e56103e0366004614bb5565b612cf9565b6040805192835260208301919091520161022a565b61026e610408366004614dd7565b612d76565b60055461037c906001600160a01b031681565b61043f61042e366004614f68565b63bc197c8160e01b95945050505050565b6040516001600160e01b0319909116815260200161022a565b610246610466366004614b1d565b613082565b610246610479366004615016565b61319b565b61024661048c366004614bb5565b613239565b6104a461049f366004614bce565b6133eb565b60405161022a9190615033565b61043f6104bf366004615099565b63f23a6e6160e01b95945050505050565b6102466104de366004615016565b6134e6565b6102466104f1366004615102565b61355f565b60006001600160e01b03198216630271189760e51b148061052757506301ffc9a760e01b6001600160e01b03198316145b92915050565b610535613aea565b6001600160a01b03831660009081526001602052604090819020905161055e9084908490615114565b9081526040519081900360200190205460ff166105b95760405162461bcd60e51b81526020600482015260146024820152731c9bdb1948185b1c9958591e481c995d9bdad95960621b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526001602052604080822090516105e19085908590615114565b908152604051908190036020018120805492151560ff19909316929092179091556001600160a01b038416907f9f43a01c0d4ff5aff09b3b9b472df707ceefd3f948f8942f10fa1562a89213049061063c908590859061514d565b60405180910390a2505050565b6001600160a01b03831660009081526001602052604080822090516106719085908590615114565b9081526040519081900360200190205460ff1690509392505050565b60008260006008600061069f84613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b03168252600101548183015291506106dd90830183615016565b6001600160a01b031681600001516001600160a01b0316148015610708575081602001358160200151145b6107245760405162461bcd60e51b81526004016105b090615161565b61072c613ba3565b60006008600061073b88613b44565b8152602001908152602001600020905080600501544210156107955760405162461bcd60e51b8152602060048201526013602482015272185d58dd1a5bdb881b9bdd081cdd185c9d1959606a1b60448201526064016105b0565b80600601544211156107d95760405162461bcd60e51b815260206004820152600d60248201526c185d58dd1a5bdb88195b991959609a1b60448201526064016105b0565b806004015481600801546107ed91906151a7565b85101561083c5760405162461bcd60e51b815260206004820152601760248201527f6c657373207468616e206d696e2062696420707269636500000000000000000060448201526064016105b0565b6000610856610850368990038901896151ba565b87613bfa565b905060008082602001518861086b91906151a7565b60078501549091506001600160a01b0316156108df5760078401546008850154600a8601546001600160a01b03909216916108a690826151a7565b93506108dc6001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e168386613d4e565b50505b6108e98282615212565b600460008282546108fa91906151a7565b9091555050600784018054336001600160a01b03199182168117909255600886018a905584516009870180549092166001600160a01b03918216179091556020850151600a870155610972917f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e909116903084613db6565b3360208a01803590610984908c615016565b6001600160a01b03167fee1a0230501a9dcbae451066086d830aee591f615be9ffe9a22908a17bae4bfe8b6040516109be91815260200190565b60405180910390a495505050506109d56001600255565b505092915050565b6109e5613aea565b60038190556040518181527f6010cf03b6e12d66f84ef928e1a14bdb853b594648e6b074b8fa3f659407e505906020015b60405180910390a150565b80600060066000610a3184613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff1690811115610a8e57610a8e614bfc565b6001811115610a9f57610a9f614bfc565b815260028201546001600160a01b0361010090910481166020830152600383015460408084019190915260048401546060840152600590930154608090920191909152908201519192501615801590610afc575060008160600151115b8015610b0c57508060a001514211155b610b455760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081b1a5cdd195960b21b60448201526064016105b0565b6000610b5084613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff1690811115610baf57610baf614bfc565b6001811115610bc057610bc0614bfc565b815260028201546001600160a01b036101009091048116602083015260038301546040808401919091526004840154606084015260059093015460809092019190915290820151919250163314610c465760405162461bcd60e51b815260206004820152600a6024820152693737ba1039b2b63632b960b11b60448201526064016105b0565b6000828152600660209081526040822080546001600160a01b0319168155600181018390556002810180546001600160a81b0319169055600381018390556004810183905560050191909155810151610ca490309033908890613df4565b60408082015182516020808201519151606080870151608088015160a0890151885192835294820152958601929092526001600160a01b0393841694929316917ffb08e5d69c419df44c760c7540d73292bef47ffdd651ae31b4b9236be25478f891015b60405180910390a45050505050565b60008181600781610d2784613b44565b81526020019081526020016000206000836040016020810190610d4a9190615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808801358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff90911690811115610dd457610dd4614bfc565b6001811115610de557610de5614bfc565b815260408051808201825260058401546001600160a01b03168152600684015460208281019190915283015260079092015460ff16151590820152909150610e339060608401908401615016565b6001600160a01b031681602001516001600160a01b0316148015610e5e575081606001358160400151145b610e985760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081bd999995c995960aa1b60448201526064016105b0565b8060a0015115610edd5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481858d8d95c1d195960821b60448201526064016105b0565b33610eee6060860160408701615016565b6001600160a01b031614610f325760405162461bcd60e51b815260206004820152600b60248201526a3737ba1037b33332b932b960a91b60448201526064016105b0565b6000610f3d85613b44565b6000818152600760205260408082209293509091908290610f649060608a01908a01615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808c01358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff90911690811115610fee57610fee614bfc565b6001811115610fff57610fff614bfc565b815260408051808201825260058401546001600160a01b0316815260068401546020828101919091528084019190915260079384015460ff161515928201929092526000868152929091528082209293506110609060608a01908a01615016565b6001600160a01b031681526020808201929092526040908101600090812060608a01358252835281812080546001600160a01b0319908116825560018201839055600282018054821690556003820183905560048201805460ff1990811690915560058301805490921690915560068201839055600790910180549091169055608084015190920151908301516110f791906151a7565b9050806004600082825461110b9190615212565b9091555050602082015161114a906001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e169083613d4e565b61115a6060880160408901615016565b6001600160a01b03168260000151602001518360000151600001516001600160a01b03167f63f1b8de9be45201eebe0b3a58531e124aa1d9c543611fd4aa2020f835efbe8885604001516040516111b391815260200190565b60405180910390a4945050505b5050919050565b600081816007816111d784613b44565b815260200190815260200160002060008360400160208101906111fa9190615016565b6001600160a01b039081168252602080830193909352604091820160009081206060808801358352908552908390208351610100810185528154841660c0820190815260018084015460e084015290825260028301549094169581019590955260038101549385019390935260048301549084019160ff9091169081111561128457611284614bfc565b600181111561129557611295614bfc565b815260408051808201825260058401546001600160a01b03168152600684015460208281019190915283015260079092015460ff161515908201529091506112e39060608401908401615016565b6001600160a01b031681602001516001600160a01b031614801561130e575081606001358160400151145b6113485760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081bd999995c995960aa1b60448201526064016105b0565b8060a001511561138d5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481858d8d95c1d195960821b60448201526064016105b0565b611395613ba3565b60006113a085613b44565b60008181526007602052604080822092935090919082906113c79060608a01908a01615016565b6001600160a01b0390811682526020808301939093526040918201600090812060608b0135825284528281208682526006855283822084516101008101909552805490931660c0850190815260018085015460e08701529085526002840154919650919484019160ff9091169081111561144357611443614bfc565b600181111561145457611454614bfc565b815260028201546001600160a01b0361010090910481166020830152600383015460408084019190915260048401546060840152600590930154608090920191909152908201519192503091161561154a5781604001516001600160a01b0316336001600160a01b0316146114fe5760405162461bcd60e51b815260206004820152601060248201526f3737ba103634b9ba32b21037bbb732b960811b60448201526064016105b0565b600084815260066020526040812080546001600160a01b0319168155600181018290556002810180546001600160a81b031916905560038101829055600481018290556005015561156d565b61156a3361155d368b90038b018b6151ba565b600486015460ff16613f3e565b50335b6040805180820190915260058401546001600160a01b031681526006840154602082018190526000906115a49060608c01356151a7565b905080600460008282546115b89190615212565b909155505060078501805460ff1916600117905560006115db60608c0135612cf9565b509050336001600160a01b031683600001516001600160a01b03160361164957600083602001518261160d91906151a7565b90506116436001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e163383613d4e565b50611687565b6116538330614247565b6116876001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e163383613d4e565b6116aa8461169b60608e0160408f01615016565b60048901548e9060ff16613df4565b3360208c018035906116bc908e615016565b6001600160a01b03167fb74b122f793476356e38304aa6158223018c6637ed6b2425a91c83c4bac4115f8e606001358f60400160208101906116fe9190615016565b604080519283526001600160a01b0390911660208301520160405180910390a498505050505050506111c06001600255565b8060006008600061174084613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b031682526001015481830152915061177e90830183615016565b6001600160a01b031681600001516001600160a01b03161480156117a9575081602001358160200151145b6117c55760405162461bcd60e51b81526004016105b090615161565b60006117d084613b44565b600081815260086020908152604080832081516101c0810190925280546001600160a01b031661018083019081526001808301546101a0850152908352600282015495965093949193909284019160ff169081111561183157611831614bfc565b600181111561184257611842614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e086015280518082018252600987015484168152600a8701549281019290925292840152600b9093015480841661012084015260ff600160a01b909104161515610140909201919091528201519192501633146119365760405162461bcd60e51b81526020600482015260136024820152723737ba1030bab1ba34b7b71031b932b0ba37b960691b60448201526064016105b0565b806101600151156119895760405162461bcd60e51b815260206004820152601760248201527f61756374696f6e20616c7265616479207375636365737300000000000000000060448201526064016105b0565b60e08101516001600160a01b0316156119da5760405162461bcd60e51b815260206004820152601360248201527230b63932b0b23c903430bb32903134b23232b960691b60448201526064016105b0565b6000828152600860208181526040832080546001600160a01b03199081168255600182018590556002820180546001600160a81b031990811690915560038301869055600483018690556005830186905560068301869055600783018054831690559382018590556009820180549091169055600a810193909355600b90920180549091169055810151611a7390309033908890613df4565b60208501803590611a849087615016565b6001600160a01b03167f7ae0b2dad8211114d3703f3eae564996deaa436d58d3860aff659ddc284b58ec60405160405180910390a35050505050565b600080611acc836142f2565b90508060046000828254611ae09190615212565b90915550909392505050565b611b70604080516101c081018252600061018082018181526101a0830182905282526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052835180850190945281845283015290610120820190815260006020820181905260409091015290565b60086000611b7d84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff1690811115611bdc57611bdc614bfc565b6001811115611bed57611bed614bfc565b81526002820154610100908190046001600160a01b0390811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b90920154918216610120820152600160a01b90910460ff1615156101409091015292915050565b60008181600881611cae84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff1690811115611d0d57611d0d614bfc565b6001811115611d1e57611d1e614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b9092015480831661012083015260ff600160a01b90910416151561014090910152815151919250161580611ddd57508061016001515b611e235760405162461bcd60e51b8152602060048201526017602482015276185d58dd1a5bdb88185b1c9958591e4818dc99585d1959604a1b60448201526064016105b0565b8360600135674563918244f400008111611e4f5760405162461bcd60e51b81526004016105b090615225565b6000611e66611e616020880188615016565b614693565b90506000816001811115611e7c57611e7c614bfc565b03611f45576000611e906020880188615016565b6040516331a9108f60e11b8152602089013560048201526001600160a01b039190911690636352211e90602401602060405180830381865afa158015611eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efe919061526e565b6001600160a01b031603611f405760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016105b0565b61204e565b6001600160a01b037f000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d8216611f7c6020880188615016565b6001600160a01b03160361204e57604051634f558e7960e01b8152602087013560048201527f000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d826001600160a01b031690634f558e7990602401602060405180830381865afa158015611ff2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612016919061528b565b61204e5760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016105b0565b600061206c612062368990038901896151ba565b8860600135613bfa565b905060008160200151886060013561208491906151a7565b9050806004600082825461209891906151a7565b909155506120d390506001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e16333084613db6565b6040805160c08101909152806120ee368b90038b018b6151ba565b81523360208201526060808b013560408301520184600181111561211457612114614bfc565b815260208101849052600060409091018190526007906121338b613b44565b815260208082019290925260409081016000908120338252835281812060608d8101358352908452908290208451805182546001600160a01b03199081166001600160a01b039283161784559186015160018085019190915595870151600284018054909316911617905591840151600383015583015160048201805492939192909160ff199091169083818111156121ce576121ce614bfc565b0217905550608082015180516005830180546001600160a01b0319166001600160a01b03909216919091179055602090810151600683015560a0909201516007909101805460ff191691151591909117905533908901803590612231908b615016565b6001600160a01b03167f527cfdddfc33a6d9f2322227fe65218bb4f9da4914c5813a4cedc78bc0f55c5a8b6060013560405161226f91815260200190565b60405180910390a4979650505050505050565b600080805b838110156122d15760006122b18686848181106122a6576122a66152ad565b9050604002016142f2565b90506122bd81846151a7565b925050806122ca906152c3565b9050612287565b5080600460008282546122e49190615212565b9091555090949350505050565b6122f9613aea565b61230360006147ce565b565b600480546040516370a0823160e01b815230928101929092526000917f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e6001600160a01b0316906370a0823190602401602060405180830381865afa158015612372573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239691906152dc565b6123a09190615212565b905090565b6123ad613aea565b6000806008816123bc86613b44565b8152602081019190915260400160009081206002015461010090046001600160a01b031691909114159150806006816123f487613b44565b815260208101919091526040016000206002015461010090046001600160a01b031614801591506124585760405162461bcd60e51b815260206004820152600e60248201526d6e6674206973206f6e2073616c6560901b60448201526064016105b0565b811561249a5760405162461bcd60e51b815260206004820152601160248201527037333a1034b99037b71030bab1ba34b7b760791b60448201526064016105b0565b60006124ac611e616020870187615016565b90506124ba30858784613df4565b5050505050565b6000826000600660006124d384613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff169081111561253057612530614bfc565b600181111561254157612541614bfc565b815260028201546001600160a01b036101009091048116602083015260038301546040808401919091526004840154606084015260059093015460809092019190915290820151919250161580159061259e575060008160600151115b80156125ae57508060a001514211155b6125e75760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081b1a5cdd195960b21b60448201526064016105b0565b60006125f286613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff169081111561265157612651614bfc565b600181111561266257612662614bfc565b8152600282015461010090046001600160a01b031660208201526003820154604082015260048201546060808301919091526005909201546080909101528101519091508610156126ee5760405162461bcd60e51b81526020600482015260166024820152756c657373207468616e206c697374656420707269636560501b60448201526064016105b0565b600082815260066020526040812080546001600160a01b0319168155600181018290556002810180546001600160a81b0319169055600381018290556004810182905560050181905561274f612749368a90038a018a6151ba565b88613bfa565b905061275b8133614247565b60008061276789612cf9565b90925090506127a16001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e16333084613db6565b60408401516127dd906001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e1690339085613db6565b6127ed30338c8760200151613df4565b3360208b018035906127ff908d615016565b60408088015181518e81526001600160a01b0391821660208201529216917f7ecd9705c4bad458d33cbb498a44bd1a8591b38703a9db6df94f1f390bc9bb1c910160405180910390a46020830151612857908a6151a7565b9a9950505050505050505050565b60008160400135674563918244f4000081116128935760405162461bcd60e51b81526004016105b090615225565b826060013542111580156128ae575082606001358360800135115b6128ef5760405162461bcd60e51b8152602060048201526012602482015271696e76616c69642074696d652072616e676560701b60448201526064016105b0565b60006128fa84613b44565b60008181526006602090815260408083208151610100810190925280546001600160a01b031660c0830190815260018083015460e0850152908352600282015495965093949193909284019160ff169081111561295957612959614bfc565b600181111561296a5761296a614bfc565b8152600282015461010090046001600160a01b031660208083019190915260038301546040830152600483015460608301526005909201546080909101529091506000906129be90611e6190880188615016565b60408301519091506001600160a01b031615612a225760408201516001600160a01b03163314612a1d5760405162461bcd60e51b815260206004820152600a6024820152693737ba1039b2b63632b960b11b60448201526064016105b0565b612b64565b612a3b33612a35368990038901896151ba565b83613f3e565b6040516370a0823160e01b8152336004820152670de0b6b3a7640000907f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e6001600160a01b0316906370a0823190602401602060405180830381865afa158015612aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612acd91906152dc565b1015612b1b5760405162461bcd60e51b815260206004820152601a60248201527f6e6f20746f6b656e7320666f7220706c6174666f726d2066656500000000000060448201526064016105b0565b612b2733308884613df4565b612b646001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e163330670de0b6b3a7640000613db6565b6040805160c0810190915280612b7f368990038901896151ba565b8152602001826001811115612b9657612b96614bfc565b815233602080830191909152604089810135818401526060808b0135908401526080808b0135930192909252600086815260068252919091208251805182546001600160a01b0319166001600160a01b039091161782558201516001808301919091559183015160028201805492939192909160ff19909116908381811115612c2157612c21614bfc565b021790555060408201516002820180546001600160a01b0390921661010002610100600160a81b0319909216919091179055606082015160038201556080820151600482015560a0909101516005909101553360208701803590612c859089615016565b6001600160a01b03167f36f968ca1dfee9f8ffd2bbc98ce38c681ac3d9bfb14ac469b0fa3c9a6b44550d89604001358a606001358b60800135604051612cde939291909283526020830191909152604082015260600190565b60405180910390a450670de0b6b3a764000095945050505050565b6000806000606460035485612d0e91906152f5565b612d24906b033b2e3c9fd0803ce80000006152f5565b612d2e919061530c565b9050612d466b033b2e3c9fd0803ce80000008261530c565b9150674563918244f40000821015612d6457674563918244f4000091505b612d6e8285615212565b925050915091565b6000833560601c81612d8b6020870135612cf9565b50905060007f000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d826001600160a01b031663180b0d7e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e129190615343565b6001600160601b0316612e2b60e0890160c08a0161536b565b612e42906001600160601b031660208a01356152f5565b612e4c919061530c565b9050600060405180604001604052808960a0016020810190612e6e9190615016565b6001600160a01b03168152602001838152509050612ecd333083602001518b60200135612e9b91906151a7565b6001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e16929190613db6565b80516001600160a01b03808616911603612f2f576000816020015184612ef391906151a7565b9050612f296001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e168683613d4e565b50612f6d565b612f398130614247565b612f6d6001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e168585613d4e565b604051631c7e53fd60e21b81526001600160a01b037f000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d8216906371f94ff490612fbf9033908c908c908c906004016153e5565b600060405180830381600087803b158015612fd957600080fd5b505af1158015612fed573d6000803e3d6000fd5b5050604080516020808d013582526001600160a01b03898116918301919091523394508c3593507f000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d8216917f7ecd9705c4bad458d33cbb498a44bd1a8591b38703a9db6df94f1f390bc9bb1c910160405180910390a48760200135816020015161307691906151a7565b98975050505050505050565b61308a613aea565b6001600160a01b0383166000908152600160205260409081902090516130b39084908490615114565b9081526040519081900360200190205460ff161561310a5760405162461bcd60e51b81526020600482015260146024820152731c9bdb1948185b1c9958591e4819dc985b9d195960621b60448201526064016105b0565b6001806000856001600160a01b03166001600160a01b031681526020019081526020016000208383604051613140929190615114565b908152604051908190036020018120805492151560ff19909316929092179091556001600160a01b038416907fb710f7d3e79cb091613cfea70444ea824ad23f2b1297bdea427bc6f097e346a89061063c908590859061514d565b6131a3613aea565b6001600160a01b0381166131eb5760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206164647265737360881b60448201526064016105b0565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527fce118ac8247ab22e55e5f2799d4f5dcf662d59fe0d207b98d6a89764ae81d48190602001610a16565b6040518060400160405280600581526020016430b236b4b760d91b81525060016000336001600160a01b03166001600160a01b031681526020019081526020016000208160405161328a91906154d9565b9081526040519081900360200190205460ff16806132b257506000546001600160a01b031633145b6132fe5760405162461bcd60e51b815260206004820152601d60248201527f6163636f756e7420646f65736e742068617665207468697320726f6c6500000060448201526064016105b0565b6005546001600160a01b03166133565760405162461bcd60e51b815260206004820152601b60248201527f696e76616c69642066656552656365697665722061646472657373000000000060448201526064016105b0565b8161335f612305565b10156133ad5760405162461bcd60e51b815260206004820152601f60248201527f696e73756666696369656e742062616c616e636520287265736572766564290060448201526064016105b0565b6005546133e7906001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e8116911684613d4e565b5050565b6040805161010081018252600060c0820181815260e08301829052825260208201819052918101829052606081018290526080810182905260a08101919091526006600061343884613b44565b815260208082019290925260409081016000208151610100810190925280546001600160a01b031660c0830190815260018083015460e08501529083526002820154929391929184019160ff169081111561349557613495614bfc565b60018111156134a6576134a6614bfc565b8152600282015461010090046001600160a01b03166020820152600382015460408201526004820154606082015260059091015460809091015292915050565b6134ee613aea565b6001600160a01b0381166135535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b0565b61355c816147ce565b50565b80600060088161356e84613b44565b8152602080820192909252604090810160002081516101c0810190925280546001600160a01b031661018083019081526001808301546101a08501529083526002820154929391929184019160ff16908111156135cd576135cd614bfc565b60018111156135de576135de614bfc565b815260028201546001600160a01b0361010091829004811660208085019190915260038501546040808601919091526004860154606086015260058601546080860152600686015460a08601526007860154831660c0860152600886015460e08601528051808201909152600986015483168152600a8601549181019190915291830191909152600b9092015480831661012083015260ff600160a01b9091041615156101409091015281515191925016158061369d57508061016001515b6136e35760405162461bcd60e51b8152602060048201526017602482015276185d58dd1a5bdb88185b1c9958591e4818dc99585d1959604a1b60448201526064016105b0565b8260400135674563918244f40000811161370f5760405162461bcd60e51b81526004016105b090615225565b6000613721611e616020870187615016565b905061373633612a35368890038801886151ba565b6040516370a0823160e01b8152336004820152670de0b6b3a7640000907f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e6001600160a01b0316906370a0823190602401602060405180830381865afa1580156137a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c891906152dc565b10156138165760405162461bcd60e51b815260206004820152601a60248201527f6e6f20746f6b656e7320666f7220706c6174666f726d2066656500000000000060448201526064016105b0565b6138536001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e163330670de0b6b3a7640000613db6565b61385f33308784613df4565b6040805161018081019091528061387b368890038801886151ba565b815260200182600181111561389257613892614bfc565b8152602001336001600160a01b031681526020018660400135815260200186606001358152602001866080013581526020018660a00135815260200160006001600160a01b0316815260200186604001358152602001604051806040016040528060006001600160a01b031681526020016000815250815260200160006001600160a01b03168152602001600015158152506008600061393488600001613b44565b81526020808201929092526040016000208251805182546001600160a01b0319166001600160a01b039091161782558201516001808301919091559183015160028201805492939192909160ff1990911690838181111561399757613997614bfc565b021790555060408201516002820180546001600160a01b03928316610100908102610100600160a81b031990921691909117909155606084015160038401556080840151600484015560a0840151600584015560c0840151600684015560e08401516007840180549184166001600160a01b031992831617905590840151600884015561012084015180516009850180549185169190931617909155602090810151600a840155610140840151600b9093018054610160909501511515600160a01b026001600160a81b031990951693909216929092179290921790915533908601803590613a869088615016565b6001600160a01b03167f5eacffdbd5cce2705a4746bb9e12d30b78923dfdc1ff8d9a4e211bb6eaea2c11886040013589606001358a608001358b60a00135604051610d08949392919093845260208401929092526040830152606082015260800190565b6000546001600160a01b031633146123035760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b0565b6000613b536020830183615016565b8260200135604051602001613b8692919060609290921b6bffffffffffffffffffffffff19168252601482015260340190565b604051602081830303815290604052805190602001209050919050565b6002805403613bf45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105b0565b60028055565b60408051808201825260008082526020820152835191516301ffc9a760e01b815263152a902d60e11b600482015290916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015613c5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7e919061528b565b15610527578251602084015160405163152a902d60e11b815260009283926001600160a01b0390911691632a55205a91613cc5918890600401918252602082015260400190565b6040805180830381865afa158015613ce1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d0591906154f5565b9092509050613d1560058561530c565b811115613d2a57613d2760058561530c565b90505b604080518082019091526001600160a01b0390921682526020820152905092915050565b6040516001600160a01b038316602482015260448101829052613db190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261481e565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613dee9085906323b872dd60e01b90608401613d7a565b50505050565b6001816001811115613e0857613e08614bfc565b03613ea357613e1a6020830183615016565b604051637921219560e11b81526001600160a01b0386811660048301528581166024830152602085013560448301526001606483015260a06084830152600060a4830152919091169063f242432a9060c401600060405180830381600087803b158015613e8657600080fd5b505af1158015613e9a573d6000803e3d6000fd5b50505050613dee565b6000816001811115613eb757613eb7614bfc565b03613dee57613ec96020830183615016565b6040516323b872dd60e01b81526001600160a01b03868116600483015285811660248301526020850135604483015291909116906323b872dd90606401600060405180830381600087803b158015613f2057600080fd5b505af1158015613f34573d6000803e3d6000fd5b5050505050505050565b60006001826001811115613f5457613f54614bfc565b036140645782516020840151604051627eeac760e11b81526001926001600160a01b03169162fdd58e91613fa09189916004016001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fe191906152dc565b1015801561405d5750825160405163e985e9c560e01b81526001600160a01b0386811660048301523060248301529091169063e985e9c590604401602060405180830381865afa158015614039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061405d919061528b565b90506141fa565b600082600181111561407857614078614bfc565b036141fa57825160208401516040516331a9108f60e11b815260048101919091526001600160a01b03868116921690636352211e90602401602060405180830381865afa1580156140cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140f1919061526e565b6001600160a01b03161480156141f757508251602084015160405163020604bf60e21b8152600481019190915230916001600160a01b03169063081812fc90602401602060405180830381865afa158015614150573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614174919061526e565b6001600160a01b031614806141f75750825160405163e985e9c560e01b81526001600160a01b0386811660048301523060248301529091169063e985e9c590604401602060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f7919061528b565b90505b80613dee5760405162461bcd60e51b815260206004820152601c60248201527f6e6f74206f776e6572206f7220617070726f76656420746f6b656e730000000060448201526064016105b0565b81516001600160a01b031615801590614264575060008260200151115b156133e757306001600160a01b038216036142b457815160208301516133e7916001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e1691613d4e565b815160208301516133e7916001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e1691849190613db6565b60008160006008600061430484613b44565b81526020808201929092526040908101600020815180830190925280546001600160a01b031682526001015481830152915061434290830183615016565b6001600160a01b031681600001516001600160a01b031614801561436d575081602001358160200151145b6143895760405162461bcd60e51b81526004016105b090615161565b60006008600061439887613b44565b8152602001908152602001600020905080600b0160149054906101000a900460ff16156143fa5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c995cdd5b1d195960821b60448201526064016105b0565b806006015442116144415760405162461bcd60e51b8152602060048201526011602482015270185d58dd1a5bdb881b9bdd08195b991959607a1b60448201526064016105b0565b6002810154600782015460088301546001600160a01b03610100840481169392169160ff168261456157600860006144788b613b44565b81526020810191909152604001600090812080546001600160a01b03199081168255600182018390556002820180546001600160a81b0319908116909155600383018490556004830184905560058301849055600683018490556007830180548316905560088301849055600983018054909216909155600a820192909255600b018054909116905561450d30858b84613df4565b6020890180359061451e908b615016565b6001600160a01b03167f7ae0b2dad8211114d3703f3eae564996deaa436d58d3860aff659ddc284b58ec60405160405180910390a36000975050505050506111c0565b600b850180546001600160a01b038086166001600160a81b031990921691909117600160a01b179091556040805180820190915260098701549091168152600a86015460208201526145b38130614247565b60006145be84612cf9565b5090506145f56001600160a01b037f000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e168783613d4e565b600287015461460c90309087908e9060ff16613df4565b6001600160a01b03851660208c01803590614627908e615016565b604080516001600160a01b038b81168252602082018a90523382840152915192909116917f69b9e47c169c6463a921b70743b7d6705d5ee0b376296ae9bf0b1a3678fb3f5d9181900360600190a4602082015161468490856151a7565b9b9a5050505050505050505050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526000906001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156146e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614705919061528b565b1561471257506001919050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa15801561475d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614781919061528b565b1561478e57506000919050565b60405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204e4654207479706560801b60448201526064016105b0565b919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000614873826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148f39092919063ffffffff16565b9050805160001480614894575080806020019051810190614894919061528b565b613db15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105b0565b6060614902848460008561490a565b949350505050565b60608247101561496b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105b0565b600080866001600160a01b0316858760405161498791906154d9565b60006040518083038185875af1925050503d80600081146149c4576040519150601f19603f3d011682016040523d82523d6000602084013e6149c9565b606091505b50915091506149da878383876149e5565b979650505050505050565b60608315614a54578251600003614a4d576001600160a01b0385163b614a4d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b0565b5081614902565b6149028383815115614a695781518083602001fd5b8060405162461bcd60e51b81526004016105b09190615523565b600060208284031215614a9557600080fd5b81356001600160e01b031981168114614aad57600080fd5b9392505050565b6001600160a01b038116811461355c57600080fd5b80356147c981614ab4565b60008083601f840112614ae657600080fd5b50813567ffffffffffffffff811115614afe57600080fd5b602083019150836020828501011115614b1657600080fd5b9250929050565b600080600060408486031215614b3257600080fd5b8335614b3d81614ab4565b9250602084013567ffffffffffffffff811115614b5957600080fd5b614b6586828701614ad4565b9497909650939450505050565b600060408284031215614b8457600080fd5b50919050565b60008060608385031215614b9d57600080fd5b614ba78484614b72565b946040939093013593505050565b600060208284031215614bc757600080fd5b5035919050565b600060408284031215614be057600080fd5b614aad8383614b72565b600060808284031215614b8457600080fd5b634e487b7160e01b600052602160045260246000fd5b60028110614c3057634e487b7160e01b600052602160045260246000fd5b9052565b815180516001600160a01b03168252602090810151908201526101c081016020830151614c646040840182614c12565b5060408301516001600160a01b03811660608401525060608301516080830152608083015160a083015260a083015160c083015260c083015160e083015260e0830151610100614cbe818501836001600160a01b03169052565b840151610120848101919091528401519050610140614cf28185018380516001600160a01b03168252602090810151910152565b8401516001600160a01b0316610180840152506101609092015115156101a09091015290565b60008060208385031215614d2b57600080fd5b823567ffffffffffffffff80821115614d4357600080fd5b818501915085601f830112614d5757600080fd5b813581811115614d6657600080fd5b8660208260061b8501011115614d7b57600080fd5b60209290920196919550909350505050565b60008060608385031215614da057600080fd5b614daa8484614b72565b91506040830135614dba81614ab4565b809150509250929050565b600060a08284031215614b8457600080fd5b600080600060408486031215614dec57600080fd5b833567ffffffffffffffff80821115614e0457600080fd5b908501906101008288031215614e1957600080fd5b90935060208501359080821115614e2f57600080fd5b50614b6586828701614ad4565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614e7b57614e7b614e3c565b604052919050565b600082601f830112614e9457600080fd5b8135602067ffffffffffffffff821115614eb057614eb0614e3c565b8160051b614ebf828201614e52565b9283528481018201928281019087851115614ed957600080fd5b83870192505b848310156149da57823582529183019190830190614edf565b600082601f830112614f0957600080fd5b813567ffffffffffffffff811115614f2357614f23614e3c565b614f36601f8201601f1916602001614e52565b818152846020838601011115614f4b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215614f8057600080fd5b8535614f8b81614ab4565b94506020860135614f9b81614ab4565b9350604086013567ffffffffffffffff80821115614fb857600080fd5b614fc489838a01614e83565b94506060880135915080821115614fda57600080fd5b614fe689838a01614e83565b93506080880135915080821115614ffc57600080fd5b5061500988828901614ef8565b9150509295509295909350565b60006020828403121561502857600080fd5b8135614aad81614ab4565b815180516001600160a01b031682526020908101519082015260e0810160208301516150626040840182614c12565b5060018060a01b03604084015116606083015260608301516080830152608083015160a083015260a083015160c083015292915050565b600080600080600060a086880312156150b157600080fd5b85356150bc81614ab4565b945060208601356150cc81614ab4565b93506040860135925060608601359150608086013567ffffffffffffffff8111156150f657600080fd5b61500988828901614ef8565b600060c08284031215614b8457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081526000614902602083018486615124565b602080825260169082015275185d58dd1a5bdb881a5cc81b9bdd0818dc99585d195960521b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561052757610527615191565b6000604082840312156151cc57600080fd5b6040516040810181811067ffffffffffffffff821117156151ef576151ef614e3c565b60405282356151fd81614ab4565b81526020928301359281019290925250919050565b8181038181111561052757610527615191565b60208082526029908201527f7072696365206973206c657373207468616e20746865206d696e696d756d206360408201526837b6b6b4b9b9b4b7b760b91b606082015260800190565b60006020828403121561528057600080fd5b8151614aad81614ab4565b60006020828403121561529d57600080fd5b81518015158114614aad57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016152d5576152d5615191565b5060010190565b6000602082840312156152ee57600080fd5b5051919050565b808202811582820484141761052757610527615191565b60008261532957634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b038116811461355c57600080fd5b60006020828403121561535557600080fd5b8151614aad8161532e565b80356147c98161532e565b60006020828403121561537d57600080fd5b8135614aad8161532e565b80356001600160801b03811681146147c957600080fd5b6000808335601e198436030181126153b657600080fd5b830160208101925035905067ffffffffffffffff8111156153d657600080fd5b803603821315614b1657600080fd5b60018060a01b0385168152606060208201528335606082015260208401356080820152600061541660408601615388565b6001600160801b0380821660a08501528061543360608901615388565b1660c08501525050615448608086018661539f565b6101008060e086015261546061016086018385615124565b925061546e60a08901614ac9565b6001600160a01b0316908501525061548860c08701615360565b6001600160601b031661012084015260e086013561014084015282810360408401526149da818587615124565b60005b838110156154d05781810151838201526020016154b8565b50506000910152565b600082516154eb8184602087016154b5565b9190910192915050565b6000806040838503121561550857600080fd5b825161551381614ab4565b6020939093015192949293505050565b60208152600082518060208401526155428160408501602087016154b5565b601f01601f1916919091016040019291505056fea2646970667358221220f591586e65eb5ed9c26c2f0b3bdfff2a468c5912d1e768040e1c25c5c5aa8d5164736f6c63430008120033

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

000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d820000000000000000000000000d6f043296c9e950ae5aaf8add002358cd24bd46

-----Decoded View---------------
Arg [0] : _loveToken (address): 0x504624040e0642921C2c266a9aC37CafBd8cDa4e
Arg [1] : _loveNFTShared (address): 0xb0A5818c8C2011CcE667e56F9d1E512D6aD83D82
Arg [2] : tokenOwner (address): 0x0d6f043296c9e950aE5aAF8ADD002358cd24bD46

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000504624040e0642921c2c266a9ac37cafbd8cda4e
Arg [1] : 000000000000000000000000b0a5818c8c2011cce667e56f9d1e512d6ad83d82
Arg [2] : 0000000000000000000000000d6f043296c9e950ae5aaf8add002358cd24bd46


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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