Contract 0xd19Eb6f25De99a993A73a3931c94Cf3B299BEE03

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x17338cdf65cd193cde0b7dd5ce4441c1f1c772a19efda3e003ac69a0b855b692Safe Transfer Fr...243795342021-12-08 18:50:2138 mins ago0x284a9e0f4f7869b3294d1931b9845740a8607586 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.00513130245
0x0444c501997d51e5bd149d52ecd4c2f09ad8952c11524a00a7f3de0e98daa244Mint243757512021-12-08 17:57:081 hr 31 mins ago0x312de533692c6e1e11108cd77f2837461c7b9bdc IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.272077355571576 FTM0.048665193985
0xc05b7b5782244022672fa41387fa8c39a4fe663c38cacd9e156953d427c1f4caSafe Transfer Fr...243670682021-12-08 15:49:043 hrs 39 mins ago0x82af599ae8a62842da38be6e5d4b14cd5882bddb IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.007101795084
0x7bd0725b0d12407379c1f8c94c466dcf09c1a495fb0d03ed0cee34d66a041299Burn243642062021-12-08 15:07:504 hrs 20 mins ago0x0999ec2f80aae3df224809b88a13fe589340a672 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.003819921404
0x4c057f2c30fe85f4ea9ef33719ba12de85998bcbf4bdc04784efb6a3dff35bc8Mint243616272021-12-08 14:32:474 hrs 55 mins ago0x0999ec2f80aae3df224809b88a13fe589340a672 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275145863900804 FTM0.086712365521
0x1bb72a2268f0eb11e0b9543e41e46a6e6c6c5d517af9d6b73cd84061f419d37dMint243565912021-12-08 13:16:316 hrs 11 mins ago0xf55f170723226485a4d4a910e13d448e653949d2 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275540541240464 FTM0.06778107185
0x7ab2415adb6e5f5978dcaf51517553611dbdc15d19ba133f2b9ed2373eff4170Mint243562182021-12-08 13:11:296 hrs 16 mins ago0xf55f170723226485a4d4a910e13d448e653949d2 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275572237040181 FTM0.045671370103
0x2adba5e141e20373abc2ae6ff2402ac008edc8680fff33695ee41b9a6fd7c9c2Mint243560032021-12-08 13:08:236 hrs 20 mins ago0xf55f170723226485a4d4a910e13d448e653949d2 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275572237040181 FTM0.012644397721
0xf384ec74992d93136b4de7309ec988de0efb38ad7d6c5df25402627f2c7d436cMint243544552021-12-08 12:45:206 hrs 43 mins ago0x03adfb808a1a9a753ddbc4a18bccffc7c40de5df IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.27356808406763 FTM0.06151961819
0xa0dba85d3cfebc3a0cb9ee7644eed8a9d059f5bf6c486dbfb598d82f80c06557Mint243493222021-12-08 11:32:307 hrs 55 mins ago0x16765c8fe6eb838cb8f64e425b6dccab38d4f102 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.274062562329352 FTM0.087028683265
0x7d914d6273e22ecd2e8f6666df09eb403d49dfe9e6eb0ad88795e36c67ae301bMint243450062021-12-08 10:22:069 hrs 6 mins ago0x05c38df49ed3fc9179fb19cdcf4a6bb34aa97601 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273854389748205 FTM0.044446148587
0xea1ef6c586bf66b7fd048f7753a857aec54cdb42c03b8371260e76ca4e8e6599Mint243442242021-12-08 10:10:399 hrs 17 mins ago0xde2771d618380dbefe4ad13465142d1ba1ef3bec IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273853589474561 FTM0.047920247065
0x4e3dd2ba28e77ef3c756415fca18127459be271bb16d9b4451f96bb2f7235590Mint243434562021-12-08 10:00:019 hrs 28 mins ago0xde2771d618380dbefe4ad13465142d1ba1ef3bec IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273885877230349 FTM0.051087414726
0x19a88b725b5c94ca69ccc703661ade7266233b9868880461c6eb6a5577a018c5Safe Transfer Fr...243362802021-12-08 8:19:0411 hrs 9 mins ago0x94d1a528f550441175ff03dcd2e42d82ff1afecd IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.009492933786
0x16b39f8379d6971f5ec3edf1c3d6f2c8fe16cd2583541f409a4e913075b6b29cSafe Transfer Fr...243362802021-12-08 8:19:0411 hrs 9 mins ago0x94d1a528f550441175ff03dcd2e42d82ff1afecd IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.009492933786
0x77be177c3a628c897e8132f9e85d178462210ec96e164b25a50f3e1dd87d6146Mint243251812021-12-08 5:37:4313 hrs 50 mins ago0x7f51a3ba1d17b17bd1259c9b70542af02beeb935 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.268169873510042 FTM0.08851757799
0x33195e4cd4ea29b91f71783d1ebb22bb1de530d59c1de7642056962a8c75edf5Mint243118632021-12-08 2:26:4217 hrs 1 min ago0xa509f8974647fd642cb3a3865830f20cc74bc9c3 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269322783095681 FTM0.063723292859
0x81fc8003573bab9e735473f0cdee497b835e112634cc13052cba7572f015d7d2Safe Transfer Fr...243053442021-12-08 0:52:3918 hrs 35 mins ago0x588d988d2c01b5ac3e00044f5ca4afd97e6ca9c3 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.007915119139
0x2913169182c00084848446b13981835dc1b78ed7cbc8f240860fa8f4306ca075Mint243033552021-12-08 0:23:5919 hrs 4 mins ago0xa0d215329177e8b5ef44e90ad0c4faec80c1bb33 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269250879851528 FTM0.067787026028
0xa4b01e50152f5d21a564a62fe934fac427473fbb69c2bea1188c8c400dbf556cBurn242903062021-12-07 21:16:3822 hrs 11 mins ago0xc4afe4030e65d3f10ae20dafe822e206153156b5 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030 FTM0.004688245441
0x19ae2ba48b9d50b73a325fa06f1d53cc927c084731f22df248d5dce78adc31aeMint242862132021-12-07 20:15:0623 hrs 13 mins ago0x37bc65a05b651126dac69052d21a834c1f8876c8 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269143217994583 FTM0.063634966283
0xd7065f58a1d1dc151d50cffb7f3faef107a0c4ed4c69a657c8b2077b9927e6ecMint242861342021-12-07 20:14:0523 hrs 14 mins ago0x37bc65a05b651126dac69052d21a834c1f8876c8 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269142823538091 FTM0.063634966283
0xe78c631f6c424be6efcd386eceb4cd3612b39f3790ed900714f8cd0e65a38370Mint242859552021-12-07 20:11:4523 hrs 16 mins ago0x37bc65a05b651126dac69052d21a834c1f8876c8 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269142429082465 FTM0.061735944899
0xd0310926e7b5c431d9a7dd8bbd6a08cdeb3e5fafa1a72897d5dbbe471ead3c7dMint242848702021-12-07 19:58:0223 hrs 30 mins ago0x37bc65a05b651126dac69052d21a834c1f8876c8 IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.2692431237122 FTM0.070989016696
0x9ee9e4c1984f5d3e422f4b82db509e13280fde1d3f4288e2528511c9a8f16510Mint242817922021-12-07 19:14:521 day 13 mins ago0xb2a71c24985fd098b45349cc09829913da041cfd IN  0xd19eb6f25de99a993a73a3931c94cf3b299bee030.268987111500138 FTM0.087243387962
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x0444c501997d51e5bd149d52ecd4c2f09ad8952c11524a00a7f3de0e98daa244243757512021-12-08 17:57:081 hr 31 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007924583171987655 FTM
0x0444c501997d51e5bd149d52ecd4c2f09ad8952c11524a00a7f3de0e98daa244243757512021-12-08 17:57:081 hr 31 mins ago 0x312de533692c6e1e11108cd77f2837461c7b9bdc 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.272077355571576165 FTM
0x4c057f2c30fe85f4ea9ef33719ba12de85998bcbf4bdc04784efb6a3dff35bc8243616272021-12-08 14:32:474 hrs 55 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.008013957200994299 FTM
0x4c057f2c30fe85f4ea9ef33719ba12de85998bcbf4bdc04784efb6a3dff35bc8243616272021-12-08 14:32:474 hrs 55 mins ago 0x0999ec2f80aae3df224809b88a13fe589340a672 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275145863900804268 FTM
0x1bb72a2268f0eb11e0b9543e41e46a6e6c6c5d517af9d6b73cd84061f419d37d243565912021-12-08 13:16:316 hrs 11 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.008025452657489258 FTM
0x1bb72a2268f0eb11e0b9543e41e46a6e6c6c5d517af9d6b73cd84061f419d37d243565912021-12-08 13:16:316 hrs 11 mins ago 0xf55f170723226485a4d4a910e13d448e653949d2 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275540541240464527 FTM
0x7ab2415adb6e5f5978dcaf51517553611dbdc15d19ba133f2b9ed2373eff4170243562182021-12-08 13:11:296 hrs 16 mins ago 0xf55f170723226485a4d4a910e13d448e653949d2 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275572237040181329 FTM
0x2adba5e141e20373abc2ae6ff2402ac008edc8680fff33695ee41b9a6fd7c9c2243560032021-12-08 13:08:236 hrs 20 mins ago 0xf55f170723226485a4d4a910e13d448e653949d2 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.275572237040181329 FTM
0xf384ec74992d93136b4de7309ec988de0efb38ad7d6c5df25402627f2c7d436c243544552021-12-08 12:45:206 hrs 43 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007968002448571771 FTM
0xf384ec74992d93136b4de7309ec988de0efb38ad7d6c5df25402627f2c7d436c243544552021-12-08 12:45:206 hrs 43 mins ago 0x03adfb808a1a9a753ddbc4a18bccffc7c40de5df 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273568084067630827 FTM
0xa0dba85d3cfebc3a0cb9ee7644eed8a9d059f5bf6c486dbfb598d82f80c06557243493222021-12-08 11:32:307 hrs 55 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007982015802231018 FTM
0xa0dba85d3cfebc3a0cb9ee7644eed8a9d059f5bf6c486dbfb598d82f80c06557243493222021-12-08 11:32:307 hrs 55 mins ago 0x16765c8fe6eb838cb8f64e425b6dccab38d4f102 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.274062562329352455 FTM
0x7d914d6273e22ecd2e8f6666df09eb403d49dfe9e6eb0ad88795e36c67ae301b243450062021-12-08 10:22:069 hrs 6 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.008042489626742464 FTM
0x7d914d6273e22ecd2e8f6666df09eb403d49dfe9e6eb0ad88795e36c67ae301b243450062021-12-08 10:22:069 hrs 6 mins ago 0x05c38df49ed3fc9179fb19cdcf4a6bb34aa97601 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273854389748205039 FTM
0xea1ef6c586bf66b7fd048f7753a857aec54cdb42c03b8371260e76ca4e8e6599243442242021-12-08 10:10:399 hrs 17 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007976318140035763 FTM
0xea1ef6c586bf66b7fd048f7753a857aec54cdb42c03b8371260e76ca4e8e6599243442242021-12-08 10:10:399 hrs 17 mins ago 0xde2771d618380dbefe4ad13465142d1ba1ef3bec 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273853589474561222 FTM
0x4e3dd2ba28e77ef3c756415fca18127459be271bb16d9b4451f96bb2f7235590243434562021-12-08 10:00:019 hrs 28 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007976870000690685 FTM
0x4e3dd2ba28e77ef3c756415fca18127459be271bb16d9b4451f96bb2f7235590243434562021-12-08 10:00:019 hrs 28 mins ago 0xde2771d618380dbefe4ad13465142d1ba1ef3bec 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.273885877230349722 FTM
0x77be177c3a628c897e8132f9e85d178462210ec96e164b25a50f3e1dd87d6146243251812021-12-08 5:37:4313 hrs 50 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007810392531359082 FTM
0x77be177c3a628c897e8132f9e85d178462210ec96e164b25a50f3e1dd87d6146243251812021-12-08 5:37:4313 hrs 50 mins ago 0x7f51a3ba1d17b17bd1259c9b70542af02beeb935 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.268169873510042727 FTM
0x33195e4cd4ea29b91f71783d1ebb22bb1de530d59c1de7642056962a8c75edf5243118632021-12-08 2:26:4217 hrs 1 min ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007844352905699448 FTM
0x33195e4cd4ea29b91f71783d1ebb22bb1de530d59c1de7642056962a8c75edf5243118632021-12-08 2:26:4217 hrs 1 min ago 0xa509f8974647fd642cb3a3865830f20cc74bc9c3 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.26932278309568107 FTM
0x2913169182c00084848446b13981835dc1b78ed7cbc8f240860fa8f4306ca075243033552021-12-08 0:23:5919 hrs 4 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007842258636452289 FTM
0x2913169182c00084848446b13981835dc1b78ed7cbc8f240860fa8f4306ca075243033552021-12-08 0:23:5919 hrs 4 mins ago 0xa0d215329177e8b5ef44e90ad0c4faec80c1bb33 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.269250879851528591 FTM
0x19ae2ba48b9d50b73a325fa06f1d53cc927c084731f22df248d5dce78adc31ae242862132021-12-07 20:15:0623 hrs 13 mins ago PaintSwap: Router 0xd19eb6f25de99a993a73a3931c94cf3b299bee030.007838739885901381 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PaintSwapERC1155V2

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 320 runs

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

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/IERC2981.sol";
import "../PaintSwapOfficialNFT.sol";
import {PaintSwapLibraryV2} from "./PaintSwapLibraryV2.sol";

// From: https://eips.ethereum.org/EIPS/eip-1155#enumerating-from-events
// In order to keep storage requirements light for contracts implementing ERC-1155, enumeration (discovering the IDs and values of tokens) must be done using event logs. It is RECOMMENDED that clients such as exchanges and blockchain explorers maintain a local database containing the token ID, Supply, and URI at the minimum. This can be built from each TransferSingle, TransferBatch, and URI event, starting from the block the smart contract was deployed until the latest block.

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

interface IWETH {
  function deposit() external payable;

  function transfer(address to, uint value) external returns (bool);

  function withdraw(uint) external returns (uint256);

  function approve(address guy, uint wad) external returns (bool);

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

contract PaintSwapERC1155V2 is ERC1155, Ownable, IERC2981, ReentrancyGuard {
  event UpdateNSFW(address user, uint tokenId, bool isNSFW);

  struct Royalty {
    address creator;
    uint16 fee; // 10000 basis points
  }

  string private baseUri;
  using Counters for Counters.Counter;
  Counters.Counter private tokenIds;
  using Strings for uint256;
  IERC20 public brush;
  PaintSwapOfficialNFT public officialNFT;
  uint128 public officialNFTDiscount;
  uint128 public mintFee;
  address public dev;
  address public paintSwapMarketplaceAddress;
  uint public maxMintAmount = 5;
  uint public maxRoyalty = 1000;
  bool public enabledMinting = true;
  bool public enabledBatchMinting = false;

  mapping(uint256 => string) private tokenURIs;
  mapping(uint => Royalty) public royalties;
  address public paintRouter;
  address public wftm;

  mapping(address => bool) public whitelistedMarketplaces;

  constructor(
    IERC20 _brush,
    PaintSwapOfficialNFT _officialNFT,
    address _paintSwapMarketplaceAddress,
    address _paintRouter,
    address _wftm
  ) ERC1155("") {
    baseUri = "ipfs://";
    brush = _brush;
    mintFee = 50 * 10**18;
    officialNFT = _officialNFT;
    officialNFTDiscount = 50;
    whitelistedMarketplaces[_paintSwapMarketplaceAddress] = true;
    paintRouter = _paintRouter;
    wftm = _wftm;
  }

  function uri(uint256 _tokenId) public view virtual override returns (string memory) {
    require(_exists(_tokenId));

    // If there is no base URI, return the token URI.
    if (bytes(baseUri).length == 0) {
      return tokenURIs[_tokenId];
    }
    // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
    if (bytes(tokenURIs[_tokenId]).length > 0) {
      return string(abi.encodePacked(baseUri, tokenURIs[_tokenId]));
    }

    return super.uri(_tokenId);
  }

  function batchMint(
    address _creator,
    address _to,
    uint256[] memory _ids,
    uint256[] memory _amounts,
    string[] memory _uris,
    uint16[] memory _royalties,
    bool[] memory _isNSFWs,
    bool _payingInBrush,
    address[] memory _path
  ) external payable nonReentrant {
    require(_creator != address(0));
    require(_to != address(0));
    require(_ids.length == _amounts.length);
    require(_amounts.length == _uris.length);
    require(_uris.length == _isNSFWs.length);
    require(_isNSFWs.length == _royalties.length);
    require(enabledMinting);
    require(enabledBatchMinting);

    uint128 fee = mintFee;
    if (msg.sender == owner()) {
      fee = 0; // No fee for the owner
    } else if (officialNFT.balanceOf(msg.sender) > 0) {
      // Discount if owning an official NFT
      fee = mintFee - (officialNFTDiscount * mintFee) / 100;
    }

    // Dev address gets the fee
    if (fee > 0) {
      uint totalFee = fee * _amounts.length;
      if (!_payingInBrush) {
        require(_path[0] == wftm, "First should be wftm"); // Should be going from wftm to brush
        require(_path[_path.length - 1] == address(brush), "End should be brush");
        PaintSwapLibraryV2.zapFTM(paintRouter, uint128(totalFee), msg.value, msg.sender, _path);
        brush.transfer(dev, fee);
      } else {
        brush.transferFrom(msg.sender, dev, totalFee);
      }
    }

    // Confirm the ids are what we expect
    for (uint i = 0; i < _ids.length; ++i) {
      tokenIds.increment();
      uint256 id = tokenIds.current();
      if (_ids[i] != id) {
        revert("Ids do not match");
      }
      tokenURIs[id] = _uris[i];
      emit UpdateNSFW(_to, id, _isNSFWs[i]);

      // Set up royalty information
      require(_royalties[i] <= maxRoyalty, "Royalty is too high");
      Royalty storage _royaltyInfo = royalties[i];
      _royaltyInfo.creator = _creator; // Might not always be the case
      _royaltyInfo.fee = _royalties[i];
    }

    _mintBatch(_to, _ids, _amounts, "");
  }

  receive() external payable {}

  // In case someone sent us FTM
  function withdrawFTM() external {
    (bool success, ) = dev.call{value: address(this).balance}("");
    require(success, "FTM_TRANSFER_FAILED");
  }

  function mint(
    address _creator,
    address _to,
    uint _amount,
    string memory _uri,
    uint16 _royalty,
    bool _isNSFW,
    bool _payingInBrush,
    address[] memory _path
  ) external payable nonReentrant {
    require(_creator != address(0));
    require(_to != address(0));
    require(enabledMinting);
    require(_royalty <= maxRoyalty);
    require(bytes(_uri).length != 0, "String is empty");

    uint128 fee = mintFee;
    if (msg.sender == owner()) {
      fee = 0; // No fee for the owner
    } else if (officialNFT.balanceOf(msg.sender) > 0) {
      // Discount if owning an official NFT
      fee = mintFee - (officialNFTDiscount * mintFee) / 100;
    }
    // Dev address gets the fee
    if (fee > 0) {
      if (!_payingInBrush) {
        require(_path[0] == wftm, "First should be wftm"); // Should be going from wftm to brush
        require(_path[_path.length - 1] == address(brush), "End should be brush");
        PaintSwapLibraryV2.zapFTM(paintRouter, fee, msg.value, msg.sender, _path);
        brush.transfer(dev, fee);
      } else {
        brush.transferFrom(msg.sender, dev, fee);
      }
    }

    tokenIds.increment();

    uint256 id = tokenIds.current();
    _mint(_to, id, _amount, "");
    tokenURIs[id] = _uri;

    emit UpdateNSFW(_to, id, _isNSFW);

    // Set up royalty information
    Royalty storage _royaltyInfo = royalties[id];
    _royaltyInfo.creator = _creator; // Might not always be the case
    _royaltyInfo.fee = _royalty;
  }

  // Change the brush token to something else, as well as fees. Can only be called by the owner
  function setFees(IERC20 _brush, uint128 _mintFee) external onlyOwner {
    brush = _brush;
    mintFee = _mintFee;
  }

  function setOfficialNFT(address _officialNFT) external onlyOwner {
    officialNFT = PaintSwapOfficialNFT(_officialNFT);
  }

  function setDevAddress(address _dev) external onlyOwner {
    dev = _dev;
  }

  function setRouter(address _router) external onlyOwner {
    paintRouter = _router;
  }

  function setOfficialNFTFee(uint128 _discount) external onlyOwner {
    require(_discount <= 100, "Discount should be a percentage, 0-100");
    officialNFTDiscount = _discount;
  }

  function setMaxMintAmount(uint _maxMintAmount) external onlyOwner {
    maxMintAmount = _maxMintAmount;
  }

  function setMaxRoyalty(uint16 _maxRoyalty) external onlyOwner {
    require(_maxRoyalty < 1500, "Royalty too high");
    maxRoyalty = _maxRoyalty;
  }

  function enableMinting(bool _enable) external onlyOwner {
    enabledMinting = _enable;
  }

  function enableBatchMinting(bool _enable) external onlyOwner {
    enabledBatchMinting = _enable;
  }

  function lastTokenId() external view returns (uint) {
    return tokenIds.current();
  }

  // Anyone can burn their NFT if they have sufficient balance
  function burn(uint _id, uint _amount) external {
    require(balanceOf(msg.sender, _id) >= _amount);
    _burn(msg.sender, _id, _amount);
  }

  /**
   * @dev Returns whether `tokenId` exists.
   *
   * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
   *
   */
  function _exists(uint256 tokenId) private view returns (bool) {
    return bytes(tokenURIs[tokenId]).length != 0;
  }

  function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
    external
    view
    override
    returns (address receiver, uint256 royaltyAmount)
  {
    uint256 amount = (_salePrice * royalties[_tokenId].fee) / 10000;
    return (royalties[_tokenId].creator, amount);
  }

  function supportsInterface(bytes4 interfaceId) public view override(IERC165, ERC1155) returns (bool) {
    return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
  }

  function addWhitelistedMarketplace(address _marketplace) external onlyOwner {
    whitelistedMarketplaces[_marketplace] = true;
  }

  function removeWhitelistedMarketplace(address _marketplace) external onlyOwner {
    require(whitelistedMarketplaces[_marketplace], "This marketplace isn't whitelisted");
    whitelistedMarketplaces[_marketplace] = false;
  }

  /**
   * Override isApprovedForAll to whitelist the PaintSwap marketplace to enable listings without needing approval.
   * Just makes it easier for users. The whitelist is address
   */
  function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) {
    if (whitelistedMarketplaces[_operator]) {
      return true;
    }

    return ERC1155.isApprovedForAll(_owner, _operator);
  }
}

File 2 of 26 : 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 3 of 26 : 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 4 of 26 : 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 5 of 26 : 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 6 of 26 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }
}

File 7 of 26 : 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 26 : 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 26 : PaintSwapOfficialNFT.sol
pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./PaintSwapERC721.sol";

contract PaintSwapOfficialNFT is PaintSwapERC721, Ownable {
  using Counters for Counters.Counter;
  Counters.Counter private tokenIds;

  constructor() PaintSwapERC721("PaintSwap Official NFTs", "PNFT") {}

  function mintItem(address _to, string memory _tokenURI) external onlyOwner returns (uint256) {
    tokenIds.increment();
    // There can only ever be a maximum of 20 items minted
    assert(tokenIds.current() <= 20);

    uint256 id = tokenIds.current();
    _mint(_to, id);
    _setTokenURI(id, _tokenURI);

    return id;
  }
}

File 10 of 26 : PaintSwapLibraryV2.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/IERC2981.sol";
import "./TokensV2.sol";
import "hardhat/console.sol";

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

library PaintSwapLibraryV2 {
  event NFTFailedTransfer(address nft, uint tokenId, uint amount);
  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[] storage _nfts,
    address _owner,
    address _to,
    uint[] storage _tokenIds,
    uint[] storage _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] = _tokenIds[0];
          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];
        }

        if (tokenIdAmountBatchLengths.length == 1) {
          IERC1155(nftsInfo[i].nft).safeTransferFrom(_owner, _to, tokenIds_[0], amountBatches_[0], "");
        } else {
          IERC1155(nftsInfo[i].nft).safeBatchTransferFrom(_owner, _to, tokenIds_, amountBatches_, "");
        }
      } else {
        IERC721(nftsInfo[i].nft).safeTransferFrom(_owner, _to, _tokenIds[0]);
      }
    }
  }

  function emitFailedNFTSends(
    uint[] memory _balancesBefore,
    address[] storage _nfts,
    uint[] storage _tokenIds,
    uint[] storage _amountBatches,
    uint _amount
  ) external {
    // Check balance after
    uint[] memory balancesAfter = getBalancesSelf(_nfts, _tokenIds);
    // Check the difference
    for (uint i = 0; i < _balancesBefore.length; ++i) {
      if (_balancesBefore[i] > _amountBatches[i] * _amount) {
        if (_balancesBefore[i] > balancesAfter[i]) {
          // Some weren't sent, add them to our excess
          emit NFTFailedTransfer(_nfts[i], _tokenIds[i], _balancesBefore[i] - balancesAfter[i]);
        }
      }
    }
  }

  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 checkEditPrice(
    address _seller,
    bool _isAuction,
    uint _maxBidOrOffer
  ) external view {
    require(_seller == msg.sender);
    require(!_isAuction || _maxBidOrOffer == 0);
  }

  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,
    mapping(address => bool) storage _whitelistedSellerBuyerContract
  ) external view {
    require(_addresses[1] == msg.sender || _whitelistedSellerBuyerContract[msg.sender]);
    require(_addresses[1] != address(0), "Cannot have 0 address as seller");
    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 checkAcceptBestOffer(
    address _seller,
    bool _isAuction,
    uint256 _maxOffer,
    uint256 _endTime,
    bool _allowAcceptAfterDeadline
  ) external view {
    require(_seller == msg.sender, "Only the seller can accept offers");
    require(_maxOffer > 0, "There are no offers");
    require(!_isAuction, "Not supported with auctions");
    require(_allowAcceptAfterDeadline || _endTime >= block.timestamp, "Duration has finished, cannot accept offer");
  }

  function checkBuy(
    address _seller,
    bool _isAuction,
    uint256 _amountRemaining,
    uint256 _amount,
    uint _endTime,
    bool _complete
  ) external view {
    require(_seller != msg.sender, "Cannot buy your own NFT!");
    require(!_isAuction, "Cannot buy, because this is an auction");
    require(_amountRemaining >= _amount, "Trying to buy too many");
    require(!isCompleteOrFinished(_complete, _endTime), "Deadline has passed for this sale");
  }

  function checkMakeOffer(
    address _seller,
    bool _isAuction,
    uint256 _maxOffer,
    uint256 _offer,
    uint256 _price,
    uint128 _percentIncrease,
    uint _endTime,
    bool _complete
  ) external view {
    require(!_isAuction, "Cannot make an offer on an auction");
    require(_offer < _price, "Offer price greater than asking");
    require(!isCompleteOrFinished(_complete, _endTime), "Deadline already passed");
    require(_seller != msg.sender, "Cannot buy your own NFT!");
    require(
      _offer >= nextMinimumOffer(_maxOffer, _percentIncrease),
      "New offer needs to be X% or greater than the current max offer"
    );
    require(
      nextMinimumOffer(_offer, _percentIncrease) <= _price,
      "Offer should not be more than 10% closer to the price"
    ); // This is in case there are no offers
    require(_offer > 0, "Offer cannot be 0");
  }

  function checkMakeBid(
    address _seller,
    bool _isAuction,
    uint256 _bid,
    uint256 _maxBid,
    uint256 _price,
    uint128 _percentIncrease,
    uint256 _endTime,
    bool _complete
  ) external view {
    require(_isAuction, "This is not an auction");
    require(_endTime > block.timestamp && !_complete, "Deadline already passed");
    require(_seller != msg.sender, "Cannot place a bid on your own NFT!");
    require(
      _bid >= nextMinimumBid(_price, _maxBid, _percentIncrease),
      "New bid needs to be X% or greater than the current max bid"
    );
    require(_bid >= _price, "Bid is less than the reserve price");
    require(_bid > 0, "Bid cannot be 0");
  }

  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 _nextMinimumBidOffer(_max, _percentIncrease);
    }
  }

  function nextMinimumOffer(uint _max, uint128 _percentIncrease) public pure returns (uint) {
    if (_max == 0) {
      return 1;
    } else {
      return _nextMinimumBidOffer(_max, _percentIncrease);
    }
  }

  function _nextMinimumBidOffer(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;
  }

  function getBalancesSelf(address[] storage _nfts, uint[] storage _tokenIds)
    public
    view
    returns (uint[] memory balances)
  {
    balances = new uint[](_nfts.length);
    for (uint i = 0; i < _nfts.length; ++i) {
      address nft = _nfts[i];
      uint tokenId = _tokenIds[i];
      if (ERC165(nft).supportsInterface(type(IERC1155).interfaceId)) {
        balances[i] = IERC1155(nft).balanceOf(address(this), tokenId);
      } else {
        balances[i] = IERC721(nft).ownerOf(tokenId) == address(this) ? 1 : 0;
      }
    }
  }

  // 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 Error(string memory) {} catch {}

    return (address(0), 0);
  }

  function checkReclaim(
    bool _isAuction,
    uint256 _endTime,
    uint128 _numRemaining,
    bool _onlySellerAndHighestOfferCanEndSale,
    address _seller,
    address _maxBidderOrOfferer
  ) external view {
    require(_endTime < block.timestamp, "Time has not expired yet");
    require(!_isAuction, "This is an auction, use completeAuction");
    require(_numRemaining > 0, "There's none to claim");
    require(!_onlySellerAndHighestOfferCanEndSale || msg.sender == _seller || msg.sender == _maxBidderOrOfferer);
  }

  function checkCompleteAuction(
    bool _isAuction,
    uint _endTime,
    bool _onlySellerAndHighestOfferCanEndSale,
    address _seller,
    address _maxBidderOrOfferer
  ) external view {
    require(_isAuction, "This is not an auction");
    require(_endTime < block.timestamp, "Auction has not finished yet");
    require(!_onlySellerAndHighestOfferCanEndSale || msg.sender == _seller || msg.sender == _maxBidderOrOfferer);
  }

  function checkCancelSale(
    uint _cancelCutoff,
    address _seller,
    uint _startTime,
    uint _endTime,
    uint _saleGracePeriodForCancelling,
    bool _complete,
    bool _isAuction,
    uint _maxBidOrOffer
  ) external view {
    //    require(_enableCancelling);
    require(_seller == msg.sender);
    bool withinGracePeriod = _startTime + _saleGracePeriodForCancelling >= block.timestamp;
    require(_endTime - _cancelCutoff >= block.timestamp || withinGracePeriod);
    require(!isCompleteOrFinished(_complete, _endTime));
    require(!_isAuction || _maxBidOrOffer == 0 || withinGracePeriod);
  }

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

  function isERC1155(address _nft) public view returns (bool) {
    return
      ERC165(_nft).supportsInterface(type(IERC1155).interfaceId) &&
      ERC165(_nft).supportsInterface(type(IERC1155MetadataURI).interfaceId);
  }

  function isERC721(address _nft) public view returns (bool) {
    return
      ERC165(_nft).supportsInterface(type(IERC721).interfaceId) &&
      ERC165(_nft).supportsInterface(type(IERC721Metadata).interfaceId);
  }

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

  function marketplaceZapFTM(
    address _paintRouter,
    uint128 _fee,
    uint _value,
    address[] memory _addresses
  ) external {
    // Zap if paying with ftm necessary
    // Assign the path
    // Create path using the indexes 2 - en
    // 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, _addresses[1], path);
    } else {
      revert("Trying to zap with the marketplace but there is not path");
    }
  }
}

File 11 of 26 : 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 12 of 26 : 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 13 of 26 : 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 14 of 26 : 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 15 of 26 : 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 16 of 26 : 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 17 of 26 : 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 18 of 26 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 19 of 26 : PaintSwapERC721.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

abstract contract PaintSwapERC721 is ERC721Enumerable {
  string public baseURI;

  constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {}

  using Strings for uint256;

  // Optional mapping for token URIs
  mapping(uint256 => string) private _tokenURIs;

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

    string memory _tokenURI = _tokenURIs[tokenId];
    string memory base = _baseURI();

    // If there is no base URI, return the token URI.
    if (bytes(base).length == 0) {
      return _tokenURI;
    }
    // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
    if (bytes(_tokenURI).length > 0) {
      return string(abi.encodePacked(base, _tokenURI));
    }

    return super.tokenURI(tokenId);
  }

  /**
   * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
    require(_exists(tokenId), "PaintSwapERC721: URI set of nonexistent token");
    _tokenURIs[tokenId] = _tokenURI;
  }

  /**
   * @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 override {
    super._burn(_tokenId);

    if (bytes(_tokenURIs[_tokenId]).length != 0) {
      delete _tokenURIs[_tokenId];
    }
  }

  function _baseURI() internal view override returns (string memory) {
    return baseURI;
  }
}

File 20 of 26 : 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 21 of 26 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 22 of 26 : 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 23 of 26 : 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 24 of 26 : 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 25 of 26 : 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
  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 26 of 26 : console.sol
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;

library console {
	address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);

	function _sendLogPayload(bytes memory payload) private view {
		uint256 payloadLength = payload.length;
		address consoleAddress = CONSOLE_ADDRESS;
		assembly {
			let payloadStart := add(payload, 32)
			let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
		}
	}

	function log() internal view {
		_sendLogPayload(abi.encodeWithSignature("log()"));
	}

	function logInt(int p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
	}

	function logUint(uint p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
	}

	function logString(string memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
	}

	function logBool(bool p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
	}

	function logAddress(address p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
	}

	function logBytes(bytes memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes)", p0));
	}

	function logBytes1(bytes1 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0));
	}

	function logBytes2(bytes2 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0));
	}

	function logBytes3(bytes3 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0));
	}

	function logBytes4(bytes4 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0));
	}

	function logBytes5(bytes5 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0));
	}

	function logBytes6(bytes6 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0));
	}

	function logBytes7(bytes7 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0));
	}

	function logBytes8(bytes8 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0));
	}

	function logBytes9(bytes9 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0));
	}

	function logBytes10(bytes10 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0));
	}

	function logBytes11(bytes11 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0));
	}

	function logBytes12(bytes12 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0));
	}

	function logBytes13(bytes13 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0));
	}

	function logBytes14(bytes14 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0));
	}

	function logBytes15(bytes15 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0));
	}

	function logBytes16(bytes16 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0));
	}

	function logBytes17(bytes17 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0));
	}

	function logBytes18(bytes18 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0));
	}

	function logBytes19(bytes19 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0));
	}

	function logBytes20(bytes20 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0));
	}

	function logBytes21(bytes21 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0));
	}

	function logBytes22(bytes22 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0));
	}

	function logBytes23(bytes23 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0));
	}

	function logBytes24(bytes24 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0));
	}

	function logBytes25(bytes25 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0));
	}

	function logBytes26(bytes26 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0));
	}

	function logBytes27(bytes27 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0));
	}

	function logBytes28(bytes28 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0));
	}

	function logBytes29(bytes29 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0));
	}

	function logBytes30(bytes30 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0));
	}

	function logBytes31(bytes31 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0));
	}

	function logBytes32(bytes32 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0));
	}

	function log(uint p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
	}

	function log(string memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
	}

	function log(bool p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
	}

	function log(address p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
	}

	function log(uint p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1));
	}

	function log(uint p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1));
	}

	function log(uint p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1));
	}

	function log(uint p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1));
	}

	function log(string memory p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1));
	}

	function log(string memory p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1));
	}

	function log(string memory p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1));
	}

	function log(string memory p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1));
	}

	function log(bool p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1));
	}

	function log(bool p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1));
	}

	function log(bool p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1));
	}

	function log(bool p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1));
	}

	function log(address p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1));
	}

	function log(address p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1));
	}

	function log(address p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1));
	}

	function log(address p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1));
	}

	function log(uint p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2));
	}

	function log(uint p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2));
	}

	function log(uint p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2));
	}

	function log(uint p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2));
	}

	function log(uint p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2));
	}

	function log(uint p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2));
	}

	function log(uint p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2));
	}

	function log(uint p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2));
	}

	function log(uint p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2));
	}

	function log(uint p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2));
	}

	function log(uint p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2));
	}

	function log(uint p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2));
	}

	function log(string memory p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2));
	}

	function log(string memory p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2));
	}

	function log(string memory p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2));
	}

	function log(string memory p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2));
	}

	function log(bool p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2));
	}

	function log(bool p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2));
	}

	function log(bool p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2));
	}

	function log(bool p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2));
	}

	function log(bool p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2));
	}

	function log(bool p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2));
	}

	function log(bool p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2));
	}

	function log(bool p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2));
	}

	function log(bool p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2));
	}

	function log(bool p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2));
	}

	function log(bool p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2));
	}

	function log(bool p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2));
	}

	function log(address p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2));
	}

	function log(address p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2));
	}

	function log(address p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2));
	}

	function log(address p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2));
	}

	function log(address p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2));
	}

	function log(address p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2));
	}

	function log(address p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2));
	}

	function log(address p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2));
	}

	function log(address p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2));
	}

	function log(address p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2));
	}

	function log(address p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2));
	}

	function log(address p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2));
	}

	function log(address p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2));
	}

	function log(address p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2));
	}

	function log(address p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2));
	}

	function log(address p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2));
	}

	function log(uint p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3));
	}

}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 320
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/V2/PaintSwapLibraryV2.sol": {
      "PaintSwapLibraryV2": "0x0c1e5af693890fea56394c9d78d1b9171ae3b342"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_brush","type":"address"},{"internalType":"contract PaintSwapOfficialNFT","name":"_officialNFT","type":"address"},{"internalType":"address","name":"_paintSwapMarketplaceAddress","type":"address"},{"internalType":"address","name":"_paintRouter","type":"address"},{"internalType":"address","name":"_wftm","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isNSFW","type":"bool"}],"name":"UpdateNSFW","type":"event"},{"inputs":[{"internalType":"address","name":"_marketplace","type":"address"}],"name":"addWhitelistedMarketplace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"string[]","name":"_uris","type":"string[]"},{"internalType":"uint16[]","name":"_royalties","type":"uint16[]"},{"internalType":"bool[]","name":"_isNSFWs","type":"bool[]"},{"internalType":"bool","name":"_payingInBrush","type":"bool"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"batchMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"brush","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dev","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"enableBatchMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"enableMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enabledBatchMinting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enabledMinting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRoyalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint16","name":"_royalty","type":"uint16"},{"internalType":"bool","name":"_isNSFW","type":"bool"},{"internalType":"bool","name":"_payingInBrush","type":"bool"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintFee","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"officialNFT","outputs":[{"internalType":"contract PaintSwapOfficialNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"officialNFTDiscount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paintRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paintSwapMarketplaceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_marketplace","type":"address"}],"name":"removeWhitelistedMarketplace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"royalties","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint16","name":"fee","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dev","type":"address"}],"name":"setDevAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_brush","type":"address"},{"internalType":"uint128","name":"_mintFee","type":"uint128"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintAmount","type":"uint256"}],"name":"setMaxMintAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxRoyalty","type":"uint16"}],"name":"setMaxRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_officialNFT","type":"address"}],"name":"setOfficialNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_discount","type":"uint128"}],"name":"setOfficialNFTFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wftm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedMarketplaces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFTM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526005600c556103e8600d55600e805461ffff191660011790553480156200002a57600080fd5b5060405162003f2538038062003f258339810160408190526200004d916200022c565b60408051602081019091526000815262000067816200016d565b50600380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600160045560408051808201909152600780825266697066733a2f2f60c81b6020909201918252620000e09160059162000186565b50600780546001600160a01b039687166001600160a01b03199182161790915560088054958716958216959095179094557802b5e3af16b1880000000000000000000000000000000000326009559184166000908152601360205260409020805460ff19166001179055601180549185169184169190911790556012805491909316911617905562000302565b80516200018290600290602084019062000186565b5050565b8280546200019490620002ac565b90600052602060002090601f016020900481019282620001b8576000855562000203565b82601f10620001d357805160ff191683800117855562000203565b8280016001018555821562000203579182015b8281111562000203578251825591602001919060010190620001e6565b506200021192915062000215565b5090565b5b8082111562000211576000815560010162000216565b600080600080600060a086880312156200024557600080fd5b85516200025281620002e9565b60208701519095506200026581620002e9565b60408701519094506200027881620002e9565b60608701519093506200028b81620002e9565b60808701519092506200029e81620002e9565b809150509295509295909350565b600181811c90821680620002c157607f821691505b60208210811415620002e357634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0381168114620002ff57600080fd5b50565b613c1380620003126000396000f3fe6080604052600436106102745760003560e01c80638575e88f11610149578063d0d41fe1116100c6578063f0c1b7a51161008a578063f4f45b4611610064578063f4f45b46146107fd578063f84ddf0b1461081d578063fb79041e1461083257600080fd5b8063f0c1b7a51461079d578063f242432a146107bd578063f2fde38b146107dd57600080fd5b8063d0d41fe1146106f3578063e868200e14610713578063e985e9c514610733578063eddd12e214610753578063eec97e691461076d57600080fd5b8063b390c0ab1161010d578063b390c0ab14610661578063b919a8b214610681578063bc687c1d146106a1578063c0d78655146106c0578063c10447b9146106e057600080fd5b80638575e88f146105c35780638da5cb5b146105e357806391cca3db14610601578063a22cb46514610621578063ab87fa2b1461064157600080fd5b80632b792bac116101f25780635ff478c8116101b657806375933e471161019057806375933e471461052b57806378acea1e1461053e5780637f77f5741461055e57600080fd5b80635ff478c8146104e0578063674a12c714610500578063715018a61461051657600080fd5b80632b792bac146104265780632eb2c2d6146104465780634ac2a647146104665780634cd68e331461049e5780634e1273f4146104b357600080fd5b80630e89341c116102395780630e89341c1461035d57806313966db51461038a57806320cbe8ae146103b1578063239c70ae146103d15780632a55205a146103e757600080fd5b8062fdd58e1461028057806301ffc9a7146102b3578063088a4ed0146102e35780630a785cd6146103055780630e2380691461033d57600080fd5b3661027b57005b600080fd5b34801561028c57600080fd5b506102a061029b366004613479565b610852565b6040519081526020015b60405180910390f35b3480156102bf57600080fd5b506102d36102ce366004613543565b6108ec565b60405190151581526020016102aa565b3480156102ef57600080fd5b506103036102fe3660046135e8565b610911565b005b34801561031157600080fd5b50600954610325906001600160801b031681565b6040516001600160801b0390911681526020016102aa565b34801561034957600080fd5b506103036103583660046135cd565b610940565b34801561036957600080fd5b5061037d6103783660046135e8565b6109bb565b6040516102aa91906138d8565b34801561039657600080fd5b5060095461032590600160801b90046001600160801b031681565b3480156103bd57600080fd5b506103036103cc366004613509565b610ae8565b3480156103dd57600080fd5b506102a0600c5481565b3480156103f357600080fd5b5061040761040236600461361a565b610b2c565b604080516001600160a01b0390931683526020830191909152016102aa565b34801561043257600080fd5b506103036104413660046130e8565b610b83565b34801561045257600080fd5b50610303610461366004613267565b610bd1565b34801561047257600080fd5b50600754610486906001600160a01b031681565b6040516001600160a01b0390911681526020016102aa565b3480156104aa57600080fd5b50610303610efd565b3480156104bf57600080fd5b506104d36104ce3660046134a5565b610f99565b6040516102aa9190613897565b3480156104ec57600080fd5b50600854610486906001600160a01b031681565b34801561050c57600080fd5b506102a0600d5481565b34801561052257600080fd5b506103036110c3565b61030361053936600461313e565b611137565b34801561054a57600080fd5b50610303610559366004613509565b611828565b34801561056a57600080fd5b506105a16105793660046135e8565b6010602052600090815260409020546001600160a01b03811690600160a01b900461ffff1682565b604080516001600160a01b03909316835261ffff9091166020830152016102aa565b3480156105cf57600080fd5b506103036105de3660046130e8565b611865565b3480156105ef57600080fd5b506003546001600160a01b0316610486565b34801561060d57600080fd5b50600a54610486906001600160a01b031681565b34801561062d57600080fd5b5061030361063c36600461344b565b6118b1565b34801561064d57600080fd5b5061030361065c3660046130e8565b611988565b34801561066d57600080fd5b5061030361067c36600461361a565b611a46565b34801561068d57600080fd5b5061030361069c3660046135b2565b611a6b565b3480156106ad57600080fd5b50600e546102d390610100900460ff1681565b3480156106cc57600080fd5b506103036106db3660046130e8565b611b29565b6103036106ee366004613315565b611b75565b3480156106ff57600080fd5b5061030361070e3660046130e8565b61211b565b34801561071f57600080fd5b50601154610486906001600160a01b031681565b34801561073f57600080fd5b506102d361074e366004613105565b612167565b34801561075f57600080fd5b50600e546102d39060ff1681565b34801561077957600080fd5b506102d36107883660046130e8565b60136020526000908152604090205460ff1681565b3480156107a957600080fd5b50600b54610486906001600160a01b031681565b3480156107c957600080fd5b506103036107d83660046133e2565b6121c1565b3480156107e957600080fd5b506103036107f83660046130e8565b6123f2565b34801561080957600080fd5b50601254610486906001600160a01b031681565b34801561082957600080fd5b506102a06124dd565b34801561083e57600080fd5b5061030361084d36600461357d565b6124ed565b60006001600160a01b0383166108c35760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b0319821663152a902d60e11b14806108e657506108e682612558565b6003546001600160a01b0316331461093b5760405162461bcd60e51b81526004016108ba906138eb565b600c55565b6003546001600160a01b0316331461096a5760405162461bcd60e51b81526004016108ba906138eb565b6105dc8161ffff16106109b25760405162461bcd60e51b815260206004820152601060248201526f0a4def2c2d8e8f240e8dede40d0d2ced60831b60448201526064016108ba565b61ffff16600d55565b60606109c6826125a8565b6109cf57600080fd5b600580546109dc90613a23565b15159050610a82576000828152600f6020526040902080546109fd90613a23565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2990613a23565b8015610a765780601f10610a4b57610100808354040283529160200191610a76565b820191906000526020600020905b815481529060010190602001808311610a5957829003601f168201915b50505050509050919050565b6000828152600f602052604081208054610a9b90613a23565b90501115610adf576005600f6000848152602001908152602001600020604051602001610ac992919061375e565b6040516020818303038152906040529050919050565b6108e6826125ca565b6003546001600160a01b03163314610b125760405162461bcd60e51b81526004016108ba906138eb565b600e80549115156101000261ff0019909216919091179055565b6000828152601060205260408120548190819061271090610b5890600160a01b900461ffff16866139c5565b610b629190613982565b600095865260106020526040909520546001600160a01b0316959350505050565b6003546001600160a01b03163314610bad5760405162461bcd60e51b81526004016108ba906138eb565b6001600160a01b03166000908152601360205260409020805460ff19166001179055565b8151835114610c335760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108ba565b6001600160a01b038416610c975760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ba565b6001600160a01b038516331480610cb35750610cb38533612167565b610d1a5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016108ba565b3360005b8451811015610e8f576000858281518110610d3b57610d3b613ad2565b602002602001015190506000858381518110610d5957610d59613ad2565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015610dec5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ba565b610df68282613a0c565b60008085815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055508160008085815260200190815260200160002060008b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610e749190613944565b9250508190555050505080610e8890613a8b565b9050610d1e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610edf9291906138aa565b60405180910390a4610ef58187878787876125d9565b505050505050565b600a546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610f4a576040519150601f19603f3d011682016040523d82523d6000602084013e610f4f565b606091505b5050905080610f965760405162461bcd60e51b815260206004820152601360248201527211951357d514905394d1915497d19052531151606a1b60448201526064016108ba565b50565b60608151835114610ffe5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108ba565b6000835167ffffffffffffffff81111561101a5761101a613ae8565b604051908082528060200260200182016040528015611043578160200160208202803683370190505b50905060005b84518110156110bb5761108e85828151811061106757611067613ad2565b602002602001015185838151811061108157611081613ad2565b6020026020010151610852565b8282815181106110a0576110a0613ad2565b60209081029190910101526110b481613a8b565b9050611049565b509392505050565b6003546001600160a01b031633146110ed5760405162461bcd60e51b81526004016108ba906138eb565b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6002600454141561118a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108ba565b60026004556001600160a01b0389166111a257600080fd5b6001600160a01b0388166111b557600080fd5b85518751146111c357600080fd5b84518651146111d157600080fd5b82518551146111df57600080fd5b83518351146111ed57600080fd5b600e5460ff166111fc57600080fd5b600e54610100900460ff1661121057600080fd5b6009546001600160801b03600160801b909104166112366003546001600160a01b031690565b6001600160a01b0316336001600160a01b0316141561125757506000611325565b6008546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561129b57600080fd5b505afa1580156112af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d39190613601565b1115611325576009546064906112fb906001600160801b03600160801b820481169116613996565b611305919061395c565b6009546113229190600160801b90046001600160801b03166139e4565b90505b6001600160801b038116156115ef5760008751826001600160801b031661134c91906139c5565b90508361155d5760125483516001600160a01b0390911690849060009061137557611375613ad2565b60200260200101516001600160a01b0316146113ca5760405162461bcd60e51b815260206004820152601460248201527346697273742073686f756c64206265207766746d60601b60448201526064016108ba565b60075483516001600160a01b039091169084906113e990600190613a0c565b815181106113f9576113f9613ad2565b60200260200101516001600160a01b03161461144d5760405162461bcd60e51b815260206004820152601360248201527208adcc840e6d0deead8c840c4ca40c4e4eae6d606b1b60448201526064016108ba565b6011546040516304e4874760e11b8152730c1e5af693890fea56394c9d78d1b9171ae3b342916309c90e8e91611497916001600160a01b0316908590349033908a9060040161381c565b60006040518083038186803b1580156114af57600080fd5b505af41580156114c3573d6000803e3d6000fd5b5050600754600a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526001600160801b03871660248201529116925063a9059cbb9150604401602060405180830381600087803b15801561151f57600080fd5b505af1158015611533573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115579190613526565b506115ed565b600754600a546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018490529116906323b872dd90606401602060405180830381600087803b1580156115b357600080fd5b505af11580156115c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115eb9190613526565b505b505b60005b88518110156117fb57611609600680546001019055565b600061161460065490565b9050808a838151811061162957611629613ad2565b6020026020010151146116715760405162461bcd60e51b815260206004820152601060248201526f092c8e640c8de40dcdee840dac2e8c6d60831b60448201526064016108ba565b87828151811061168357611683613ad2565b6020026020010151600f600083815260200190815260200160002090805190602001906116b1929190612d2d565b507f068aeaee087adfe5eee212636146e304714a59279410457117b6029d63a037358b828885815181106116e7576116e7613ad2565b602002602001015160405161171c939291906001600160a01b0393909316835260208301919091521515604082015260600190565b60405180910390a1600d5487838151811061173957611739613ad2565b602002602001015161ffff1611156117895760405162461bcd60e51b81526020600482015260136024820152720a4def2c2d8e8f240d2e640e8dede40d0d2ced606b1b60448201526064016108ba565b600082815260106020526040902080546001600160a01b0319166001600160a01b038e1617815587518890849081106117c4576117c4613ad2565b6020908102919091010151815461ffff909116600160a01b0261ffff60a01b19909116179055506117f481613a8b565b90506115f2565b506118178989896040518060200160405280600081525061278e565b505060016004555050505050505050565b6003546001600160a01b031633146118525760405162461bcd60e51b81526004016108ba906138eb565b600e805460ff1916911515919091179055565b6003546001600160a01b0316331461188f5760405162461bcd60e51b81526004016108ba906138eb565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b038316141561191c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108ba565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6003546001600160a01b031633146119b25760405162461bcd60e51b81526004016108ba906138eb565b6001600160a01b03811660009081526013602052604090205460ff16611a255760405162461bcd60e51b815260206004820152602260248201527f54686973206d61726b6574706c6163652069736e27742077686974656c697374604482015261195960f21b60648201526084016108ba565b6001600160a01b03166000908152601360205260409020805460ff19169055565b80611a513384610852565b1015611a5c57600080fd5b611a67338383612954565b5050565b6003546001600160a01b03163314611a955760405162461bcd60e51b81526004016108ba906138eb565b6064816001600160801b03161115611afe5760405162461bcd60e51b815260206004820152602660248201527f446973636f756e742073686f756c6420626520612070657263656e746167652c604482015265020302d3130360d41b60648201526084016108ba565b600980546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b6003546001600160a01b03163314611b535760405162461bcd60e51b81526004016108ba906138eb565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b60026004541415611bc85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108ba565b60026004556001600160a01b038816611be057600080fd5b6001600160a01b038716611bf357600080fd5b600e5460ff16611c0257600080fd5b600d548461ffff161115611c1557600080fd5b8451611c555760405162461bcd60e51b815260206004820152600f60248201526e537472696e6720697320656d70747960881b60448201526064016108ba565b6009546001600160801b03600160801b90910416611c7b6003546001600160a01b031690565b6001600160a01b0316336001600160a01b03161415611c9c57506000611d6a565b6008546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015611ce057600080fd5b505afa158015611cf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d189190613601565b1115611d6a57600954606490611d40906001600160801b03600160801b820481169116613996565b611d4a919061395c565b600954611d679190600160801b90046001600160801b03166139e4565b90505b6001600160801b038116156120205782611f885760125482516001600160a01b03909116908390600090611da057611da0613ad2565b60200260200101516001600160a01b031614611df55760405162461bcd60e51b815260206004820152601460248201527346697273742073686f756c64206265207766746d60601b60448201526064016108ba565b60075482516001600160a01b03909116908390611e1490600190613a0c565b81518110611e2457611e24613ad2565b60200260200101516001600160a01b031614611e785760405162461bcd60e51b815260206004820152601360248201527208adcc840e6d0deead8c840c4ca40c4e4eae6d606b1b60448201526064016108ba565b6011546040516304e4874760e11b8152730c1e5af693890fea56394c9d78d1b9171ae3b342916309c90e8e91611ec2916001600160a01b031690859034903390899060040161381c565b60006040518083038186803b158015611eda57600080fd5b505af4158015611eee573d6000803e3d6000fd5b5050600754600a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526001600160801b03861660248201529116925063a9059cbb9150604401602060405180830381600087803b158015611f4a57600080fd5b505af1158015611f5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f829190613526565b50612020565b600754600a546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526001600160801b03841660448201529116906323b872dd90606401602060405180830381600087803b158015611fe657600080fd5b505af1158015611ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201e9190613526565b505b61202e600680546001019055565b600061203960065490565b905061205689828a60405180602001604052806000815250612ad6565b6000818152600f602090815260409091208851612075928a0190612d2d565b50604080516001600160a01b038b168152602081018390528615158183015290517f068aeaee087adfe5eee212636146e304714a59279410457117b6029d63a037359181900360600190a16000908152601060205260409020805461ffff909616600160a01b0275ffffffffffffffffffffffffffffffffffffffffffff199096166001600160a01b03909a169990991794909417909755505060016004555050505050565b6003546001600160a01b031633146121455760405162461bcd60e51b81526004016108ba906138eb565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03811660009081526013602052604081205460ff1615612190575060016108e6565b6001600160a01b0380841660009081526001602090815260408083209386168352929052205460ff165b9392505050565b6001600160a01b0384166122255760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ba565b6001600160a01b03851633148061224157506122418533612167565b61229f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108ba565b336122bf8187876122af88612bd7565b6122b888612bd7565b5050505050565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156123435760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ba565b61234d8482613a0c565b6000868152602081815260408083206001600160a01b038c81168552925280832093909355881681529081208054869290612389908490613944565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46123e9828888888888612c22565b50505050505050565b6003546001600160a01b0316331461241c5760405162461bcd60e51b81526004016108ba906138eb565b6001600160a01b0381166124815760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108ba565b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006124e860065490565b905090565b6003546001600160a01b031633146125175760405162461bcd60e51b81526004016108ba906138eb565b600780546001600160a01b039093166001600160a01b031990931692909217909155600980546001600160801b03928316600160801b029216919091179055565b60006001600160e01b03198216636cdb3d1360e11b148061258957506001600160e01b031982166303a24d0760e21b145b806108e657506301ffc9a760e01b6001600160e01b03198316146108e6565b6000818152600f6020526040812080546125c190613a23565b15159392505050565b6060600280546109fd90613a23565b6001600160a01b0384163b15610ef55760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061261d908990899088908890889060040161377b565b602060405180830381600087803b15801561263757600080fd5b505af1925050508015612667575060408051601f3d908101601f1916820190925261266491810190613560565b60015b61271d57612673613afe565b806308c379a014156126ad5750612688613b1a565b8061269357506126af565b8060405162461bcd60e51b81526004016108ba91906138d8565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016108ba565b6001600160e01b0319811663bc197c8160e01b146123e95760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ba565b6001600160a01b0384166127ee5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108ba565b81518351146128505760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108ba565b3360005b84518110156128ec5783818151811061286f5761286f613ad2565b602002602001015160008087848151811061288c5761288c613ad2565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546128d49190613944565b909155508190506128e481613a8b565b915050612854565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161293d9291906138aa565b60405180910390a46122b8816000878787876125d9565b6001600160a01b0383166129b65760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108ba565b336129e6818560006129c787612bd7565b6129d087612bd7565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b038816845290915290205482811015612a635760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108ba565b612a6d8382613a0c565b6000858152602081815260408083206001600160a01b038a811680865291845282852095909555815189815292830188905292938616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b038416612b365760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108ba565b33612b47816000876122af88612bd7565b6000848152602081815260408083206001600160a01b038916845290915281208054859290612b77908490613944565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46122b881600087878787612c22565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612c1157612c11613ad2565b602090810291909101015292915050565b6001600160a01b0384163b15610ef55760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612c6690899089908890889088906004016137d9565b602060405180830381600087803b158015612c8057600080fd5b505af1925050508015612cb0575060408051601f3d908101601f19168201909252612cad91810190613560565b60015b612cbc57612673613afe565b6001600160e01b0319811663f23a6e6160e01b146123e95760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ba565b828054612d3990613a23565b90600052602060002090601f016020900481019282612d5b5760008555612da1565b82601f10612d7457805160ff1916838001178555612da1565b82800160010185558215612da1579182015b82811115612da1578251825591602001919060010190612d86565b50612dad929150612db1565b5090565b5b80821115612dad5760008155600101612db2565b8035612dd181613ba4565b919050565b600082601f830112612de757600080fd5b81356020612df482613920565b604051612e018282613a5e565b8381528281019150858301600585901b87018401881015612e2157600080fd5b60005b85811015612e49578135612e3781613ba4565b84529284019290840190600101612e24565b5090979650505050505050565b600082601f830112612e6757600080fd5b81356020612e7482613920565b604051612e818282613a5e565b8381528281019150858301600585901b87018401881015612ea157600080fd5b60005b85811015612e49578135612eb781613bb9565b84529284019290840190600101612ea4565b600082601f830112612eda57600080fd5b81356020612ee782613920565b604051612ef48282613a5e565b8381528281019150858301600585901b87018401881015612f1457600080fd5b6000805b86811015612f5757823567ffffffffffffffff811115612f36578283fd5b612f448b88838d010161304b565b8652509385019391850191600101612f18565b509198975050505050505050565b600082601f830112612f7657600080fd5b81356020612f8382613920565b604051612f908282613a5e565b8381528281019150858301600585901b87018401881015612fb057600080fd5b60005b85811015612e4957612fc4826130d6565b84529284019290840190600101612fb3565b600082601f830112612fe757600080fd5b81356020612ff482613920565b6040516130018282613a5e565b8381528281019150858301600585901b8701840188101561302157600080fd5b60005b85811015612e4957813584529284019290840190600101613024565b8035612dd181613bb9565b600082601f83011261305c57600080fd5b813567ffffffffffffffff81111561307657613076613ae8565b60405161308d601f8301601f191660200182613a5e565b8181528460208386010111156130a257600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160801b0381168114612dd157600080fd5b803561ffff81168114612dd157600080fd5b6000602082840312156130fa57600080fd5b81356121ba81613ba4565b6000806040838503121561311857600080fd5b823561312381613ba4565b9150602083013561313381613ba4565b809150509250929050565b60008060008060008060008060006101208a8c03121561315d57600080fd5b6131668a612dc6565b985061317460208b01612dc6565b975060408a013567ffffffffffffffff8082111561319157600080fd5b61319d8d838e01612fd6565b985060608c01359150808211156131b357600080fd5b6131bf8d838e01612fd6565b975060808c01359150808211156131d557600080fd5b6131e18d838e01612ec9565b965060a08c01359150808211156131f757600080fd5b6132038d838e01612f65565b955060c08c013591508082111561321957600080fd5b6132258d838e01612e56565b945061323360e08d01613040565b93506101008c013591508082111561324a57600080fd5b506132578c828d01612dd6565b9150509295985092959850929598565b600080600080600060a0868803121561327f57600080fd5b853561328a81613ba4565b9450602086013561329a81613ba4565b9350604086013567ffffffffffffffff808211156132b757600080fd5b6132c389838a01612fd6565b945060608801359150808211156132d957600080fd5b6132e589838a01612fd6565b935060808801359150808211156132fb57600080fd5b506133088882890161304b565b9150509295509295909350565b600080600080600080600080610100898b03121561333257600080fd5b883561333d81613ba4565b9750602089013561334d81613ba4565b965060408901359550606089013567ffffffffffffffff8082111561337157600080fd5b61337d8c838d0161304b565b965061338b60808c016130d6565b955060a08b0135915061339d82613bb9565b90935060c08a0135906133af82613bb9565b90925060e08a013590808211156133c557600080fd5b506133d28b828c01612dd6565b9150509295985092959890939650565b600080600080600060a086880312156133fa57600080fd5b853561340581613ba4565b9450602086013561341581613ba4565b93506040860135925060608601359150608086013567ffffffffffffffff81111561343f57600080fd5b6133088882890161304b565b6000806040838503121561345e57600080fd5b823561346981613ba4565b9150602083013561313381613bb9565b6000806040838503121561348c57600080fd5b823561349781613ba4565b946020939093013593505050565b600080604083850312156134b857600080fd5b823567ffffffffffffffff808211156134d057600080fd5b6134dc86838701612dd6565b935060208501359150808211156134f257600080fd5b506134ff85828601612fd6565b9150509250929050565b60006020828403121561351b57600080fd5b81356121ba81613bb9565b60006020828403121561353857600080fd5b81516121ba81613bb9565b60006020828403121561355557600080fd5b81356121ba81613bc7565b60006020828403121561357257600080fd5b81516121ba81613bc7565b6000806040838503121561359057600080fd5b823561359b81613ba4565b91506135a9602084016130bf565b90509250929050565b6000602082840312156135c457600080fd5b6121ba826130bf565b6000602082840312156135df57600080fd5b6121ba826130d6565b6000602082840312156135fa57600080fd5b5035919050565b60006020828403121561361357600080fd5b5051919050565b6000806040838503121561362d57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561366c57815187529582019590820190600101613650565b509495945050505050565b6000815180845260005b8181101561369d57602081850181015186830182015201613681565b818111156136af576000602083870101525b50601f01601f19169290920160200192915050565b8054600090600181811c90808316806136de57607f831692505b602080841082141561370057634e487b7160e01b600052602260045260246000fd5b818015613714576001811461372557613752565b60ff19861689528489019650613752565b60008881526020902060005b8681101561374a5781548b820152908501908301613731565b505084890196505b50505050505092915050565b600061377361376d83866136c4565b846136c4565b949350505050565b60006001600160a01b03808816835280871660208401525060a060408301526137a760a083018661363c565b82810360608401526137b9818661363c565b905082810360808401526137cd8185613677565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261381160a0830184613677565b979650505050505050565b600060a082016001600160a01b03808916845260206001600160801b03891681860152876040860152818716606086015260a0608086015282865180855260c087019150828801945060005b81811015613886578551851683529483019491830191600101613868565b50909b9a5050505050505050505050565b6020815260006121ba602083018461363c565b6040815260006138bd604083018561363c565b82810360208401526138cf818561363c565b95945050505050565b6020815260006121ba6020830184613677565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600067ffffffffffffffff82111561393a5761393a613ae8565b5060051b60200190565b6000821982111561395757613957613aa6565b500190565b60006001600160801b038084168061397657613976613abc565b92169190910492915050565b60008261399157613991613abc565b500490565b60006001600160801b03808316818516818304811182151516156139bc576139bc613aa6565b02949350505050565b60008160001904831182151516156139df576139df613aa6565b500290565b60006001600160801b0383811690831681811015613a0457613a04613aa6565b039392505050565b600082821015613a1e57613a1e613aa6565b500390565b600181811c90821680613a3757607f821691505b60208210811415613a5857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff81118282101715613a8457613a84613ae8565b6040525050565b6000600019821415613a9f57613a9f613aa6565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115613b175760046000803e5060005160e01c5b90565b600060443d1015613b285790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613b5857505050505090565b8285019150815181811115613b705750505050505090565b843d8701016020828501011115613b8a5750505050505090565b613b9960208286010187613a5e565b509095945050505050565b6001600160a01b0381168114610f9657600080fd5b8015158114610f9657600080fd5b6001600160e01b031981168114610f9657600080fdfea2646970667358221220329a26550b77047b1a44466589987371e695c4caeb440118a8f2e74cde47980d64736f6c6343000806003300000000000000000000000085dec8c4b2680793661bca91a8f129607571863d000000000000000000000000e74b987ee386c98bdaf1f9e32aef27f23f5df8a20000000000000000000000006125fd14b6790d5f66509b7aa53274c93dae70b9000000000000000000000000fd000ddcea75a2e23059881c3589f6425bff1abb00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

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

00000000000000000000000085dec8c4b2680793661bca91a8f129607571863d000000000000000000000000e74b987ee386c98bdaf1f9e32aef27f23f5df8a20000000000000000000000006125fd14b6790d5f66509b7aa53274c93dae70b9000000000000000000000000fd000ddcea75a2e23059881c3589f6425bff1abb00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

-----Decoded View---------------
Arg [0] : _brush (address): 0x85dec8c4b2680793661bca91a8f129607571863d
Arg [1] : _officialNFT (address): 0xe74b987ee386c98bdaf1f9e32aef27f23f5df8a2
Arg [2] : _paintSwapMarketplaceAddress (address): 0x6125fd14b6790d5f66509b7aa53274c93dae70b9
Arg [3] : _paintRouter (address): 0xfd000ddcea75a2e23059881c3589f6425bff1abb
Arg [4] : _wftm (address): 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000085dec8c4b2680793661bca91a8f129607571863d
Arg [1] : 000000000000000000000000e74b987ee386c98bdaf1f9e32aef27f23f5df8a2
Arg [2] : 0000000000000000000000006125fd14b6790d5f66509b7aa53274c93dae70b9
Arg [3] : 000000000000000000000000fd000ddcea75a2e23059881c3589f6425bff1abb
Arg [4] : 00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.