FTM Price: $0.42 (-2.28%)
Gas: 13 Gwei

Contract

0xf3dF7b6DCcC267393784a3876d0CbCBDC73147d4
 

Sponsored

Transaction Hash
Method
Block
From
To
Value
Buy760145462024-02-20 22:18:353 mins ago1708467515IN
PaintSwap: Marketplace V3
0.88 FTM0.002739516.07067411
Buy760141172024-02-20 22:09:0012 mins ago1708466940IN
PaintSwap: Marketplace V3
0.89 FTM0.0026430914.80889903
Edit Offer760124342024-02-20 21:25:0956 mins ago1708464309IN
PaintSwap: Marketplace V3
0 FTM0.001052616.39386938
Edit Offer760124072024-02-20 21:23:4957 mins ago1708464229IN
PaintSwap: Marketplace V3
0 FTM0.001096316.59384254
Edit Price760123352024-02-20 21:20:231 hr 1 min ago1708464023IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Edit Price760123292024-02-20 21:20:031 hr 1 min ago1708464003IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Edit Price760123232024-02-20 21:19:411 hr 2 mins ago1708463981IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Edit Price760123172024-02-20 21:19:311 hr 2 mins ago1708463971IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Edit Price760123052024-02-20 21:18:591 hr 2 mins ago1708463939IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Edit Price760122882024-02-20 21:18:141 hr 3 mins ago1708463894IN
PaintSwap: Marketplace V3
0 FTM0.0010037417
Buy760117752024-02-20 21:03:011 hr 18 mins ago1708462981IN
PaintSwap: Marketplace V3
0.35 FTM0.005918.17008031
Buy Batch760113952024-02-20 20:52:091 hr 29 mins ago1708462329IN
PaintSwap: Marketplace V3
365 FTM0.0085241617.46711726
Buy760113682024-02-20 20:50:151 hr 31 mins ago1708462215IN
PaintSwap: Marketplace V3
2.304 FTM0.0051594716.7742567
Buy760113562024-02-20 20:49:311 hr 32 mins ago1708462171IN
PaintSwap: Marketplace V3
2.304 FTM0.0057686616.7742567
Buy Batch760113192024-02-20 20:47:231 hr 34 mins ago1708462043IN
PaintSwap: Marketplace V3
256 FTM0.0238443716.7742567
Safe NFT Transfe...760110572024-02-20 20:38:591 hr 42 mins ago1708461539IN
PaintSwap: Marketplace V3
0 FTM0.0387814205.24800255
Add Sale760107552024-02-20 20:29:311 hr 52 mins ago1708460971IN
PaintSwap: Marketplace V3
0 FTM0.0050133717.5360371
Add Sale Batch760104792024-02-20 20:24:481 hr 56 mins ago1708460688IN
PaintSwap: Marketplace V3
0 FTM0.008942517.5360371
Add Sale Batch760103842024-02-20 20:23:201 hr 58 mins ago1708460600IN
PaintSwap: Marketplace V3
0 FTM0.0240698417.5360371
Complete Marketp...760103822024-02-20 20:23:181 hr 58 mins ago1708460598IN
PaintSwap: Marketplace V3
0 FTM0.0036059620.79467541
Add Sale Batch760102402024-02-20 20:20:552 hrs ago1708460455IN
PaintSwap: Marketplace V3
0 FTM0.0094651818.38003905
Add Sale760101182024-02-20 20:19:082 hrs 2 mins ago1708460348IN
PaintSwap: Marketplace V3
0 FTM0.0059990819.92091226
Add Sale760101072024-02-20 20:19:002 hrs 2 mins ago1708460340IN
PaintSwap: Marketplace V3
0 FTM0.0052646118.38003905
Add Sale760100602024-02-20 20:18:172 hrs 3 mins ago1708460297IN
PaintSwap: Marketplace V3
0 FTM0.006070719.92256228
Add Sale760099992024-02-20 20:17:262 hrs 4 mins ago1708460246IN
PaintSwap: Marketplace V3
0 FTM0.0060512219.93636424
View all transactions

Latest 25 internal transactions (View All)

Parent Txn Hash Block From To Value
759927042024-02-20 13:00:189 hrs 21 mins ago1708434018
PaintSwap: Marketplace V3
51 FTM
759798552024-02-20 3:34:5118 hrs 46 mins ago1708400091
PaintSwap: Marketplace V3
0.10279291 FTM
759560352024-02-19 14:59:121 day 7 hrs ago1708354752
PaintSwap: Marketplace V3
100 FTM
759551972024-02-19 14:29:191 day 7 hrs ago1708352959
PaintSwap: Marketplace V3
0.10863467 FTM
759470272024-02-19 11:42:141 day 10 hrs ago1708342934
PaintSwap: Marketplace V3
1,000 FTM
759461962024-02-19 11:25:481 day 10 hrs ago1708341948
PaintSwap: Marketplace V3
0.10692556 FTM
759460812024-02-19 11:23:401 day 10 hrs ago1708341820
PaintSwap: Marketplace V3
0.10692656 FTM
759460252024-02-19 11:22:281 day 10 hrs ago1708341748
PaintSwap: Marketplace V3
1.28495645 FTM
758716142024-02-18 5:50:142 days 16 hrs ago1708235414
PaintSwap: Marketplace V3
188 FTM
758481972024-02-17 21:20:023 days 1 hr ago1708204802
PaintSwap: Marketplace V3
0.08724807 FTM
758449872024-02-17 19:46:373 days 2 hrs ago1708199197
PaintSwap: Marketplace V3
0.08691543 FTM
758272182024-02-17 10:32:193 days 11 hrs ago1708165939
PaintSwap: Marketplace V3
3.5 FTM
758259662024-02-17 9:36:133 days 12 hrs ago1708162573
PaintSwap: Marketplace V3
3.5 FTM
758221312024-02-17 6:36:563 days 15 hrs ago1708151816
PaintSwap: Marketplace V3
65 FTM
758206952024-02-17 5:38:543 days 16 hrs ago1708148334
PaintSwap: Marketplace V3
3.5 FTM
758137572024-02-17 0:31:013 days 21 hrs ago1708129861
PaintSwap: Marketplace V3
129 FTM
757596822024-02-15 23:45:344 days 22 hrs ago1708040734
PaintSwap: Marketplace V3
1.31085815 FTM
757227122024-02-15 8:56:055 days 13 hrs ago1707987365
PaintSwap: Marketplace V3
85 FTM
757142742024-02-15 5:10:185 days 17 hrs ago1707973818
PaintSwap: Marketplace V3
25 FTM
757123172024-02-15 4:30:395 days 17 hrs ago1707971439
PaintSwap: Marketplace V3
100 FTM
756772462024-02-14 16:03:416 days 6 hrs ago1707926621
PaintSwap: Marketplace V3
180 FTM
756623562024-02-14 10:36:576 days 11 hrs ago1707907017
PaintSwap: Marketplace V3
180 FTM
756224822024-02-13 20:16:537 days 2 hrs ago1707855413
PaintSwap: Marketplace V3
0.08627458 FTM
756041542024-02-13 14:21:117 days 8 hrs ago1707834071
PaintSwap: Marketplace V3
220 FTM
755869012024-02-13 9:02:177 days 13 hrs ago1707814937
PaintSwap: Marketplace V3
189 FTM
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PaintSwapMarketplaceV3

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion
File 1 of 28 : PaintSwapMarketplaceV3.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./PaintSwapMarketplaceV3StateBase.sol";

contract PaintSwapMarketplaceV3 is PaintSwapMarketplaceV3StateBase {
  constructor(
    address _officialNFTDiscount,
    address _marketplaceWhitelist,
    address _collectionRoyalties,
    address _tokens,
    address _paintRouter,
    address _wftm,
    address _implBuyEditListing,
    address _implMakeAndEditOffers,
    address _implBidsAndAcceptOffers,
    address _implListAndComplete,
    address _implBatchTransferNFT,
    address _feePercentage,
    uint startId
  ) {
    officialNFTDiscount = OfficialNFTDiscount(_officialNFTDiscount);
    marketplaceWhitelist = MarketplaceWhitelistV3(_marketplaceWhitelist);
    tokens = TokensV2(_tokens);
    paintRouter = _paintRouter;
    wftm = _wftm;
    currentMarketplaceId = startId;
    feePercentage = FeePercentage(_feePercentage);
    implBuyEditListing = _implBuyEditListing;
    implMakeAndEditOffers = _implMakeAndEditOffers;
    implBidsAndAcceptOffers = _implBidsAndAcceptOffers;
    implListAndComplete = _implListAndComplete;
    implBatchTransferNFT = _implBatchTransferNFT;

    // Include sale %
    royaltyInfo = RoyaltyInfo({
      collectionRoyalties: _collectionRoyalties,
      maxRoyalty: 750 // 7.5%
    });
  }

  // Sell many nfts/bundles as different sales
  function addSaleBatch(
    address[][] memory _nfts,
    uint256[][] memory _tokenIds,
    uint256[][] memory _amountBatches,
    uint128[] memory _prices,
    uint64[][] memory _times, // [_duration, startTime]
    uint128[] memory _amounts,
    bool[][] memory _flags, // [isAuction, isNSFW, payNative, antisnipe, isFlash]
    string[] memory _searchKeywords,
    address[][] memory _addresses // [listingToken, vault, paymentToken, path]
  ) external payable returns (uint) {
    (bool success, bytes memory data) = implListAndComplete.delegatecall(
      abi.encodeWithSignature(
        "addSaleBatch(address[][],uint256[][],uint256[][],uint128[],uint64[][],uint128[],bool[][],string[],address[][])",
        _nfts,
        _tokenIds,
        _amountBatches,
        _prices,
        _times,
        _amounts,
        _flags,
        _searchKeywords,
        _addresses
      )
    );
    require(success);
    uint lastMarketplaceId = abi.decode(data, (uint));
    return lastMarketplaceId;
  }

  function addSale(
    address[] memory _nfts,
    uint256[] memory _tokenIds,
    uint256[] memory _amountBatches,
    uint128 _price,
    uint64[] memory _times, // [_duration, startTime]
    uint128 _amount,
    bool[] memory _flags, // [isAuction, isNSFW, payNative, antisnipe, isFlash]
    string memory _searchKeywords,
    address[] memory _addresses // [listingToken, vault, paymentToken, path]
  ) public payable returns (uint) {
    (bool success, bytes memory data) = implListAndComplete.delegatecall(
      abi.encodeWithSignature(
        "addSale(address[],uint256[],uint256[],uint128,uint64[],uint128,bool[],string,address[])",
        _nfts,
        _tokenIds,
        _amountBatches,
        _price,
        _times,
        _amount,
        _flags,
        _searchKeywords,
        _addresses
      )
    );
    require(success);
    return abi.decode(data, (uint));
  }

  function completeMarketplaceEntry(uint _marketplaceId) external {
    (bool success, ) = implListAndComplete.delegatecall(
      abi.encodeWithSignature("completeMarketplaceEntry(uint256)", _marketplaceId)
    );
    require(success);
  }

  /*
  function completeMarketplaceEntryBatch(uint[] memory _marketplaceIds) external {
    (bool success, ) = implListAndComplete.delegatecall(
      abi.encodeWithSignature("completeMarketplaceEntryBatch(uint256[])", _marketplaceIds)
    );
    require(success);
  } */

  function buy(uint _marketplaceId, uint128 _amount) external payable {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("buy(uint256,uint128)", _marketplaceId, _amount)
    );
    require(success);
  }

  function buyBatch(
    uint[] memory _marketplaceIds,
    uint128[] memory _amounts,
    bool _allowFailures
  ) external payable {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("buyBatch(uint256[],uint128[],bool)", _marketplaceIds, _amounts, _allowFailures)
    );
    require(success);
  }
  // Should be moved down, but dunno if that will affect verification :/
  function setOfferDuration(uint _minDuration, uint _maxDuration) external onlyOwner {
    require(_minDuration > 0);
    require(_maxDuration >= _minDuration);
    minOfferDuration = _minDuration;
    maxOfferDuration = _maxDuration;
  }

  function makeOfferSingle(
    address _nft,
    uint _tokenId,
    uint128 _quantity,
    uint128 _price,
    uint _duration,
    string memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeOfferSingle(address,uint256,uint128,uint128,uint256,string)",
        _nft,
        _tokenId,
        _quantity,
        _price,
        _duration,
        _searchKeywords
      )
    );
    require(success);
  }

  function makeOfferSingleBatch(
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint128[] memory _quantities,
    uint128[] memory _prices,
    uint[] memory _durations,
    string[] memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeOfferSingleBatch(address[],uint256[],uint128[],uint128[],uint256[],string[])",
        _nfts,
        _tokenIds,
        _quantities,
        _prices,
        _durations,
        _searchKeywords
      )
    );
    require(success);
  }

  function makeOffer(
    uint _marketplaceId,
    uint128 _quantity,
    uint128 _price,
    uint _duration // pass in 0 means the end of the sale
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeOffer(uint256,uint128,uint128,uint256)",
        _marketplaceId,
        _quantity,
        _price,
        _duration
      )
    );
    require(success);
  }

  // TODO: Test this one at least
  function makeOfferBatch(
    uint[] memory _marketplaceIds,
    uint128[] memory _quantities,
    uint128[] memory _prices,
    uint[] memory _durations // pass in 0 means the end of the sale
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeOfferBatch(uint256[],uint128[],uint128[],uint256[])",
        _marketplaceIds,
        _quantities,
        _prices,
        _durations
      )
    );
    require(success);
  }

  /*
  // use 0 for marketplace ids if it's normal sale
  function makeOfferBothOfferAndSingle(
    uint[] memory _marketplaceIds,
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint128[] memory _prices,
    uint[] memory _durations,
    string[] memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeOfferBothOfferAndSingle(uint256[],address[],uint256[],uint128[],uint256[],string[])",
        _marketplaceIds,
        _nfts,
        _tokenIds,
        _prices,
        _durations,
        _searchKeywords
      )
    );
    require(success);
  } */

  function makeCollectionOffer(
    address _nft,
    uint128 _quantity,
    uint128 _price,
    uint _duration,
    string memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeCollectionOffer(address,uint128,uint128,uint256,string)",
        _nft,
        _quantity,
        _price,
        _duration,
        _searchKeywords
      )
    );
    require(success);
  }

  // TODO test
  function hasExistingActiveOffers(
    address[] memory _nfts,
    uint[] memory _tokenIds,
    address _user
  ) external view returns (bool[] memory) {
    bool[] memory activeOffers = new bool[](_nfts.length);
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      uint tokenId = _tokenIds[i];
      uint offerId = userOffersMade[_user][nft][tokenId];
      if (offerId > 0) {
        Offer storage offer = offers[offerId];
        if (offer.expires > block.timestamp) {
          activeOffers[i] = true;
        }
      }

      offerId = userFilteredCollectionOffersMade[_user][nft];
      if (offerId > 0) {
        Offer storage offer = offers[offerId];
        for (uint j = 0; j < offer.tokenIds.length; ++j) {
          if (tokenId == offer.tokenIds[j]) {
            if (offer.expires > block.timestamp) {
              activeOffers[i] = true;
              break;
            }
          }
        }
      }

      offerId = userAltOffersMade[_user];
      if (offerId > 0) {
        Offer storage offer = offers[offerId];
        for (uint j = 0; j < offer.nfts.length; ++j) {
          if (offer.nfts[j] == nft && offer.tokenIds[j] == tokenId) {
            if (offer.expires > block.timestamp) {
              activeOffers[i] = true;
              break;
            }
          }
        }
      }
    }

    return activeOffers;
  }

  function makeFilteredCollectionOffer(
    address _nft,
    uint[] memory _tokenIds,
    uint128 _quantity,
    uint128[] memory _prices,
    uint _duration,
    string[] memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeFilteredCollectionOffer(address,uint256[],uint128,uint128[],uint256,string[])",
        _nft,
        _tokenIds,
        _quantity,
        _prices,
        _duration,
        _searchKeywords
      )
    );
    require(success);
  }

  function makeFilteredCollectionOfferBatch(
    address[] memory _nfts,
    uint[][] memory _tokenIds,
    uint128[] memory _quantities,
    uint128[][] memory _prices,
    uint[] memory _durations,
    string[][] memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeFilteredCollectionOfferBatch(address[],uint256[][],uint128[],uint128[][],uint256[],string[][])",
        _nfts,
        _tokenIds,
        _quantities,
        _prices,
        _durations,
        _searchKeywords
      )
    );
    require(success);
  }

  function makeAltOffer(
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint128 _quantity,
    uint128[] memory _prices,
    uint _duration,
    string[] memory _searchKeywords
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "makeAltOffer(address[],uint256[],uint128,uint128[],uint256,string[])",
        _nfts,
        _tokenIds,
        _quantity,
        _prices,
        _duration,
        _searchKeywords
      )
    );
    require(success);
  }

  function acceptOnSaleOffer(
    uint _offerId,
    uint128 _quantity,
    uint _marketplaceId
  ) external {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature("acceptOnSaleOffer(uint256,uint128,uint256)", _offerId, _quantity, _marketplaceId)
    );
    require(success);
  }

  function acceptOffer(
    uint _offerId,
    address _nft,
    uint _tokenId,
    uint128 _quantity,
    string memory _searchKeywords
  ) external {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature(
        "acceptOffer(uint256,address,uint256,uint128,string)",
        _offerId,
        _nft,
        _tokenId,
        _quantity,
        _searchKeywords
      )
    );
    require(success);
  }

  function acceptOfferBatch(
    uint[] memory _offerIds,
    address[] memory _nfts,
    uint[] memory _tokenIdOrMarketplaceIds,
    bool[] memory _isMarketplaceIds,
    uint128[] memory _quantities,
    string[] memory _searchKeywords
  ) external {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature(
        "acceptOfferBatch(uint256[],address[],uint256[],bool[],uint128[],string[])",
        _offerIds,
        _nfts,
        _tokenIdOrMarketplaceIds,
        _isMarketplaceIds,
        _quantities,
        _searchKeywords
      )
    );
    require(success);
  }

  function cancelOffer(uint _offerId) public {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("cancelOffer(uint256)", _offerId));
    require(success);
  }

  function cancelOfferBatch(uint[] memory _offerIds) external {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature("cancelOfferBatch(uint256[])", _offerIds)
    );
    require(success);
  }

  function expireOffers(uint[] memory _offerIds) external {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature("expireOffers(uint256[])", _offerIds)
    );
    require(success);
  }

  function makeBid(uint _marketplaceId, uint128 _bid) external payable {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature("makeBid(uint256,uint128)", _marketplaceId, _bid)
    );
    require(success);
  }

  function makeBidBatch(uint[] memory _marketplaceIds, uint128[] memory _bids) external payable {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature("makeBidBatch(uint256[],uint128[])", _marketplaceIds, _bids)
    );
    require(success);
  }

  // Cannot cancel up to cancelCutoffAuction for auctions
  // Called by the seller if they want to cancel the sale of their nft so the users who made an offer get back the locked brush and the seller gets back the nft
  function cancelSale(uint _marketplaceId) public {
    (bool success, ) = implBuyEditListing.delegatecall(abi.encodeWithSignature("cancelSale(uint256)", _marketplaceId));
    require(success);
  }

  function cancelSaleBatch(uint[] calldata _marketplaceIds) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("cancelSaleBatch(uint256[])", _marketplaceIds)
    );
    require(success);
  }

  function safeNFTTransferBulk(
    address[] memory _nfts,
    uint[] memory _tokenIds,
    address[] memory _tos,
    uint[] memory _amounts,
    uint _chainId,
    address[] memory _destinations,
    bytes memory _data
  ) external payable {
    (bool success, ) = implBatchTransferNFT.delegatecall(
      abi.encodeWithSignature(
        "safeNFTTransferBulk(address[],uint256[],address[],uint256[],uint256,address[],bytes)",
        _nfts,
        _tokenIds,
        _tos,
        _amounts,
        _chainId,
        _destinations,
        _data
      )
    );
    require(success);
  }

  function safeNFTTransferBulkOrdered(
    BulkTransferInfo[] memory _nftsInfo,
    uint _chainId, // not used
    address _destination, // not used
    bytes memory _data // not used
  ) external {
    (bool success, ) = implBatchTransferNFT.delegatecall(
      abi.encodeWithSignature(
        "safeNFTTransferBulkOrdered((address,uint256[],uint256[],address)[],uint256,address,bytes)",
        _nftsInfo,
        _chainId,
        _destination,
        _data
      )
    );
    require(success);
  }

  function editPrice(uint _marketplaceId, uint128 _price) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("editPrice(uint256,uint128)", _marketplaceId, _price)
    );
    require(success);
  }

  function editPriceBatch(uint[] memory _marketplaceIds, uint128[] memory _prices) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("editPriceBatch(uint256[],uint128[])", _marketplaceIds, _prices)
    );
    require(success);
  }

  function editQuantity(uint _marketplaceId, uint128 _newQuantity) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("editQuantity(uint256,uint128)", _marketplaceId, _newQuantity)
    );
    require(success);
  }

  function editQuantityBatch(uint[] memory _marketplaceIds, uint128[] memory _newQuantities) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("editQuantityBatch(uint256[],uint128[])", _marketplaceIds, _newQuantities)
    );
    require(success);
  }

  function editPriceAndQuantity(
    uint _marketplaceId,
    uint128 _newPrice,
    uint128 _newQuantity
  ) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature("editPriceAndQuantity(uint256,uint128,uint128)", _marketplaceId, _newPrice, _newQuantity)
    );
    require(success);
  }

  function editPriceAndQuantityBatch(
    uint[] memory _marketplaceId,
    uint128[] memory _newPrices,
    uint128[] memory _newQuantities
  ) external {
    (bool success, ) = implBuyEditListing.delegatecall(
      abi.encodeWithSignature(
        "editPriceAndQuantityBatch(uint256[],uint128[],uint128[])",
        _marketplaceId,
        _newPrices,
        _newQuantities
      )
    );
    require(success);
  }

  function editOffer(
    uint _offerId,
    address _nft,
    uint _tokenId,
    uint128 _newQuantity,
    uint128 _newOfferPrice,
    uint256 _newOfferDuration
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "editOffer(uint256,address,uint256,uint128,uint128,uint256)",
        _offerId,
        _nft,
        _tokenId,
        _newQuantity,
        _newOfferPrice,
        _newOfferDuration
      )
    );
    require(success);
  }

  function editOfferBatch(
    uint[] memory _offerIds,
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint128[] memory _newQuantities,
    uint128[] memory _newOfferPrices,
    uint256[] memory _newOfferDurations
  ) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(
      abi.encodeWithSignature(
        "editOfferBatch(uint256[],address[],uint256[],uint128[],uint128[],uint256[])",
        _offerIds,
        _nfts,
        _tokenIds,
        _newQuantities,
        _newOfferPrices,
        _newOfferDurations
      )
    );
    require(success);
  }

  function getSaleDetails(uint _marketplaceId) external view returns (FullDetails memory) {
    nftDetails storage saleDetails = nftForSale[_marketplaceId];
    if (saleDetails.nft != address(0)) {
      return nftDetailsToFullDetails(saleDetails);
    }

    return bundleForSale[_marketplaceId];
  }

  function nextMinimumBid(uint _marketplaceId) public view returns (uint) {
    nftDetails storage saleDetails = nftForSale[_marketplaceId];
    bool isAuction;
    uint128 price;
    uint128 maxBid;
    if (saleDetails.nft != address(0)) {
      isAuction = saleDetails.isAuction;
      price = saleDetails.price;
      maxBid = saleDetails.maxBid;
    } else {
      FullDetails storage bundleDetails = bundleForSale[_marketplaceId];
      isAuction = bundleDetails.isAuction;
      price = bundleDetails.price;
      maxBid = bundleDetails.maxBid;
    }

    if (isAuction) {
      return PaintSwapLibraryV3.nextMinimumBid(price, maxBid, minIncreasedBidPercent);
    }
    return 0;
  }

  function getOffer(uint _offerId) external view returns (Offer memory) {
    return offers[_offerId];
  }

  function setImplBuyEditListing(address _implBuyEditListing) external onlyOwner {
    require(_implBuyEditListing != address(0));
    implBuyEditListing = _implBuyEditListing;
  }

  function setimplMakeAndEditOffers(address _implMakeAndEditOffers) external onlyOwner {
    require(_implMakeAndEditOffers != address(0));
    implMakeAndEditOffers = _implMakeAndEditOffers;
  }

  function setImplBidsAndAcceptOffers(address _implBidsAndAcceptOffers) external onlyOwner {
    require(_implBidsAndAcceptOffers != address(0));
    implBidsAndAcceptOffers = _implBidsAndAcceptOffers;
  }

  function setImplListAndComplete(address _implListAndComplete) external onlyOwner {
    require(_implListAndComplete != address(0));
    implListAndComplete = _implListAndComplete;
  }

  function setImplBatchTransferNFT(address _implBatchTransferNFT) external onlyOwner {
    require(_implBatchTransferNFT != address(0));
    implBatchTransferNFT = _implBatchTransferNFT;
  }

  function setDurations(
    uint _minDuration,
    uint _maxDuration,
    uint _minAuctionDuration,
    uint _minFlashAuctionDuration,
    uint _maxAuctionDuration
  ) external onlyOwner {
    require(_minDuration > 0);
    require(_minDuration <= _maxDuration);
    minDuration = _minDuration;
    maxDuration = _maxDuration;

    require(_minAuctionDuration > 0);
    require(_minAuctionDuration <= _maxAuctionDuration);
    require(_minFlashAuctionDuration > 0);
    require(_minFlashAuctionDuration <= _maxAuctionDuration);

    minAuctionDuration = _minAuctionDuration;
    minFlashAuctionDuration = _minFlashAuctionDuration;
    maxAuctionDuration = _maxAuctionDuration;
  }

  function setEnableSelling(bool _enable) external onlyOwner {
    isSellingEnabled = _enable;
  }

  function setFeeAddresses(address _dev, address _salesFee) external onlyOwner {
    require(_dev != address(0));
    require(_salesFee != address(0));
    devFeeAddress = _dev;
    salesFeeAddress = _salesFee;
  }

  function setBundles(uint128 _maxBundleNumber, bool _enable) external onlyOwner {
    require(maxBundleNumber <= 20);
    maxBundleNumber = _maxBundleNumber;
    bundlesEnabled = _enable;
  }

  // Basis points 10000
  function setVariousTimes(
    uint64 _auctionGracePeriodForCancelling,
    uint64 _flashAuctionGracePeriodForCancelling,
    uint64 _auctionEndTimeIncreaseCutOff,
    uint64 _flashAuctionEndTimeIncreaseCutOff,
    uint128 _minIncreasedBidPercent,
    bool _modifyInitialStartTime,
    bool _modifyPostStartTime
  ) external onlyOwner {
    auctionGracePeriodForCancelling = _auctionGracePeriodForCancelling;
    flashAuctionGracePeriodForCancelling = _flashAuctionGracePeriodForCancelling;
    auctionEndTimeIncreaseCutOff = _auctionEndTimeIncreaseCutOff;
    flashAuctionEndTimeIncreaseCutOff = _flashAuctionEndTimeIncreaseCutOff;

    require(_minIncreasedBidPercent <= 2000); // 20%
    minIncreasedBidPercent = _minIncreasedBidPercent;

    modifyInitialStartTime = _modifyInitialStartTime;
    modifyPostStartTime = _modifyPostStartTime;
  }

  function setVarious(
    uint _maxRoyalty,
    uint64 _maxStartTimeIncrement,
    address _officialNFTDiscount,
    uint _callGasLimit,
    address _paintRouter
  ) external onlyOwner {
    require(_maxRoyalty <= 1000);
    royaltyInfo.maxRoyalty = _maxRoyalty;

    maxStartTimeIncrement = _maxStartTimeIncrement;

    officialNFTDiscount = OfficialNFTDiscount(_officialNFTDiscount);

    require(_callGasLimit < 5000000);
    callGasLimit = _callGasLimit;

    require(_paintRouter != address(0));
    paintRouter = _paintRouter;
  }

  function setMaxActiveOfferCountAndMinVaultVersion(uint _maxActiveOfferCount, uint _minVaultVersion)
    external
    onlyOwner
  {
    require(_maxActiveOfferCount > 0);
    maxActiveOfferCount = _maxActiveOfferCount;

    require(_minVaultVersion > 0);
    minVaultVersion = _minVaultVersion;
  }

  function setFeePercentage(address _feePercentage) external onlyOwner {
    require(_feePercentage != address(0));
    feePercentage = FeePercentage(_feePercentage);
  }

  function reserve1(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve1(bytes)", _data));
    require(success);
  }

  function reserve2(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve2(bytes)", _data));
    require(success);
  }

  function reserve3(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve3(bytes)", _data));
    require(success);
  }

  function reserve4(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve4(bytes)", _data));
    require(success);
  }

  /*
  function reserve5(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve5(bytes)", _data));
    require(success);
  }

  function reserve6(bytes memory _data) external payable {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserve6(bytes)", _data));
    require(success);
  } */

  function reserveOnlyOwner(bytes memory _data) external onlyOwner {
    (bool success, ) = implMakeAndEditOffers.delegatecall(abi.encodeWithSignature("reserveOnlyOwner(bytes)", _data));
    require(success);
  }

  function addValidVaultFactory(address _vaultFactory) external onlyOwner {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature("addValidVaultFactory(address)", _vaultFactory)
    );
    require(success);
  }

  function removeInvalidVaultFactory(address _vaultFactory) external onlyOwner {
    (bool success, ) = implBidsAndAcceptOffers.delegatecall(
      abi.encodeWithSignature("removeInvalidVaultFactory(address)", _vaultFactory)
    );
    require(success);
  }

  receive() external payable {}
}

File 2 of 28 : PaintSwapMarketplaceV3StateBase.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "../interfaces/IERC2981.sol";
import "../interfaces/IBrushToken.sol";
import "../CollectionRoyalties.sol";
import "../OfficialNFTDiscount.sol";
import "../V2/TokensV2.sol";
import "./MarketplaceWhitelistV3.sol";
import "./FeePercentage.sol";
import "./interfaces/INFTVault.sol";
import {PaintSwapLibraryV3} from "./PaintSwapLibraryV3.sol";

interface INFTVaultFactory {
  struct CreationInfo {
    bool createdHere;
    uint16 version;
  }

  function version() external view returns (uint16);

  function vaultAddresses(address, uint16) external view returns (address);

  function creationInfo(address _nftContract) external view returns (CreationInfo memory);
}

contract PaintSwapMarketplaceV3StateBase is Ownable, ReentrancyGuard {
  event SaleFinished(uint marketplaceId);
  event UpdatePrice(uint marketplaceId, uint128 price, address[] nfts, uint256[] tokenIds);
  event UpdateStartTime(uint marketplaceId, uint startTime);
  event UpdateEndTime(uint marketplaceId, uint endTime);

  event Sold(
    uint marketplaceId,
    address[] nfts,
    uint256[] tokenIds,
    uint256[] amountBatches,
    uint128 price,
    address buyer,
    address seller,
    uint256 amount,
    uint256 offerId
  );
  // These 2 should match. NewTempListing is used for accepting an offer, but don't want to show "new listing" events.
  event NewSale(
    uint marketplaceId,
    address[] nfts,
    uint256[] tokenIds,
    uint256[] amountBatches,
    uint128 price,
    uint256 duration,
    bool isAuction,
    bool antisnipe,
    bool flashAuction,
    uint256 amount,
    bool isNSFW,
    string searchKeywords,
    address[] addresses,
    address seller
  );

  event NewTempListing(
    uint marketplaceId,
    address[] nfts,
    uint256[] tokenIds,
    uint256[] amountBatches,
    uint128 price,
    uint256 duration,
    bool isAuction,
    bool antisnipe,
    bool flashAuction,
    uint256 amount,
    bool isNSFW,
    string searchKeywords,
    address[] addresses,
    address seller
  );

  // Not used until subgraph can support it
  event NewSaleBatch(
    uint[] marketplaceId,
    address[][] nfts,
    uint256[][] tokenIds,
    uint256[][] amountBatches,
    uint128[] prices,
    uint256[] durations,
    bool[] isAuctions,
    bool[] isAntisnipes,
    uint256[] amounts,
    bool[] isNSFWs,
    string[] searchKeywords,
    address[][] addresses,
    address[] sellers
  );

  event CancelledSale(uint marketplaceId, address[] nfts, uint256[] tokenIds, uint256[] amountBatches);
  event NewBid(uint marketplaceId, address indexed bidder, uint128 bid, uint nextMinimum);

  event RemoveExpiredListing(uint _marketplaceId);
  event UpdateQuantity(
    uint256 marketplaceId,
    address[] nfts,
    uint256[] tokenIds,
    uint newAmount,
    uint newAmountRemaining
  );

  // Placing it on a marketplace sale is useful for bundles & FNFTs that require custody. Otherwise put 0
  event NewOffer(
    uint offerId,
    uint marketplaceId,
    address[] nfts,
    uint256[] tokenIds,
    address indexed from,
    uint128 quantity,
    uint128 price,
    uint256 expires,
    string searchKeywords
  );

  event NewCollectionOffer(
    uint offerId,
    address nft,
    address indexed from,
    uint128 quantity,
    uint128 price,
    uint256 expires,
    string searchKeywords
  );

  event NewFilteredCollectionOffer(
    uint offerId,
    address nft,
    uint256[] tokenIds,
    address indexed from,
    uint128 quantity,
    uint128 price,
    uint128[] prices,
    uint256 expires,
    string[] searchKeywords
  );

  event OfferAccepted(uint offerId, address nft, uint tokenId, uint128 quantity, uint marketplaceId);
  event OfferCompleted(uint offerId);
  event OfferRemoved(uint offerId);
  event OfferExpired(uint offerId);
  event UpdateOffer(uint offerId, address nft, uint256 tokenId, uint128 quantity, uint128 newPrice, uint256 expires);

  event AddedVaultFactory(address _factory);
  event RemovedVaultFactory(address _factory);

  struct FullDetails {
    address[] nfts;
    uint256[] tokenIds;
    uint256[] amountBatches;
    uint256 startTime;
    uint256 endTime;
    uint128 price; // reserve price if auction
    // For bids
    uint128 maxBid;
    address maxBidder;
    address seller;
    // Whether this is an auction
    bool isAuction;
    bool complete;
    bool antisnipe;
    bool flashAuction;
    // How many are they selling and how many remain
    uint128 amount;
    uint128 amountRemaining;
    // The token payment is expected for
    address paymentToken;
    address vault; // 0 if no vault is involved
  }

  struct nftDetails {
    address nft;
    uint256 tokenId;
    uint64 startTime;
    uint64 endTime;
    // For bids
    uint128 maxBid;
    uint128 price; // reserve price if auction
    address maxBidder;
    address seller;
    // Whether this is an auction
    bool isAuction;
    bool complete;
    bool antisnipe;
    bool flashAuction;
    // How many are they selling and how many remain
    uint128 amount;
    uint128 amountRemaining;
    // The token payment is expected for
    address paymentToken;
    address vault; // 0 if no vault is involved
  }

  struct NFTInfo {
    address[] nfts;
    uint[] tokenIds;
    uint[] amountBatches;
  }

  struct BulkTransferInfo {
    address nft;
    uint[] tokenIds;
    uint[] amounts;
    address to;
  }

  function makeNFTInfo(nftDetails storage _nftDetails) internal view returns (NFTInfo memory) {
    address[] memory nfts = new address[](1);
    nfts[0] = _nftDetails.nft;

    uint[] memory tokenIds = new uint[](1);
    tokenIds[0] = _nftDetails.tokenId;

    uint[] memory amountBatches = new uint[](1);
    amountBatches[0] = 1;

    return NFTInfo({nfts: nfts, tokenIds: tokenIds, amountBatches: amountBatches});
  }

  function nftDetailsToFullDetails(nftDetails storage _nftDetails) internal view returns (FullDetails memory) {
    NFTInfo memory nftInfo = makeNFTInfo(_nftDetails);

    return
      FullDetails({
        nfts: nftInfo.nfts,
        tokenIds: nftInfo.tokenIds,
        amountBatches: nftInfo.amountBatches,
        seller: _nftDetails.seller,
        price: _nftDetails.price,
        startTime: _nftDetails.startTime,
        endTime: _nftDetails.endTime,
        maxBid: _nftDetails.maxBid,
        maxBidder: _nftDetails.maxBidder,
        isAuction: _nftDetails.isAuction,
        complete: _nftDetails.complete,
        antisnipe: _nftDetails.antisnipe,
        flashAuction: _nftDetails.flashAuction,
        amount: _nftDetails.amount,
        amountRemaining: _nftDetails.amountRemaining,
        paymentToken: _nftDetails.paymentToken,
        vault: _nftDetails.vault
      });
  }

  struct RoyaltyInfo {
    uint maxRoyalty;
    address collectionRoyalties;
  }

  uint public constant VERSION = 3;

  // The address to send the fees
  address public devFeeAddress;
  // The address to send sales fees to
  address public salesFeeAddress;

  // All the NFTs currently for sale on the marketplace (includes auctions)
  mapping(uint => FullDetails) internal bundleForSale;
  mapping(uint => nftDetails) internal nftForSale;

  // Information about collection royalties
  RoyaltyInfo internal royaltyInfo;

  // The discount for holding an Official PaintSwap NFT
  OfficialNFTDiscount internal officialNFTDiscount;

  // Which NFT addresses can be sold on the marketplace without a fee
  MarketplaceWhitelistV3 internal marketplaceWhitelist;
  // Information about tokens allowed for listing, fee/refund amount & payment tokens etc..
  TokensV2 internal tokens;

  // Whether selling is allowed on the marketplace
  bool internal isSellingEnabled = true;

  // The minimum length of time an NFT can be put on the marketplace for sale (not auctions)
  uint public minDuration = 1 days; // 1 day
  // The maximum length of time an NFT can be put on the marketplace for sale (not auctions)
  uint public maxDuration = 200 days;

  // The minimum length of time an NFT can be put on the marketplace for auction
  uint public minAuctionDuration = 30 minutes;
  // The minimum length of time an NFT can be put on the marketplace for auction for flash sales
  uint public minFlashAuctionDuration = 5 minutes;

  // The maximum length of time an NFT can be put on the marketplace for auction
  uint public maxAuctionDuration = 1 weeks;

  // How much the next bid or offer must be, prevents +1ing someone else
  uint128 public minIncreasedBidPercent = 1000; // 10000 basis points, 945 means 9.45%

  // The maximum number of NFTs a bundle can have
  uint internal maxBundleNumber = 5;
  // Whether bundles are supported
  bool internal bundlesEnabled;

  // The current id of the marketplace
  uint public currentMarketplaceId;

  // Grace period for cancelling
  uint64 public auctionGracePeriodForCancelling = 10 minutes;
  uint64 public flashAuctionGracePeriodForCancelling = 1 minutes;

  // If antisnipe is enabled and an auction ends within this period increase the auction by this amount.
  uint64 public auctionEndTimeIncreaseCutOff = 3 minutes;
  uint64 public flashAuctionEndTimeIncreaseCutOff = 1 minutes;

  // Whether the start time can be modified
  bool internal modifyInitialStartTime;
  bool internal modifyPostStartTime;
  uint64 public maxStartTimeIncrement = 7 days;

  uint internal callGasLimit = 250000;

  // Router to do the zapping
  address internal paintRouter;
  address internal wftm;

  // Has a lot of the marketplace functionality in it. Helps with contract code size.
  address internal implBuyEditListing;
  address internal implMakeAndEditOffers;
  address internal implBidsAndAcceptOffers;
  address internal implListAndComplete;
  address internal implBatchTransferNFT;

  uint public minVaultVersion = 1;

  enum OfferType {
    //    Listing,
    SingleNFT, // Could be single sale too
    Bundle,
    Collection,
    FilteredCollection,
    AltNFT
  }

  /*
             nft nfts	tokenIds saleid
Offers	      1	  0	     1	     0/1
Bundles	      0	  2	     2	      1
Collections	  1	  0	     0	      0 
Filtered	    1	  0	     2	      0
Alt	          0	  2	     2	      0
*/

  // TODO: Disable Alt & Bundles for now?

  // These are wftm offers.
  // Filtered collections can have an optimization if they are all in the same collection.
  struct Offer {
    address nft; // Only used for collection & filtered collection offers
    address[] nfts; // Used for bundle offers & filtered collection offers
    uint[] tokenIds; // empty if collection offer, more than 1 & nft is set for filtered collection. Otherwise if equal to 1 is normal offer, else bundle offer
    uint128 quantity;
    uint128 quantityRemaining;
    uint128 price;
    uint128[] prices;
    address from;
    OfferType offerType;
    uint expires;
    uint saleId; // 0 if not on sale
  }

  // This holds all offers whether on sale or on the nft itself
  mapping(uint => Offer) internal offers;
  uint public offerId = 1;
  uint public maxActiveOfferCount = 1000;
  mapping(address => uint) public offerCounts; // number of offers made from users

  uint public minOfferDuration = 1 days;
  uint public maxOfferDuration = 200 days;

  mapping(address => mapping(address => mapping(uint => uint))) public userOffersMade; // user => nft address => tokenId => offerId
  mapping(address => mapping(uint => uint)) public userBundleOffersMade; // user => marketplaceId => offerId
  mapping(address => mapping(address => uint)) public userCollectionOffersMade; // user => nft address => offerId
  mapping(address => mapping(address => uint)) public userFilteredCollectionOffersMade; // user => nft address => offerId
  mapping(address => uint) public userAltOffersMade; // user => offerId

  FeePercentage internal feePercentage;

  address[] internal validVaultFactories;

  // Can only have 1 listing per NFT
  mapping(address => mapping(address => mapping(uint => uint))) public singleNFTListings; // user => (nft address => tokenid) => marketplaceId;

  uint internal constant MAX_SEARCH_KEYWORDS = 1024;
}

File 3 of 28 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping (uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping (address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0
            ? string(abi.encodePacked(baseURI, tokenId.toString()))
            : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
     * in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}

File 4 of 28 : ERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping (uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping (address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor (string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    )
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        _balances[id][from] = fromBalance - amount;
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            _balances[id][from] = fromBalance - amount;
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(account != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][account] += amount;
        emit TransferSingle(operator, address(0), account, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * 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 _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `account`
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens of token type `id`.
     */
    function _burn(address account, uint256 id, uint256 amount) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 accountBalance = _balances[id][account];
        require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
        _balances[id][account] = accountBalance - amount;

        emit TransferSingle(operator, account, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), ids, amounts, "");

        for (uint i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 accountBalance = _balances[id][account];
            require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
            _balances[id][account] = accountBalance - amount;
        }

        emit TransferBatch(operator, account, address(0), ids, amounts);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        internal
        virtual
    { }

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 5 of 28 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 6 of 28 : Ownable.sol
// SPDX-License-Identifier: MIT

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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 7 of 28 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

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 make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 8 of 28 : IERC2981.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IERC2981 is IERC165 {
  /// @notice Called with the sale price to determine how much royalty
  //          is owed and to whom.
  /// @param _tokenId - the NFT asset queried for royalty information
  /// @param _salePrice - the sale price of the NFT asset specified by _tokenId
  /// @return receiver - address of who should be sent the royalty payment
  /// @return royaltyAmount - the royalty payment amount for _salePrice
  function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
    external
    view
    returns (address receiver, uint256 royaltyAmount);
}

File 9 of 28 : IBrushToken.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBrushToken {
  function transferFrom(
    address _sender,
    address _recipient,
    uint amount
  ) external;

  function transfer(address _recipient, uint amount) external;

  function burn(uint256 _amount) external;

  function allowance(address _sender, address _recipient) external returns (uint);

  function balanceOf(address _address) external returns (uint);
}

File 10 of 28 : CollectionRoyalties.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract CollectionRoyalties is Ownable {
  event AddedCollectionFromRoyalty(address nft, address recipient, uint fee);
  event RemovedCollectionFromRoyalty(address nft);

  struct CollectionRoyaltyInfo {
    address recipient;
    uint16 fee;
  }

  // Contract to recipient royalties
  mapping(address => CollectionRoyaltyInfo) public collectionRoyalties;
  uint16 public baseCollectionRoyaltyFeePercentage;
  uint public maxCollectionRoyalty = 1000;

  constructor() {
    baseCollectionRoyaltyFeePercentage = 10; // 0.1%
  }

  function setBaseCollectionRoyalty(uint16 _feePercentage) external onlyOwner {
    require(_feePercentage < maxCollectionRoyalty, "Royalty fee is too high");
    baseCollectionRoyaltyFeePercentage = _feePercentage;
  }

  function setMaxCollectionRoyalty(uint _maxCollectionRoyalty) external onlyOwner {
    require(maxCollectionRoyalty <= 1000);
    maxCollectionRoyalty = _maxCollectionRoyalty;
  }

  //	function updateRoyalty // TODO If I updated contracts again, otherwise delete and re-add

  function getCollectionRoyaltyInfo(address _addr) external view returns (CollectionRoyaltyInfo memory) {
    return collectionRoyalties[_addr];
  }

  function addCollectionRoyaltyFromOwner(address _nft, address _recipient) external {
    // Add they the owner?
    require(Ownable(_nft).owner() == msg.sender, "Only the owner can call this");
    require(!collectionRoyaltyBlacklist[_nft], "This collection is in the blacklist");
    collectionRoyalties[_nft] = CollectionRoyaltyInfo({recipient: _recipient, fee: baseCollectionRoyaltyFeePercentage});
    emit AddedCollectionFromRoyalty(_nft, _recipient, baseCollectionRoyaltyFeePercentage);
  }

  function removeCollectionRoyaltyFromOwner(address _nft) external onlyOwner {
    require(Ownable(_nft).owner() == msg.sender, "Only the owner can call this");
    delete collectionRoyalties[_nft];
    emit RemovedCollectionFromRoyalty(_nft);
  }

  function addToCollectionRoyaltyBlacklist(address _nft) external onlyOwner {
    collectionRoyaltyBlacklist[_nft] = true;
  }

  function addCollectionRoyalty(
    address _nft,
    address _recipient,
    uint16 _fee
  ) external onlyOwner {
    require(_fee <= maxCollectionRoyalty, "Royalty is too much");
    collectionRoyalties[_nft] = CollectionRoyaltyInfo({recipient: _recipient, fee: _fee});
    emit AddedCollectionFromRoyalty(_nft, _recipient, _fee);
  }

  mapping(address => bool) collectionRoyaltyBlacklist;

  function removeCollectionRoyalty(address _nft) external onlyOwner {
    delete collectionRoyalties[_nft];
    // Only owner can add them
    emit RemovedCollectionFromRoyalty(_nft);
  }
}

File 11 of 28 : OfficialNFTDiscount.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract OfficialNFTDiscount is Ownable {
  // The discount for holding an official NFT 0 - 100
  event NewOfficialNFTDiscount(uint oldDiscount, uint newDiscount);

  ERC721 public nft;
  uint128 public discount; // 0 - 100 (%)

  constructor(address _officialNFT, uint128 _officialNFTDiscount) {
    nft = ERC721(_officialNFT);
    discount = _officialNFTDiscount;
  }

  // Pass in 0-50 as an integer for the percentage reduction for holding an official NFT
  function setOfficialNFTDiscount(uint128 _amount) external onlyOwner {
    require(_amount <= 50);
    uint128 oldDiscount = discount;
    discount = _amount;

    emit NewOfficialNFTDiscount(oldDiscount, _amount);
  }
}

File 12 of 28 : TokensV2.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract TokensV2 is Ownable {
  struct TokenInfo {
    bool whitelist;
    uint128 sellerFee;
  }

  event AddPaymentTokenWhitelist(address token);
  event RemovePaymentTokenWhitelist(address token);

  event AddListingTokenWhitelist(address token, uint128 fee);
  event RemoveListingTokenWhitelist(address token);

  event NewSellerFee(address token, uint oldFee, uint newFee);

  mapping(address => TokenInfo) public listingTokens; // Which tokens are allowed for payment for listing
  mapping(address => bool) public paymentTokens; // Which payment tokens are allowed for the sale

  constructor(address _listingToken, uint128 _sellerFee) {
    listingTokens[_listingToken].whitelist = true; // Add it to the whitelist
    listingTokens[_listingToken].sellerFee = _sellerFee; // How much to charge for selling on the marketplace (could include a refund amount)
  }

  function addListingTokenWhitelist(address _token, uint128 _sellerFee) external onlyOwner {
    emit AddListingTokenWhitelist(_token, _sellerFee);
    emit NewSellerFee(_token, listingTokens[_token].sellerFee, _sellerFee);
    require(!listingTokens[_token].whitelist, "This token is already whitelisted");

    listingTokens[_token].whitelist = true;
    listingTokens[_token].sellerFee = _sellerFee;
  }

  function removeListingTokenWhitelist(address _token) external onlyOwner {
    emit RemoveListingTokenWhitelist(_token);
    emit NewSellerFee(_token, listingTokens[_token].sellerFee, 0);

    listingTokens[_token].whitelist = false;
    listingTokens[_token].sellerFee = 0;
  }

  function setSellerFee(address _token, uint128 _fee) external onlyOwner {
    emit NewSellerFee(_token, listingTokens[_token].sellerFee, _fee);

    listingTokens[_token].sellerFee = _fee;
  }

  function isListingTokenWhitelisted(address _token) external view returns (bool) {
    return listingTokens[_token].whitelist;
  }

  function sellerFee(address _token) external view returns (uint128) {
    return listingTokens[_token].sellerFee;
  }

  function addPaymentTokenWhitelist(address _token) external onlyOwner {
    paymentTokens[_token] = true;
    emit AddPaymentTokenWhitelist(_token);
  }

  function removePaymentTokenWhitelist(address _token) external onlyOwner {
    delete paymentTokens[_token];
    emit RemovePaymentTokenWhitelist(_token);
  }

  function isPaymentTokenWhitelisted(address _token) external view returns (bool) {
    return paymentTokens[_token];
  }
}

File 13 of 28 : MarketplaceWhitelistV3.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract MarketplaceWhitelistV3 is Ownable {
  event AddWhitelist(address[] nfts);
  event RemoveWhitelist(address[] nfts);

  mapping(address => bool) public whitelistNFTs;
  mapping(address => bool) public admins;

  function addWhitelist(address[] calldata _nfts) external {
    require(admins[msg.sender] || owner() == msg.sender);
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      whitelistNFTs[nft] = true;
    }
    emit AddWhitelist(_nfts);
  }

  function removeWhitelist(address[] calldata _nfts) external {
    require(admins[msg.sender] || owner() == msg.sender);

    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      whitelistNFTs[nft] = false;
    }
    emit RemoveWhitelist(_nfts);
  }

  function isWhitelisted(address _nft) external view returns (bool) {
    return whitelistNFTs[_nft];
  }

  function addAdmin(address _admin) external onlyOwner {
    admins[_admin] = true;
  }

  function removeAdmin(address _admin) external onlyOwner {
    admins[_admin] = false;
  }
}

File 14 of 28 : FeePercentage.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract FeePercentage is Ownable {
  // Basis points 10000, how much the dev address gets from each sale
  uint public devFeePercentage;

  // Basis points 10000, how much the dev address gets from each sale for financial NFTs
  uint public devFeeFNFTPercentage;

  event AddFNFT(address nft);
  event RemoveFNFT(address nft);

  mapping(address => bool) public usesFNFT;

  constructor(uint _devFeePercentage, uint _devFeeFNFTPercentage) {
    devFeePercentage = _devFeePercentage;
    devFeeFNFTPercentage = _devFeeFNFTPercentage;
  }

  // Basis points 10000, 185 is 1.85%
  function setDevFeePercentage(uint16 _feePercentage) external onlyOwner {
    require(_feePercentage <= 1000);
    devFeePercentage = _feePercentage;
  }

  // Basis points 10000, 185 is 1.85%
  function setDevFeeFNFTPercentage(uint16 _feePercentage) external onlyOwner {
    require(_feePercentage <= 1000);
    devFeeFNFTPercentage = _feePercentage;
  }

  function addFNFT(address _nft) external onlyOwner {
    usesFNFT[_nft] = true;
    emit AddFNFT(_nft);
  }

  function removeFNFT(address _nft) external onlyOwner {
    usesFNFT[_nft] = false;
    emit RemoveFNFT(_nft);
  }

  function getFee(address _nft) external view returns (uint) {
    return usesFNFT[_nft] ? devFeeFNFTPercentage : devFeePercentage;
  }
}

File 15 of 28 : INFTVault.sol
pragma solidity ^0.8.0;

//SPDX-License-Identifier: MIT

interface INFTVault {
  function owner() external view returns (address);
	function version() external view returns (uint);

  function trySafeNFTTransfer(
    address _to,
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint[] memory _amountBatches,
    uint _amount,
    uint _maxBundleNumber
  ) external returns (bool);

  function safeNFTTransfer(
    address _to,
    address[] memory _nfts,
    uint[] memory _tokenIds,
    uint[] memory _amountBatches,
    uint _amount,
    uint _maxBundleNumber
  ) external;

  function addedSale(address[] memory _nfts,
    uint256[] memory _tokenIds,
    uint256[] memory _amountBatches,
    uint128 _amount) external;
}

File 16 of 28 : PaintSwapLibraryV3.sol
pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/IWrappedToken.sol";
import "../interfaces/IERC2981.sol";
import "../V2/TokensV2.sol";

interface PaintRouter {
  function swapETHForExactTokens(
    uint amountOut,
    address[] calldata path,
    address to,
    uint deadline
  ) external payable returns (uint[] memory amounts);
}

library PaintSwapLibraryV3 {
  event TokenFailedTransfer(address token, uint amount);

  struct BatchTransferInfo {
    address nft;
    uint[] tokenIds;
    uint[] amountBatches;
  }

  // Pre-condition is that the NFTS are either ERC721 or ERC1155
  function safeNFTTransferFrom(
    address[] memory _nfts,
    address _owner,
    address _to,
    uint[] memory _tokenIds,
    uint[] memory _amountBatches,
    uint _amount,
    uint _maxBundleNumber
  ) external {
    // Do a pre-pass packaging up the nfts into combined sets
    BatchTransferInfo[] memory nftsInfo = new BatchTransferInfo[](_maxBundleNumber);
    uint length = 0; // nft length

    uint[] memory tokenIdAmountBatchLengths = new uint[](_maxBundleNumber);

    {
      for (uint i = 0; i < _nfts.length; ++i) {
        address nft = _nfts[i];
        uint tokenId = _tokenIds[i];

        bool exists = false;
        // Loop over all the ones which have been added
        for (uint j = 0; j < nftsInfo.length; ++j) {
          BatchTransferInfo memory nftInfo = nftsInfo[j];
          if (nft == nftInfo.nft) {
            // Already exists
            exists = true;

            nftInfo.tokenIds[tokenIdAmountBatchLengths[j]] = tokenId;
            nftInfo.amountBatches[tokenIdAmountBatchLengths[j]] = _amountBatches[i];
            ++tokenIdAmountBatchLengths[j];
          }
        }

        if (!exists) {
          uint[] memory __tokenIds = new uint[](_maxBundleNumber);
          __tokenIds[0] = tokenId;
          uint[] memory __amountBatches = new uint[](_maxBundleNumber);
          __amountBatches[0] = _amountBatches[i];
          nftsInfo[length] = BatchTransferInfo({nft: nft, tokenIds: __tokenIds, amountBatches: __amountBatches});
          ++tokenIdAmountBatchLengths[length];
          ++length;
        }
      }
    }

    for (uint i = 0; i < length; ++i) {
      if (ERC165(nftsInfo[i].nft).supportsInterface(type(IERC1155).interfaceId)) {
        // Multiply the amounts inside the batches if this is a bundle
        uint[] memory amountBatches = nftsInfo[i].amountBatches;
        for (uint j = 0; j < tokenIdAmountBatchLengths[i]; ++j) {
          amountBatches[j] *= _amount;
        }

        // Create appropriate lengths of arrays
        uint[] memory tokenIds_ = new uint[](tokenIdAmountBatchLengths[i]);
        uint[] memory amountBatches_ = new uint[](tokenIdAmountBatchLengths[i]);

        for (uint j = 0; j < tokenIdAmountBatchLengths[i]; ++j) {
          tokenIds_[j] = nftsInfo[i].tokenIds[j];
          amountBatches_[j] = nftsInfo[i].amountBatches[j];
        }

        // This line is different for vaults
        if (tokenIds_.length == 1) {
          IERC1155(nftsInfo[i].nft).safeTransferFrom(_owner, _to, tokenIds_[0], amountBatches_[0], "");
        } else {
          IERC1155(nftsInfo[i].nft).safeBatchTransferFrom(_owner, _to, tokenIds_, amountBatches_, "");
        }
      } else {
        require(IERC165(nftsInfo[i].nft).supportsInterface(type(IERC721).interfaceId));
        for (uint j = 0; j < tokenIdAmountBatchLengths[i]; ++j) {
          IERC721(nftsInfo[i].nft).safeTransferFrom(_owner, _to, nftsInfo[i].tokenIds[j]);
        }
      }
    }
  }

  function checkBalance(
    address[] memory _nfts,
    address _owner,
    uint[] memory _tokenIds,
    uint[] memory _amountBatches,
    uint _amount
  ) external view {
    // Check that owner has these nfts and approved us
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      uint tokenId = _tokenIds[i];
      uint amountBatch = _amountBatches[i];
      if (ERC165(nft).supportsInterface(type(IERC1155).interfaceId)) {
        require(IERC1155(nft).balanceOf(_owner, tokenId) >= amountBatch * _amount);
      } else {
        require(IERC721(nft).ownerOf(tokenId) == _owner);
      }
    }
  }

  function checkBalanceAndApproval(
    address[] memory _nfts,
    address _owner,
    address _operator,
    uint[] memory _tokenIds,
    uint[] memory _amountBatches,
    uint _amount
  ) external view {
    // Check that owner has these nfts and approved us
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      uint tokenId = _tokenIds[i];
      uint amountBatch = _amountBatches[i];
      if (ERC165(nft).supportsInterface(type(IERC1155).interfaceId)) {
        require(IERC1155(nft).balanceOf(_owner, tokenId) >= amountBatch * _amount);
        require(IERC1155(nft).isApprovedForAll(_owner, _operator));
      } else {
        require(IERC721(nft).ownerOf(tokenId) == _owner);
        require(IERC721(nft).isApprovedForAll(_owner, _operator) || IERC721(nft).getApproved(tokenId) == _operator);
      }
    }
  }

  function safeTransferFromUs(
    address _token,
    address _receiver,
    uint _amount,
    uint _callGasLimit
  ) external returns (uint amountToSend) {
    if (tokenIsNativeFtm(_token)) {
      // Do an FTM transfer
      uint balance = address(this).balance;
      amountToSend = balance >= _amount ? _amount : balance;
      (bool success, ) = _receiver.call{value: amountToSend, gas: _callGasLimit}(""); // Don't care if it fails
      if (!success) {
        emit TokenFailedTransfer(_token, amountToSend);
      }
    } else {
      uint balance = IERC20(_token).balanceOf(address(this));
      amountToSend = balance >= _amount ? _amount : balance;
      IERC20(_token).transfer(_receiver, amountToSend);
    }
  }

  function checkAddSale(
    address[] memory _nfts,
    uint128 _price,
    uint _amount,
    bool _isSellingEnabled,
    uint256[] memory _tokenIds,
    uint256[] memory _amountBatches,
    uint256 _maxBundleNumber,
    address[] memory _addresses,
    address _tokens,
    bool _bundlesEnabled
  ) external view {
    require(_bundlesEnabled || _nfts.length == 1);
    require(TokensV2(_tokens).isListingTokenWhitelisted(_addresses[0]));
    require(TokensV2(_tokens).isPaymentTokenWhitelisted(_addresses[2]));

    require(_tokenIds.length <= _maxBundleNumber, "Do not support this many in a bundle");
    require(_amountBatches.length == _tokenIds.length, "Token id and amount lengths should be equal");
    require(_nfts.length == _tokenIds.length, "NFT and token id lengths should be equal");
    require(_nfts.length > 0, "NFT length cannot be 0");
    require(_amount > 0, "Amount not greater than 0");
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      require(nft != address(0), "Invalid Account");
      require(isValidNFTContract(nft), "Not a compatible contract");
      require(isERC1155(nft) || (_amount == 1 && _amountBatches[i] == 1), "ERC721 can only have 1 per tokenId");
    }

    require(_price > 0, "Price should be more than 0");
    if (tokenIsNativeFtm(_addresses[2])) {
      require(_price < 3175000000 * 10**18, "Price is too high (native ftm)");
    } else {
      require(_price < IERC20(_addresses[2]).totalSupply(), "Price is too high");
    }

    require(_amount > 0, "Amount cannot be 0");
    require(_isSellingEnabled, "Selling is not enabled");
  }

  function isCompleteOrFinished(bool _complete, uint _endTime) public view returns (bool) {
    return _complete || _endTime <= block.timestamp;
  }

  function nextMinimumBid(
    uint _price,
    uint _max,
    uint128 _percentIncrease
  ) public pure returns (uint) {
    if (_max == 0) {
      return _price;
    } else {
      return _nextMinimumBid(_max, _percentIncrease);
    }
  }

  function _nextMinimumBid(uint _max, uint128 _percentIncrease) private pure returns (uint) {
    uint newMin = (_max + (_max * _percentIncrease) / 10000);
    if (newMin == _max) {
      return _max + 1; // Increase by 1
    }
    return newMin;
  }

  // The zero address is used to show that the token is native fantom
  function tokenIsNativeFtm(address _token) public pure returns (bool) {
    return _token == address(0);
  }

  // An NFT contract could be malicious and prevent a sale finishing. Try send NFT to our backup address,
  // if possible, otherwise it just gets lost forever.
  function tryRoyaltyInfo(
    address _nft,
    uint256 _tokenId,
    uint256 _salePrice
  ) external view returns (address receiver, uint256 royaltyAmount) {
    try IERC2981(_nft).royaltyInfo(_tokenId, _salePrice) returns (address _receiver, uint256 _royaltyAmount) {
      return (_receiver, _royaltyAmount);
    } catch {}

    return (address(0), 0);
  }

  function isValidNFTContract(address _nft) public view returns (bool) {
    return isERC1155(_nft) || isERC721(_nft);
  }

  function isERC721(address _nft) public view returns (bool) {
    try IERC165(_nft).supportsInterface(type(IERC721).interfaceId) returns (bool _supportsERC721) {
      return _supportsERC721;
    } catch {}

    return false;
  }

  function isERC1155(address _nft) public view returns (bool) {
    try IERC165(_nft).supportsInterface(type(IERC1155).interfaceId) returns (bool _supportsERC1155) {
      return _supportsERC1155;
    } catch {}

    return false;
  }

  function zapFTM(
    address _paintRouter,
    uint128 _fee,
    uint _value,
    address _refundTo,
    address[] memory _path
  ) public {
    uint deadline = block.timestamp + 10 * 60;
    uint[] memory amounts = PaintRouter(_paintRouter).swapETHForExactTokens{value: _value}(
      _fee,
      _path,
      address(this),
      deadline
    );
    // Refund back to seller if there is dust left from the transaction
    uint amount = amounts[0];
    if (_value > amount) {
      (bool sent, ) = _refundTo.call{value: _value - amount}("");
      require(sent, "Failed to refund FTM");
    }
  }

  function marketplaceZapFTM(
    address _paintRouter,
    uint128 _fee,
    uint _value,
    address[] memory _addresses
  ) public {
    // Zap if paying with ftm necessary
    // Assign the path
    // Create path using the indexes 2 - n
    // Sent FTM to us (if listingToken is in brush)
    uint preNonPathCount = 3;
    uint pathSize = _addresses.length - preNonPathCount;
    bool hasPath = pathSize > 0;
    if (hasPath) {
      address[] memory path = new address[](pathSize);
      for (uint i = 0; i < pathSize; ++i) {
        path[i] = _addresses[preNonPathCount + i];
      }

      zapFTM(_paintRouter, _fee, _value, msg.sender, path);
    } else {
      revert("Trying to zap with the marketplace but there is not path");
    }
  }

  function convertFTM(address _wftm) external {
    IWrappedToken(_wftm).deposit{value: msg.value}();
    IERC20(_wftm).transfer(msg.sender, msg.value);
  }

  function addSaleListingTransfer(address[] memory _addresses,
    bool _payNative,
    uint128 _listingFee,
    address _devFeeAddress,
    address _paintRouter,
    address _wftm
  ) external {
    if (_listingFee > 0) {
      // If paying with ftm
      if (_payNative) {
        if (tokenIsNativeFtm(_addresses[0])) {
          require(msg.value >= _listingFee);
          (bool sent, ) = _devFeeAddress.call{value: _listingFee}("");
          require(sent, "Failed to send FTM");

          // Refund any excess FTM
          if (msg.value > _listingFee) {
            (bool sent1, ) = msg.sender.call{value: msg.value - _listingFee}("");
            require(sent1, "Failed to refund FTM");
          }
        } else {
          require(_addresses[3] == _wftm && _addresses[_addresses.length - 1] == _addresses[0]); // Should be going from ftm to the listing token
          marketplaceZapFTM(_paintRouter, _listingFee, msg.value, _addresses);
          IERC20(_addresses[0]).transfer(_devFeeAddress, _listingFee);
        }
      } else {
        IERC20(_addresses[0]).transferFrom(msg.sender, _devFeeAddress, _listingFee);
      }
    }
  }
}

File 17 of 28 : IERC721.sol
// SPDX-License-Identifier: MIT

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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

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

File 18 of 28 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

File 19 of 28 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 20 of 28 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 21 of 28 : Context.sol
// SPDX-License-Identifier: MIT

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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 22 of 28 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant alphabet = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = alphabet[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

}

File 23 of 28 : ERC165.sol
// SPDX-License-Identifier: MIT

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 24 of 28 : IERC165.sol
// SPDX-License-Identifier: MIT

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 25 of 28 : IERC1155.sol
// SPDX-License-Identifier: MIT

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 be 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 26 of 28 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

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.
        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. 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 27 of 28 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT

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 28 of 28 : IWrappedToken.sol
pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWrappedToken is IERC20 {
  function deposit() external payable;
  function withdraw(uint wad) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999999,
    "details": {
      "yul": true
    }
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/V3/PaintSwapLibraryV3.sol": {
      "PaintSwapLibraryV3": "0x5d9fe5b343d308ed8f72dc370a57423b8eef3680"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_officialNFTDiscount","type":"address"},{"internalType":"address","name":"_marketplaceWhitelist","type":"address"},{"internalType":"address","name":"_collectionRoyalties","type":"address"},{"internalType":"address","name":"_tokens","type":"address"},{"internalType":"address","name":"_paintRouter","type":"address"},{"internalType":"address","name":"_wftm","type":"address"},{"internalType":"address","name":"_implBuyEditListing","type":"address"},{"internalType":"address","name":"_implMakeAndEditOffers","type":"address"},{"internalType":"address","name":"_implBidsAndAcceptOffers","type":"address"},{"internalType":"address","name":"_implListAndComplete","type":"address"},{"internalType":"address","name":"_implBatchTransferNFT","type":"address"},{"internalType":"address","name":"_feePercentage","type":"address"},{"internalType":"uint256","name":"startId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_factory","type":"address"}],"name":"AddedVaultFactory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amountBatches","type":"uint256[]"}],"name":"CancelledSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":false,"internalType":"uint128","name":"bid","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"nextMinimum","type":"uint256"}],"name":"NewBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint128","name":"quantity","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"},{"indexed":false,"internalType":"string","name":"searchKeywords","type":"string"}],"name":"NewCollectionOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint128","name":"quantity","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint128[]","name":"prices","type":"uint128[]"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"},{"indexed":false,"internalType":"string[]","name":"searchKeywords","type":"string[]"}],"name":"NewFilteredCollectionOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint128","name":"quantity","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"},{"indexed":false,"internalType":"string","name":"searchKeywords","type":"string"}],"name":"NewOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amountBatches","type":"uint256[]"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isAuction","type":"bool"},{"indexed":false,"internalType":"bool","name":"antisnipe","type":"bool"},{"indexed":false,"internalType":"bool","name":"flashAuction","type":"bool"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isNSFW","type":"bool"},{"indexed":false,"internalType":"string","name":"searchKeywords","type":"string"},{"indexed":false,"internalType":"address[]","name":"addresses","type":"address[]"},{"indexed":false,"internalType":"address","name":"seller","type":"address"}],"name":"NewSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"marketplaceId","type":"uint256[]"},{"indexed":false,"internalType":"address[][]","name":"nfts","type":"address[][]"},{"indexed":false,"internalType":"uint256[][]","name":"tokenIds","type":"uint256[][]"},{"indexed":false,"internalType":"uint256[][]","name":"amountBatches","type":"uint256[][]"},{"indexed":false,"internalType":"uint128[]","name":"prices","type":"uint128[]"},{"indexed":false,"internalType":"uint256[]","name":"durations","type":"uint256[]"},{"indexed":false,"internalType":"bool[]","name":"isAuctions","type":"bool[]"},{"indexed":false,"internalType":"bool[]","name":"isAntisnipes","type":"bool[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"bool[]","name":"isNSFWs","type":"bool[]"},{"indexed":false,"internalType":"string[]","name":"searchKeywords","type":"string[]"},{"indexed":false,"internalType":"address[][]","name":"addresses","type":"address[][]"},{"indexed":false,"internalType":"address[]","name":"sellers","type":"address[]"}],"name":"NewSaleBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amountBatches","type":"uint256[]"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isAuction","type":"bool"},{"indexed":false,"internalType":"bool","name":"antisnipe","type":"bool"},{"indexed":false,"internalType":"bool","name":"flashAuction","type":"bool"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isNSFW","type":"bool"},{"indexed":false,"internalType":"string","name":"searchKeywords","type":"string"},{"indexed":false,"internalType":"address[]","name":"addresses","type":"address[]"},{"indexed":false,"internalType":"address","name":"seller","type":"address"}],"name":"NewTempListing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"quantity","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"}],"name":"OfferAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"}],"name":"OfferCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"}],"name":"OfferExpired","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"}],"name":"OfferRemoved","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":false,"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"RemoveExpiredListing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_factory","type":"address"}],"name":"RemovedVaultFactory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"}],"name":"SaleFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amountBatches","type":"uint256[]"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"UpdateEndTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offerId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"quantity","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"newPrice","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"UpdateOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"UpdatePrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nfts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmountRemaining","type":"uint256"}],"name":"UpdateQuantity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"marketplaceId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"UpdateStartTime","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offerId","type":"uint256"},{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"string","name":"_searchKeywords","type":"string"}],"name":"acceptOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_offerIds","type":"uint256[]"},{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIdOrMarketplaceIds","type":"uint256[]"},{"internalType":"bool[]","name":"_isMarketplaceIds","type":"bool[]"},{"internalType":"uint128[]","name":"_quantities","type":"uint128[]"},{"internalType":"string[]","name":"_searchKeywords","type":"string[]"}],"name":"acceptOfferBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offerId","type":"uint256"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"acceptOnSaleOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amountBatches","type":"uint256[]"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint64[]","name":"_times","type":"uint64[]"},{"internalType":"uint128","name":"_amount","type":"uint128"},{"internalType":"bool[]","name":"_flags","type":"bool[]"},{"internalType":"string","name":"_searchKeywords","type":"string"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addSale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[][]","name":"_nfts","type":"address[][]"},{"internalType":"uint256[][]","name":"_tokenIds","type":"uint256[][]"},{"internalType":"uint256[][]","name":"_amountBatches","type":"uint256[][]"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"},{"internalType":"uint64[][]","name":"_times","type":"uint64[][]"},{"internalType":"uint128[]","name":"_amounts","type":"uint128[]"},{"internalType":"bool[][]","name":"_flags","type":"bool[][]"},{"internalType":"string[]","name":"_searchKeywords","type":"string[]"},{"internalType":"address[][]","name":"_addresses","type":"address[][]"}],"name":"addSaleBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultFactory","type":"address"}],"name":"addValidVaultFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auctionEndTimeIncreaseCutOff","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionGracePeriodForCancelling","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_amount","type":"uint128"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_amounts","type":"uint128[]"},{"internalType":"bool","name":"_allowFailures","type":"bool"}],"name":"buyBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offerId","type":"uint256"}],"name":"cancelOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_offerIds","type":"uint256[]"}],"name":"cancelOfferBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"cancelSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"}],"name":"cancelSaleBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"completeMarketplaceEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentMarketplaceId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devFeeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offerId","type":"uint256"},{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint128","name":"_newQuantity","type":"uint128"},{"internalType":"uint128","name":"_newOfferPrice","type":"uint128"},{"internalType":"uint256","name":"_newOfferDuration","type":"uint256"}],"name":"editOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_offerIds","type":"uint256[]"},{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_newQuantities","type":"uint128[]"},{"internalType":"uint128[]","name":"_newOfferPrices","type":"uint128[]"},{"internalType":"uint256[]","name":"_newOfferDurations","type":"uint256[]"}],"name":"editOfferBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_price","type":"uint128"}],"name":"editPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_newPrice","type":"uint128"},{"internalType":"uint128","name":"_newQuantity","type":"uint128"}],"name":"editPriceAndQuantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceId","type":"uint256[]"},{"internalType":"uint128[]","name":"_newPrices","type":"uint128[]"},{"internalType":"uint128[]","name":"_newQuantities","type":"uint128[]"}],"name":"editPriceAndQuantityBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"}],"name":"editPriceBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_newQuantity","type":"uint128"}],"name":"editQuantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_newQuantities","type":"uint128[]"}],"name":"editQuantityBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_offerIds","type":"uint256[]"}],"name":"expireOffers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flashAuctionEndTimeIncreaseCutOff","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flashAuctionGracePeriodForCancelling","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offerId","type":"uint256"}],"name":"getOffer","outputs":[{"components":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"address[]","name":"nfts","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint128","name":"quantity","type":"uint128"},{"internalType":"uint128","name":"quantityRemaining","type":"uint128"},{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128[]","name":"prices","type":"uint128[]"},{"internalType":"address","name":"from","type":"address"},{"internalType":"enum PaintSwapMarketplaceV3StateBase.OfferType","name":"offerType","type":"uint8"},{"internalType":"uint256","name":"expires","type":"uint256"},{"internalType":"uint256","name":"saleId","type":"uint256"}],"internalType":"struct PaintSwapMarketplaceV3StateBase.Offer","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"getSaleDetails","outputs":[{"components":[{"internalType":"address[]","name":"nfts","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amountBatches","type":"uint256[]"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"maxBid","type":"uint128"},{"internalType":"address","name":"maxBidder","type":"address"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"bool","name":"isAuction","type":"bool"},{"internalType":"bool","name":"complete","type":"bool"},{"internalType":"bool","name":"antisnipe","type":"bool"},{"internalType":"bool","name":"flashAuction","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"amountRemaining","type":"uint128"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"address","name":"vault","type":"address"}],"internalType":"struct PaintSwapMarketplaceV3StateBase.FullDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address","name":"_user","type":"address"}],"name":"hasExistingActiveOffers","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"string[]","name":"_searchKeywords","type":"string[]"}],"name":"makeAltOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_bid","type":"uint128"}],"name":"makeBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_bids","type":"uint128[]"}],"name":"makeBidBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"string","name":"_searchKeywords","type":"string"}],"name":"makeCollectionOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"string[]","name":"_searchKeywords","type":"string[]"}],"name":"makeFilteredCollectionOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[][]","name":"_tokenIds","type":"uint256[][]"},{"internalType":"uint128[]","name":"_quantities","type":"uint128[]"},{"internalType":"uint128[][]","name":"_prices","type":"uint128[][]"},{"internalType":"uint256[]","name":"_durations","type":"uint256[]"},{"internalType":"string[][]","name":"_searchKeywords","type":"string[][]"}],"name":"makeFilteredCollectionOfferBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"makeOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marketplaceIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_quantities","type":"uint128[]"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"},{"internalType":"uint256[]","name":"_durations","type":"uint256[]"}],"name":"makeOfferBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint128","name":"_quantity","type":"uint128"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"string","name":"_searchKeywords","type":"string"}],"name":"makeOfferSingle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint128[]","name":"_quantities","type":"uint128[]"},{"internalType":"uint128[]","name":"_prices","type":"uint128[]"},{"internalType":"uint256[]","name":"_durations","type":"uint256[]"},{"internalType":"string[]","name":"_searchKeywords","type":"string[]"}],"name":"makeOfferSingleBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"maxActiveOfferCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAuctionDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxOfferDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxStartTimeIncrement","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAuctionDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minFlashAuctionDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minIncreasedBidPercent","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minOfferDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minVaultVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketplaceId","type":"uint256"}],"name":"nextMinimumBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"offerCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"offerId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultFactory","type":"address"}],"name":"removeInvalidVaultFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"reserve1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"reserve2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"reserve3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"reserve4","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"reserveOnlyOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nfts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"_tos","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address[]","name":"_destinations","type":"address[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeNFTTransferBulk","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct PaintSwapMarketplaceV3StateBase.BulkTransferInfo[]","name":"_nftsInfo","type":"tuple[]"},{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeNFTTransferBulkOrdered","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"salesFeeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"_maxBundleNumber","type":"uint128"},{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setBundles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDuration","type":"uint256"},{"internalType":"uint256","name":"_maxDuration","type":"uint256"},{"internalType":"uint256","name":"_minAuctionDuration","type":"uint256"},{"internalType":"uint256","name":"_minFlashAuctionDuration","type":"uint256"},{"internalType":"uint256","name":"_maxAuctionDuration","type":"uint256"}],"name":"setDurations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setEnableSelling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dev","type":"address"},{"internalType":"address","name":"_salesFee","type":"address"}],"name":"setFeeAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feePercentage","type":"address"}],"name":"setFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implBatchTransferNFT","type":"address"}],"name":"setImplBatchTransferNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implBidsAndAcceptOffers","type":"address"}],"name":"setImplBidsAndAcceptOffers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implBuyEditListing","type":"address"}],"name":"setImplBuyEditListing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implListAndComplete","type":"address"}],"name":"setImplListAndComplete","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxActiveOfferCount","type":"uint256"},{"internalType":"uint256","name":"_minVaultVersion","type":"uint256"}],"name":"setMaxActiveOfferCountAndMinVaultVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDuration","type":"uint256"},{"internalType":"uint256","name":"_maxDuration","type":"uint256"}],"name":"setOfferDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxRoyalty","type":"uint256"},{"internalType":"uint64","name":"_maxStartTimeIncrement","type":"uint64"},{"internalType":"address","name":"_officialNFTDiscount","type":"address"},{"internalType":"uint256","name":"_callGasLimit","type":"uint256"},{"internalType":"address","name":"_paintRouter","type":"address"}],"name":"setVarious","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_auctionGracePeriodForCancelling","type":"uint64"},{"internalType":"uint64","name":"_flashAuctionGracePeriodForCancelling","type":"uint64"},{"internalType":"uint64","name":"_auctionEndTimeIncreaseCutOff","type":"uint64"},{"internalType":"uint64","name":"_flashAuctionEndTimeIncreaseCutOff","type":"uint64"},{"internalType":"uint128","name":"_minIncreasedBidPercent","type":"uint128"},{"internalType":"bool","name":"_modifyInitialStartTime","type":"bool"},{"internalType":"bool","name":"_modifyPostStartTime","type":"bool"}],"name":"setVariousTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implMakeAndEditOffers","type":"address"}],"name":"setimplMakeAndEditOffers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"singleNFTListings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userAltOffersMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userBundleOffersMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userCollectionOffersMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userFilteredCollectionOffersMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userOffersMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080346200030e57601f620062b338819003918201601f19168301916001600160401b03831184841017620002f8578084926101a0946040528339810103126200030e576200004e8162000313565b906200005d6020820162000313565b916200006c6040830162000313565b916200007b6060820162000313565b936200008a6080830162000313565b6200009860a0840162000313565b92620000a760c0820162000313565b96620000b660e0830162000313565b91620000c6610100820162000313565b90620000d6610120820162000313565b93620000e6610140830162000313565b96610180620000f9610160850162000313565b930151600080546001600160a01b031916339081178255604051929e929c917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0818fa36001808055600a805462015180600b819055630107ac00600c819055610708600d5561012c600e5562093a80600f55601080546001600160801b0319166103e89081179091556005601155783c00000000000000b4000000000000003c00000000000002586014556015805462010000600160501b03191664093a8000001790556203d090601655601e869055602095909555602194909455602355602492909255600880546001600160a01b03199081166001600160a01b0395861617909155600980548216968516969096179095556001600160a81b031990911697821697909717600160a01b17909655601780548316988716989098179097556018805482169986169990991790985560139a909a55602a8054881691841691909117905560198054871694831694909417909355601a8054861698821698909817909755601b8054851692881692909217909155601c80548416918716919091179055601d805490921690851617905560408101926001600160401b03841182851017620002f8576020936040526102ee9283835216928391015260065560018060a01b03196007541617600755604051615f8a9081620003298239f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b51906001600160a01b03821682036200030e5756fe608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816301a8126514614e775750806308e64e4d14614dd45780630c697fdf14614d415780630cfc253214614c8557806311c8412014614bd5578063171b217214614b24578063180466f8146145c85780631a745951146144bd5780631db84f7c1461447e57806321ce9f911461444357806322aa84c31461438657806328aca4c9146141e05780633092a388146141975780633574abaf14613eb357806336453ddf14613e2057806337b3630f14613d2e57806338d0096e14613cca5780633ef748f614613c655780634451d01c14613c0d5780634579268a1461388457806347cdb1bc14613807578063482d3fb3146137c157806348c9581e1461378557806349ae64b01461373f5780634aa8d113146134ce578063541348761461349257806356715761146134565780635a0059631461332b5780635bd0ed85146132c25780635f588c5a1461321857806361532ecc1461316e57806366afec1f146131165780636b39a92c14612f675780636b67a72c14612f2b5780636db5c8fd14612eef5780636f59270d14612b20578063715018a614612a7b5780637cdc8e2c14612a32578063802807ba1461299f578063804d3f471461293a578063848b21381461288e578063858122fd146128525780638642683f146127a757806387fbfdc7146126fb5780638c746d8b146125755780638c8b7f0c146123e35780638da5cb5b1461239157806391f28218146122985780639676bdf8146121995780639716eafa146121065780639b43ce50146120735780639e9109fe146120375780639ef305d614611f88578063a41e477614611f0b578063a4e44fdd14611e70578063a51377a414611dfd578063a9a0c65514611d4c578063ad11ee1b14611bfa578063b10b633814611a62578063b1388dbf146119cf578063bd94b00514611944578063c0907099146118f2578063c0b647201461178d578063c38f1fb914611696578063c99e0ffc1461165a578063cecf9c8f14611472578063d197911a14611409578063d4cb66851461135f578063d58d360c146112b0578063d6602b7814611206578063d7e9089414611153578063d943779914611046578063da1a200e1461100a578063dd99146614610fc3578063e2a70fb414610e89578063e428697614610de6578063e48a2ba714610c59578063e4958c0114610c1d578063ebc1195614610bcf578063ebd1347514610abf578063ef706adf14610a34578063f2fde38b146108f7578063f4f1af1f14610839578063f602eccd146107e7578063f92171e8146107a3578063f968d006146104d0578063fc60698b146104315763ffa1ad74146103f2573861000f565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602060405160038152f35b600080fd5b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff601c541660405160208101907ffc60698b0000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b51915af46104c86158da565b501561042c57005b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576105209036906004016150aa565b9060243590811161042c57610539903690600401615191565b90610542614f03565b908051927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061058961057386615092565b956105816040519788615051565b808752615092565b0193602094368683013773ffffffffffffffffffffffffffffffffffffffff9384169360005b845181101561078c57816105c382876159a2565b51166105cf82866159a2565b51908760005260258952604060002081600052895260406000208260005289526040600020548061075d575b5087600052602889526040600020816000528952604060002054806106ea575b50876000526029895260406000205480610641575b50505061063c9061590a565b6105af565b600052601f895260406000206000926001928383018054955b86811061066b575b50505050610630565b88848461067884866159b6565b939054600394851b1c161491826106cd575b505061069f575b61069a9061590a565b61065a565b60078501544210156106915750505050508291506106c061063c93866159a2565b5290888080808080610662565b9091506106dd83600289016159b6565b9054911b1c14843861068a565b600052601f89526040600020600090600281018054925b838110610711575b50505061061b565b61071b81836159b6565b90549060031b1c8614610737575b6107329061590a565b610701565b60078301544210156107295750505050600161075384876159a2565b5289808080610709565b600052601f8952600760406000200154421061077a575b896105fb565b600161078684876159a2565b52610774565b6040518781528061079f818a0186615693565b0390f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760206107df600435615df5565b604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576004356fffffffffffffffffffffffffffffffff811680910361042c576024359081151580920361042c576108b673ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b60146011541161042c5760115560ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00601254169116176012556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761092e614ebd565b6000549073ffffffffffffffffffffffffffffffffffffffff808316916109563384146156c9565b1680156109b0577fffffffffffffffffffffffff000000000000000000000000000000000000000060009382604051947f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08787a316178255f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff601a541660405160208101907fef706adf0000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600435610af96152e7565b90610b02614f03565b90606435906084359373ffffffffffffffffffffffffffffffffffffffff9182861680960361042c57610b3a836000541633146156c9565b6103e8811161042c576006557fffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffff69ffffffffffffffff00006015549260101b169116176015557fffffffffffffffffffffffff00000000000000000000000000000000000000009216826008541617600855624c4b4081101561042c57601655811561042c5760175416176017556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760206fffffffffffffffffffffffffffffffff60105416604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020601e54604051908152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57610c8b614ebd565b67ffffffffffffffff9060243582811161042c57610cad903690600401615191565b610cb5614f66565b9260643581811161042c57610cce903690600401615270565b9360a43591821161042c576104bc60009594610dba8796610d147fe48a2ba700000000000000000000000000000000000000000000000000000000963690600401615455565b610da373ffffffffffffffffffffffffffffffffffffffff966fffffffffffffffffffffffffffffffff610d6b89601a54169b6040519a8b9960208b019d8e521660248a015260c060448a015260e48901906155e5565b911660648701527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016084880152615619565b9160843560a48601528483030160c4850152615885565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080610e20614ebd565b73ffffffffffffffffffffffffffffffffffffffff90610e448284541633146156c9565b81601b5416916040519060208201927fe4286976000000000000000000000000000000000000000000000000000000008452166024820152602481526104bc81614ffd565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57610ed4903690600401615191565b9060243590811161042c57610eed903690600401615270565b60443580151580910361042c57600092610f916104bc859473ffffffffffffffffffffffffffffffffffffffff6019541694604051938492610f6160208501977fe2a70fb40000000000000000000000000000000000000000000000000000000089526060602487015260848601906155e5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc858303016044860152615619565b906064830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b3461042c57610fd13661565f565b90610ff573ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c5780821061042c57602355602455005b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602454604051908152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611078614f47565b611080614f66565b73ffffffffffffffffffffffffffffffffffffffff601a54166040519260208401927fd943779900000000000000000000000000000000000000000000000000000000845260043560248601526fffffffffffffffffffffffffffffffff809216604486015216606484015260643560848401526084835260c083019183831067ffffffffffffffff84111761112457600093849360405251915af46104c86158da565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008061118d614f47565b73ffffffffffffffffffffffffffffffffffffffff601b5416906040516fffffffffffffffffffffffffffffffff60208201927fd7e9089400000000000000000000000000000000000000000000000000000000845260043560248401521660448201526044356064820152606481526104bc81615019565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006112538192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd6602b78000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57600061130281923690600401615191565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd58d360c0000000000000000000000000000000000000000000000000000000086526020602484015260448301906155e5565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006113ac8192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd4cb6685000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760008061141a366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601954169360405192839160208301957fd197911a000000000000000000000000000000000000000000000000000000008752602484016159ce565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576114bd9036906004016150aa565b9060243581811161042c576114d6903690600401615191565b60443582811161042c576114ee903690600401615270565b60643583811161042c57611506903690600401615270565b9160843584811161042c5761151f903690600401615191565b9360a43590811161042c57611538903690600401615455565b90601a5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987fcecf9c8f000000000000000000000000000000000000000000000000000000008a526024870160c0905260e487016115969161559b565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc94858882030160448901526115cc916155e5565b848782030160648801526115df91615619565b838682030160848701526115f291615619565b828582030160a4860152611605916155e5565b908382030160c484015261161891615885565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810182526116489082615051565b515a92600093928493f46104c86158da565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602354604051908152f35b60a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576116c8614ebd565b6116d0614f47565b906116d9614f66565b916084359167ffffffffffffffff831161042c576000936104bc6117028695369060040161540e565b610dba73ffffffffffffffffffffffffffffffffffffffff9182601a54169660405195869460208601987fc38f1fb9000000000000000000000000000000000000000000000000000000008a521660248601526fffffffffffffffffffffffffffffffff8092166044860152166064840152606435608484015260a060a484015260c4830190615816565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576117d89036906004016150aa565b60243582811161042c576117f0903690600401615191565b6117f8614f66565b9260643581811161042c57611811903690600401615270565b9160a43591821161042c576104bc60009594610dba6118ab938897610da361185e7fc0b6472000000000000000000000000000000000000000000000000000000000983690600401615455565b9173ffffffffffffffffffffffffffffffffffffffff601a5416996fffffffffffffffffffffffffffffffff6118dc6040519a8b9960208b019d8e5260c060248c015260e48b019061559b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc97888b83030160448c01526155e5565b9216606488015284878303016084880152615619565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff6019541660405160208101907fbd94b0050000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611a06614ebd565b73ffffffffffffffffffffffffffffffffffffffff90611a2b826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601b541617601b556000604051f35b3461042c5760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57611ab2903690600401615191565b9060243581811161042c57611acb9036906004016150aa565b60443582811161042c57611ae3903690600401615191565b60643583811161042c57611afb90369060040161536d565b9160843584811161042c57611b14903690600401615270565b9360a43590811161042c57611b2d903690600401615455565b90601b5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987fb10b6338000000000000000000000000000000000000000000000000000000008a526024870160c0905260e48701611b8b916155e5565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9485888203016044890152611bc19161559b565b84878203016064880152611bd4916155e5565b83868203016084870152611be791615693565b828582030160a486015261160591615619565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57611c45903690600401615191565b9060243581811161042c57611c5e903690600401615270565b60443582811161042c57611c76903690600401615270565b9260643592831161042c57611d3d6104bc600095610dba611c9c88973690600401615191565b9573ffffffffffffffffffffffffffffffffffffffff601a541696604051958694611d2d611cfc602088019a7fad11ee1b000000000000000000000000000000000000000000000000000000008c52608060248a015260a48901906155e5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc95868983030160448a0152615619565b9084878303016064880152615619565b918483030160848501526155e5565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080611d86614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947fa9a0c655000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff611e49614ebd565b16600052602660205260406000206024356000526020526020604060002054604051908152f35b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576004356024356044356064359160843593611ed373ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c5781811161042c57600b55600c55801561042c5782811161042c57811561042c5782821161042c57600d55600e55600f55005b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611f42614ebd565b611f4a614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091166000526027602052604060002091166000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c576000611fda81923690600401615191565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f9ef305d60000000000000000000000000000000000000000000000000000000086526020602484015260448301906155e5565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020601354604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576120aa614ebd565b73ffffffffffffffffffffffffffffffffffffffff906120cf826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601a541617601a556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761213d614ebd565b73ffffffffffffffffffffffffffffffffffffffff90612162826000541633146156c9565b16801561042c577fffffffffffffffffffffffff000000000000000000000000000000000000000060195416176019556000604051f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576121cb614ebd565b6121d3614f66565b906121dc614f85565b9160a4359167ffffffffffffffff831161042c576000936104bc6122058695369060040161540e565b610dba73ffffffffffffffffffffffffffffffffffffffff9182601a54169660405195869460208601987f9676bdf8000000000000000000000000000000000000000000000000000000008a5216602486015260243560448601526fffffffffffffffffffffffffffffffff809216606486015216608484015260843560a484015260c060c484015260e4830190615816565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576122ca614ee0565b6122d2614f85565b906122db614fa4565b73ffffffffffffffffffffffffffffffffffffffff9283601a5416916040519460208601947f91f28218000000000000000000000000000000000000000000000000000000008652600435602488015216604486015260443560648601526fffffffffffffffffffffffffffffffff80921660848601521660a484015260a43560c484015260c4835261010083019183831067ffffffffffffffff84111761112457600093849360405251915af46104c86158da565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b3461042c5760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff80821680920361042c576124306152e7565b9160443592828416840361042c57606435928316830361042c57612452614fa4565b9060a4359485151580960361042c5760c4359485151580960361042c576fffffffffffffffffffffffffffffffff946fffffffffffffffff00000000000000007fffffffffffffffff00000000000000000000000000000000000000000000000077ffffffffffffffff00000000000000000000000000000000936124f073ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b60c01b169460401b16179160801b161717601455166107d0811161042c577fffffffffffffffffffffffffffffffff0000000000000000000000000000000060105416176010557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000060ff61ff006015549360081b169316911617176015556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576125af600435615b29565b60405180916020825280516126246125d56102209283602087015261024086019061559b565b61260f6020850151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe092838883030160408901526155e5565b906040850151908683030160608701526155e5565b9160608101516080850152608081015160a08501526fffffffffffffffffffffffffffffffff908160a08201511660c08601528160c08201511660e086015273ffffffffffffffffffffffffffffffffffffffff828193828060e08601511661010090818b01528501511661012090818a0152840151151561014090818a0152840151151561016090818a0152840151151561018090818a015284015115156101a090818a0152840151166101c09081890152830151166101e0908188015282015116906102009182870152015116908301520390f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080612730614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947f87fbfdc7000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043580151580910361042c5761280673ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff0000000000000000000000000000000000000000600a549260a01b16911617600a556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600e54604051908152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576000806128c3614f47565b73ffffffffffffffffffffffffffffffffffffffff601b5416906040516104bc81610dba60208201947f848b2138000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff612986614ebd565b1660005260296020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576129d6614ebd565b73ffffffffffffffffffffffffffffffffffffffff906129fb826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601c541617601c556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145460801c16604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080547fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821691612af23384146156c9565b83604051937f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08286a3168255f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57612b6a9036906004016150aa565b60243567ffffffffffffffff811161042c57612b8a9036906004016151ef565b9060443567ffffffffffffffff811161042c57612bab903690600401615270565b906064359167ffffffffffffffff831161042c573660238401121561042c578260040135612bd881615092565b93612be66040519586615051565b81855260208501906024829360051b8201019036821161042c5760248101925b828410612ebf575050505060843567ffffffffffffffff811161042c57612c31903690600401615191565b67ffffffffffffffff60a4351161042c5736602360a43501121561042c5760a4356004013591612c6083615092565b91612c6e6040519384615051565b8383526020830180943660248260051b60a43501011161042c57602460a4999493993501915b60248260051b60a43501018310612e815750505073ffffffffffffffffffffffffffffffffffffffff601a541696612d4960405196612d39612d0860208a019a7f6f59270d000000000000000000000000000000000000000000000000000000008c5260c060248c015260e48b019061559b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9c8d8b83030160448c0152615783565b908b8983030160648a0152615619565b928987850301608488015251808452602084019360208260051b82010193946000915b838310612e345750505050612d8b9250888683030160a48701526155e5565b958387030160c484015251808652602086019060208160051b88010192916000905b828210612deb576000808989896104bc818b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b90919293602080612e26837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08d600196030186528851615885565b960192019201909291612dad565b9091929394602080612e70837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a51615619565b980193019301919594939290612d6c565b8299939499359067ffffffffffffffff821161042c5760208091612eae60249485369160a4350101615455565b815201930192905098939298612c94565b833567ffffffffffffffff811161042c57602091612ee4839260243691870101615270565b815201930192612c06565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600c54604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602154604051908152f35b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57612fb29036906004016150aa565b9060243581811161042c57612fcb903690600401615191565b60443582811161042c57612fe39036906004016150aa565b60643583811161042c57612ffb903690600401615191565b9160a43584811161042c576130149036906004016150aa565b9360c43590811161042c5761302d90369060040161540e565b90601d5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987f6b39a92c000000000000000000000000000000000000000000000000000000008a526024870160e09052610104870161308c9161559b565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc94858882030160448901526130c2916155e5565b848782030160648801526130d59161559b565b838682030160848701526130e8916155e5565b60843560a4860152828582030160c48601526131039161559b565b908382030160e484015261161891615816565b3461042c576131243661553b565b9173ffffffffffffffffffffffffffffffffffffffff8091166000526025602052604060002091166000526020526040600020906000526020526020604060002054604051908152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006131bb8192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f61532ecc000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006132658192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f5f588c5a000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c576000806132d3366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601954169360405192839160208301957f5bd0ed85000000000000000000000000000000000000000000000000000000008752602484016159ce565b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761337b903690600401615191565b9060243581811161042c57613394903690600401615270565b60443591821161042c576000926133b084933690600401615270565b916104bc73ffffffffffffffffffffffffffffffffffffffff6019541693610dba60405193849261344761341660208601987f5a005963000000000000000000000000000000000000000000000000000000008a526060602488015260848701906155e5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016044880152615619565b91848303016064850152615619565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600b54604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600d54604051908152f35b610120807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761351b9036906004016150aa565b60243582811161042c57613533903690600401615191565b9060443583811161042c5761354c903690600401615191565b91613555614f85565b9060843585811161042c5761356e9036906004016152fe565b60a435956fffffffffffffffffffffffffffffffff9687811680910361042c5760c43582811161042c576135a690369060040161536d565b9060e43583811161042c576135bf90369060040161540e565b9361010493843590811161042c576135db9036906004016150aa565b96601c5473ffffffffffffffffffffffffffffffffffffffff169a6040519a8b9a60208c019e8f7f4aa8d11300000000000000000000000000000000000000000000000000000000905260248d01526101448c016136389161559b565b987fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc998c8b81830301906044015261366f916155e5565b898c82030160648d0152613682916155e5565b911660848a0152868982030160a48a015261369c916157d8565b9060c4880152848782030160e48801526136b591615693565b908386830301908601526136c891615816565b90838203016101248401526136dc9161559b565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101825261370c9082615051565b515a92600093928493f461371e6158da565b901561042c5760208180518101031261042c57602080910151604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145416604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600f54604051908152f35b3461042c576137cf3661565f565b906137f373ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c57602155801561042c57601e55005b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761383e614ebd565b613846614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091166000526028602052604060002091166000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760006101406040516138c481614fc3565b82815260606020820152606060408201528260608201528260808201528260a0820152606060c08201528260e082015282610100820152826101208201520152600435600052601f60205260406000206040519061392182614fc3565b73ffffffffffffffffffffffffffffffffffffffff815416825261394760018201615a73565b602083015261395860028201615ada565b604083015260038101546fffffffffffffffffffffffffffffffff8116606084015260801c60808301526fffffffffffffffffffffffffffffffff60048201541660a083015260058101604051808260208294549384815201906000526020600020926000905b806001830110613bd5576139e5945491818110613bb2575b10613ba4575b500382615051565b60c083015260068101549073ffffffffffffffffffffffffffffffffffffffff821660e0840152600560ff8360a01c161015613b755760ff60089260a01c1661010084015260078101546101208401520154610140820152604051906020825273ffffffffffffffffffffffffffffffffffffffff8151166020830152613b23613a806020830151610160604086015261018085019061559b565b613aba6040840151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe092838783030160608801526155e5565b906fffffffffffffffffffffffffffffffff60608501511660808601526fffffffffffffffffffffffffffffffff60808501511660a08601526fffffffffffffffffffffffffffffffff60a08501511660c086015260c0840151908583030160e0860152615619565b73ffffffffffffffffffffffffffffffffffffffff60e0830151166101008401526101008201516005811015613b75578392610140916101208501526101208101518285015201516101608301520390f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60801c8152602001866139dd565b9260206001916fffffffffffffffffffffffffffffffff851681520193016139d7565b916002919350604060019186546fffffffffffffffffffffffffffffffff8116825260801c60208201520194019201849293916139bf565b3461042c57613c1b3661553b565b9173ffffffffffffffffffffffffffffffffffffffff809116600052602c602052604060002091166000526020526040600020906000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff613cb1614ebd565b1660005260226020526020604060002054604051908152f35b600080613cd6366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601b54169360405192839160208301957f38d0096e000000000000000000000000000000000000000000000000000000008752602484016159ce565b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57613d65614ee0565b613d6d614f85565b6084359067ffffffffffffffff821161042c57600092613d928493369060040161540e565b916104bc73ffffffffffffffffffffffffffffffffffffffff610dba81601b5416956fffffffffffffffffffffffffffffffff60405195869460208601987f37b3630f000000000000000000000000000000000000000000000000000000008a526004356024880152166044860152604435606486015216608484015260a060a484015260c4830190615816565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57613e57614ebd565b73ffffffffffffffffffffffffffffffffffffffff90613e7c826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601d541617601d556000604051f35b3461042c576080807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c573660238201121561042c57806004013590613f1082615092565b92613f1e6040519485615051565b82845260209283850192836024809360051b8301019136831161042c57838101915b8383106140b25750505050613f53614f03565b9160643590811161042c57613f709096959496369060040161540e565b9173ffffffffffffffffffffffffffffffffffffffff9182601d54169660405196898801997f3574abaf000000000000000000000000000000000000000000000000000000008b5260a489019183858b01525180925260c489019260c48360051b8b010198936000915b848310614031575050506000808b8d8c6104bc81610dba8f8f8f8f8f3560448701521660648501527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc848303016084850152615816565b9091929394998480827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c8f600195030186528d51908c8251168152614096614084848401518886850152888401906155e5565b604084015183820360408501526155e5565b918d606080920151169101529c01930193019194939290613fda565b823586811161042c578201908a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc833603011261042c57604051908b82018281108982111761416957604052614109878401614f26565b8252604483013588811161042c5761412690883691860101615191565b8a83015260648301359188831161042c5761415960848c9561414e87968c3691840101615191565b604085015201614f26565b6060820152815201920191613f40565b877f4e487b710000000000000000000000000000000000000000000000000000000060005260416004526000fd5b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145460401c16604051908152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761422b903690600401615191565b9060243581811161042c576142449036906004016150aa565b60443582811161042c5761425c903690600401615191565b60643583811161042c57614274903690600401615270565b9160843584811161042c5761428d903690600401615270565b9360a43590811161042c576142a6903690600401615191565b90601a5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987f28aca4c9000000000000000000000000000000000000000000000000000000008a526024870160c0905260e48701614304916155e5565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc948588820301604489015261433a9161559b565b8487820301606488015261434d916155e5565b8386820301608487015261436091615619565b828582030160a486015261437391615619565b908382030160c4840152611618916155e5565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006143d88192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff6143fb8184541633146156c9565b601a5416906040516104bc81610dba60208201947f22aa84c3000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760208054604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602060145460c01c604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff80821161042c573660238301121561042c57816004013590811161042c578060051b90366024838501011161042c5773ffffffffffffffffffffffffffffffffffffffff60195416906040517f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60208201927f1a745951000000000000000000000000000000000000000000000000000000008452602060248401528060448401521161042c576104bc606482866000989760248a99018484013781018783820152036044810184520182615051565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57614613903690600401615110565b60243567ffffffffffffffff811161042c576146339036906004016151ef565b9060443567ffffffffffffffff811161042c576146549036906004016151ef565b9160643567ffffffffffffffff811161042c57614675903690600401615270565b916084359367ffffffffffffffff851161042c573660238601121561042c578460040135906146a382615092565b956146b16040519788615051565b82875260208701906024829460051b8201019036821161042c5760248101925b828410614af5575050505060a43567ffffffffffffffff811161042c576146fc903690600401615270565b9167ffffffffffffffff60c4351161042c5736602360c43501121561042c5760c435600401359261472c84615092565b9761473a604051998a615051565b8489526020890180953660248260051b60c43501011161042c57602460c43501915b60248260051b60c43501018310614ac15750505060e43567ffffffffffffffff811161042c57614790903690600401615455565b9367ffffffffffffffff610104351161042c5761481f9861487f6148af9261484f6147c5979695973661010435600401615110565b9a73ffffffffffffffffffffffffffffffffffffffff601c54169c6040519e8f927f180466f8000000000000000000000000000000000000000000000000000000006020850152610120602485015261014484019061572e565b9160447fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82850301910152615783565b8c81037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc0160648e015290615783565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8b83030160848c0152615619565b927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8985030160a48a015251808452602084019360208260051b82010193946000915b838310614a74575050505061493192507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8883030160c4890152615619565b957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8688030160e487015251808752602087019060208160051b89010193916000905b828210614a2b576000808a8a614a1a826149ee8d6149bd8e8e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc86830301610104870152615885565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8483030161012485015261572e565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283615051565b602082519201905af461371e6158da565b90919294602080614a66837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08e600196030186528951615693565b970192019201909291614974565b9091929394602080614ab0837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a516157d8565b9801930193019195949392906148f2565b67ffffffffffffffff83351161042c57602080602492614ae83685883560c435010161536d565b815201930192905061475c565b67ffffffffffffffff84351161042c5760208091614b1936602488358701016152fe565b8152019301926146d1565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614b5e614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947f171b2172000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57614c0c614ebd565b614c14614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091614c3b826000541633146156c9565b1691821561042c571690811561042c577fffffffffffffffffffffffff00000000000000000000000000000000000000009081600254161760025560035416176003556000604051f35b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614cbf614f47565b614cc7614f66565b73ffffffffffffffffffffffffffffffffffffffff60195416916040519060208201927f0cfc253200000000000000000000000000000000000000000000000000000000845260043560248401526fffffffffffffffffffffffffffffffff8092166044840152166064820152606481526104bc81615019565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57614d78614ebd565b73ffffffffffffffffffffffffffffffffffffffff90614d9d826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000602a541617602a556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614e0e614ebd565b73ffffffffffffffffffffffffffffffffffffffff90614e328284541633146156c9565b81601b5416916040519060208201927f08e64e4d000000000000000000000000000000000000000000000000000000008452166024820152602481526104bc81614ffd565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760209067ffffffffffffffff60155460101c168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b602435906fffffffffffffffffffffffffffffffff8216820361042c57565b604435906fffffffffffffffffffffffffffffffff8216820361042c57565b606435906fffffffffffffffffffffffffffffffff8216820361042c57565b608435906fffffffffffffffffffffffffffffffff8216820361042c57565b610160810190811067ffffffffffffffff82111761112457604052565b610220810190811067ffffffffffffffff82111761112457604052565b6060810190811067ffffffffffffffff82111761112457604052565b60a0810190811067ffffffffffffffff82111761112457604052565b6040810190811067ffffffffffffffff82111761112457604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761112457604052565b67ffffffffffffffff81116111245760051b60200190565b81601f8201121561042c578035916150c183615092565b926150cf6040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106150f9575050505090565b83809161510584614f26565b8152019101906150eb565b9080601f8301121561042c5781359061512882615092565b926151366040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106151645750505050505090565b823567ffffffffffffffff811161042c578691615186848480948901016150aa565b815201920191615154565b81601f8201121561042c578035916151a883615092565b926151b66040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106151e0575050505090565b813581529083019083016151d2565b9080601f8301121561042c5781359061520782615092565b926152156040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106152435750505050505090565b823567ffffffffffffffff811161042c57869161526584848094890101615191565b815201920191615233565b81601f8201121561042c5780359161528783615092565b926152956040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106152bf575050505090565b81356fffffffffffffffffffffffffffffffff8116810361042c5781529083019083016152b1565b6024359067ffffffffffffffff8216820361042c57565b81601f8201121561042c5780359161531583615092565b926153236040519485615051565b808452602092838086019260051b82010192831161042c578301905b82821061534d575050505090565b813567ffffffffffffffff8116810361042c57815290830190830161533f565b81601f8201121561042c5780359161538483615092565b926153926040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106153bc575050505090565b8135801515810361042c5781529083019083016153ae565b67ffffffffffffffff811161112457601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561042c57803590615425826153d4565b926154336040519485615051565b8284526020838301011161042c57816000926020809301838601378301015290565b9080601f8301121561042c5781359061546d82615092565b9261547b6040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106154a95750505050505090565b823567ffffffffffffffff811161042c5786916154cb8484809489010161540e565b815201920191615499565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261042c5767ffffffffffffffff60043581811161042c578361552191600401615191565b9260243591821161042c5761553891600401615270565b90565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc606091011261042c5773ffffffffffffffffffffffffffffffffffffffff90600435828116810361042c5791602435908116810361042c579060443590565b90815180825260208080930193019160005b8281106155bb575050505090565b835173ffffffffffffffffffffffffffffffffffffffff16855293810193928101926001016155ad565b90815180825260208080930193019160005b828110615605575050505090565b8351855293810193928101926001016155f7565b90815180825260208080930193019160005b828110615639575050505090565b83516fffffffffffffffffffffffffffffffff168552938101939281019260010161562b565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261042c576004359060243590565b90815180825260208080930193019160005b8281106156b3575050505090565b83511515855293810193928101926001016156a5565b156156d057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90815180825260208092019182818360051b85019501936000915b8483106157595750505050505090565b909192939495848061577383856001950387528a5161559b565b9801930193019194939290615749565b90815180825260208092019182818360051b82019501936000915b8483106157ae5750505050505090565b90919293949584806157c883856001950387528a516155e5565b980193019301919493929061579e565b90815180825260208080930193019160005b8281106157f8575050505090565b835167ffffffffffffffff16855293810193928101926001016157ea565b91908251928382526000905b84821061586d5750601f84602094957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09311615860575b0116010190565b6000858286010152615859565b90602090818082850101519082860101520190615822565b90815180825260208092019182818360051b82019501936000915b8483106158b05750505050505090565b90919293949584806158ca83856001950387528a51615816565b98019301930191949392906158a0565b3d15615905573d906158eb826153d4565b916158f96040519384615051565b82523d6000602084013e565b606090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146159375760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8051156159735760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80518210156159735760209160051b010190565b80548210156159735760005260206000200190600090565b90916159e5615538936040845260408401906155e5565b916020818403910152615619565b60405190615a0082614fe0565b816060815260606020820152606060408201526102006000918260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e08201520152565b9060405191828154918282526020928383019160005283600020936000905b828210615aaa57505050615aa892500383615051565b565b855473ffffffffffffffffffffffffffffffffffffffff1684526001958601958895509381019390910190615a92565b9060405191828154918282526020928383019160005283600020936000905b828210615b0f57505050615aa892500383615051565b855484526001958601958895509381019390910190615af9565b615b316159f3565b5080600052602060058152604091826000209273ffffffffffffffffffffffffffffffffffffffff91828554169485615c6b5750600a92939450600052600484528060002090805194615b8386614fe0565b615b8c83615a73565b8652615b9a60018401615ada565b90860152615baa60028301615ada565b90850152600381015460608501526004810154608085015260058101546fffffffffffffffffffffffffffffffff9081811660a087015260801c60c08601528360068301541660e086015260ff6007830154858116610100880152818160a01c161515610120880152818160a81c161515610140880152818160b01c16151561016088015260b81c16151561018086015260088201549081166101a086015260801c6101c0850152826009820154166101e085015201541661020082015290565b928392915060ff90615c7b6159f3565b506060838051615c8a81614ffd565b82815282898201520152825196615ca088615035565b600188528636818a0137615cb388615966565b52825190615cc082615035565b600182528636818401376001850154615cd883615966565b5284845192615ce684615035565b600184528836818601376001615cfb85615966565b5283868051615d0981614ffd565b8c8152838c82015201526005820154936fffffffffffffffffffffffffffffffff96876003850154169160028501549386600881600760068260048c0154169a01549e0154169d0154169c83519e8f90615d6282614fe0565b81520152818d01528267ffffffffffffffff918d60608484169101521c1660808c015260a08b015260801c60c08a015260e08901528116610100880152818160a01c161515610120880152818160a81c161515610140880152818160b01c16151561016088015260b81c16151561018086015281166101a085015260801c6101c08401526101e083015261020082015290565b60009081526005602090815260408220805473ffffffffffffffffffffffffffffffffffffffff1615615f1d5760ff600582015460a01c1660026fffffffffffffffffffffffffffffffff60038401541692015460801c905b615e585750505090565b6fffffffffffffffffffffffffffffffff9391929380601054169181604051957fc6c7612000000000000000000000000000000000000000000000000000000000875216600486015216602484015260448301528282606481735d9fe5b343d308ed8f72dc370a57423b8eef36805af4928315615f10578193615edc575b50505090565b9091809350813d8311615f09575b615ef48183615051565b81010312615f06575051388080615ed6565b80fd5b503d615eea565b50604051903d90823e3d90fd5b506004815260408220600560ff600783015460a01c16910154906fffffffffffffffffffffffffffffffff82169160801c90615e4e56fea26469706673582212205b1f82ad0e85c57ef03e5b8ed5b374c1e63ff1f747b1373fc42aedeb22d52fee64736f6c634300080f0033000000000000000000000000b6a0e72634fa69d68a139ccc6af04b9a4b9e2c130000000000000000000000007559038535f3d6ed6bac5a54ab4b69da827f44bd000000000000000000000000809d88b727c4c7024462d7955777835938f02f3b0000000000000000000000007e5cac8d49b42bba05388b7e005d6b61c7773c47000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c2900000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000299a86c53f4d980d6f7842cc2c5c3624c3920818000000000000000000000000d82331366b217bdb4b58f1e87628021cc8f8062c00000000000000000000000020445e02b1dc0314d1b12997443530da8597994d00000000000000000000000080b2e94df55d1ed2c359c894ae6811cb80d606cd000000000000000000000000a137c705fc17ef52f895323633249d088dfb28f1000000000000000000000000ba1100f63987d76675e344bc93be060d545d8f4a00000000000000000000000000000000000000000000000000000000000493e0

Deployed Bytecode

0x608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816301a8126514614e775750806308e64e4d14614dd45780630c697fdf14614d415780630cfc253214614c8557806311c8412014614bd5578063171b217214614b24578063180466f8146145c85780631a745951146144bd5780631db84f7c1461447e57806321ce9f911461444357806322aa84c31461438657806328aca4c9146141e05780633092a388146141975780633574abaf14613eb357806336453ddf14613e2057806337b3630f14613d2e57806338d0096e14613cca5780633ef748f614613c655780634451d01c14613c0d5780634579268a1461388457806347cdb1bc14613807578063482d3fb3146137c157806348c9581e1461378557806349ae64b01461373f5780634aa8d113146134ce578063541348761461349257806356715761146134565780635a0059631461332b5780635bd0ed85146132c25780635f588c5a1461321857806361532ecc1461316e57806366afec1f146131165780636b39a92c14612f675780636b67a72c14612f2b5780636db5c8fd14612eef5780636f59270d14612b20578063715018a614612a7b5780637cdc8e2c14612a32578063802807ba1461299f578063804d3f471461293a578063848b21381461288e578063858122fd146128525780638642683f146127a757806387fbfdc7146126fb5780638c746d8b146125755780638c8b7f0c146123e35780638da5cb5b1461239157806391f28218146122985780639676bdf8146121995780639716eafa146121065780639b43ce50146120735780639e9109fe146120375780639ef305d614611f88578063a41e477614611f0b578063a4e44fdd14611e70578063a51377a414611dfd578063a9a0c65514611d4c578063ad11ee1b14611bfa578063b10b633814611a62578063b1388dbf146119cf578063bd94b00514611944578063c0907099146118f2578063c0b647201461178d578063c38f1fb914611696578063c99e0ffc1461165a578063cecf9c8f14611472578063d197911a14611409578063d4cb66851461135f578063d58d360c146112b0578063d6602b7814611206578063d7e9089414611153578063d943779914611046578063da1a200e1461100a578063dd99146614610fc3578063e2a70fb414610e89578063e428697614610de6578063e48a2ba714610c59578063e4958c0114610c1d578063ebc1195614610bcf578063ebd1347514610abf578063ef706adf14610a34578063f2fde38b146108f7578063f4f1af1f14610839578063f602eccd146107e7578063f92171e8146107a3578063f968d006146104d0578063fc60698b146104315763ffa1ad74146103f2573861000f565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602060405160038152f35b600080fd5b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff601c541660405160208101907ffc60698b0000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b51915af46104c86158da565b501561042c57005b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576105209036906004016150aa565b9060243590811161042c57610539903690600401615191565b90610542614f03565b908051927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061058961057386615092565b956105816040519788615051565b808752615092565b0193602094368683013773ffffffffffffffffffffffffffffffffffffffff9384169360005b845181101561078c57816105c382876159a2565b51166105cf82866159a2565b51908760005260258952604060002081600052895260406000208260005289526040600020548061075d575b5087600052602889526040600020816000528952604060002054806106ea575b50876000526029895260406000205480610641575b50505061063c9061590a565b6105af565b600052601f895260406000206000926001928383018054955b86811061066b575b50505050610630565b88848461067884866159b6565b939054600394851b1c161491826106cd575b505061069f575b61069a9061590a565b61065a565b60078501544210156106915750505050508291506106c061063c93866159a2565b5290888080808080610662565b9091506106dd83600289016159b6565b9054911b1c14843861068a565b600052601f89526040600020600090600281018054925b838110610711575b50505061061b565b61071b81836159b6565b90549060031b1c8614610737575b6107329061590a565b610701565b60078301544210156107295750505050600161075384876159a2565b5289808080610709565b600052601f8952600760406000200154421061077a575b896105fb565b600161078684876159a2565b52610774565b6040518781528061079f818a0186615693565b0390f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760206107df600435615df5565b604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576004356fffffffffffffffffffffffffffffffff811680910361042c576024359081151580920361042c576108b673ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b60146011541161042c5760115560ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00601254169116176012556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761092e614ebd565b6000549073ffffffffffffffffffffffffffffffffffffffff808316916109563384146156c9565b1680156109b0577fffffffffffffffffffffffff000000000000000000000000000000000000000060009382604051947f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08787a316178255f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff601a541660405160208101907fef706adf0000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600435610af96152e7565b90610b02614f03565b90606435906084359373ffffffffffffffffffffffffffffffffffffffff9182861680960361042c57610b3a836000541633146156c9565b6103e8811161042c576006557fffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffff69ffffffffffffffff00006015549260101b169116176015557fffffffffffffffffffffffff00000000000000000000000000000000000000009216826008541617600855624c4b4081101561042c57601655811561042c5760175416176017556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760206fffffffffffffffffffffffffffffffff60105416604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020601e54604051908152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57610c8b614ebd565b67ffffffffffffffff9060243582811161042c57610cad903690600401615191565b610cb5614f66565b9260643581811161042c57610cce903690600401615270565b9360a43591821161042c576104bc60009594610dba8796610d147fe48a2ba700000000000000000000000000000000000000000000000000000000963690600401615455565b610da373ffffffffffffffffffffffffffffffffffffffff966fffffffffffffffffffffffffffffffff610d6b89601a54169b6040519a8b9960208b019d8e521660248a015260c060448a015260e48901906155e5565b911660648701527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016084880152615619565b9160843560a48601528483030160c4850152615885565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080610e20614ebd565b73ffffffffffffffffffffffffffffffffffffffff90610e448284541633146156c9565b81601b5416916040519060208201927fe4286976000000000000000000000000000000000000000000000000000000008452166024820152602481526104bc81614ffd565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57610ed4903690600401615191565b9060243590811161042c57610eed903690600401615270565b60443580151580910361042c57600092610f916104bc859473ffffffffffffffffffffffffffffffffffffffff6019541694604051938492610f6160208501977fe2a70fb40000000000000000000000000000000000000000000000000000000089526060602487015260848601906155e5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc858303016044860152615619565b906064830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b3461042c57610fd13661565f565b90610ff573ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c5780821061042c57602355602455005b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602454604051908152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611078614f47565b611080614f66565b73ffffffffffffffffffffffffffffffffffffffff601a54166040519260208401927fd943779900000000000000000000000000000000000000000000000000000000845260043560248601526fffffffffffffffffffffffffffffffff809216604486015216606484015260643560848401526084835260c083019183831067ffffffffffffffff84111761112457600093849360405251915af46104c86158da565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008061118d614f47565b73ffffffffffffffffffffffffffffffffffffffff601b5416906040516fffffffffffffffffffffffffffffffff60208201927fd7e9089400000000000000000000000000000000000000000000000000000000845260043560248401521660448201526044356064820152606481526104bc81615019565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006112538192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd6602b78000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57600061130281923690600401615191565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd58d360c0000000000000000000000000000000000000000000000000000000086526020602484015260448301906155e5565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006113ac8192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947fd4cb6685000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760008061141a366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601954169360405192839160208301957fd197911a000000000000000000000000000000000000000000000000000000008752602484016159ce565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576114bd9036906004016150aa565b9060243581811161042c576114d6903690600401615191565b60443582811161042c576114ee903690600401615270565b60643583811161042c57611506903690600401615270565b9160843584811161042c5761151f903690600401615191565b9360a43590811161042c57611538903690600401615455565b90601a5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987fcecf9c8f000000000000000000000000000000000000000000000000000000008a526024870160c0905260e487016115969161559b565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc94858882030160448901526115cc916155e5565b848782030160648801526115df91615619565b838682030160848701526115f291615619565b828582030160a4860152611605916155e5565b908382030160c484015261161891615885565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810182526116489082615051565b515a92600093928493f46104c86158da565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602354604051908152f35b60a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576116c8614ebd565b6116d0614f47565b906116d9614f66565b916084359167ffffffffffffffff831161042c576000936104bc6117028695369060040161540e565b610dba73ffffffffffffffffffffffffffffffffffffffff9182601a54169660405195869460208601987fc38f1fb9000000000000000000000000000000000000000000000000000000008a521660248601526fffffffffffffffffffffffffffffffff8092166044860152166064840152606435608484015260a060a484015260c4830190615816565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c576117d89036906004016150aa565b60243582811161042c576117f0903690600401615191565b6117f8614f66565b9260643581811161042c57611811903690600401615270565b9160a43591821161042c576104bc60009594610dba6118ab938897610da361185e7fc0b6472000000000000000000000000000000000000000000000000000000000983690600401615455565b9173ffffffffffffffffffffffffffffffffffffffff601a5416996fffffffffffffffffffffffffffffffff6118dc6040519a8b9960208b019d8e5260c060248c015260e48b019061559b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc97888b83030160448c01526155e5565b9216606488015284878303016084880152615619565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760008073ffffffffffffffffffffffffffffffffffffffff6019541660405160208101907fbd94b0050000000000000000000000000000000000000000000000000000000082526004356024820152602481526104bc81614ffd565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611a06614ebd565b73ffffffffffffffffffffffffffffffffffffffff90611a2b826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601b541617601b556000604051f35b3461042c5760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57611ab2903690600401615191565b9060243581811161042c57611acb9036906004016150aa565b60443582811161042c57611ae3903690600401615191565b60643583811161042c57611afb90369060040161536d565b9160843584811161042c57611b14903690600401615270565b9360a43590811161042c57611b2d903690600401615455565b90601b5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987fb10b6338000000000000000000000000000000000000000000000000000000008a526024870160c0905260e48701611b8b916155e5565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9485888203016044890152611bc19161559b565b84878203016064880152611bd4916155e5565b83868203016084870152611be791615693565b828582030160a486015261160591615619565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57611c45903690600401615191565b9060243581811161042c57611c5e903690600401615270565b60443582811161042c57611c76903690600401615270565b9260643592831161042c57611d3d6104bc600095610dba611c9c88973690600401615191565b9573ffffffffffffffffffffffffffffffffffffffff601a541696604051958694611d2d611cfc602088019a7fad11ee1b000000000000000000000000000000000000000000000000000000008c52608060248a015260a48901906155e5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc95868983030160448a0152615619565b9084878303016064880152615619565b918483030160848501526155e5565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080611d86614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947fa9a0c655000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff611e49614ebd565b16600052602660205260406000206024356000526020526020604060002054604051908152f35b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576004356024356044356064359160843593611ed373ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c5781811161042c57600b55600c55801561042c5782811161042c57811561042c5782821161042c57600d55600e55600f55005b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57611f42614ebd565b611f4a614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091166000526027602052604060002091166000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c576000611fda81923690600401615191565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f9ef305d60000000000000000000000000000000000000000000000000000000086526020602484015260448301906155e5565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020601354604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576120aa614ebd565b73ffffffffffffffffffffffffffffffffffffffff906120cf826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601a541617601a556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761213d614ebd565b73ffffffffffffffffffffffffffffffffffffffff90612162826000541633146156c9565b16801561042c577fffffffffffffffffffffffff000000000000000000000000000000000000000060195416176019556000604051f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576121cb614ebd565b6121d3614f66565b906121dc614f85565b9160a4359167ffffffffffffffff831161042c576000936104bc6122058695369060040161540e565b610dba73ffffffffffffffffffffffffffffffffffffffff9182601a54169660405195869460208601987f9676bdf8000000000000000000000000000000000000000000000000000000008a5216602486015260243560448601526fffffffffffffffffffffffffffffffff809216606486015216608484015260843560a484015260c060c484015260e4830190615816565b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576122ca614ee0565b6122d2614f85565b906122db614fa4565b73ffffffffffffffffffffffffffffffffffffffff9283601a5416916040519460208601947f91f28218000000000000000000000000000000000000000000000000000000008652600435602488015216604486015260443560648601526fffffffffffffffffffffffffffffffff80921660848601521660a484015260a43560c484015260c4835261010083019183831067ffffffffffffffff84111761112457600093849360405251915af46104c86158da565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b3461042c5760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff80821680920361042c576124306152e7565b9160443592828416840361042c57606435928316830361042c57612452614fa4565b9060a4359485151580960361042c5760c4359485151580960361042c576fffffffffffffffffffffffffffffffff946fffffffffffffffff00000000000000007fffffffffffffffff00000000000000000000000000000000000000000000000077ffffffffffffffff00000000000000000000000000000000936124f073ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b60c01b169460401b16179160801b161717601455166107d0811161042c577fffffffffffffffffffffffffffffffff0000000000000000000000000000000060105416176010557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000060ff61ff006015549360081b169316911617176015556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576125af600435615b29565b60405180916020825280516126246125d56102209283602087015261024086019061559b565b61260f6020850151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe092838883030160408901526155e5565b906040850151908683030160608701526155e5565b9160608101516080850152608081015160a08501526fffffffffffffffffffffffffffffffff908160a08201511660c08601528160c08201511660e086015273ffffffffffffffffffffffffffffffffffffffff828193828060e08601511661010090818b01528501511661012090818a0152840151151561014090818a0152840151151561016090818a0152840151151561018090818a015284015115156101a090818a0152840151166101c09081890152830151166101e0908188015282015116906102009182870152015116908301520390f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080612730614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947f87fbfdc7000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043580151580910361042c5761280673ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff0000000000000000000000000000000000000000600a549260a01b16911617600a556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600e54604051908152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576000806128c3614f47565b73ffffffffffffffffffffffffffffffffffffffff601b5416906040516104bc81610dba60208201947f848b2138000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff612986614ebd565b1660005260296020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576129d6614ebd565b73ffffffffffffffffffffffffffffffffffffffff906129fb826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601c541617601c556000604051f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145460801c16604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080547fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821691612af23384146156c9565b83604051937f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08286a3168255f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57612b6a9036906004016150aa565b60243567ffffffffffffffff811161042c57612b8a9036906004016151ef565b9060443567ffffffffffffffff811161042c57612bab903690600401615270565b906064359167ffffffffffffffff831161042c573660238401121561042c578260040135612bd881615092565b93612be66040519586615051565b81855260208501906024829360051b8201019036821161042c5760248101925b828410612ebf575050505060843567ffffffffffffffff811161042c57612c31903690600401615191565b67ffffffffffffffff60a4351161042c5736602360a43501121561042c5760a4356004013591612c6083615092565b91612c6e6040519384615051565b8383526020830180943660248260051b60a43501011161042c57602460a4999493993501915b60248260051b60a43501018310612e815750505073ffffffffffffffffffffffffffffffffffffffff601a541696612d4960405196612d39612d0860208a019a7f6f59270d000000000000000000000000000000000000000000000000000000008c5260c060248c015260e48b019061559b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9c8d8b83030160448c0152615783565b908b8983030160648a0152615619565b928987850301608488015251808452602084019360208260051b82010193946000915b838310612e345750505050612d8b9250888683030160a48701526155e5565b958387030160c484015251808652602086019060208160051b88010192916000905b828210612deb576000808989896104bc818b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282615051565b90919293602080612e26837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08d600196030186528851615885565b960192019201909291612dad565b9091929394602080612e70837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a51615619565b980193019301919594939290612d6c565b8299939499359067ffffffffffffffff821161042c5760208091612eae60249485369160a4350101615455565b815201930192905098939298612c94565b833567ffffffffffffffff811161042c57602091612ee4839260243691870101615270565b815201930192612c06565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600c54604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020602154604051908152f35b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c57612fb29036906004016150aa565b9060243581811161042c57612fcb903690600401615191565b60443582811161042c57612fe39036906004016150aa565b60643583811161042c57612ffb903690600401615191565b9160a43584811161042c576130149036906004016150aa565b9360c43590811161042c5761302d90369060040161540e565b90601d5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987f6b39a92c000000000000000000000000000000000000000000000000000000008a526024870160e09052610104870161308c9161559b565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc94858882030160448901526130c2916155e5565b848782030160648801526130d59161559b565b838682030160848701526130e8916155e5565b60843560a4860152828582030160c48601526131039161559b565b908382030160e484015261161891615816565b3461042c576131243661553b565b9173ffffffffffffffffffffffffffffffffffffffff8091166000526025602052604060002091166000526020526040600020906000526020526020604060002054604051908152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006131bb8192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f61532ecc000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006132658192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff601a5416906040516104bc81610dba60208201947f5f588c5a000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c576000806132d3366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601954169360405192839160208301957f5bd0ed85000000000000000000000000000000000000000000000000000000008752602484016159ce565b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761337b903690600401615191565b9060243581811161042c57613394903690600401615270565b60443591821161042c576000926133b084933690600401615270565b916104bc73ffffffffffffffffffffffffffffffffffffffff6019541693610dba60405193849261344761341660208601987f5a005963000000000000000000000000000000000000000000000000000000008a526060602488015260848701906155e5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016044880152615619565b91848303016064850152615619565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600b54604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600d54604051908152f35b610120807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761351b9036906004016150aa565b60243582811161042c57613533903690600401615191565b9060443583811161042c5761354c903690600401615191565b91613555614f85565b9060843585811161042c5761356e9036906004016152fe565b60a435956fffffffffffffffffffffffffffffffff9687811680910361042c5760c43582811161042c576135a690369060040161536d565b9060e43583811161042c576135bf90369060040161540e565b9361010493843590811161042c576135db9036906004016150aa565b96601c5473ffffffffffffffffffffffffffffffffffffffff169a6040519a8b9a60208c019e8f7f4aa8d11300000000000000000000000000000000000000000000000000000000905260248d01526101448c016136389161559b565b987fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc998c8b81830301906044015261366f916155e5565b898c82030160648d0152613682916155e5565b911660848a0152868982030160a48a015261369c916157d8565b9060c4880152848782030160e48801526136b591615693565b908386830301908601526136c891615816565b90838203016101248401526136dc9161559b565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101825261370c9082615051565b515a92600093928493f461371e6158da565b901561042c5760208180518101031261042c57602080910151604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145416604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c576020600f54604051908152f35b3461042c576137cf3661565f565b906137f373ffffffffffffffffffffffffffffffffffffffff6000541633146156c9565b801561042c57602155801561042c57601e55005b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5761383e614ebd565b613846614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091166000526028602052604060002091166000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760006101406040516138c481614fc3565b82815260606020820152606060408201528260608201528260808201528260a0820152606060c08201528260e082015282610100820152826101208201520152600435600052601f60205260406000206040519061392182614fc3565b73ffffffffffffffffffffffffffffffffffffffff815416825261394760018201615a73565b602083015261395860028201615ada565b604083015260038101546fffffffffffffffffffffffffffffffff8116606084015260801c60808301526fffffffffffffffffffffffffffffffff60048201541660a083015260058101604051808260208294549384815201906000526020600020926000905b806001830110613bd5576139e5945491818110613bb2575b10613ba4575b500382615051565b60c083015260068101549073ffffffffffffffffffffffffffffffffffffffff821660e0840152600560ff8360a01c161015613b755760ff60089260a01c1661010084015260078101546101208401520154610140820152604051906020825273ffffffffffffffffffffffffffffffffffffffff8151166020830152613b23613a806020830151610160604086015261018085019061559b565b613aba6040840151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe092838783030160608801526155e5565b906fffffffffffffffffffffffffffffffff60608501511660808601526fffffffffffffffffffffffffffffffff60808501511660a08601526fffffffffffffffffffffffffffffffff60a08501511660c086015260c0840151908583030160e0860152615619565b73ffffffffffffffffffffffffffffffffffffffff60e0830151166101008401526101008201516005811015613b75578392610140916101208501526101208101518285015201516101608301520390f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60801c8152602001866139dd565b9260206001916fffffffffffffffffffffffffffffffff851681520193016139d7565b916002919350604060019186546fffffffffffffffffffffffffffffffff8116825260801c60208201520194019201849293916139bf565b3461042c57613c1b3661553b565b9173ffffffffffffffffffffffffffffffffffffffff809116600052602c602052604060002091166000526020526040600020906000526020526020604060002054604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5773ffffffffffffffffffffffffffffffffffffffff613cb1614ebd565b1660005260226020526020604060002054604051908152f35b600080613cd6366154d6565b90610dba6104bc73ffffffffffffffffffffffffffffffffffffffff601b54169360405192839160208301957f38d0096e000000000000000000000000000000000000000000000000000000008752602484016159ce565b3461042c5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57613d65614ee0565b613d6d614f85565b6084359067ffffffffffffffff821161042c57600092613d928493369060040161540e565b916104bc73ffffffffffffffffffffffffffffffffffffffff610dba81601b5416956fffffffffffffffffffffffffffffffff60405195869460208601987f37b3630f000000000000000000000000000000000000000000000000000000008a526004356024880152166044860152604435606486015216608484015260a060a484015260c4830190615816565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57613e57614ebd565b73ffffffffffffffffffffffffffffffffffffffff90613e7c826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000601d541617601d556000604051f35b3461042c576080807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c573660238201121561042c57806004013590613f1082615092565b92613f1e6040519485615051565b82845260209283850192836024809360051b8301019136831161042c57838101915b8383106140b25750505050613f53614f03565b9160643590811161042c57613f709096959496369060040161540e565b9173ffffffffffffffffffffffffffffffffffffffff9182601d54169660405196898801997f3574abaf000000000000000000000000000000000000000000000000000000008b5260a489019183858b01525180925260c489019260c48360051b8b010198936000915b848310614031575050506000808b8d8c6104bc81610dba8f8f8f8f8f3560448701521660648501527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc848303016084850152615816565b9091929394998480827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c8f600195030186528d51908c8251168152614096614084848401518886850152888401906155e5565b604084015183820360408501526155e5565b918d606080920151169101529c01930193019194939290613fda565b823586811161042c578201908a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc833603011261042c57604051908b82018281108982111761416957604052614109878401614f26565b8252604483013588811161042c5761412690883691860101615191565b8a83015260648301359188831161042c5761415960848c9561414e87968c3691840101615191565b604085015201614f26565b6060820152815201920191613f40565b877f4e487b710000000000000000000000000000000000000000000000000000000060005260416004526000fd5b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602067ffffffffffffffff60145460401c16604051908152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5767ffffffffffffffff60043581811161042c5761422b903690600401615191565b9060243581811161042c576142449036906004016150aa565b60443582811161042c5761425c903690600401615191565b60643583811161042c57614274903690600401615270565b9160843584811161042c5761428d903690600401615270565b9360a43590811161042c576142a6903690600401615191565b90601a5473ffffffffffffffffffffffffffffffffffffffff169460405194859460208601987f28aca4c9000000000000000000000000000000000000000000000000000000008a526024870160c0905260e48701614304916155e5565b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc948588820301604489015261433a9161559b565b8487820301606488015261434d916155e5565b8386820301608487015261436091615619565b828582030160a486015261437391615619565b908382030160c4840152611618916155e5565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c5760006143d88192369060040161540e565b73ffffffffffffffffffffffffffffffffffffffff6143fb8184541633146156c9565b601a5416906040516104bc81610dba60208201947f22aa84c3000000000000000000000000000000000000000000000000000000008652602060248401526044830190615816565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760208054604051908152f35b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57602060145460c01c604051908152f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff80821161042c573660238301121561042c57816004013590811161042c578060051b90366024838501011161042c5773ffffffffffffffffffffffffffffffffffffffff60195416906040517f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60208201927f1a745951000000000000000000000000000000000000000000000000000000008452602060248401528060448401521161042c576104bc606482866000989760248a99018484013781018783820152036044810184520182615051565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760043567ffffffffffffffff811161042c57614613903690600401615110565b60243567ffffffffffffffff811161042c576146339036906004016151ef565b9060443567ffffffffffffffff811161042c576146549036906004016151ef565b9160643567ffffffffffffffff811161042c57614675903690600401615270565b916084359367ffffffffffffffff851161042c573660238601121561042c578460040135906146a382615092565b956146b16040519788615051565b82875260208701906024829460051b8201019036821161042c5760248101925b828410614af5575050505060a43567ffffffffffffffff811161042c576146fc903690600401615270565b9167ffffffffffffffff60c4351161042c5736602360c43501121561042c5760c435600401359261472c84615092565b9761473a604051998a615051565b8489526020890180953660248260051b60c43501011161042c57602460c43501915b60248260051b60c43501018310614ac15750505060e43567ffffffffffffffff811161042c57614790903690600401615455565b9367ffffffffffffffff610104351161042c5761481f9861487f6148af9261484f6147c5979695973661010435600401615110565b9a73ffffffffffffffffffffffffffffffffffffffff601c54169c6040519e8f927f180466f8000000000000000000000000000000000000000000000000000000006020850152610120602485015261014484019061572e565b9160447fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82850301910152615783565b8c81037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc0160648e015290615783565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8b83030160848c0152615619565b927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8985030160a48a015251808452602084019360208260051b82010193946000915b838310614a74575050505061493192507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8883030160c4890152615619565b957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8688030160e487015251808752602087019060208160051b89010193916000905b828210614a2b576000808a8a614a1a826149ee8d6149bd8e8e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc86830301610104870152615885565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8483030161012485015261572e565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283615051565b602082519201905af461371e6158da565b90919294602080614a66837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08e600196030186528951615693565b970192019201909291614974565b9091929394602080614ab0837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a516157d8565b9801930193019195949392906148f2565b67ffffffffffffffff83351161042c57602080602492614ae83685883560c435010161536d565b815201930192905061475c565b67ffffffffffffffff84351161042c5760208091614b1936602488358701016152fe565b8152019301926146d1565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614b5e614f47565b73ffffffffffffffffffffffffffffffffffffffff60195416906040516104bc81610dba60208201947f171b2172000000000000000000000000000000000000000000000000000000008652600435602484019092916fffffffffffffffffffffffffffffffff6020916040840195845216910152565b3461042c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57614c0c614ebd565b614c14614ee0565b9073ffffffffffffffffffffffffffffffffffffffff8091614c3b826000541633146156c9565b1691821561042c571690811561042c577fffffffffffffffffffffffff00000000000000000000000000000000000000009081600254161760025560035416176003556000604051f35b3461042c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614cbf614f47565b614cc7614f66565b73ffffffffffffffffffffffffffffffffffffffff60195416916040519060208201927f0cfc253200000000000000000000000000000000000000000000000000000000845260043560248401526fffffffffffffffffffffffffffffffff8092166044840152166064820152606481526104bc81615019565b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57614d78614ebd565b73ffffffffffffffffffffffffffffffffffffffff90614d9d826000541633146156c9565b16801561042c577fffffffffffffffffffffffff0000000000000000000000000000000000000000602a541617602a556000604051f35b3461042c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c57600080614e0e614ebd565b73ffffffffffffffffffffffffffffffffffffffff90614e328284541633146156c9565b81601b5416916040519060208201927f08e64e4d000000000000000000000000000000000000000000000000000000008452166024820152602481526104bc81614ffd565b3461042c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042c5760209067ffffffffffffffff60155460101c168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b359073ffffffffffffffffffffffffffffffffffffffff8216820361042c57565b602435906fffffffffffffffffffffffffffffffff8216820361042c57565b604435906fffffffffffffffffffffffffffffffff8216820361042c57565b606435906fffffffffffffffffffffffffffffffff8216820361042c57565b608435906fffffffffffffffffffffffffffffffff8216820361042c57565b610160810190811067ffffffffffffffff82111761112457604052565b610220810190811067ffffffffffffffff82111761112457604052565b6060810190811067ffffffffffffffff82111761112457604052565b60a0810190811067ffffffffffffffff82111761112457604052565b6040810190811067ffffffffffffffff82111761112457604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761112457604052565b67ffffffffffffffff81116111245760051b60200190565b81601f8201121561042c578035916150c183615092565b926150cf6040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106150f9575050505090565b83809161510584614f26565b8152019101906150eb565b9080601f8301121561042c5781359061512882615092565b926151366040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106151645750505050505090565b823567ffffffffffffffff811161042c578691615186848480948901016150aa565b815201920191615154565b81601f8201121561042c578035916151a883615092565b926151b66040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106151e0575050505090565b813581529083019083016151d2565b9080601f8301121561042c5781359061520782615092565b926152156040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106152435750505050505090565b823567ffffffffffffffff811161042c57869161526584848094890101615191565b815201920191615233565b81601f8201121561042c5780359161528783615092565b926152956040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106152bf575050505090565b81356fffffffffffffffffffffffffffffffff8116810361042c5781529083019083016152b1565b6024359067ffffffffffffffff8216820361042c57565b81601f8201121561042c5780359161531583615092565b926153236040519485615051565b808452602092838086019260051b82010192831161042c578301905b82821061534d575050505090565b813567ffffffffffffffff8116810361042c57815290830190830161533f565b81601f8201121561042c5780359161538483615092565b926153926040519485615051565b808452602092838086019260051b82010192831161042c578301905b8282106153bc575050505090565b8135801515810361042c5781529083019083016153ae565b67ffffffffffffffff811161112457601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561042c57803590615425826153d4565b926154336040519485615051565b8284526020838301011161042c57816000926020809301838601378301015290565b9080601f8301121561042c5781359061546d82615092565b9261547b6040519485615051565b828452602092838086019160051b8301019280841161042c57848301915b8483106154a95750505050505090565b823567ffffffffffffffff811161042c5786916154cb8484809489010161540e565b815201920191615499565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261042c5767ffffffffffffffff60043581811161042c578361552191600401615191565b9260243591821161042c5761553891600401615270565b90565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc606091011261042c5773ffffffffffffffffffffffffffffffffffffffff90600435828116810361042c5791602435908116810361042c579060443590565b90815180825260208080930193019160005b8281106155bb575050505090565b835173ffffffffffffffffffffffffffffffffffffffff16855293810193928101926001016155ad565b90815180825260208080930193019160005b828110615605575050505090565b8351855293810193928101926001016155f7565b90815180825260208080930193019160005b828110615639575050505090565b83516fffffffffffffffffffffffffffffffff168552938101939281019260010161562b565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261042c576004359060243590565b90815180825260208080930193019160005b8281106156b3575050505090565b83511515855293810193928101926001016156a5565b156156d057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90815180825260208092019182818360051b85019501936000915b8483106157595750505050505090565b909192939495848061577383856001950387528a5161559b565b9801930193019194939290615749565b90815180825260208092019182818360051b82019501936000915b8483106157ae5750505050505090565b90919293949584806157c883856001950387528a516155e5565b980193019301919493929061579e565b90815180825260208080930193019160005b8281106157f8575050505090565b835167ffffffffffffffff16855293810193928101926001016157ea565b91908251928382526000905b84821061586d5750601f84602094957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09311615860575b0116010190565b6000858286010152615859565b90602090818082850101519082860101520190615822565b90815180825260208092019182818360051b82019501936000915b8483106158b05750505050505090565b90919293949584806158ca83856001950387528a51615816565b98019301930191949392906158a0565b3d15615905573d906158eb826153d4565b916158f96040519384615051565b82523d6000602084013e565b606090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146159375760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8051156159735760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80518210156159735760209160051b010190565b80548210156159735760005260206000200190600090565b90916159e5615538936040845260408401906155e5565b916020818403910152615619565b60405190615a0082614fe0565b816060815260606020820152606060408201526102006000918260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e08201520152565b9060405191828154918282526020928383019160005283600020936000905b828210615aaa57505050615aa892500383615051565b565b855473ffffffffffffffffffffffffffffffffffffffff1684526001958601958895509381019390910190615a92565b9060405191828154918282526020928383019160005283600020936000905b828210615b0f57505050615aa892500383615051565b855484526001958601958895509381019390910190615af9565b615b316159f3565b5080600052602060058152604091826000209273ffffffffffffffffffffffffffffffffffffffff91828554169485615c6b5750600a92939450600052600484528060002090805194615b8386614fe0565b615b8c83615a73565b8652615b9a60018401615ada565b90860152615baa60028301615ada565b90850152600381015460608501526004810154608085015260058101546fffffffffffffffffffffffffffffffff9081811660a087015260801c60c08601528360068301541660e086015260ff6007830154858116610100880152818160a01c161515610120880152818160a81c161515610140880152818160b01c16151561016088015260b81c16151561018086015260088201549081166101a086015260801c6101c0850152826009820154166101e085015201541661020082015290565b928392915060ff90615c7b6159f3565b506060838051615c8a81614ffd565b82815282898201520152825196615ca088615035565b600188528636818a0137615cb388615966565b52825190615cc082615035565b600182528636818401376001850154615cd883615966565b5284845192615ce684615035565b600184528836818601376001615cfb85615966565b5283868051615d0981614ffd565b8c8152838c82015201526005820154936fffffffffffffffffffffffffffffffff96876003850154169160028501549386600881600760068260048c0154169a01549e0154169d0154169c83519e8f90615d6282614fe0565b81520152818d01528267ffffffffffffffff918d60608484169101521c1660808c015260a08b015260801c60c08a015260e08901528116610100880152818160a01c161515610120880152818160a81c161515610140880152818160b01c16151561016088015260b81c16151561018086015281166101a085015260801c6101c08401526101e083015261020082015290565b60009081526005602090815260408220805473ffffffffffffffffffffffffffffffffffffffff1615615f1d5760ff600582015460a01c1660026fffffffffffffffffffffffffffffffff60038401541692015460801c905b615e585750505090565b6fffffffffffffffffffffffffffffffff9391929380601054169181604051957fc6c7612000000000000000000000000000000000000000000000000000000000875216600486015216602484015260448301528282606481735d9fe5b343d308ed8f72dc370a57423b8eef36805af4928315615f10578193615edc575b50505090565b9091809350813d8311615f09575b615ef48183615051565b81010312615f06575051388080615ed6565b80fd5b503d615eea565b50604051903d90823e3d90fd5b506004815260408220600560ff600783015460a01c16910154906fffffffffffffffffffffffffffffffff82169160801c90615e4e56fea26469706673582212205b1f82ad0e85c57ef03e5b8ed5b374c1e63ff1f747b1373fc42aedeb22d52fee64736f6c634300080f0033

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

000000000000000000000000b6a0e72634fa69d68a139ccc6af04b9a4b9e2c130000000000000000000000007559038535f3d6ed6bac5a54ab4b69da827f44bd000000000000000000000000809d88b727c4c7024462d7955777835938f02f3b0000000000000000000000007e5cac8d49b42bba05388b7e005d6b61c7773c47000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c2900000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000299a86c53f4d980d6f7842cc2c5c3624c3920818000000000000000000000000d82331366b217bdb4b58f1e87628021cc8f8062c00000000000000000000000020445e02b1dc0314d1b12997443530da8597994d00000000000000000000000080b2e94df55d1ed2c359c894ae6811cb80d606cd000000000000000000000000a137c705fc17ef52f895323633249d088dfb28f1000000000000000000000000ba1100f63987d76675e344bc93be060d545d8f4a00000000000000000000000000000000000000000000000000000000000493e0

-----Decoded View---------------
Arg [0] : _officialNFTDiscount (address): 0xB6A0e72634Fa69d68A139ccC6aF04b9a4b9e2C13
Arg [1] : _marketplaceWhitelist (address): 0x7559038535f3d6ed6BAc5a54Ab4B69DA827F44BD
Arg [2] : _collectionRoyalties (address): 0x809D88B727c4C7024462d7955777835938F02F3B
Arg [3] : _tokens (address): 0x7E5caC8D49b42bba05388b7e005D6b61C7773C47
Arg [4] : _paintRouter (address): 0xF491e7B69E4244ad4002BC14e878a34207E38c29
Arg [5] : _wftm (address): 0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83
Arg [6] : _implBuyEditListing (address): 0x299A86C53f4d980d6f7842cc2c5c3624c3920818
Arg [7] : _implMakeAndEditOffers (address): 0xd82331366b217BDb4b58F1e87628021cC8f8062c
Arg [8] : _implBidsAndAcceptOffers (address): 0x20445e02b1dc0314d1B12997443530da8597994d
Arg [9] : _implListAndComplete (address): 0x80b2E94dF55d1ed2c359c894Ae6811Cb80D606cD
Arg [10] : _implBatchTransferNFT (address): 0xA137C705Fc17Ef52f895323633249D088dfb28f1
Arg [11] : _feePercentage (address): 0xBa1100f63987d76675e344BC93Be060d545D8f4a
Arg [12] : startId (uint256): 300000

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 000000000000000000000000b6a0e72634fa69d68a139ccc6af04b9a4b9e2c13
Arg [1] : 0000000000000000000000007559038535f3d6ed6bac5a54ab4b69da827f44bd
Arg [2] : 000000000000000000000000809d88b727c4c7024462d7955777835938f02f3b
Arg [3] : 0000000000000000000000007e5cac8d49b42bba05388b7e005d6b61c7773c47
Arg [4] : 000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c29
Arg [5] : 00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83
Arg [6] : 000000000000000000000000299a86c53f4d980d6f7842cc2c5c3624c3920818
Arg [7] : 000000000000000000000000d82331366b217bdb4b58f1e87628021cc8f8062c
Arg [8] : 00000000000000000000000020445e02b1dc0314d1b12997443530da8597994d
Arg [9] : 00000000000000000000000080b2e94df55d1ed2c359c894ae6811cb80d606cd
Arg [10] : 000000000000000000000000a137c705fc17ef52f895323633249d088dfb28f1
Arg [11] : 000000000000000000000000ba1100f63987d76675e344bc93be060d545d8f4a
Arg [12] : 00000000000000000000000000000000000000000000000000000000000493e0


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

PaintSwap Marketplace V3 Contract.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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