ETH Price: $3,367.06 (-3.42%)

Token

OKPC (OKPC)
 

Overview

Max Total Supply

8,192 OKPC

Holders

3,309

Market

Volume (24H)

0.0013 ETH

Min Price (24H)

$4.38 @ 0.001300 ETH

Max Price (24H)

$4.38 @ 0.001300 ETH
Filtered by Token Holder
chiefrocka.eth
Balance
1 OKPC
0xcc02f3d224E9e83C8287A94060A298BB7A22AC04
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

OKPC is an on chain toy that lets you create, collect and share artwork.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
OKPC

Compiler Version
v0.8.8+commit.dddeac2f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : OKPC.sol
/*
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░░░██████████░░░░░██████████░░░███████████████░░██████████░░░░░██████████░░░░░
  ░░░░░███░░░░░██░░░░░███░░░░░██░░░░░███░░░░░██░░░░░███░░░░░██░░░░░███░░░░░██░░░░░
  ░░░░░█████░░░██████████░░░░░██████████░░░░░██████████░░░░░██████████░░█████░░░░░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ████████████████████████████████████████████████████████████████████████████████
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░█████░░                                                            ░░░░░███░░
  ░░░░░░░░░░          ██████████                    ██████████          ░░░█████░░
  ░░░░░███░░        ██          ███               ██          ███       ░░░██░░░░░
  ░░░░░░░░░░     ███               ██          ███               ██     ░░░░░░░░░░
  ░░░█████░░     ███     █████     ██          ███     █████     ██     ░░░░░███░░
  ░░░░░░░░░░     ███       ███     ██   █████  ███       ███     ██     ░░░█████░░
  ░░░░░███░░     ███     █████     ██          ███     █████     ██     ░░░██░░░░░
  ░░░░░░░░░░     ███     █████     ██   █████  ███     █████     ██     ░░░░░░░░░░
  ░░░█████░░        ██          ███               ██          ███       ░░░██░░░░░
  ░░░░░░░░░░          ██████████        █████       ██████████          ░░░█████░░
  ░░░░░███░░                                                            ░░░░░███░░
  ░░░░░░░░░░     █████                                        █████     ░░░░░░░░░░
  ░░░█████░░     █████   █████  █████   █████  █████   █████  █████     ░░░██░░░░░
  ░░░░░░░░░░             █████  █████   █████     ██   █████            ░░░█████░░
  ░░░░░███░░                                                            ░░░░░███░░
  ░░░░░░░░░░                                                            ░░░░░░░░░░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ████████████████████████████████████████████████████████████████████████████████
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░░░████████░░███░░███░░████████░░████████░░░░░██░░░██░░░██░░░██░░░██░░░██░░░░░
  ░░░░░███░░███░░█████░░░░░████████░░███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░░░░░████████░░███░░███░░███░░░░░░░████████░░░░░██░░░██░░░██░░░██░░░██░░░██░░░░░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░


                       scotato.eth, shahruz.eth, cjpais.eth

*/

// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.8;

import {IOKPC} from './interfaces/IOKPC.sol';
import {ERC721A} from 'erc721a/contracts/ERC721A.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import {SSTORE2} from '@0xsequence/sstore2/contracts/SSTORE2.sol';
import {MerkleProof} from '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import {IERC2981} from '@openzeppelin/contracts/interfaces/IERC2981.sol';
import {IOKPCMetadata} from './interfaces/IOKPCMetadata.sol';

contract OKPC is IOKPC, ERC721A, IERC2981, Ownable, ReentrancyGuard {
  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   CONFIG                                   */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- MINTING -------------------------------- */
  uint256 public immutable MAX_SUPPLY;
  uint16 private immutable ARTISTS_RESERVED;
  uint16 private immutable TEAM_RESERVED;
  uint16 private immutable MAX_PER_PHASE;
  uint256 public immutable MINT_COST;
  /* --------------------------------- GALLERY -------------------------------- */
  uint8 private constant MAX_ART_PER_ARTIST = 8;
  uint8 private constant MIN_GALLERY_ART = 128;
  uint16 public constant MAX_COLLECT_PER_ART = 512;
  uint256 public constant ART_COLLECT_COST = 0.02 ether;
  /* -------------------------------- ROYALTIES ------------------------------- */
  uint256 private constant ROYALTY = 640;
  /* ------------------------------- CLOCK SPEED ------------------------------ */
  uint256 public clockSpeedMaxMultiplier = 24;

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   STORAGE                                  */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- MINTING -------------------------------- */
  Phase public mintingPhase;
  mapping(address => bool) public earlyBirdsMintClaimed;
  mapping(address => bool) public friendsMintClaimed;
  bytes32 private _artistsMerkleRoot;
  bytes32 private _earlyBirdsMerkleRoot;
  bytes32 private _friendsMerkleRoot;
  /* --------------------------------- GALLERY -------------------------------- */
  bool public galleryOpen;
  uint256 public galleryArtCounter;
  uint256 private maxGalleryArt = 512;
  mapping(uint256 => uint256) public galleryArtCollectedCount;
  mapping(uint256 => address) private _galleryArtData;
  mapping(address => uint256) public galleryArtistArtCount;
  mapping(uint256 => uint256) public activeArtForOKPC;
  mapping(uint256 => mapping(uint256 => bool)) public artCollectedByOKPC;
  mapping(uint256 => uint256) public artCountForOKPC;
  mapping(bytes32 => bool) private _galleryArtHashes;
  /* ---------------------------------- PAINT --------------------------------- */
  bool public paintOpen;
  mapping(uint256 => Art) public paintArtForOKPC;
  mapping(uint256 => Commission) public openCommissionForOKPC;
  mapping(address => bool) public denyList;
  /* -------------------------------- RENDERER -------------------------------- */
  address public metadataAddress;
  mapping(uint256 => bool) public useOffchainMetadata;
  /* -------------------------------- PAYMENTS -------------------------------- */
  uint256 public paymentBalanceOwner;
  mapping(address => uint256) public paymentBalanceArtist;
  /* ------------------------------- CLOCK SPEED ------------------------------ */
  mapping(uint256 => ClockSpeedXP) public clockSpeedData;
  /* ------------------------------- EXPANSIONS ------------------------------- */
  address public messagingAddress;
  address public communityAddress;
  address public marketplaceAddress;

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   EVENTS                                   */
  /* -------------------------------------------------------------------------- */
  event hello();
  /* --------------------------------- MINTING -------------------------------- */
  event MintingPhaseStarted(Phase phase);
  /* --------------------------------- GALLERY -------------------------------- */
  event ArtChanged(uint256 pcId, uint256 artId);
  event GalleryOpenUpdated(bool open);
  event GalleryArtCreated(uint256 indexed artId, address artist);
  event GalleryArtCollected(uint256 pcId, uint256 artId);
  event GalleryArtSwapped(uint256 pcId1, uint256 pcId2);
  event GalleryArtTransferred(
    uint256 fromOKPCId,
    uint256 toOKPCId,
    uint256 artId
  );
  event GalleryMaxArtUpdated(uint256 maxGalleryArt);
  /* ---------------------------------- PAINT --------------------------------- */
  event PaintOpenUpdated(bool open);
  event PaintArtCreated(uint256 indexed pcId, address artist);
  event CommissionCreated(uint256 pcId, address artist, uint256 amount);
  event CommissionCompleted(uint256 pcId, address artist, uint256 amount);
  event CommissionCancelled(uint256 pcId);
  /* -------------------------------- RENDERER -------------------------------- */
  event MetadataAddressUpdated(address addr);
  /* -------------------------------- PAYMENTS -------------------------------- */
  event PaymentWithdrawnOwner(uint256 amount);
  event PaymentWithdrawnArtist(address artist, uint256 amount);
  event PaymentReceivedArtist(address artist, uint256 amount);
  event PaymentReceivedOwner(uint256 amount);
  /* ------------------------------- CLOCK SPEED ------------------------------ */
  event ClockSpeedMaxMultiplierUpdated(uint256 maxMultiplier);
  /* ------------------------------- EXPANSIONS ------------------------------- */
  event MessagingAddressUpdated(address messagingAddress);
  event CommunityAddressUpdated(address communityAddress);
  event MarketplaceAddressUpdated(address marketplaceAddress);

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   ERRORS                                   */
  /* -------------------------------------------------------------------------- */
  error NotOKPCOwner();
  error OKPCNotFound();
  error MerkleProofInvalid();
  error InvalidAddress();
  /* --------------------------------- MINTING -------------------------------- */
  error MintPhaseNotOpen();
  error MintTooManyOKPCs();
  error MintAlreadyClaimed();
  error MintMaxReached();
  error MintNotAuthorized();
  /* --------------------------------- GALLERY -------------------------------- */
  error GalleryNotOpen();
  error GalleryMinArtNotReached();
  error GalleryMaxArtReached();
  error GalleryArtNotFound();
  error GalleryArtAlreadyCollected();
  error GalleryArtNotCollected();
  error GalleryArtCollectedMaximumTimes();
  error GalleryArtCannotBeActive();
  error GalleryArtDuplicate();
  error GalleryArtLastCollected();
  /* ---------------------------------- PAINT --------------------------------- */
  error PaintArtDataInvalid();
  error PaintArtNotFound();
  error PaintNotOpen();
  error PaintDenyList();
  error PaintCommissionInvalid();
  error PaintNotCommissionedArtist();
  /* -------------------------------- PAYMENTS -------------------------------- */
  error PaymentAmountInvalid();
  error PaymentBalanceZero();
  error PaymentTransferFailed();
  /* ------------------------------- EXPANSIONS ------------------------------- */
  error NotCommunityAddress();
  error NotMarketplaceAddress();
  error NotOwnerOrCommunity();

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                  MODIFIERS                                 */
  /* -------------------------------------------------------------------------- */
  /// @notice Requires the caller to be the owner of the specified pcId.
  modifier onlyOwnerOf(uint256 pcId) {
    if (msg.sender != ownerOf(pcId)) revert NotOKPCOwner();
    _;
  }
  /* --------------------------------- MINTING -------------------------------- */
  /// @notice Requires the current total OKPC supply to be less than the max supply for the current phase.
  modifier onlyIfSupplyMintable() {
    if (
      _currentIndex >
      ARTISTS_RESERVED + TEAM_RESERVED + (uint256(mintingPhase) * MAX_PER_PHASE)
    ) revert MintMaxReached();
    _;
  }
  /// @notice Requires the specified minting phase be active.
  modifier onlyIfMintingPhaseIsSetTo(Phase phase) {
    if (mintingPhase != phase) revert MintPhaseNotOpen();
    _;
  }
  /// @notice Requires the specified minting phase be active or have been active before
  modifier onlyIfMintingPhaseIsSetToOrAfter(Phase minimumPhase) {
    if (mintingPhase < minimumPhase) revert MintPhaseNotOpen();
    _;
  }
  /// @notice Requires the a valid merkle proof for the specified merkle root.
  modifier onlyIfValidMerkleProof(bytes32 root, bytes32[] calldata proof) {
    if (
      !MerkleProof.verify(proof, root, keccak256(abi.encodePacked(msg.sender)))
    ) revert MerkleProofInvalid();
    _;
  }
  /// @notice Requires no earlier claims for the caller in the Early Birds mint.
  modifier onlyIfNotAlreadyClaimedEarlyBirds() {
    if (earlyBirdsMintClaimed[msg.sender]) revert MintAlreadyClaimed();
    _;
  }
  /// @notice Requires no earlier claims for the caller in the Friends mint.
  modifier onlyIfNotAlreadyClaimedFriends() {
    if (friendsMintClaimed[msg.sender]) revert MintAlreadyClaimed();
    _;
  }
  /* --------------------------------- GALLERY -------------------------------- */
  /// @notice Requires Gallery to be open.
  modifier onlyIfGalleryOpen() {
    if (!galleryOpen) revert GalleryNotOpen();
    _;
  }
  /// @notice Requires the artId corresponds to existing Gallery art.
  modifier onlyIfGalleryArtExists(uint256 artId) {
    if (artId > galleryArtCounter || artId == 0) revert GalleryArtNotFound();
    _;
  }
  /// @notice Requires the pcId to have artId in its collection already
  modifier onlyIfOKPCHasCollectedGalleryArt(uint256 pcId, uint256 artId) {
    if (!artCollectedByOKPC[pcId][artId]) revert GalleryArtNotCollected();
    _;
  }
  /// @notice Requires the minimum amount of Gallery art to be uploaded already.
  modifier onlyAfterMinimumGalleryArtUploaded() {
    if (galleryArtCounter < MIN_GALLERY_ART) revert GalleryMinArtNotReached();
    _;
  }
  /* ---------------------------------- PAINT --------------------------------- */
  /// @notice Requires Paint to be open.
  modifier onlyIfPaintOpen() {
    if (!paintOpen) revert PaintNotOpen();
    _;
  }
  /* -------------------------------- PAYMENTS -------------------------------- */
  /// @notice Requires msg.value be exactly the specified amount.
  modifier onlyIfPaymentAmountValid(uint256 value) {
    if (msg.value != value) revert PaymentAmountInvalid();
    _;
  }
  /* ------------------------------- EXPANSIONS ------------------------------- */
  /// @notice Requires the caller be the owner or community address.
  modifier onlyOwnerOrCommunity() {
    if (msg.sender != communityAddress && msg.sender != owner())
      revert NotOwnerOrCommunity();
    _;
  }
  /// @notice Requires the caller be the community address.
  modifier onlyCommunity() {
    if (msg.sender != communityAddress) revert NotCommunityAddress();
    _;
  }
  /// @notice Requires the caller be the marketplace address.
  modifier onlyMarketplace() {
    if (msg.sender != marketplaceAddress) revert NotMarketplaceAddress();
    _;
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                               INITIALIZATION                               */
  /* -------------------------------------------------------------------------- */
  constructor(
    uint16 artistsReserved,
    uint16 teamReserved,
    uint16 maxPerPhase,
    uint256 mintCost
  ) ERC721A('OKPC', 'OKPC') {
    ARTISTS_RESERVED = artistsReserved;
    TEAM_RESERVED = teamReserved;
    MAX_PER_PHASE = maxPerPhase;
    MAX_SUPPLY = ARTISTS_RESERVED + TEAM_RESERVED + (MAX_PER_PHASE * 3);
    MINT_COST = mintCost;

    emit hello();
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Allows owner to set a merkle root for Artists.
  /// @param newRoot The new merkle root to set.
  function setArtistsMerkleRoot(bytes32 newRoot) external onlyOwner {
    _artistsMerkleRoot = newRoot;
  }

  /// @notice Allows owner to set a merkle root for Early Birds.
  /// @param newRoot The new merkle root to set.
  function setEarlyBirdsMerkleRoot(bytes32 newRoot) external onlyOwner {
    _earlyBirdsMerkleRoot = newRoot;
  }

  /// @notice Allows owner to set a merkle root for Friends.
  /// @param newRoot The new merkle root to set.
  function setFriendsMerkleRoot(bytes32 newRoot) external onlyOwner {
    _friendsMerkleRoot = newRoot;
  }

  /// @notice Allows the owner to upload initial Gallery art before minting opens.
  /// @param data The data of the art to be uploaded for 128 art pieces
  function addInitialGalleryArt(bytes calldata data) external onlyOwner {
    if (galleryArtCounter > 0) revert GalleryMaxArtReached();
    if (data.length != uint256(MIN_GALLERY_ART) * 128)
      revert PaintArtDataInvalid();

    for (uint256 i; i < MIN_GALLERY_ART; i++) {
      uint256 artId = i + 1;

      (address artist, uint256 data1, uint256 data2, bytes16 title) = abi
        .decode(
          data[i * MIN_GALLERY_ART:artId * MIN_GALLERY_ART],
          (address, uint256, uint256, bytes16)
        );

      if (title[0] == bytes1(0x0)) revert PaintArtDataInvalid();
      if (_galleryArtHashes[keccak256(abi.encodePacked(data1, data2))])
        revert GalleryArtDuplicate();
      if (galleryArtistArtCount[artist] == MAX_ART_PER_ARTIST)
        revert GalleryMaxArtReached();

      unchecked {
        galleryArtistArtCount[artist]++;
      }
      _galleryArtHashes[keccak256(abi.encodePacked(data1, data2))] = true;

      emit GalleryArtCreated(artId, artist);
    }

    _galleryArtData[0] = SSTORE2.write(data);
    galleryArtCounter = MIN_GALLERY_ART;
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   MINTING                                  */
  /* -------------------------------------------------------------------------- */
  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Allows owner to mint 64 OKPCs to a list of 64 artist addresses.
  /// @param addr An array of 64 artist addresses.
  function mintArtists(address[64] calldata addr)
    external
    onlyOwner
    onlyAfterMinimumGalleryArtUploaded
    nonReentrant
  {
    if (_currentIndex > ARTISTS_RESERVED) revert MintMaxReached();
    for (uint16 i; i < 64; i++) {
      _collectIncludedGalleryArt(_currentIndex);
      _safeMint(addr[i], 1);
    }
  }

  /// @notice Allows owner to mint 64 OKPCs to a list of 4 team addresses.
  /// @param addr An array of 4 team addresses.
  function mintTeam(address[4] calldata addr)
    external
    onlyOwner
    onlyAfterMinimumGalleryArtUploaded
    nonReentrant
  {
    if (_currentIndex < ARTISTS_RESERVED) revert MintPhaseNotOpen();
    if (_currentIndex > ARTISTS_RESERVED + TEAM_RESERVED)
      revert MintMaxReached();
    for (uint16 i; i < 64; i++) {
      _collectIncludedGalleryArt(_currentIndex);
      _safeMint(addr[i % 4], 1);
    }
  }

  /* ------------------------------- EARLY BIRDS ------------------------------ */
  /// @notice Allows the owner to start the Early Birds minting phase.
  function startEarlyBirdsMint()
    external
    onlyOwner
    onlyAfterMinimumGalleryArtUploaded
    onlyIfMintingPhaseIsSetTo(Phase.INIT)
  {
    if (_currentIndex <= 512) revert MintPhaseNotOpen();
    mintingPhase = Phase.EARLY_BIRDS;
    emit MintingPhaseStarted(mintingPhase);
  }

  /// @notice Mint your OKPC if you're on the Early Birds list.
  /// @param merkleProof A Merkle proof of the caller's address in the Early Birds list.
  function mintEarlyBirds(bytes32[] calldata merkleProof)
    external
    payable
    onlyIfMintingPhaseIsSetToOrAfter(Phase.EARLY_BIRDS)
    onlyIfValidMerkleProof(_earlyBirdsMerkleRoot, merkleProof)
    onlyIfPaymentAmountValid(MINT_COST)
    onlyIfNotAlreadyClaimedEarlyBirds
    onlyIfSupplyMintable
    nonReentrant
  {
    earlyBirdsMintClaimed[msg.sender] = true;

    _collectIncludedGalleryArt(_currentIndex);

    addToOwnerBalance(MINT_COST - ART_COLLECT_COST);
    addToArtistBalance(
      getGalleryArt(_includedGalleryArtForOKPC(_currentIndex)).artist,
      ART_COLLECT_COST
    );

    _safeMint(msg.sender, 1);
  }

  /* --------------------------------- FRIENDS -------------------------------- */
  /// @notice Allows the owner to start the Friends minting phase.
  function startFriendsMint()
    external
    onlyOwner
    onlyIfMintingPhaseIsSetTo(Phase.EARLY_BIRDS)
  {
    mintingPhase = Phase.FRIENDS;
    emit MintingPhaseStarted(mintingPhase);
  }

  /// @notice Mint your OKPC if you're on the Friends list.
  /// @param merkleProof A Merkle proof of the caller's address in the Friends list.
  function mintFriends(bytes32[] calldata merkleProof)
    external
    payable
    onlyIfMintingPhaseIsSetToOrAfter(Phase.FRIENDS)
    onlyIfValidMerkleProof(_friendsMerkleRoot, merkleProof)
    onlyIfPaymentAmountValid(MINT_COST)
    onlyIfSupplyMintable
    onlyIfNotAlreadyClaimedFriends
    nonReentrant
  {
    friendsMintClaimed[msg.sender] = true;

    _collectIncludedGalleryArt(_currentIndex);

    addToOwnerBalance(MINT_COST - ART_COLLECT_COST);
    addToArtistBalance(
      getGalleryArt(_includedGalleryArtForOKPC(_currentIndex)).artist,
      ART_COLLECT_COST
    );

    _safeMint(msg.sender, 1);
  }

  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice Allows the owner to start the Public minting phase.
  function startPublicMint()
    external
    onlyOwner
    onlyIfMintingPhaseIsSetTo(Phase.FRIENDS)
  {
    mintingPhase = Phase.PUBLIC;
    emit MintingPhaseStarted(mintingPhase);
  }

  /// @notice Mint your OKPC.
  /// @param amount The number of OKPCs to mint. Accepts values between 1 and 8.
  function mint(uint256 amount)
    external
    payable
    onlyIfMintingPhaseIsSetTo(Phase.PUBLIC)
    onlyIfSupplyMintable
    onlyIfPaymentAmountValid(MINT_COST * amount)
    nonReentrant
  {
    if (amount > 8) revert MintTooManyOKPCs();
    if (tx.origin != msg.sender) revert MintNotAuthorized();

    addToOwnerBalance(amount * (MINT_COST - ART_COLLECT_COST));

    for (uint256 i; i < amount; i++) {
      _collectIncludedGalleryArt(_currentIndex + i);
      addToArtistBalance(
        getGalleryArt(_includedGalleryArtForOKPC(_currentIndex + i)).artist,
        ART_COLLECT_COST
      );
    }

    _safeMint(msg.sender, amount);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   GALLERY                                  */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice Returns data for the specified Gallery art.
  /// @param artId The artId to look for in the Gallery.
  function getGalleryArt(uint256 artId)
    public
    view
    onlyIfGalleryArtExists(artId)
    returns (Art memory)
  {
    if (artId <= MIN_GALLERY_ART) {
      uint256 artBucket = (artId - 1) / MIN_GALLERY_ART;
      uint256 artBucketOffset = (artId - 1) % MIN_GALLERY_ART;
      (address addr, uint256 data1, uint256 data2, bytes16 title) = abi.decode(
        SSTORE2.read(
          _galleryArtData[artBucket],
          artBucketOffset * 128,
          (artBucketOffset + 1) * 128
        ),
        (address, uint256, uint256, bytes16)
      );
      return Art(addr, title, data1, data2);
    } else {
      (address addr, uint256 data1, uint256 data2, bytes16 title) = abi.decode(
        SSTORE2.read(_galleryArtData[artId]),
        (address, uint256, uint256, bytes16)
      );
      return Art(addr, title, data1, data2);
    }
  }

  /* ------------------------------- OKPC OWNERS ------------------------------ */
  /// @notice Collect artwork from the Gallery on your OKPC.
  /// @param pcId The id of the OKPC to collect the gallery to.
  /// @param artId The id of the artwork you'd like to collect.
  /// @param makeActive Set to true to switch your OKPC to displaying this art.
  function collectArt(
    uint256 pcId,
    uint256 artId,
    bool makeActive
  )
    external
    payable
    onlyIfGalleryOpen
    onlyOwnerOf(pcId)
    onlyIfGalleryArtExists(artId)
  {
    address artist = getGalleryArt(artId).artist;
    if (msg.sender != artist && msg.value != ART_COLLECT_COST)
      revert PaymentAmountInvalid();
    else if (msg.sender == artist && msg.value > 0)
      revert PaymentAmountInvalid();

    if (msg.value > 0) addToArtistBalance(artist, msg.value);

    _collectGalleryArt(pcId, artId);

    if (makeActive) setGalleryArt(pcId, artId);
  }

  /// @notice Collect multiple Gallery artworks on your OKPC.
  /// @param pcId The id of the OKPC to collect to. You need to own the OKPC.
  /// @param artIds An array of ids for the art you'd like to collect.
  function collectArt(uint256 pcId, uint256[] calldata artIds)
    external
    payable
    onlyIfGalleryOpen
    onlyOwnerOf(pcId)
  {
    if (msg.value != ART_COLLECT_COST * artIds.length)
      revert PaymentAmountInvalid();

    for (uint256 i; i < artIds.length; i++) {
      if (artIds[i] > galleryArtCounter || artIds[i] == 0)
        revert GalleryArtNotFound();

      addToArtistBalance(getGalleryArt(artIds[i]).artist, ART_COLLECT_COST);

      _collectGalleryArt(pcId, artIds[i]);
    }
  }

  /// @notice Switch the active Gallery art on your OKPC.
  /// @param pcId The id of the OKPC to collect to. You need to own the OKPC.
  /// @param artId A id of the art you'd like to display. If your OKPC has custom art, you can display it by setting this to 0.
  function setGalleryArt(uint256 pcId, uint256 artId)
    public
    onlyOwnerOf(pcId)
    onlyIfOKPCHasCollectedGalleryArt(pcId, artId)
  {
    activeArtForOKPC[pcId] = artId;
    clockSpeedData[pcId].artLastChanged = block.timestamp;
    emit ArtChanged(pcId, artId);
  }

  /* --------------------------------- ARTISTS -------------------------------- */
  /// @notice Post new Gallery artwork if you're an OKPC artist.
  /// @param title The title of the artwork.
  /// @param data1 The first part of the art data to be stored.
  /// @param data1 The second part of the art data to be stored.
  /// @param merkleProof A Merkle proof of the caller's address in the Artists list.
  function addGalleryArt(
    bytes16 title,
    uint256 data1,
    uint256 data2,
    bytes32[] calldata merkleProof
  ) external onlyIfValidMerkleProof(_artistsMerkleRoot, merkleProof) {
    if (denyList[msg.sender]) revert PaintDenyList();
    if (galleryArtCounter == maxGalleryArt) revert GalleryMaxArtReached();
    if (title[0] == bytes1(0x0)) revert PaintArtDataInvalid();
    if (_galleryArtHashes[keccak256(abi.encodePacked(data1, data2))])
      revert GalleryArtDuplicate();
    if (galleryArtistArtCount[msg.sender] == MAX_ART_PER_ARTIST)
      revert GalleryMaxArtReached();

    unchecked {
      galleryArtistArtCount[msg.sender]++;
      galleryArtCounter++;
    }
    _galleryArtHashes[keccak256(abi.encodePacked(data1, data2))] = true;

    _galleryArtData[galleryArtCounter] = SSTORE2.write(
      abi.encode(msg.sender, data1, data2, title)
    );

    emit GalleryArtCreated(galleryArtCounter, msg.sender);
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Toggles the Gallery interactions on or off.
  function toggleGalleryOpen() external onlyOwner {
    galleryOpen = !galleryOpen;
    emit GalleryOpenUpdated(galleryOpen);
  }

  /// @notice Allows the owner to increase the size of the Gallery.
  /// @param newMaxGalleryArt The new maximum number of Gallery artworks. Must be greater than the previous amount.
  function increaseMaxGalleryArt(uint256 newMaxGalleryArt) external onlyOwner {
    if (maxGalleryArt >= newMaxGalleryArt) revert GalleryMaxArtReached();
    maxGalleryArt = newMaxGalleryArt;
    emit GalleryMaxArtUpdated(maxGalleryArt);
  }

  /// @notice Allows the owner or community to moderate Gallery artwork.
  /// @param artId The id of the Gallery artwork to moderate.
  /// @param title The title for the replacement art.
  /// @param data1 The first part of the art data to be stored.
  /// @param data2 The second part of the art data to be stored.
  /// @param artist The address of the artist of the replacement art.
  function moderateGalleryArt(
    uint256 artId,
    bytes16 title,
    uint256 data1,
    uint256 data2,
    address artist
  ) external onlyOwnerOrCommunity {
    if (artId <= 128) revert PaintArtDataInvalid();
    if (title[0] == bytes1(0x0)) revert PaintArtDataInvalid();

    Art memory art = getGalleryArt(artId);
    galleryArtistArtCount[art.artist]--;

    unchecked {
      galleryArtistArtCount[artist]++;
    }

    _galleryArtData[artId] = SSTORE2.write(
      abi.encode(artist, data1, data2, title)
    );

    emit GalleryArtCreated(galleryArtCounter, msg.sender);
  }

  /* -------------------------------- INTERNAL -------------------------------- */
  /// @notice Collects Gallery artwork to your OKPC.
  /// @param pcId The id of the OKPC to collect to.
  /// @param artId The id of the Gallery art you'd like to collect.
  function _collectGalleryArt(uint256 pcId, uint256 artId) internal {
    if (artCollectedByOKPC[pcId][artId]) revert GalleryArtAlreadyCollected();
    if (galleryArtCollectedCount[artId] == MAX_COLLECT_PER_ART)
      revert GalleryArtCollectedMaximumTimes();

    artCollectedByOKPC[pcId][artId] = true;

    unchecked {
      artCountForOKPC[pcId]++;
      galleryArtCollectedCount[artId]++;
    }

    emit GalleryArtCollected(pcId, artId);
  }

  /// @notice Determines the included Gallery artwork for an OKPC.
  /// @param pcId The id of the OKPC being minted.
  function _includedGalleryArtForOKPC(uint256 pcId)
    internal
    view
    returns (uint256)
  {
    return
      pcId <= 128
        ? pcId
        : (uint256(
          keccak256(
            abi.encodePacked(
              'OKPC',
              pcId,
              blockhash(block.number - 1),
              block.coinbase,
              block.difficulty,
              msg.sender
            )
          )
        ) % galleryArtCounter) + 1;
  }

  /// @notice Collects the included Gallery artwork for an OKPC.
  /// @param pcId The id of the OKPC being minted.
  function _collectIncludedGalleryArt(uint256 pcId) internal {
    uint256 artId = _includedGalleryArtForOKPC(pcId);

    artCountForOKPC[pcId] = 1;
    artCollectedByOKPC[pcId][artId] = true;
    emit GalleryArtCollected(pcId, artId);

    activeArtForOKPC[pcId] = artId;
    clockSpeedData[pcId].artLastChanged = block.timestamp;
    emit ArtChanged(pcId, artId);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                    PAINT                                   */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice Get the Paint art stored on an OKPC.
  /// @param pcId The id of the OKPC to look up.
  function getPaintArt(uint256 pcId) public view returns (Art memory) {
    if (paintArtForOKPC[pcId].artist == address(0)) revert PaintArtNotFound();
    return paintArtForOKPC[pcId];
  }

  /* ------------------------------- OKPC OWNERS ------------------------------ */
  /// @notice Displays stored Paint art on your OKPC.
  /// @param pcId The id of the OKPC to display. You'll need to own the OKPC.
  function setPaintArt(uint256 pcId) external onlyOwnerOf(pcId) {
    if (paintArtForOKPC[pcId].artist == address(0)) revert PaintArtNotFound();
    activeArtForOKPC[pcId] = 0;
    clockSpeedData[pcId].artLastChanged = block.timestamp;
    emit ArtChanged(pcId, 0);
  }

  /// @notice Stores and displays stored Paint art on your OKPC.
  /// @param pcId The id of the OKPC to store Paint art on. You'll need to own the OKPC.
  /// @param title The title of the Paint art.
  /// @param data1 The first part of the art data to be stored.
  /// @param data2 The second part of the art data to be stored.
  function setPaintArt(
    uint256 pcId,
    bytes16 title,
    uint256 data1,
    uint256 data2
  ) external onlyIfPaintOpen onlyOwnerOf(pcId) {
    _setPaintArt(pcId, title, msg.sender, data1, data2);
  }

  /// @notice Create a commission for another artist to use Paint on your OKPC.
  /// @param pcId The id of the OKPC to use. You'll need to own the OKPC.
  /// @param artist The address of the artist to create a commission for.
  function createCommission(uint256 pcId, address artist)
    external
    payable
    onlyOwnerOf(pcId)
    onlyIfPaintOpen
    nonReentrant
  {
    if (artist == address(0)) revert PaintCommissionInvalid();
    if (msg.sender == artist) revert PaintCommissionInvalid();

    if (openCommissionForOKPC[pcId].artist != address(0))
      cancelCommission(pcId);

    openCommissionForOKPC[pcId] = Commission(artist, msg.value);

    emit CommissionCreated(pcId, artist, msg.value);
  }

  /// @notice Cancels a commission
  /// @param pcId The id of the OKPC to cancel a commission on. You'll need to own the OKPC.
  function cancelCommission(uint256 pcId)
    public
    onlyOwnerOf(pcId)
    onlyIfPaintOpen
  {
    _cancelCommission(pcId);
  }

  /// @notice Cancels a commission. This may be called by the owner of the OKPC or when a token is being transferred.
  /// @param pcId The id of the OKPC to cancel a commission on.
  function _cancelCommission(uint256 pcId) internal nonReentrant {
    if (openCommissionForOKPC[pcId].artist == address(0))
      revert PaintCommissionInvalid();

    uint256 amount = openCommissionForOKPC[pcId].amount;
    delete openCommissionForOKPC[pcId];

    if (amount > 0) {
      (bool success, ) = ownerOf(pcId).call{value: amount}('');
      if (!success) revert PaymentTransferFailed();
    }

    emit CommissionCancelled(pcId);
  }

  /* --------------------------------- ARTISTS -------------------------------- */
  /// @notice Completes a commission.
  /// @param pcId The id of the OKPC to complete a commission for.
  /// @param title The title of the new art.
  /// @param data1 The first part of the art data to be stored.
  /// @param data2 The second part of the art data to be stored.
  function completeCommission(
    uint256 pcId,
    bytes16 title,
    uint256 data1,
    uint256 data2
  ) external onlyIfPaintOpen nonReentrant {
    if (msg.sender != openCommissionForOKPC[pcId].artist)
      revert PaintNotCommissionedArtist();

    _setPaintArt(pcId, title, msg.sender, data1, data2);

    uint256 amount = openCommissionForOKPC[pcId].amount;
    delete openCommissionForOKPC[pcId];
    if (amount > 0) {
      (bool success, ) = msg.sender.call{value: amount}('');
      if (!success) revert PaymentTransferFailed();
    }

    emit CommissionCompleted(pcId, msg.sender, amount);
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Toggles the Paint interactions on or off.
  function togglePaintOpen() external onlyOwner {
    paintOpen = !paintOpen;
    emit PaintOpenUpdated(paintOpen);
  }

  /// @notice Allows the owner to update the deny list status for an address.
  /// @param artist The address of the artist to update.
  /// @param deny Whether to deny the artist or not from submitting Art.
  function setDenyListStatus(address artist, bool deny) external onlyOwner {
    denyList[artist] = deny;
  }

  /// @notice Allows the owner or community to moderate Paint art and revert to collected Gallery art.
  /// @param pcId The OKPC containing the Paint art.
  /// @param artId The Gallery Art to revert to. This must already be owned by the OKPC.
  function moderatePaintArt(uint256 pcId, uint256 artId)
    external
    onlyOwnerOrCommunity
    onlyIfOKPCHasCollectedGalleryArt(pcId, artId)
  {
    if (getPaintArt(pcId).artist == address(0)) revert PaintArtNotFound();

    delete paintArtForOKPC[pcId];

    activeArtForOKPC[pcId] = artId;
    emit ArtChanged(pcId, artId);
  }

  /* -------------------------------- INTERNAL -------------------------------- */
  /// @notice Stores and displays Paint art on an OKPC.
  function _setPaintArt(
    uint256 pcId,
    bytes16 title,
    address artist,
    uint256 data1,
    uint256 data2
  ) internal {
    if (denyList[artist]) revert PaintDenyList();
    if (title[0] == bytes1(0x0)) revert PaintArtDataInvalid();
    if (_galleryArtHashes[keccak256(abi.encodePacked(data1, data2))])
      revert GalleryArtDuplicate();

    paintArtForOKPC[pcId].artist = artist;
    paintArtForOKPC[pcId].title = title;
    paintArtForOKPC[pcId].data1 = data1;
    paintArtForOKPC[pcId].data2 = data2;
    emit PaintArtCreated(pcId, artist);

    activeArtForOKPC[pcId] = 0;
    clockSpeedData[pcId].artLastChanged = block.timestamp;
    emit ArtChanged(pcId, 0);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                  RENDERER                                  */
  /* -------------------------------------------------------------------------- */
  /* ------------------------------- OKPC OWNERS ------------------------------ */
  /// @notice Toggles the off-chain renderer for your OKPC.
  /// @param pcId The OKPC to toggle.
  function switchOKPCRenderer(uint256 pcId) external onlyOwnerOf(pcId) {
    useOffchainMetadata[pcId] = !useOffchainMetadata[pcId];
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Updates the metadata address for OKPC.
  /// @param addr The new metadata address. Must conform to IOKPCMetadata.
  function setMetadataAddress(address addr) external onlyOwner {
    if (addr == address(0)) revert InvalidAddress();
    metadataAddress = addr;
    emit MetadataAddressUpdated(addr);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                  PAYMENTS                                  */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- ARTISTS -------------------------------- */
  /// @notice Sends you your full available balance if you're an OKPC artist.
  function withdrawArtistBalance() external nonReentrant {
    uint256 balance = paymentBalanceArtist[msg.sender];
    if (balance == 0) revert PaymentBalanceZero();
    paymentBalanceArtist[msg.sender] = 0;

    (bool success, ) = msg.sender.call{value: balance}('');
    if (!success) revert PaymentBalanceZero();

    emit PaymentWithdrawnArtist(msg.sender, balance);
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Sends you your full available balance if you're the OKPC.
  /// @param withdrawTo The address to send the balance to.
  function withdrawOwnerBalance(address withdrawTo)
    external
    onlyOwner
    nonReentrant
  {
    if (paymentBalanceOwner == 0) revert PaymentBalanceZero();
    uint256 balance = paymentBalanceOwner;
    paymentBalanceOwner = 0;

    (bool success, ) = withdrawTo.call{value: balance}('');
    if (!success) revert PaymentBalanceZero();

    emit PaymentWithdrawnOwner(balance);
  }

  /* -------------------------------- INTERNAL -------------------------------- */
  /// @notice Adds funds to the payment balance for the specified address.
  /// @param artist The address to add funds to.
  /// @param amount The amount to add to the balance.
  function addToArtistBalance(address artist, uint256 amount) internal {
    emit PaymentReceivedArtist(artist, amount);
    paymentBalanceArtist[artist] += amount;
  }

  /// @notice Adds funds to the payment balance for the owner.
  /// @param amount The amount to add to the balance.
  function addToOwnerBalance(uint256 amount) internal {
    emit PaymentReceivedOwner(amount);
    paymentBalanceOwner += amount;
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                  ROYALTIES                                 */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice EIP2981 royalty standard
  function royaltyInfo(uint256, uint256 salePrice)
    external
    view
    returns (address receiver, uint256 royaltyAmount)
  {
    return (address(this), (salePrice * ROYALTY) / 10000);
  }

  /// @notice Receive royalties
  receive() external payable {
    addToOwnerBalance(msg.value);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                 CLOCK SPEED                                */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice Returns the clockspeed for the specified OKPC.
  /// @param pcId The id of the OKPC to look up.
  function clockSpeed(uint256 pcId) public view returns (uint256) {
    uint256 lastBlock = clockSpeedData[pcId].lastSaveBlock;
    if (lastBlock == 0) {
      return 1;
    }
    uint256 delta = block.number - lastBlock;
    uint256 multiplier = delta / 200_000;
    if (multiplier > clockSpeedMaxMultiplier) {
      multiplier = clockSpeedMaxMultiplier;
    }
    uint256 total = clockSpeedData[pcId].savedSpeed +
      ((delta * (multiplier + 1)) / 10_000);
    if (total < 1) total = 1;
    return total;
  }

  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Allows the owner to update the maximum clockspeed multiplier.
  /// @param multiplier The new max clockspeed multiplier to set.
  function setClockSpeedMaxMultiplier(uint256 multiplier) external onlyOwner {
    clockSpeedMaxMultiplier = multiplier;
    emit ClockSpeedMaxMultiplierUpdated(multiplier);
  }

  /* -------------------------------- INTERNAL -------------------------------- */
  /// @notice Saves clockspeed data. Called before an OKPC is transferred.
  function _saveClockSpeed(uint256 pcId) internal {
    clockSpeedData[pcId].savedSpeed = clockSpeed(pcId);
    clockSpeedData[pcId].lastSaveBlock = block.number;
    unchecked {
      clockSpeedData[pcId].transferCount++;
    }
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                 EXPANSIONS                                 */
  /* -------------------------------------------------------------------------- */
  /* ---------------------------------- ADMIN --------------------------------- */
  /// @notice Allows the owner to update the Messaging address.
  /// @param addr The new Messaging address.
  function setMessagingAddress(address addr) external onlyOwner {
    if (addr == address(0)) revert InvalidAddress();
    messagingAddress = addr;
    emit MessagingAddressUpdated(addr);
  }

  /// @notice Allows the owner to update the Community address.
  /// @param addr The new Community address.
  function setCommunityAddress(address addr) external onlyOwner {
    if (addr == address(0)) revert InvalidAddress();
    communityAddress = addr;
    emit CommunityAddressUpdated(addr);
  }

  /// @notice Allows the owner to update the Marketplace address.
  /// @param addr The new Marketplace address.
  function setMarketplaceAddress(address addr) external onlyOwner {
    if (addr == address(0)) revert InvalidAddress();
    marketplaceAddress = addr;
    emit MarketplaceAddressUpdated(addr);
  }

  /* ------------------------------- MARKETPLACE ------------------------------ */
  /// @notice Allows the Marketplace contract to transfer art between OKPCs.
  /// @param fromOKPCId The id of the OKPC to transfer from.
  /// @param toOKPCId The id of the OKPC to transfer to.
  /// @param artId The id of the Gallery artwork to transfer.
  function transferArt(
    uint256 fromOKPCId,
    uint256 toOKPCId,
    uint256 artId
  ) external onlyMarketplace onlyIfGalleryArtExists(artId) {
    if (!artCollectedByOKPC[fromOKPCId][artId]) revert GalleryArtNotCollected();

    if (artCollectedByOKPC[toOKPCId][artId])
      revert GalleryArtAlreadyCollected();

    if (artCountForOKPC[fromOKPCId] == 1) revert GalleryArtLastCollected();

    if (activeArtForOKPC[fromOKPCId] == artId)
      revert GalleryArtCannotBeActive();

    artCollectedByOKPC[fromOKPCId][artId] = false;
    artCountForOKPC[fromOKPCId]--;

    artCollectedByOKPC[toOKPCId][artId] = true;
    unchecked {
      artCountForOKPC[toOKPCId]++;
    }
    emit GalleryArtTransferred(fromOKPCId, toOKPCId, artId);
  }

  /// @notice Allows the Marketplace contract to add funds to an artist's withdrawable balance.
  /// @param artist The address to add funds to.
  function addToArtistBalanceFromMarketplace(address artist)
    external
    payable
    onlyMarketplace
  {
    addToArtistBalance(artist, msg.value);
  }

  /// @notice Allows the Marketplace contract to add funds to the owner's withdrawable balance.
  function addToOwnerBalanceFromMarketplace() external payable onlyMarketplace {
    addToOwnerBalance(msg.value);
  }

  /* --------------------------------- ****** --------------------------------- */

  /* -------------------------------------------------------------------------- */
  /*                                   ERC721A                                  */
  /* -------------------------------------------------------------------------- */
  /* --------------------------------- PUBLIC --------------------------------- */
  /// @notice The standard ERC721 tokenURI function. Routes to the Metadata contract.
  function tokenURI(uint256 pcId) public view override returns (string memory) {
    if (!_exists(pcId)) revert OKPCNotFound();
    return IOKPCMetadata(metadataAddress).tokenURI(pcId);
  }

  /* -------------------------------- INTERNAL -------------------------------- */
  /// @notice ERC721A override to start tokenId's at 1 instead of 0.
  function _startTokenId() internal pure override returns (uint256) {
    return 1;
  }

  /// @notice Overrides _beforeTokenTransfers to update clockspeeds and clear any active commissions.
  function _beforeTokenTransfers(
    address,
    address,
    uint256 startTokenId,
    uint256 quantity
  ) internal override {
    for (uint256 i; i < quantity; i++) {
      uint256 pcId = startTokenId + i;
      _saveClockSpeed(pcId);
      if (openCommissionForOKPC[pcId].artist != address(0))
        _cancelCommission(pcId);
    }
  }

  /* --------------------------------- ****** --------------------------------- */
}

File 2 of 21 : IOKPC.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.8;

interface IOKPC {
  enum Phase {
    INIT,
    EARLY_BIRDS,
    FRIENDS,
    PUBLIC
  }
  struct Art {
    address artist;
    bytes16 title;
    uint256 data1;
    uint256 data2;
  }
  struct Commission {
    address artist;
    uint256 amount;
  }
  struct ClockSpeedXP {
    uint256 savedSpeed;
    uint256 lastSaveBlock;
    uint256 transferCount;
    uint256 artLastChanged;
  }

  function getPaintArt(uint256) external view returns (Art memory);

  function getGalleryArt(uint256) external view returns (Art memory);

  function activeArtForOKPC(uint256) external view returns (uint256);

  function useOffchainMetadata(uint256) external view returns (bool);

  function clockSpeed(uint256) external view returns (uint256);

  function artCountForOKPC(uint256) external view returns (uint256);
}

File 3 of 21 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error AuxQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

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

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @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 override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert MintedQueryForZeroAddress();
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert BurnedQueryForZeroAddress();
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        if (owner == address(0)) revert AuxQueryForZeroAddress();
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        if (owner == address(0)) revert AuxQueryForZeroAddress();
        _addressData[owner].aux = aux;
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr && curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant:
                    // There will always be an ownership that has an address and is not burned
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. 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 override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _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 {
        _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 {
        _transfer(from, to, tokenId);
        if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _startTokenId() <= tokenId && tokenId < _currentIndex &&
            !_ownerships[tokenId].burned;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (safe && to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex != end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex != end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            isApprovedForAll(prevOwnership.addr, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @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 {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[prevOwnership.addr].balance -= 1;
            _addressData[prevOwnership.addr].numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            _ownerships[tokenId].addr = prevOwnership.addr;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);
            _ownerships[tokenId].burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(prevOwnership.addr, address(0), tokenId);
        _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

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

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        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 TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 4 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

File 5 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 6 of 21 : SSTORE2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./utils/Bytecode.sol";

/**
  @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost.
  @author Agustin Aguilar <[email protected]>

  Readme: https://github.com/0xsequence/sstore2#readme
*/
library SSTORE2 {
  error WriteError();

  /**
    @notice Stores `_data` and returns `pointer` as key for later retrieval
    @dev The pointer is a contract address with `_data` as code
    @param _data to be written
    @return pointer Pointer to the written `_data`
  */
  function write(bytes memory _data) internal returns (address pointer) {
    // Append 00 to _data so contract can't be called
    // Build init code
    bytes memory code = Bytecode.creationCodeFor(
      abi.encodePacked(
        hex'00',
        _data
      )
    );

    // Deploy contract using create
    assembly { pointer := create(0, add(code, 32), mload(code)) }

    // Address MUST be non-zero
    if (pointer == address(0)) revert WriteError();
  }

  /**
    @notice Reads the contents of the `_pointer` code as data, skips the first byte 
    @dev The function is intended for reading pointers generated by `write`
    @param _pointer to be read
    @return data read from `_pointer` contract
  */
  function read(address _pointer) internal view returns (bytes memory) {
    return Bytecode.codeAt(_pointer, 1, type(uint256).max);
  }

  /**
    @notice Reads the contents of the `_pointer` code as data, skips the first byte 
    @dev The function is intended for reading pointers generated by `write`
    @param _pointer to be read
    @param _start number of bytes to skip
    @return data read from `_pointer` contract
  */
  function read(address _pointer, uint256 _start) internal view returns (bytes memory) {
    return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max);
  }

  /**
    @notice Reads the contents of the `_pointer` code as data, skips the first byte 
    @dev The function is intended for reading pointers generated by `write`
    @param _pointer to be read
    @param _start number of bytes to skip
    @param _end index before which to end extraction
    @return data read from `_pointer` contract
  */
  function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) {
    return Bytecode.codeAt(_pointer, _start + 1, _end + 1);
  }
}

File 7 of 21 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 8 of 21 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 9 of 21 : IOKPCMetadata.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.8;

import {IOKPC} from './IOKPC.sol';
import {IOKPCParts} from './IOKPCParts.sol';

interface IOKPCMetadata {
  error InvalidTokenID();
  error NotEnoughPixelData();

  struct Parts {
    IOKPCParts.Vector headband;
    IOKPCParts.Vector rightSpeaker;
    IOKPCParts.Vector leftSpeaker;
    IOKPCParts.Color color;
    string word;
  }

  function tokenURI(uint256 tokenId) external view returns (string memory);

  function renderArt(bytes memory art, uint256 colorIndex)
    external
    view
    returns (string memory);

  function getParts(uint256 tokenId) external view returns (Parts memory);

  function drawArt(bytes memory artData) external pure returns (string memory);
}

File 10 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 11 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

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 12 of 21 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

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 13 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

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

    /**
     * @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 14 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 16 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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


library Bytecode {
  error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end);

  /**
    @notice Generate a creation code that results on a contract with `_code` as bytecode
    @param _code The returning value of the resulting `creationCode`
    @return creationCode (constructor) for new contract
  */
  function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) {
    /*
      0x00    0x63         0x63XXXXXX  PUSH4 _code.length  size
      0x01    0x80         0x80        DUP1                size size
      0x02    0x60         0x600e      PUSH1 14            14 size size
      0x03    0x60         0x6000      PUSH1 00            0 14 size size
      0x04    0x39         0x39        CODECOPY            size
      0x05    0x60         0x6000      PUSH1 00            0 size
      0x06    0xf3         0xf3        RETURN
      <CODE>
    */

    return abi.encodePacked(
      hex"63",
      uint32(_code.length),
      hex"80_60_0E_60_00_39_60_00_F3",
      _code
    );
  }

  /**
    @notice Returns the size of the code on a given address
    @param _addr Address that may or may not contain code
    @return size of the code on the given `_addr`
  */
  function codeSize(address _addr) internal view returns (uint256 size) {
    assembly { size := extcodesize(_addr) }
  }

  /**
    @notice Returns the code of a given address
    @dev It will fail if `_end < _start`
    @param _addr Address that may or may not contain code
    @param _start number of bytes of code to skip on read
    @param _end index before which to end extraction
    @return oCode read from `_addr` deployed bytecode

    Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd
  */
  function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) {
    uint256 csize = codeSize(_addr);
    if (csize == 0) return bytes("");

    if (_start > csize) return bytes("");
    if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); 

    unchecked {
      uint256 reqSize = _end - _start;
      uint256 maxSize = csize - _start;

      uint256 size = maxSize < reqSize ? maxSize : reqSize;

      assembly {
        // allocate output byte array - this could also be done without assembly
        // by using o_code = new bytes(size)
        oCode := mload(0x40)
        // new "memory end" including padding
        mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f))))
        // store length in memory
        mstore(oCode, size)
        // actually retrieve the code, this needs assembly
        extcodecopy(_addr, add(oCode, 0x20), _start, size)
      }
    }
  }
}

File 20 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

File 21 of 21 : IOKPCParts.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.7;

interface IOKPCParts {
  // errors
  error IndexOutOfBounds(uint256 index, uint256 maxIndex);

  // structures
  struct Color {
    bytes6 light;
    bytes6 regular;
    bytes6 dark;
    string name;
  }

  struct Vector {
    string data;
    string name;
  }

  // functions
  function getColor(uint256 index) external view returns (Color memory);

  function getHeadband(uint256 index) external view returns (Vector memory);

  function getSpeaker(uint256 index) external view returns (Vector memory);

  function getWord(uint256 index) external view returns (string memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint16","name":"artistsReserved","type":"uint16"},{"internalType":"uint16","name":"teamReserved","type":"uint16"},{"internalType":"uint16","name":"maxPerPhase","type":"uint16"},{"internalType":"uint256","name":"mintCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"GalleryArtAlreadyCollected","type":"error"},{"inputs":[],"name":"GalleryArtCannotBeActive","type":"error"},{"inputs":[],"name":"GalleryArtCollectedMaximumTimes","type":"error"},{"inputs":[],"name":"GalleryArtDuplicate","type":"error"},{"inputs":[],"name":"GalleryArtLastCollected","type":"error"},{"inputs":[],"name":"GalleryArtNotCollected","type":"error"},{"inputs":[],"name":"GalleryArtNotFound","type":"error"},{"inputs":[],"name":"GalleryMaxArtReached","type":"error"},{"inputs":[],"name":"GalleryMinArtNotReached","type":"error"},{"inputs":[],"name":"GalleryNotOpen","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"_size","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"InvalidCodeAtRange","type":"error"},{"inputs":[],"name":"MerkleProofInvalid","type":"error"},{"inputs":[],"name":"MintAlreadyClaimed","type":"error"},{"inputs":[],"name":"MintMaxReached","type":"error"},{"inputs":[],"name":"MintNotAuthorized","type":"error"},{"inputs":[],"name":"MintPhaseNotOpen","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintTooManyOKPCs","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCommunityAddress","type":"error"},{"inputs":[],"name":"NotMarketplaceAddress","type":"error"},{"inputs":[],"name":"NotOKPCOwner","type":"error"},{"inputs":[],"name":"NotOwnerOrCommunity","type":"error"},{"inputs":[],"name":"OKPCNotFound","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"PaintArtDataInvalid","type":"error"},{"inputs":[],"name":"PaintArtNotFound","type":"error"},{"inputs":[],"name":"PaintCommissionInvalid","type":"error"},{"inputs":[],"name":"PaintDenyList","type":"error"},{"inputs":[],"name":"PaintNotCommissionedArtist","type":"error"},{"inputs":[],"name":"PaintNotOpen","type":"error"},{"inputs":[],"name":"PaymentAmountInvalid","type":"error"},{"inputs":[],"name":"PaymentBalanceZero","type":"error"},{"inputs":[],"name":"PaymentTransferFailed","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"WriteError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":false,"internalType":"uint256","name":"pcId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"artId","type":"uint256"}],"name":"ArtChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxMultiplier","type":"uint256"}],"name":"ClockSpeedMaxMultiplierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"CommissionCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pcId","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CommissionCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pcId","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CommissionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"communityAddress","type":"address"}],"name":"CommunityAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pcId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"artId","type":"uint256"}],"name":"GalleryArtCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"artId","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"}],"name":"GalleryArtCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pcId1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pcId2","type":"uint256"}],"name":"GalleryArtSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fromOKPCId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toOKPCId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"artId","type":"uint256"}],"name":"GalleryArtTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxGalleryArt","type":"uint256"}],"name":"GalleryMaxArtUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"open","type":"bool"}],"name":"GalleryOpenUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"marketplaceAddress","type":"address"}],"name":"MarketplaceAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"messagingAddress","type":"address"}],"name":"MessagingAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"MetadataAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IOKPC.Phase","name":"phase","type":"uint8"}],"name":"MintingPhaseStarted","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":"uint256","name":"pcId","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"}],"name":"PaintArtCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"open","type":"bool"}],"name":"PaintOpenUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceivedArtist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceivedOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentWithdrawnArtist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentWithdrawnOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"hello","type":"event"},{"inputs":[],"name":"ART_COLLECT_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_COLLECT_PER_ART","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeArtForOKPC","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"addGalleryArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"addInitialGalleryArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"artist","type":"address"}],"name":"addToArtistBalanceFromMarketplace","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"addToOwnerBalanceFromMarketplace","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"artCollectedByOKPC","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"artCountForOKPC","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"cancelCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"clockSpeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"clockSpeedData","outputs":[{"internalType":"uint256","name":"savedSpeed","type":"uint256"},{"internalType":"uint256","name":"lastSaveBlock","type":"uint256"},{"internalType":"uint256","name":"transferCount","type":"uint256"},{"internalType":"uint256","name":"artLastChanged","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clockSpeedMaxMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"uint256[]","name":"artIds","type":"uint256[]"}],"name":"collectArt","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"uint256","name":"artId","type":"uint256"},{"internalType":"bool","name":"makeActive","type":"bool"}],"name":"collectArt","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"communityAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"}],"name":"completeCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"address","name":"artist","type":"address"}],"name":"createCommission","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"denyList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"earlyBirdsMintClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"friendsMintClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"galleryArtCollectedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"galleryArtCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"galleryArtistArtCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"galleryOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"artId","type":"uint256"}],"name":"getGalleryArt","outputs":[{"components":[{"internalType":"address","name":"artist","type":"address"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"}],"internalType":"struct IOKPC.Art","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"getPaintArt","outputs":[{"components":[{"internalType":"address","name":"artist","type":"address"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"}],"internalType":"struct IOKPC.Art","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxGalleryArt","type":"uint256"}],"name":"increaseMaxGalleryArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketplaceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messagingAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[64]","name":"addr","type":"address[64]"}],"name":"mintArtists","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintEarlyBirds","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintFriends","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[4]","name":"addr","type":"address[4]"}],"name":"mintTeam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPhase","outputs":[{"internalType":"enum IOKPC.Phase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"artId","type":"uint256"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"},{"internalType":"address","name":"artist","type":"address"}],"name":"moderateGalleryArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"uint256","name":"artId","type":"uint256"}],"name":"moderatePaintArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"openCommissionForOKPC","outputs":[{"internalType":"address","name":"artist","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"paintArtForOKPC","outputs":[{"internalType":"address","name":"artist","type":"address"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paintOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"paymentBalanceArtist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentBalanceOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","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":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","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":"bytes32","name":"newRoot","type":"bytes32"}],"name":"setArtistsMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"multiplier","type":"uint256"}],"name":"setClockSpeedMaxMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setCommunityAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"artist","type":"address"},{"internalType":"bool","name":"deny","type":"bool"}],"name":"setDenyListStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"setEarlyBirdsMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"setFriendsMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"uint256","name":"artId","type":"uint256"}],"name":"setGalleryArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setMarketplaceAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setMessagingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setMetadataAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"setPaintArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"},{"internalType":"bytes16","name":"title","type":"bytes16"},{"internalType":"uint256","name":"data1","type":"uint256"},{"internalType":"uint256","name":"data2","type":"uint256"}],"name":"setPaintArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startEarlyBirdsMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startFriendsMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"switchOKPCRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleGalleryOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePaintOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pcId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromOKPCId","type":"uint256"},{"internalType":"uint256","name":"toOKPCId","type":"uint256"},{"internalType":"uint256","name":"artId","type":"uint256"}],"name":"transferArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"useOffchainMetadata","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawArtistBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"withdrawTo","type":"address"}],"name":"withdrawOwnerBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101206040526018600a556102006013553480156200001d57600080fd5b5060405162005cff38038062005cff833981016040819052620000409162000254565b6040805180820182526004808252634f4b504360e01b6020808401828152855180870190965292855284015281519192916200007f9160029162000196565b5080516200009590600390602084019062000196565b5050600160005550620000a83362000144565b60016009556001600160f01b031960f085811b821660a05284811b821660c05283901b1660e052620000e061ffff83166003620002bc565b60c05160f01c60a05160f01c620000f89190620002e9565b620001049190620002e9565b61ffff166080526101008190526040517f19ff1d210e06a53ee50e5bad25fa509a6b00ed395695f7d9b82b68155d9e106590600090a1505050506200034f565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001a49062000312565b90600052602060002090601f016020900481019282620001c8576000855562000213565b82601f10620001e357805160ff191683800117855562000213565b8280016001018555821562000213579182015b8281111562000213578251825591602001919060010190620001f6565b506200022192915062000225565b5090565b5b8082111562000221576000815560010162000226565b805161ffff811681146200024f57600080fd5b919050565b600080600080608085870312156200026b57600080fd5b62000276856200023c565b935062000286602086016200023c565b925062000296604086016200023c565b6060959095015193969295505050565b634e487b7160e01b600052601160045260246000fd5b600061ffff80831681851681830481118215151615620002e057620002e0620002a6565b02949350505050565b600061ffff808316818516808303821115620003095762000309620002a6565b01949350505050565b600181811c908216806200032757607f821691505b602082108114156200034957634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160f01c60c05160f01c60e05160f01c610100516158f96200040660003960008181610ec501528181612262015281816123ef01528181612d210152818161304d015261310b0152600081816122a901528181612d990152612f8e015260008181611baa015281816122ed01528181612ddd0152612fd2015260008181611a1701528181611b6601528181611bcb0152818161230e01528181612dfe0152612ff3015260006107ec01526158f96000f3fe6080604052600436106104b95760003560e01c80637ae8d5be1161026b578063af5f84271161014f578063d57fc41a116100c1578063e985e9c511610085578063e985e9c514610fda578063e9c3a1a314611023578063f0b5383714611063578063f2fde38b14611093578063f654a9c3146110b3578063f7ce4479146110d357600080fd5b8063d57fc41a14610f2a578063daa17f4914610f4a578063e17b25af14610f6a578063e4dad85014610f8a578063e6b21e7f14610fba57600080fd5b8063bcd1311c11610113578063bcd1311c14610e80578063c3b76ef514610ea0578063c662e48114610eb3578063c87b56dd14610ee7578063c970f20014610f07578063cc7ab11214610f0f57600080fd5b8063af5f842714610dd3578063b47cc55614610df3578063b75f7e5114610e13578063b7e507b414610e40578063b88d4fde14610e6057600080fd5b80638a142a8b116101e85780639601699a116101ac5780639601699a14610cde5780639eb2660c14610d40578063a0712d6814610d60578063a22cb46514610d73578063abf9b9fe14610d93578063af2d07c614610db357600080fd5b80638a142a8b14610c6a5780638d774da814610c7f5780638da5cb5b14610c95578063950d657e14610cb357806395d89b4114610cc957600080fd5b8063807071d01161022f578063807071d014610bf1578063851eae1614610c11578063861f47ff14610c2457806386e476dd14610c3757806389ef639914610c5757600080fd5b80637ae8d5be14610af75780637c1ede0214610b175780637e5354f014610b9b5780637e5ac09a14610bb55780637e6caaca14610bdc57600080fd5b80633d91b5ae1161039d57806354ba75511161030f5780636c8e80bc116102d35780636c8e80bc14610a4f5780636eb3500d14610a6457806370a0823114610a84578063715018a614610aa457806376c64c6214610ab957806377e18a0b14610ace57600080fd5b806354ba7551146109ba57806354e31078146109da5780635bde8223146109fa5780636352211e14610a0f57806367478a3514610a2f57600080fd5b806349af27c31161036157806349af27c3146108f85780634c483c1f146109255780634cc6028d146109455780634df186ec146109655780634dfe33ac146109925780634e5fff41146109a757600080fd5b80633d91b5ae1461084e5780633f79a9b814610861578063406821521461087b57806342520452146108ab57806342842e0e146108d857600080fd5b80631a19ae781161043657806323b872dd116103fa57806323b872dd1461075b578063285fa9141461077b5780632a55205a1461079b57806332cb6b0c146107da57806337efc8eb1461080e57806338e0ae4d1461082e57600080fd5b80631a19ae78146106b65780631a8b05d7146106d65780631e4c78871461070557806320eeb3221461071b578063210877e61461073b57600080fd5b806309d3c5c91161047d57806309d3c5c9146105b85780630cce60fd146105d85780630da0bedb1461063e578063139e60571461067957806318160ddd1461069957600080fd5b806301ffc9a7146104ce5780630458b6db1461050357806306fdde031461053e578063081812fc14610560578063095ea7b31461059857600080fd5b366104c9576104c7346110f3565b005b600080fd5b3480156104da57600080fd5b506104ee6104e9366004614e28565b611140565b60405190151581526020015b60405180910390f35b34801561050f57600080fd5b506104ee61051e366004614e45565b601860209081526000928352604080842090915290825290205460ff1681565b34801561054a57600080fd5b50610553611192565b6040516104fa9190614ebf565b34801561056c57600080fd5b5061058061057b366004614ed2565b611224565b6040516001600160a01b0390911681526020016104fa565b3480156105a457600080fd5b506104c76105b3366004614f00565b611268565b3480156105c457600080fd5b506104c76105d3366004614e45565b6112f6565b3480156105e457600080fd5b506105f86105f3366004614ed2565b6113be565b6040516104fa919081516001600160a01b031681526020808301516001600160801b03191690820152604080830151908201526060918201519181019190915260800190565b34801561064a57600080fd5b5061066b610659366004614ed2565b60146020526000908152604090205481565b6040519081526020016104fa565b34801561068557600080fd5b506105f8610694366004614ed2565b611472565b3480156106a557600080fd5b50600154600054036000190161066b565b3480156106c257600080fd5b506104c76106d1366004614ed2565b61161e565b3480156106e257600080fd5b506104ee6106f1366004614ed2565b602080526000908152604090205460ff1681565b34801561071157600080fd5b5061066b60215481565b34801561072757600080fd5b506104c7610736366004614f42565b611689565b34801561074757600080fd5b506104c7610756366004614f98565b611812565b34801561076757600080fd5b506104c7610776366004614fd5565b61198e565b34801561078757600080fd5b506104c7610796366004615016565b611999565b3480156107a757600080fd5b506107bb6107b6366004614e45565b611abf565b604080516001600160a01b0390931683526020830191909152016104fa565b3480156107e657600080fd5b5061066b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561081a57600080fd5b506104c7610829366004615041565b611ae8565b34801561083a57600080fd5b506104c7610849366004614ed2565b611c65565b6104c761085c366004615063565b611c94565b34801561086d57600080fd5b506011546104ee9060ff1681565b34801561088757600080fd5b506104ee610896366004615093565b601e6020526000908152604090205460ff1681565b3480156108b757600080fd5b5061066b6108c6366004614ed2565b60196020526000908152604090205481565b3480156108e457600080fd5b506104c76108f3366004614fd5565b611e29565b34801561090457600080fd5b5061066b610913366004615093565b60226020526000908152604090205481565b34801561093157600080fd5b506104c7610940366004614ed2565b611e44565b34801561095157600080fd5b506104c76109603660046150b0565b611e9f565b34801561097157600080fd5b5061066b610980366004615093565b60166020526000908152604090205481565b34801561099e57600080fd5b506104c7612086565b6104c76109b5366004615120565b612197565b3480156109c657600080fd5b506104c76109d5366004615176565b612450565b3480156109e657600080fd5b506104c76109f5366004614ed2565b6124a5565b348015610a0657600080fd5b506104c7612561565b348015610a1b57600080fd5b50610580610a2a366004614ed2565b612661565b348015610a3b57600080fd5b506104c7610a4a366004615093565b612673565b348015610a5b57600080fd5b506104c7612791565b348015610a7057600080fd5b50601f54610580906001600160a01b031681565b348015610a9057600080fd5b5061066b610a9f366004615093565b612809565b348015610ab057600080fd5b506104c7612857565b348015610ac557600080fd5b506104c761288d565b348015610ada57600080fd5b50610ae461020081565b60405161ffff90911681526020016104fa565b348015610b0357600080fd5b506104c7610b12366004614ed2565b612903565b348015610b2357600080fd5b50610b68610b32366004614ed2565b601c6020526000908152604090208054600182015460028301546003909301546001600160a01b039092169260809190911b9184565b604080516001600160a01b0390951685526001600160801b031990931660208501529183015260608201526080016104fa565b348015610ba757600080fd5b50601b546104ee9060ff1681565b348015610bc157600080fd5b50600b54610bcf9060ff1681565b6040516104fa91906151c1565b348015610be857600080fd5b506104c7612962565b348015610bfd57600080fd5b50602454610580906001600160a01b031681565b6104c7610c1f3660046151e9565b6129d8565b6104c7610c32366004615234565b612b2e565b348015610c4357600080fd5b50602554610580906001600160a01b031681565b6104c7610c65366004615120565b612c6d565b348015610c7657600080fd5b506104c7612e9e565b348015610c8b57600080fd5b5061066b600a5481565b348015610ca157600080fd5b506008546001600160a01b0316610580565b348015610cbf57600080fd5b5061066b60125481565b348015610cd557600080fd5b50610553612f10565b348015610cea57600080fd5b50610d20610cf9366004614ed2565b60236020526000908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016104fa565b348015610d4c57600080fd5b506104c7610d5b366004614ed2565b612f1f565b6104c7610d6e366004614ed2565b612f4e565b348015610d7f57600080fd5b506104c7610d8e366004615176565b61319d565b348015610d9f57600080fd5b506104c7610dae366004614ed2565b613233565b348015610dbf57600080fd5b506104c7610dce366004615093565b613262565b348015610ddf57600080fd5b506104c7610dee366004614e45565b613301565b348015610dff57600080fd5b506104c7610e0e366004615093565b613421565b348015610e1f57600080fd5b5061066b610e2e366004614ed2565b60176020526000908152604090205481565b348015610e4c57600080fd5b506104c7610e5b366004615269565b6134c0565b348015610e6c57600080fd5b506104c7610e7b36600461533f565b61373b565b348015610e8c57600080fd5b506104c7610e9b366004614f98565b61378c565b6104c7610eae366004615093565b6137f7565b348015610ebf57600080fd5b5061066b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610ef357600080fd5b50610553610f02366004614ed2565b61382f565b6104c76138d7565b348015610f1b57600080fd5b5061066b66470de4df82000081565b348015610f3657600080fd5b5061066b610f45366004614ed2565b61390b565b348015610f5657600080fd5b50602654610580906001600160a01b031681565b348015610f7657600080fd5b506104c7610f85366004615093565b6139ae565b348015610f9657600080fd5b506104ee610fa5366004615093565b600d6020526000908152604090205460ff1681565b348015610fc657600080fd5b506104c7610fd53660046153ed565b613a4d565b348015610fe657600080fd5b506104ee610ff536600461545e565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561102f57600080fd5b506107bb61103e366004614ed2565b601d60205260009081526040902080546001909101546001600160a01b039091169082565b34801561106f57600080fd5b506104ee61107e366004615093565b600c6020526000908152604090205460ff1681565b34801561109f57600080fd5b506104c76110ae366004615093565b613d2c565b3480156110bf57600080fd5b506104c76110ce366004614ed2565b613dc4565b3480156110df57600080fd5b506104c76110ee366004615093565b613e45565b6040518181527faab58724194bfb12b018298382453c333764e73d19ec73cb98d26f8dd10d29cc9060200160405180910390a1806021600082825461113891906154a2565b909155505050565b60006001600160e01b031982166380ac58cd60e01b148061117157506001600160e01b03198216635b5e139f60e01b145b8061118c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546111a1906154ba565b80601f01602080910402602001604051908101604052809291908181526020018280546111cd906154ba565b801561121a5780601f106111ef5761010080835404028352916020019161121a565b820191906000526020600020905b8154815290600101906020018083116111fd57829003601f168201915b5050505050905090565b600061122f82613ee4565b61124c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061127382612661565b9050806001600160a01b0316836001600160a01b031614156112a85760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906112c857506112c68133610ff5565b155b156112e6576040516367d9dca160e11b815260040160405180910390fd5b6112f1838383613f1d565b505050565b8161130081612661565b6001600160a01b0316336001600160a01b03161461133157604051632afe9a2360e01b815260040160405180910390fd5b60008381526018602090815260408083208584529091529020548390839060ff1661136f5760405163d0aeeedb60e01b815260040160405180910390fd5b600085815260176020908152604080832087905560238252918290204260039091015581518781529081018690526000805160206158a483398151915291015b60405180910390a15050505050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152601c60205260409020546001600160a01b0316611417576040516347ac481b60e01b815260040160405180910390fd5b506000908152601c602090815260409182902082516080808201855282546001600160a01b0316825260018301546001600160801b0319911b1692810192909252600281015492820192909252600390910154606082015290565b604080516080810182526000808252602082018190529181018290526060810191909152816012548111806114a5575080155b156114c357604051638ccdbe7f60e01b815260040160405180910390fd5b6080831161159f57600060806114da6001866154ef565b6114e4919061551c565b9050600060806114f56001876154ef565b6114ff9190615530565b6000838152601560205260408120549192509081908190819061154b906001600160a01b0316611530876080615544565b61153b8860016154a2565b611546906080615544565b613f79565b80602001905181019061155e9190615563565b604080516080810182526001600160a01b0390951685526001600160801b031990911660208501528301919091526060820152975061161895505050505050565b6000838152601560205260408120548190819081906115c6906001600160a01b0316613fa4565b8060200190518101906115d99190615563565b604080516080810182526001600160a01b0390951685526001600160801b03199091166020850152830191909152606082015295506116189350505050565b50919050565b8061162881612661565b6001600160a01b0316336001600160a01b03161461165957604051632afe9a2360e01b815260040160405180910390fd5b601b5460ff1661167c57604051631009968f60e01b815260040160405180910390fd5b61168582613fb4565b5050565b6025546001600160a01b031633148015906116af57506008546001600160a01b03163314155b156116cd576040516319b1226f60e01b815260040160405180910390fd5b608085116116ee5760405163a0973b4960e01b815260040160405180910390fd5b6001600160f81b0319600085901a60f81b1661171d5760405163a0973b4960e01b815260040160405180910390fd5b600061172886611472565b80516001600160a01b03166000908152601660205260408120805492935090611750836155c5565b90915550506001600160a01b0382166000908152601660209081526040918290208054600101905590516117a491611790918591889188918b91016155dc565b6040516020818303038152906040526140ef565b60008781526015602090815260409182902080546001600160a01b0319166001600160a01b039490941693909317909255601254905133815290917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b910160405180910390a2505050505050565b601b5460ff1661183557604051631009968f60e01b815260040160405180910390fd5b600260095414156118615760405162461bcd60e51b81526004016118589061560c565b60405180910390fd5b60026009556000848152601d60205260409020546001600160a01b0316331461189d57604051635a2f22a360e01b815260040160405180910390fd5b6118aa848433858561414e565b6000848152601d6020526040812060018101805482546001600160a01b03191690925591909155801561194257604051600090339083908381818185875af1925050503d8060008114611919576040519150601f19603f3d011682016040523d82523d6000602084013e61191e565b606091505b505090508061194057604051632ee66eed60e01b815260040160405180910390fd5b505b604080518681523360208201529081018290527f6f64cca79281ddf5d6052a87efe416686e69397f0251a87ed5f3b4d2b3470ee89060600160405180910390a150506001600955505050565b6112f18383836142e8565b6008546001600160a01b031633146119c35760405162461bcd60e51b815260040161185890615643565b601254608011156119e757604051639efd128d60e01b815260040160405180910390fd5b60026009541415611a0a5760405162461bcd60e51b81526004016118589061560c565b600260095560005461ffff7f0000000000000000000000000000000000000000000000000000000000000000161015611a56576040516304b3f10360e41b815260040160405180910390fd5b60005b60408161ffff161015611ab657611a71600054614506565b611aa4828261ffff1660408110611a8a57611a8a6155af565b602002016020810190611a9d9190615093565b60016145c0565b80611aae81615678565b915050611a59565b50506001600955565b60008030612710611ad261028086615544565b611adc919061551c565b915091505b9250929050565b6008546001600160a01b03163314611b125760405162461bcd60e51b815260040161185890615643565b60125460801115611b3657604051639efd128d60e01b815260040160405180910390fd5b60026009541415611b595760405162461bcd60e51b81526004016118589061560c565b600260095560005461ffff7f0000000000000000000000000000000000000000000000000000000000000000161115611ba55760405163098b967160e21b815260040160405180910390fd5b611bef7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061569a565b61ffff166000541115611c15576040516304b3f10360e41b815260040160405180910390fd5b60005b60408161ffff161015611ab657611c30600054614506565b611c5382611c3f6004846156c0565b61ffff1660048110611a8a57611a8a6155af565b80611c5d81615678565b915050611c18565b6008546001600160a01b03163314611c8f5760405162461bcd60e51b815260040161185890615643565b600e55565b81611c9e81612661565b6001600160a01b0316336001600160a01b031614611ccf57604051632afe9a2360e01b815260040160405180910390fd5b601b5460ff16611cf257604051631009968f60e01b815260040160405180910390fd5b60026009541415611d155760405162461bcd60e51b81526004016118589061560c565b60026009556001600160a01b038216611d445760405160016259cde560e11b0319815260040160405180910390fd5b336001600160a01b0383161415611d715760405160016259cde560e11b0319815260040160405180910390fd5b6000838152601d60205260409020546001600160a01b031615611d9757611d978361161e565b6040805180820182526001600160a01b0384811680835234602080850182815260008a8152601d8352879020955186546001600160a01b03191695169490941785559251600190940193909355835187815291820152918201527fc2ab2c3e34b2abfba288fefedb95b84b61aa55172be6f809e72a60fb55d12d01906060015b60405180910390a15050600160095550565b6112f18383836040518060200160405280600081525061373b565b80611e4e81612661565b6001600160a01b0316336001600160a01b031614611e7f57604051632afe9a2360e01b815260040160405180910390fd5b5060009081526020805260409020805460ff19811660ff90911615179055565b6026546001600160a01b03163314611eca576040516336c24c2360e11b815260040160405180910390fd5b80601254811180611ed9575080155b15611ef757604051638ccdbe7f60e01b815260040160405180910390fd5b600084815260186020908152604080832085845290915290205460ff16611f315760405163d0aeeedb60e01b815260040160405180910390fd5b600083815260186020908152604080832085845290915290205460ff1615611f6c5760405163fbe51aef60e01b815260040160405180910390fd5b60008481526019602052604090205460011415611f9c57604051632752d6d360e01b815260040160405180910390fd5b600084815260176020526040902054821415611fcb5760405163eff5ecf960e01b815260040160405180910390fd5b60008481526018602090815260408083208584528252808320805460ff1916905586835260199091528120805491612002836155c5565b909155505060008381526018602090815260408083208584528252808320805460ff191660019081179091558684526019835292819020805490930190925581518681529081018590529081018390527f650bf0a99430e8498db96fbcb3181ddc6835f640e9b925383386812f6fc5a696906060015b60405180910390a150505050565b600260095414156120a95760405162461bcd60e51b81526004016118589061560c565b600260095533600090815260226020526040902054806120dc57604051632f31015b60e11b815260040160405180910390fd5b336000818152602260205260408082208290555190919083908381818185875af1925050503d806000811461212d576040519150601f19603f3d011682016040523d82523d6000602084013e612132565b606091505b505090508061215457604051632f31015b60e11b815260040160405180910390fd5b60408051338152602081018490527f105e0a840d5935f890052dd3aa0ae7ff26a62832269c15f00ca439c6e5b5c5f391015b60405180910390a150506001600955565b600280600b5460ff1660038111156121b1576121b16151ab565b10156121d05760405163098b967160e21b815260040160405180910390fd5b6010548383612243828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b16602082015287925060340190505b604051602081830303815290604052805190602001206145da565b6122605760405163c8ac23c360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008034146122a157604051631fc4606f60e31b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000000169060ff1660038111156122de576122de6151ab565b6122e89190615544565b6123327f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061569a565b61ffff1661234091906154a2565b6000541115612362576040516304b3f10360e41b815260040160405180910390fd5b336000908152600d602052604090205460ff1615612393576040516315bc7bef60e21b815260040160405180910390fd5b600260095414156123b65760405162461bcd60e51b81526004016118589061560c565b6002600955336000908152600d60205260408120805460ff19166001179055546123df90614506565b61241861241366470de4df8200007f00000000000000000000000000000000000000000000000000000000000000006154ef565b6110f3565b6124376124296106946000546145f0565b5166470de4df820000614687565b6124423360016145c0565b505060016009555050505050565b6008546001600160a01b0316331461247a5760405162461bcd60e51b815260040161185890615643565b6001600160a01b03919091166000908152601e60205260409020805460ff1916911515919091179055565b806124af81612661565b6001600160a01b0316336001600160a01b0316146124e057604051632afe9a2360e01b815260040160405180910390fd5b6000828152601c60205260409020546001600160a01b0316612515576040516347ac481b60e01b815260040160405180910390fd5b600082815260176020908152604080832083905560238252808320426003909101558051858152918201929092526000805160206158a483398151915291015b60405180910390a15050565b6008546001600160a01b0316331461258b5760405162461bcd60e51b815260040161185890615643565b601254608011156125af57604051639efd128d60e01b815260040160405180910390fd5b600080600b5460ff1660038111156125c9576125c96151ab565b146125e75760405163098b967160e21b815260040160405180910390fd5b6102006000541161260b5760405163098b967160e21b815260040160405180910390fd5b600b80546001919060ff191682805b0217905550600b546040517f0c7df5c41f5db1871b22033f4e6cc38d80772527b6d731c7f1be10732ca9e3e7916126569160ff909116906151c1565b60405180910390a150565b600061266c826146fa565b5192915050565b6008546001600160a01b0316331461269d5760405162461bcd60e51b815260040161185890615643565b600260095414156126c05760405162461bcd60e51b81526004016118589061560c565b60026009556021546126e557604051632f31015b60e11b815260040160405180910390fd5b602180546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d806000811461273a576040519150601f19603f3d011682016040523d82523d6000602084013e61273f565b606091505b505090508061276157604051632f31015b60e11b815260040160405180910390fd5b6040518281527f2d5923adf91dd211e633a33f2e27918338e6a33e3b3f386e9d466d1bc52eba7990602001611e17565b6008546001600160a01b031633146127bb5760405162461bcd60e51b815260040161185890615643565b6011805460ff8082161560ff1990921682179092556040519116151581527ffb4e2971f359a0145230242cec0aa5f8dbea151a33a56a708b844ee8edaf26b6906020015b60405180910390a1565b60006001600160a01b038216612832576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6008546001600160a01b031633146128815760405162461bcd60e51b815260040161185890615643565b61288b6000614821565b565b6008546001600160a01b031633146128b75760405162461bcd60e51b815260040161185890615643565b600280600b5460ff1660038111156128d1576128d16151ab565b146128ef5760405163098b967160e21b815260040160405180910390fd5b600b80546003919060ff191660018361261a565b6008546001600160a01b0316331461292d5760405162461bcd60e51b815260040161185890615643565b600a8190556040518181527f3716f232c8d8ab5b747e1964a12bd66b18ee73573b5bf671b7ab254f6036634d90602001612656565b6008546001600160a01b0316331461298c5760405162461bcd60e51b815260040161185890615643565b600180600b5460ff1660038111156129a6576129a66151ab565b146129c45760405163098b967160e21b815260040160405180910390fd5b600b80546002919060ff191660018361261a565b60115460ff166129fb5760405163691b948f60e01b815260040160405180910390fd5b82612a0581612661565b6001600160a01b0316336001600160a01b031614612a3657604051632afe9a2360e01b815260040160405180910390fd5b612a478266470de4df820000615544565b3414612a6657604051631fc4606f60e31b815260040160405180910390fd5b60005b82811015612b2757601254848483818110612a8657612a866155af565b905060200201351180612ab15750838382818110612aa657612aa66155af565b905060200201356000145b15612acf57604051638ccdbe7f60e01b815260040160405180910390fd5b612af3612429858584818110612ae757612ae76155af565b90506020020135611472565b612b1585858584818110612b0957612b096155af565b90506020020135614873565b80612b1f816156e1565b915050612a69565b5050505050565b60115460ff16612b515760405163691b948f60e01b815260040160405180910390fd5b82612b5b81612661565b6001600160a01b0316336001600160a01b031614612b8c57604051632afe9a2360e01b815260040160405180910390fd5b82601254811180612b9b575080155b15612bb957604051638ccdbe7f60e01b815260040160405180910390fd5b6000612bc485611472565b519050336001600160a01b03821614801590612be7575066470de4df8200003414155b15612c0557604051631fc4606f60e31b815260040160405180910390fd5b336001600160a01b038216148015612c1d5750600034115b15612c3b57604051631fc4606f60e31b815260040160405180910390fd5b3415612c4b57612c4b8134614687565b612c558686614873565b8315612c6557612c6586866112f6565b505050505050565b600180600b5460ff166003811115612c8757612c876151ab565b1015612ca65760405163098b967160e21b815260040160405180910390fd5b600f548383612d02828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b1660208201528792506034019050612228565b612d1f5760405163c8ac23c360e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000803414612d6057604051631fc4606f60e31b815260040160405180910390fd5b336000908152600c602052604090205460ff1615612d91576040516315bc7bef60e21b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000000169060ff166003811115612dce57612dce6151ab565b612dd89190615544565b612e227f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061569a565b61ffff16612e3091906154a2565b6000541115612e52576040516304b3f10360e41b815260040160405180910390fd5b60026009541415612e755760405162461bcd60e51b81526004016118589061560c565b6002600955336000908152600c60205260408120805460ff19166001179055546123df90614506565b6008546001600160a01b03163314612ec85760405162461bcd60e51b815260040161185890615643565b601b805460ff8082161560ff1990921682179092556040519116151581527f48047c0a84651e8cf29bf88cedfe6c9447848ff5f69f17cbdfb140f7f7d8f9d3906020016127ff565b6060600380546111a1906154ba565b6008546001600160a01b03163314612f495760405162461bcd60e51b815260040161185890615643565b601055565b600380600b5460ff166003811115612f6857612f686151ab565b14612f865760405163098b967160e21b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000000169060ff166003811115612fc357612fc36151ab565b612fcd9190615544565b6130177f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061569a565b61ffff1661302591906154a2565b6000541115613047576040516304b3f10360e41b815260040160405180910390fd5b613071827f0000000000000000000000000000000000000000000000000000000000000000615544565b80341461309157604051631fc4606f60e31b815260040160405180910390fd5b600260095414156130b45760405162461bcd60e51b81526004016118589061560c565b600260095560088311156130db57604051636c2b1b2360e01b815260040160405180910390fd5b3233146130fb5760405163c5ad1c2d60e01b815260040160405180910390fd5b61313961312f66470de4df8200007f00000000000000000000000000000000000000000000000000000000000000006154ef565b6124139085615544565b60005b838110156131885761315a8160005461315591906154a2565b614506565b6131766124296106948360005461317191906154a2565b6145f0565b80613180816156e1565b91505061313c565b5061319333846145c0565b5050600160095550565b6001600160a01b0382163314156131c75760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6008546001600160a01b0316331461325d5760405162461bcd60e51b815260040161185890615643565b600f55565b6008546001600160a01b0316331461328c5760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166132b35760405163e6c4247b60e01b815260040160405180910390fd5b602480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9b86171bab9d24e82c2c7748d0fab7c14cb8fb55091a66bf47822c78af1eb58190602001612656565b6025546001600160a01b0316331480159061332757506008546001600160a01b03163314155b15613345576040516319b1226f60e01b815260040160405180910390fd5b60008281526018602090815260408083208484529091529020548290829060ff166133835760405163d0aeeedb60e01b815260040160405180910390fd5b600061338e856113be565b516001600160a01b031614156133b7576040516347ac481b60e01b815260040160405180910390fd5b6000848152601c6020908152604080832080546001600160a01b03191681556001810180546001600160801b031916905560028101849055600301839055601782529182902085905581518681529081018590526000805160206158a48339815191529101612078565b6008546001600160a01b0316331461344b5760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166134725760405163e6c4247b60e01b815260040160405180910390fd5b602680546001600160a01b0319166001600160a01b0383169081179091556040519081527f3ff9503ebb449a398e05d1e0984e6bbebc0b2af8f06707fe1111bfc707a9adfe90602001612656565b600e54828261351c828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b1660208201528792506034019050612228565b6135395760405163c8ac23c360e01b815260040160405180910390fd5b336000908152601e602052604090205460ff161561356a5760405163e9d5636f60e01b815260040160405180910390fd5b601354601254141561358f5760405163a055d0d160e01b815260040160405180910390fd5b6001600160f81b0319600089901a60f81b166135be5760405163a0973b4960e01b815260040160405180910390fd5b601a600088886040516020016135de929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561362557604051635488c1b960e11b815260040160405180910390fd5b33600090815260166020526040902054600814156136565760405163a055d0d160e01b815260040160405180910390fd5b33600081815260166020908152604080832080546001908101909155601280548201905581518084018d90528083018c90528251808203840181526060820184528051908501208552601a9093529220805460ff19169092179091556136c891611790918a908a908d906080016155dc565b6012805460009081526015602090815260409182902080546001600160a01b0319166001600160a01b0395909516949094179093559054905133815290917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b910160405180910390a25050505050505050565b6137468484846142e8565b6001600160a01b0383163b1515801561376857506137668484848461495b565b155b15613786576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b601b5460ff166137af57604051631009968f60e01b815260040160405180910390fd5b836137b981612661565b6001600160a01b0316336001600160a01b0316146137ea57604051632afe9a2360e01b815260040160405180910390fd5b612b27858533868661414e565b6026546001600160a01b03163314613822576040516336c24c2360e11b815260040160405180910390fd5b61382c8134614687565b50565b606061383a82613ee4565b61385757604051632194448760e11b815260040160405180910390fd5b601f5460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b15801561389b57600080fd5b505afa1580156138af573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261118c91908101906156fc565b6026546001600160a01b03163314613902576040516336c24c2360e11b815260040160405180910390fd5b61288b346110f3565b6000818152602360205260408120600101548061392b5750600192915050565b600061393782436154ef565b9050600061394862030d408361551c565b9050600a548111156139595750600a545b60006127106139698360016154a2565b6139739085615544565b61397d919061551c565b60008781526023602052604090205461399691906154a2565b905060018110156139a5575060015b95945050505050565b6008546001600160a01b031633146139d85760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166139ff5760405163e6c4247b60e01b815260040160405180910390fd5b601f80546001600160a01b0319166001600160a01b0383169081179091556040519081527fecd048926e13141636897d3f0d342bef0b1e0f18e90fd56c22ec853f222980b790602001612656565b6008546001600160a01b03163314613a775760405162461bcd60e51b815260040161185890615643565b60125415613a985760405163a055d0d160e01b815260040160405180910390fd5b613aa3608080615544565b8114613ac25760405163a0973b4960e01b815260040160405180910390fd5b60005b6080811015613c9b576000613adb8260016154a2565b905060008080808787613aef608089615544565b90613afb608089615544565b92613b0893929190615769565b810190613b159190615793565b929650909450925090506001600160f81b0319600082901a60f81b16613b4e5760405163a0973b4960e01b815260040160405180910390fd5b601a60008484604051602001613b6e929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615613bb557604051635488c1b960e11b815260040160405180910390fd5b6001600160a01b03841660009081526016602052604090205460081415613bef5760405163a055d0d160e01b815260040160405180910390fd5b6001600160a01b0384166000818152601660209081526040808320805460019081019091558151808401899052808301889052825180820384018152606082018085528151918601919091208652601a90945293829020805460ff19169091179055929052905186917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b919081900360800190a250505050508080613c93906156e1565b915050613ac5565b50613cdb82828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506140ef92505050565b6000805260156020527fa31547ce6245cdb9ecea19cf8c7eb9f5974025bb4075011409251ae855b30aed80546001600160a01b0319166001600160a01b039290921691909117905550506080601255565b6008546001600160a01b03163314613d565760405162461bcd60e51b815260040161185890615643565b6001600160a01b038116613dbb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611858565b61382c81614821565b6008546001600160a01b03163314613dee5760405162461bcd60e51b815260040161185890615643565b8060135410613e105760405163a055d0d160e01b815260040160405180910390fd5b60138190556040518181527f5a5dddfeab101151b5fc13ae7871208057836c3980dcb28081a52d59e0f2d94390602001612656565b6008546001600160a01b03163314613e6f5760405162461bcd60e51b815260040161185890615643565b6001600160a01b038116613e965760405163e6c4247b60e01b815260040160405180910390fd5b602580546001600160a01b0319166001600160a01b0383169081179091556040519081527f309760724dfef4345276c369654fa30018f3ad5f76f69ff99b73ea259375b49090602001612656565b600081600111158015613ef8575060005482105b801561118c575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6060613f9a84613f8a8560016154a2565b613f958560016154a2565b614a52565b90505b9392505050565b606061118c826001600019614a52565b60026009541415613fd75760405162461bcd60e51b81526004016118589061560c565b60026009556000818152601d60205260409020546001600160a01b03166140145760405160016259cde560e11b0319815260040160405180910390fd5b6000818152601d6020526040812060018101805482546001600160a01b0319169092559190915580156140bf57600061404c83612661565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114614096576040519150601f19603f3d011682016040523d82523d6000602084013e61409b565b606091505b50509050806140bd57604051632ee66eed60e01b815260040160405180910390fd5b505b6040518281527fc0f85208e35254684c619f02df13c81238b1f82d1ce927b93ac4e320bee43f3190602001612186565b60008061411a8360405160200161410691906157d2565b604051602081830303815290604052614b03565b90508051602082016000f091506001600160a01b0382166116185760405163046a55db60e11b815260040160405180910390fd5b6001600160a01b0383166000908152601e602052604090205460ff16156141885760405163e9d5636f60e01b815260040160405180910390fd5b6001600160f81b0319600085901a60f81b166141b75760405163a0973b4960e01b815260040160405180910390fd5b601a600083836040516020016141d7929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561421e57604051635488c1b960e11b815260040160405180910390fd5b6000858152601c602090815260409182902080546001600160a01b0319166001600160a01b03871690811782556001820180546001600160801b03191660808a901c179055600282018690556003909101849055915191825286917f91db776821b6cd8516424cca4b60cde3d965102a5a2b2612b538a9bcc7155158910160405180910390a2600085815260176020908152604080832083905560238252808320426003909101558051888152918201929092526000805160206158a483398151915291016113af565b60006142f3826146fa565b80519091506000906001600160a01b0316336001600160a01b03161480614321575081516143219033610ff5565b8061433c57503361433184611224565b6001600160a01b0316145b90508061435c57604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b0316146143915760405162a1148160e81b815260040160405180910390fd5b6001600160a01b0384166143b857604051633a954ecd60e21b815260040160405180910390fd5b6143c58585856001614b2f565b6143d56000848460000151613f1d565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b4290921691909102179092559086018083529120549091166144bf576000548110156144bf57825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612b27565b6000614511826145f0565b600083815260196020908152604080832060019081905560188352818420858552835292819020805460ff191690931790925581518581529081018390529192507ed15c27c63a10a83b4eadb76d945304112b12090976b6bb55e37c7aace877df910160405180910390a1600082815260176020908152604080832084905560238252918290204260039091015581518481529081018390526000805160206158a48339815191529101612555565b611685828260405180602001604052806000815250614b8a565b6000826145e78584614b97565b14949350505050565b60006080821115614683576012548261460a6001436154ef565b604051634f4b504360e01b602082015260248101929092524060448201526001600160601b031941606090811b8216606484015244607884015233901b16609882015260ac016040516020818303038152906040528051906020012060001c6146739190615530565b61467e9060016154a2565b61118c565b5090565b604080516001600160a01b0384168152602081018390527fc022b6ffc9301dc614c4e05b0216e5438a405e79147d64c1ff2ab75b17fba5d5910160405180910390a16001600160a01b038216600090815260226020526040812080548392906146f19084906154a2565b90915550505050565b6040805160608101825260008082526020820181905291810191909152818060011115801561472a575060005481105b1561480857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906148065780516001600160a01b03161561479d579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215614801579392505050565b61479d565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082815260186020908152604080832084845290915290205460ff16156148ae5760405163fbe51aef60e01b815260040160405180910390fd5b60008181526014602052604090205461020014156148df57604051637f13a70f60e11b815260040160405180910390fd5b60008281526018602090815260408083208484528252808320805460ff19166001908117909155858452601983528184208054820190558484526014835292819020805490930190925581518481529081018390527ed15c27c63a10a83b4eadb76d945304112b12090976b6bb55e37c7aace877df9101612555565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906149909033908990889088906004016157f8565b602060405180830381600087803b1580156149aa57600080fd5b505af19250505080156149da575060408051601f3d908101601f191682019092526149d791810190615835565b60015b614a35573d808015614a08576040519150601f19603f3d011682016040523d82523d6000602084013e614a0d565b606091505b508051614a2d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060833b80614a71575050604080516020810190915260008152613f9d565b80841115614a8f575050604080516020810190915260008152613f9d565b83831015614ac15760405163162544fd60e11b8152600481018290526024810185905260448101849052606401611858565b8383038482036000828210614ad65782614ad8565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b6060815182604051602001614b19929190615852565b6040516020818303038152906040529050919050565b60005b81811015612b27576000614b4682856154a2565b9050614b5181614c0b565b6000818152601d60205260409020546001600160a01b031615614b7757614b7781613fb4565b5080614b82816156e1565b915050614b32565b6112f18383836001614c3e565b600081815b8451811015614c03576000858281518110614bb957614bb96155af565b60200260200101519050808311614bdf5760008381526020829052604090209250614bf0565b600081815260208490526040902092505b5080614bfb816156e1565b915050614b9c565b509392505050565b614c148161390b565b60009182526023602052604090912090815543600180830191909155600290910180549091019055565b6000546001600160a01b038516614c6757604051622e076360e81b815260040160405180910390fd5b83614c855760405163b562e8dd60e01b815260040160405180910390fd5b614c926000868387614b2f565b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015614d3a57506001600160a01b0387163b15155b15614dc3575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4614d8b600088848060010195508861495b565b614da8576040516368d2bf6b60e11b815260040160405180910390fd5b80821415614d40578260005414614dbe57600080fd5b614e09565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614dc4575b50600055612b27565b6001600160e01b03198116811461382c57600080fd5b600060208284031215614e3a57600080fd5b8135613f9d81614e12565b60008060408385031215614e5857600080fd5b50508035926020909101359150565b60005b83811015614e82578181015183820152602001614e6a565b838111156137865750506000910152565b60008151808452614eab816020860160208601614e67565b601f01601f19169290920160200192915050565b602081526000613f9d6020830184614e93565b600060208284031215614ee457600080fd5b5035919050565b6001600160a01b038116811461382c57600080fd5b60008060408385031215614f1357600080fd5b8235614f1e81614eeb565b946020939093013593505050565b6001600160801b03198116811461382c57600080fd5b600080600080600060a08688031215614f5a57600080fd5b853594506020860135614f6c81614f2c565b935060408601359250606086013591506080860135614f8a81614eeb565b809150509295509295909350565b60008060008060808587031215614fae57600080fd5b843593506020850135614fc081614f2c565b93969395505050506040820135916060013590565b600080600060608486031215614fea57600080fd5b8335614ff581614eeb565b9250602084013561500581614eeb565b929592945050506040919091013590565b600061080080838503121561502a57600080fd5b83818401111561503957600080fd5b509092915050565b60006080828403121561505357600080fd5b8260808301111561161857600080fd5b6000806040838503121561507657600080fd5b82359150602083013561508881614eeb565b809150509250929050565b6000602082840312156150a557600080fd5b8135613f9d81614eeb565b6000806000606084860312156150c557600080fd5b505081359360208301359350604090920135919050565b60008083601f8401126150ee57600080fd5b5081356001600160401b0381111561510557600080fd5b6020830191508360208260051b8501011115611ae157600080fd5b6000806020838503121561513357600080fd5b82356001600160401b0381111561514957600080fd5b615155858286016150dc565b90969095509350505050565b8035801515811461517157600080fd5b919050565b6000806040838503121561518957600080fd5b823561519481614eeb565b91506151a260208401615161565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600483106151e357634e487b7160e01b600052602160045260246000fd5b91905290565b6000806000604084860312156151fe57600080fd5b8335925060208401356001600160401b0381111561521b57600080fd5b615227868287016150dc565b9497909650939450505050565b60008060006060848603121561524957600080fd5b833592506020840135915061526060408501615161565b90509250925092565b60008060008060006080868803121561528157600080fd5b853561528c81614f2c565b9450602086013593506040860135925060608601356001600160401b038111156152b557600080fd5b6152c1888289016150dc565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715615310576153106152d2565b604052919050565b60006001600160401b03821115615331576153316152d2565b50601f01601f191660200190565b6000806000806080858703121561535557600080fd5b843561536081614eeb565b9350602085013561537081614eeb565b92506040850135915060608501356001600160401b0381111561539257600080fd5b8501601f810187136153a357600080fd5b80356153b66153b182615318565b6152e8565b8181528860208385010111156153cb57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806020838503121561540057600080fd5b82356001600160401b038082111561541757600080fd5b818501915085601f83011261542b57600080fd5b81358181111561543a57600080fd5b86602082850101111561544c57600080fd5b60209290920196919550909350505050565b6000806040838503121561547157600080fd5b823561547c81614eeb565b9150602083013561508881614eeb565b634e487b7160e01b600052601160045260246000fd5b600082198211156154b5576154b561548c565b500190565b600181811c908216806154ce57607f821691505b6020821081141561161857634e487b7160e01b600052602260045260246000fd5b6000828210156155015761550161548c565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261552b5761552b615506565b500490565b60008261553f5761553f615506565b500690565b600081600019048311821515161561555e5761555e61548c565b500290565b6000806000806080858703121561557957600080fd5b845161558481614eeb565b80945050602085015192506040850151915060608501516155a481614f2c565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b6000816155d4576155d461548c565b506000190190565b6001600160a01b03949094168452602084019290925260408301526001600160801b031916606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff808316818114156156905761569061548c565b6001019392505050565b600061ffff8083168185168083038211156156b7576156b761548c565b01949350505050565b600061ffff808416806156d5576156d5615506565b92169190910692915050565b60006000198214156156f5576156f561548c565b5060010190565b60006020828403121561570e57600080fd5b81516001600160401b0381111561572457600080fd5b8201601f8101841361573557600080fd5b80516157436153b182615318565b81815285602083850101111561575857600080fd5b6139a5826020830160208601614e67565b6000808585111561577957600080fd5b8386111561578657600080fd5b5050820193919092039150565b600080600080608085870312156157a957600080fd5b84356157b481614eeb565b9350602085013592506040850135915060608501356155a481614f2c565b60008152600082516157eb816001850160208701614e67565b9190910160010192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061582b90830184614e93565b9695505050505050565b60006020828403121561584757600080fd5b8151613f9d81614e12565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b6005820152815160009061589581600e850160208701614e67565b91909101600e01939250505056fedeea1fc31c86232201bea5a0dc8d7c65c2482e08fee6630c29ace049fdc180a8a2646970667358221220d94b590a62bed82080bcc31c180f6dc806e0ee72bed9e61b30f50fe5dfcb31f964736f6c63430008080033000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000002386f26fc100000

Deployed Bytecode

0x6080604052600436106104b95760003560e01c80637ae8d5be1161026b578063af5f84271161014f578063d57fc41a116100c1578063e985e9c511610085578063e985e9c514610fda578063e9c3a1a314611023578063f0b5383714611063578063f2fde38b14611093578063f654a9c3146110b3578063f7ce4479146110d357600080fd5b8063d57fc41a14610f2a578063daa17f4914610f4a578063e17b25af14610f6a578063e4dad85014610f8a578063e6b21e7f14610fba57600080fd5b8063bcd1311c11610113578063bcd1311c14610e80578063c3b76ef514610ea0578063c662e48114610eb3578063c87b56dd14610ee7578063c970f20014610f07578063cc7ab11214610f0f57600080fd5b8063af5f842714610dd3578063b47cc55614610df3578063b75f7e5114610e13578063b7e507b414610e40578063b88d4fde14610e6057600080fd5b80638a142a8b116101e85780639601699a116101ac5780639601699a14610cde5780639eb2660c14610d40578063a0712d6814610d60578063a22cb46514610d73578063abf9b9fe14610d93578063af2d07c614610db357600080fd5b80638a142a8b14610c6a5780638d774da814610c7f5780638da5cb5b14610c95578063950d657e14610cb357806395d89b4114610cc957600080fd5b8063807071d01161022f578063807071d014610bf1578063851eae1614610c11578063861f47ff14610c2457806386e476dd14610c3757806389ef639914610c5757600080fd5b80637ae8d5be14610af75780637c1ede0214610b175780637e5354f014610b9b5780637e5ac09a14610bb55780637e6caaca14610bdc57600080fd5b80633d91b5ae1161039d57806354ba75511161030f5780636c8e80bc116102d35780636c8e80bc14610a4f5780636eb3500d14610a6457806370a0823114610a84578063715018a614610aa457806376c64c6214610ab957806377e18a0b14610ace57600080fd5b806354ba7551146109ba57806354e31078146109da5780635bde8223146109fa5780636352211e14610a0f57806367478a3514610a2f57600080fd5b806349af27c31161036157806349af27c3146108f85780634c483c1f146109255780634cc6028d146109455780634df186ec146109655780634dfe33ac146109925780634e5fff41146109a757600080fd5b80633d91b5ae1461084e5780633f79a9b814610861578063406821521461087b57806342520452146108ab57806342842e0e146108d857600080fd5b80631a19ae781161043657806323b872dd116103fa57806323b872dd1461075b578063285fa9141461077b5780632a55205a1461079b57806332cb6b0c146107da57806337efc8eb1461080e57806338e0ae4d1461082e57600080fd5b80631a19ae78146106b65780631a8b05d7146106d65780631e4c78871461070557806320eeb3221461071b578063210877e61461073b57600080fd5b806309d3c5c91161047d57806309d3c5c9146105b85780630cce60fd146105d85780630da0bedb1461063e578063139e60571461067957806318160ddd1461069957600080fd5b806301ffc9a7146104ce5780630458b6db1461050357806306fdde031461053e578063081812fc14610560578063095ea7b31461059857600080fd5b366104c9576104c7346110f3565b005b600080fd5b3480156104da57600080fd5b506104ee6104e9366004614e28565b611140565b60405190151581526020015b60405180910390f35b34801561050f57600080fd5b506104ee61051e366004614e45565b601860209081526000928352604080842090915290825290205460ff1681565b34801561054a57600080fd5b50610553611192565b6040516104fa9190614ebf565b34801561056c57600080fd5b5061058061057b366004614ed2565b611224565b6040516001600160a01b0390911681526020016104fa565b3480156105a457600080fd5b506104c76105b3366004614f00565b611268565b3480156105c457600080fd5b506104c76105d3366004614e45565b6112f6565b3480156105e457600080fd5b506105f86105f3366004614ed2565b6113be565b6040516104fa919081516001600160a01b031681526020808301516001600160801b03191690820152604080830151908201526060918201519181019190915260800190565b34801561064a57600080fd5b5061066b610659366004614ed2565b60146020526000908152604090205481565b6040519081526020016104fa565b34801561068557600080fd5b506105f8610694366004614ed2565b611472565b3480156106a557600080fd5b50600154600054036000190161066b565b3480156106c257600080fd5b506104c76106d1366004614ed2565b61161e565b3480156106e257600080fd5b506104ee6106f1366004614ed2565b602080526000908152604090205460ff1681565b34801561071157600080fd5b5061066b60215481565b34801561072757600080fd5b506104c7610736366004614f42565b611689565b34801561074757600080fd5b506104c7610756366004614f98565b611812565b34801561076757600080fd5b506104c7610776366004614fd5565b61198e565b34801561078757600080fd5b506104c7610796366004615016565b611999565b3480156107a757600080fd5b506107bb6107b6366004614e45565b611abf565b604080516001600160a01b0390931683526020830191909152016104fa565b3480156107e657600080fd5b5061066b7f000000000000000000000000000000000000000000000000000000000000200081565b34801561081a57600080fd5b506104c7610829366004615041565b611ae8565b34801561083a57600080fd5b506104c7610849366004614ed2565b611c65565b6104c761085c366004615063565b611c94565b34801561086d57600080fd5b506011546104ee9060ff1681565b34801561088757600080fd5b506104ee610896366004615093565b601e6020526000908152604090205460ff1681565b3480156108b757600080fd5b5061066b6108c6366004614ed2565b60196020526000908152604090205481565b3480156108e457600080fd5b506104c76108f3366004614fd5565b611e29565b34801561090457600080fd5b5061066b610913366004615093565b60226020526000908152604090205481565b34801561093157600080fd5b506104c7610940366004614ed2565b611e44565b34801561095157600080fd5b506104c76109603660046150b0565b611e9f565b34801561097157600080fd5b5061066b610980366004615093565b60166020526000908152604090205481565b34801561099e57600080fd5b506104c7612086565b6104c76109b5366004615120565b612197565b3480156109c657600080fd5b506104c76109d5366004615176565b612450565b3480156109e657600080fd5b506104c76109f5366004614ed2565b6124a5565b348015610a0657600080fd5b506104c7612561565b348015610a1b57600080fd5b50610580610a2a366004614ed2565b612661565b348015610a3b57600080fd5b506104c7610a4a366004615093565b612673565b348015610a5b57600080fd5b506104c7612791565b348015610a7057600080fd5b50601f54610580906001600160a01b031681565b348015610a9057600080fd5b5061066b610a9f366004615093565b612809565b348015610ab057600080fd5b506104c7612857565b348015610ac557600080fd5b506104c761288d565b348015610ada57600080fd5b50610ae461020081565b60405161ffff90911681526020016104fa565b348015610b0357600080fd5b506104c7610b12366004614ed2565b612903565b348015610b2357600080fd5b50610b68610b32366004614ed2565b601c6020526000908152604090208054600182015460028301546003909301546001600160a01b039092169260809190911b9184565b604080516001600160a01b0390951685526001600160801b031990931660208501529183015260608201526080016104fa565b348015610ba757600080fd5b50601b546104ee9060ff1681565b348015610bc157600080fd5b50600b54610bcf9060ff1681565b6040516104fa91906151c1565b348015610be857600080fd5b506104c7612962565b348015610bfd57600080fd5b50602454610580906001600160a01b031681565b6104c7610c1f3660046151e9565b6129d8565b6104c7610c32366004615234565b612b2e565b348015610c4357600080fd5b50602554610580906001600160a01b031681565b6104c7610c65366004615120565b612c6d565b348015610c7657600080fd5b506104c7612e9e565b348015610c8b57600080fd5b5061066b600a5481565b348015610ca157600080fd5b506008546001600160a01b0316610580565b348015610cbf57600080fd5b5061066b60125481565b348015610cd557600080fd5b50610553612f10565b348015610cea57600080fd5b50610d20610cf9366004614ed2565b60236020526000908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016104fa565b348015610d4c57600080fd5b506104c7610d5b366004614ed2565b612f1f565b6104c7610d6e366004614ed2565b612f4e565b348015610d7f57600080fd5b506104c7610d8e366004615176565b61319d565b348015610d9f57600080fd5b506104c7610dae366004614ed2565b613233565b348015610dbf57600080fd5b506104c7610dce366004615093565b613262565b348015610ddf57600080fd5b506104c7610dee366004614e45565b613301565b348015610dff57600080fd5b506104c7610e0e366004615093565b613421565b348015610e1f57600080fd5b5061066b610e2e366004614ed2565b60176020526000908152604090205481565b348015610e4c57600080fd5b506104c7610e5b366004615269565b6134c0565b348015610e6c57600080fd5b506104c7610e7b36600461533f565b61373b565b348015610e8c57600080fd5b506104c7610e9b366004614f98565b61378c565b6104c7610eae366004615093565b6137f7565b348015610ebf57600080fd5b5061066b7f00000000000000000000000000000000000000000000000002386f26fc10000081565b348015610ef357600080fd5b50610553610f02366004614ed2565b61382f565b6104c76138d7565b348015610f1b57600080fd5b5061066b66470de4df82000081565b348015610f3657600080fd5b5061066b610f45366004614ed2565b61390b565b348015610f5657600080fd5b50602654610580906001600160a01b031681565b348015610f7657600080fd5b506104c7610f85366004615093565b6139ae565b348015610f9657600080fd5b506104ee610fa5366004615093565b600d6020526000908152604090205460ff1681565b348015610fc657600080fd5b506104c7610fd53660046153ed565b613a4d565b348015610fe657600080fd5b506104ee610ff536600461545e565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561102f57600080fd5b506107bb61103e366004614ed2565b601d60205260009081526040902080546001909101546001600160a01b039091169082565b34801561106f57600080fd5b506104ee61107e366004615093565b600c6020526000908152604090205460ff1681565b34801561109f57600080fd5b506104c76110ae366004615093565b613d2c565b3480156110bf57600080fd5b506104c76110ce366004614ed2565b613dc4565b3480156110df57600080fd5b506104c76110ee366004615093565b613e45565b6040518181527faab58724194bfb12b018298382453c333764e73d19ec73cb98d26f8dd10d29cc9060200160405180910390a1806021600082825461113891906154a2565b909155505050565b60006001600160e01b031982166380ac58cd60e01b148061117157506001600160e01b03198216635b5e139f60e01b145b8061118c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546111a1906154ba565b80601f01602080910402602001604051908101604052809291908181526020018280546111cd906154ba565b801561121a5780601f106111ef5761010080835404028352916020019161121a565b820191906000526020600020905b8154815290600101906020018083116111fd57829003601f168201915b5050505050905090565b600061122f82613ee4565b61124c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061127382612661565b9050806001600160a01b0316836001600160a01b031614156112a85760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906112c857506112c68133610ff5565b155b156112e6576040516367d9dca160e11b815260040160405180910390fd5b6112f1838383613f1d565b505050565b8161130081612661565b6001600160a01b0316336001600160a01b03161461133157604051632afe9a2360e01b815260040160405180910390fd5b60008381526018602090815260408083208584529091529020548390839060ff1661136f5760405163d0aeeedb60e01b815260040160405180910390fd5b600085815260176020908152604080832087905560238252918290204260039091015581518781529081018690526000805160206158a483398151915291015b60405180910390a15050505050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152601c60205260409020546001600160a01b0316611417576040516347ac481b60e01b815260040160405180910390fd5b506000908152601c602090815260409182902082516080808201855282546001600160a01b0316825260018301546001600160801b0319911b1692810192909252600281015492820192909252600390910154606082015290565b604080516080810182526000808252602082018190529181018290526060810191909152816012548111806114a5575080155b156114c357604051638ccdbe7f60e01b815260040160405180910390fd5b6080831161159f57600060806114da6001866154ef565b6114e4919061551c565b9050600060806114f56001876154ef565b6114ff9190615530565b6000838152601560205260408120549192509081908190819061154b906001600160a01b0316611530876080615544565b61153b8860016154a2565b611546906080615544565b613f79565b80602001905181019061155e9190615563565b604080516080810182526001600160a01b0390951685526001600160801b031990911660208501528301919091526060820152975061161895505050505050565b6000838152601560205260408120548190819081906115c6906001600160a01b0316613fa4565b8060200190518101906115d99190615563565b604080516080810182526001600160a01b0390951685526001600160801b03199091166020850152830191909152606082015295506116189350505050565b50919050565b8061162881612661565b6001600160a01b0316336001600160a01b03161461165957604051632afe9a2360e01b815260040160405180910390fd5b601b5460ff1661167c57604051631009968f60e01b815260040160405180910390fd5b61168582613fb4565b5050565b6025546001600160a01b031633148015906116af57506008546001600160a01b03163314155b156116cd576040516319b1226f60e01b815260040160405180910390fd5b608085116116ee5760405163a0973b4960e01b815260040160405180910390fd5b6001600160f81b0319600085901a60f81b1661171d5760405163a0973b4960e01b815260040160405180910390fd5b600061172886611472565b80516001600160a01b03166000908152601660205260408120805492935090611750836155c5565b90915550506001600160a01b0382166000908152601660209081526040918290208054600101905590516117a491611790918591889188918b91016155dc565b6040516020818303038152906040526140ef565b60008781526015602090815260409182902080546001600160a01b0319166001600160a01b039490941693909317909255601254905133815290917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b910160405180910390a2505050505050565b601b5460ff1661183557604051631009968f60e01b815260040160405180910390fd5b600260095414156118615760405162461bcd60e51b81526004016118589061560c565b60405180910390fd5b60026009556000848152601d60205260409020546001600160a01b0316331461189d57604051635a2f22a360e01b815260040160405180910390fd5b6118aa848433858561414e565b6000848152601d6020526040812060018101805482546001600160a01b03191690925591909155801561194257604051600090339083908381818185875af1925050503d8060008114611919576040519150601f19603f3d011682016040523d82523d6000602084013e61191e565b606091505b505090508061194057604051632ee66eed60e01b815260040160405180910390fd5b505b604080518681523360208201529081018290527f6f64cca79281ddf5d6052a87efe416686e69397f0251a87ed5f3b4d2b3470ee89060600160405180910390a150506001600955505050565b6112f18383836142e8565b6008546001600160a01b031633146119c35760405162461bcd60e51b815260040161185890615643565b601254608011156119e757604051639efd128d60e01b815260040160405180910390fd5b60026009541415611a0a5760405162461bcd60e51b81526004016118589061560c565b600260095560005461ffff7f0000000000000000000000000000000000000000000000000000000000000100161015611a56576040516304b3f10360e41b815260040160405180910390fd5b60005b60408161ffff161015611ab657611a71600054614506565b611aa4828261ffff1660408110611a8a57611a8a6155af565b602002016020810190611a9d9190615093565b60016145c0565b80611aae81615678565b915050611a59565b50506001600955565b60008030612710611ad261028086615544565b611adc919061551c565b915091505b9250929050565b6008546001600160a01b03163314611b125760405162461bcd60e51b815260040161185890615643565b60125460801115611b3657604051639efd128d60e01b815260040160405180910390fd5b60026009541415611b595760405162461bcd60e51b81526004016118589061560c565b600260095560005461ffff7f0000000000000000000000000000000000000000000000000000000000000100161115611ba55760405163098b967160e21b815260040160405180910390fd5b611bef7f00000000000000000000000000000000000000000000000000000000000001007f000000000000000000000000000000000000000000000000000000000000010061569a565b61ffff166000541115611c15576040516304b3f10360e41b815260040160405180910390fd5b60005b60408161ffff161015611ab657611c30600054614506565b611c5382611c3f6004846156c0565b61ffff1660048110611a8a57611a8a6155af565b80611c5d81615678565b915050611c18565b6008546001600160a01b03163314611c8f5760405162461bcd60e51b815260040161185890615643565b600e55565b81611c9e81612661565b6001600160a01b0316336001600160a01b031614611ccf57604051632afe9a2360e01b815260040160405180910390fd5b601b5460ff16611cf257604051631009968f60e01b815260040160405180910390fd5b60026009541415611d155760405162461bcd60e51b81526004016118589061560c565b60026009556001600160a01b038216611d445760405160016259cde560e11b0319815260040160405180910390fd5b336001600160a01b0383161415611d715760405160016259cde560e11b0319815260040160405180910390fd5b6000838152601d60205260409020546001600160a01b031615611d9757611d978361161e565b6040805180820182526001600160a01b0384811680835234602080850182815260008a8152601d8352879020955186546001600160a01b03191695169490941785559251600190940193909355835187815291820152918201527fc2ab2c3e34b2abfba288fefedb95b84b61aa55172be6f809e72a60fb55d12d01906060015b60405180910390a15050600160095550565b6112f18383836040518060200160405280600081525061373b565b80611e4e81612661565b6001600160a01b0316336001600160a01b031614611e7f57604051632afe9a2360e01b815260040160405180910390fd5b5060009081526020805260409020805460ff19811660ff90911615179055565b6026546001600160a01b03163314611eca576040516336c24c2360e11b815260040160405180910390fd5b80601254811180611ed9575080155b15611ef757604051638ccdbe7f60e01b815260040160405180910390fd5b600084815260186020908152604080832085845290915290205460ff16611f315760405163d0aeeedb60e01b815260040160405180910390fd5b600083815260186020908152604080832085845290915290205460ff1615611f6c5760405163fbe51aef60e01b815260040160405180910390fd5b60008481526019602052604090205460011415611f9c57604051632752d6d360e01b815260040160405180910390fd5b600084815260176020526040902054821415611fcb5760405163eff5ecf960e01b815260040160405180910390fd5b60008481526018602090815260408083208584528252808320805460ff1916905586835260199091528120805491612002836155c5565b909155505060008381526018602090815260408083208584528252808320805460ff191660019081179091558684526019835292819020805490930190925581518681529081018590529081018390527f650bf0a99430e8498db96fbcb3181ddc6835f640e9b925383386812f6fc5a696906060015b60405180910390a150505050565b600260095414156120a95760405162461bcd60e51b81526004016118589061560c565b600260095533600090815260226020526040902054806120dc57604051632f31015b60e11b815260040160405180910390fd5b336000818152602260205260408082208290555190919083908381818185875af1925050503d806000811461212d576040519150601f19603f3d011682016040523d82523d6000602084013e612132565b606091505b505090508061215457604051632f31015b60e11b815260040160405180910390fd5b60408051338152602081018490527f105e0a840d5935f890052dd3aa0ae7ff26a62832269c15f00ca439c6e5b5c5f391015b60405180910390a150506001600955565b600280600b5460ff1660038111156121b1576121b16151ab565b10156121d05760405163098b967160e21b815260040160405180910390fd5b6010548383612243828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b16602082015287925060340190505b604051602081830303815290604052805190602001206145da565b6122605760405163c8ac23c360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000002386f26fc1000008034146122a157604051631fc4606f60e31b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000a00169060ff1660038111156122de576122de6151ab565b6122e89190615544565b6123327f00000000000000000000000000000000000000000000000000000000000001007f000000000000000000000000000000000000000000000000000000000000010061569a565b61ffff1661234091906154a2565b6000541115612362576040516304b3f10360e41b815260040160405180910390fd5b336000908152600d602052604090205460ff1615612393576040516315bc7bef60e21b815260040160405180910390fd5b600260095414156123b65760405162461bcd60e51b81526004016118589061560c565b6002600955336000908152600d60205260408120805460ff19166001179055546123df90614506565b61241861241366470de4df8200007f00000000000000000000000000000000000000000000000002386f26fc1000006154ef565b6110f3565b6124376124296106946000546145f0565b5166470de4df820000614687565b6124423360016145c0565b505060016009555050505050565b6008546001600160a01b0316331461247a5760405162461bcd60e51b815260040161185890615643565b6001600160a01b03919091166000908152601e60205260409020805460ff1916911515919091179055565b806124af81612661565b6001600160a01b0316336001600160a01b0316146124e057604051632afe9a2360e01b815260040160405180910390fd5b6000828152601c60205260409020546001600160a01b0316612515576040516347ac481b60e01b815260040160405180910390fd5b600082815260176020908152604080832083905560238252808320426003909101558051858152918201929092526000805160206158a483398151915291015b60405180910390a15050565b6008546001600160a01b0316331461258b5760405162461bcd60e51b815260040161185890615643565b601254608011156125af57604051639efd128d60e01b815260040160405180910390fd5b600080600b5460ff1660038111156125c9576125c96151ab565b146125e75760405163098b967160e21b815260040160405180910390fd5b6102006000541161260b5760405163098b967160e21b815260040160405180910390fd5b600b80546001919060ff191682805b0217905550600b546040517f0c7df5c41f5db1871b22033f4e6cc38d80772527b6d731c7f1be10732ca9e3e7916126569160ff909116906151c1565b60405180910390a150565b600061266c826146fa565b5192915050565b6008546001600160a01b0316331461269d5760405162461bcd60e51b815260040161185890615643565b600260095414156126c05760405162461bcd60e51b81526004016118589061560c565b60026009556021546126e557604051632f31015b60e11b815260040160405180910390fd5b602180546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d806000811461273a576040519150601f19603f3d011682016040523d82523d6000602084013e61273f565b606091505b505090508061276157604051632f31015b60e11b815260040160405180910390fd5b6040518281527f2d5923adf91dd211e633a33f2e27918338e6a33e3b3f386e9d466d1bc52eba7990602001611e17565b6008546001600160a01b031633146127bb5760405162461bcd60e51b815260040161185890615643565b6011805460ff8082161560ff1990921682179092556040519116151581527ffb4e2971f359a0145230242cec0aa5f8dbea151a33a56a708b844ee8edaf26b6906020015b60405180910390a1565b60006001600160a01b038216612832576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6008546001600160a01b031633146128815760405162461bcd60e51b815260040161185890615643565b61288b6000614821565b565b6008546001600160a01b031633146128b75760405162461bcd60e51b815260040161185890615643565b600280600b5460ff1660038111156128d1576128d16151ab565b146128ef5760405163098b967160e21b815260040160405180910390fd5b600b80546003919060ff191660018361261a565b6008546001600160a01b0316331461292d5760405162461bcd60e51b815260040161185890615643565b600a8190556040518181527f3716f232c8d8ab5b747e1964a12bd66b18ee73573b5bf671b7ab254f6036634d90602001612656565b6008546001600160a01b0316331461298c5760405162461bcd60e51b815260040161185890615643565b600180600b5460ff1660038111156129a6576129a66151ab565b146129c45760405163098b967160e21b815260040160405180910390fd5b600b80546002919060ff191660018361261a565b60115460ff166129fb5760405163691b948f60e01b815260040160405180910390fd5b82612a0581612661565b6001600160a01b0316336001600160a01b031614612a3657604051632afe9a2360e01b815260040160405180910390fd5b612a478266470de4df820000615544565b3414612a6657604051631fc4606f60e31b815260040160405180910390fd5b60005b82811015612b2757601254848483818110612a8657612a866155af565b905060200201351180612ab15750838382818110612aa657612aa66155af565b905060200201356000145b15612acf57604051638ccdbe7f60e01b815260040160405180910390fd5b612af3612429858584818110612ae757612ae76155af565b90506020020135611472565b612b1585858584818110612b0957612b096155af565b90506020020135614873565b80612b1f816156e1565b915050612a69565b5050505050565b60115460ff16612b515760405163691b948f60e01b815260040160405180910390fd5b82612b5b81612661565b6001600160a01b0316336001600160a01b031614612b8c57604051632afe9a2360e01b815260040160405180910390fd5b82601254811180612b9b575080155b15612bb957604051638ccdbe7f60e01b815260040160405180910390fd5b6000612bc485611472565b519050336001600160a01b03821614801590612be7575066470de4df8200003414155b15612c0557604051631fc4606f60e31b815260040160405180910390fd5b336001600160a01b038216148015612c1d5750600034115b15612c3b57604051631fc4606f60e31b815260040160405180910390fd5b3415612c4b57612c4b8134614687565b612c558686614873565b8315612c6557612c6586866112f6565b505050505050565b600180600b5460ff166003811115612c8757612c876151ab565b1015612ca65760405163098b967160e21b815260040160405180910390fd5b600f548383612d02828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b1660208201528792506034019050612228565b612d1f5760405163c8ac23c360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000002386f26fc100000803414612d6057604051631fc4606f60e31b815260040160405180910390fd5b336000908152600c602052604090205460ff1615612d91576040516315bc7bef60e21b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000a00169060ff166003811115612dce57612dce6151ab565b612dd89190615544565b612e227f00000000000000000000000000000000000000000000000000000000000001007f000000000000000000000000000000000000000000000000000000000000010061569a565b61ffff16612e3091906154a2565b6000541115612e52576040516304b3f10360e41b815260040160405180910390fd5b60026009541415612e755760405162461bcd60e51b81526004016118589061560c565b6002600955336000908152600c60205260408120805460ff19166001179055546123df90614506565b6008546001600160a01b03163314612ec85760405162461bcd60e51b815260040161185890615643565b601b805460ff8082161560ff1990921682179092556040519116151581527f48047c0a84651e8cf29bf88cedfe6c9447848ff5f69f17cbdfb140f7f7d8f9d3906020016127ff565b6060600380546111a1906154ba565b6008546001600160a01b03163314612f495760405162461bcd60e51b815260040161185890615643565b601055565b600380600b5460ff166003811115612f6857612f686151ab565b14612f865760405163098b967160e21b815260040160405180910390fd5b600b5461ffff7f0000000000000000000000000000000000000000000000000000000000000a00169060ff166003811115612fc357612fc36151ab565b612fcd9190615544565b6130177f00000000000000000000000000000000000000000000000000000000000001007f000000000000000000000000000000000000000000000000000000000000010061569a565b61ffff1661302591906154a2565b6000541115613047576040516304b3f10360e41b815260040160405180910390fd5b613071827f00000000000000000000000000000000000000000000000002386f26fc100000615544565b80341461309157604051631fc4606f60e31b815260040160405180910390fd5b600260095414156130b45760405162461bcd60e51b81526004016118589061560c565b600260095560088311156130db57604051636c2b1b2360e01b815260040160405180910390fd5b3233146130fb5760405163c5ad1c2d60e01b815260040160405180910390fd5b61313961312f66470de4df8200007f00000000000000000000000000000000000000000000000002386f26fc1000006154ef565b6124139085615544565b60005b838110156131885761315a8160005461315591906154a2565b614506565b6131766124296106948360005461317191906154a2565b6145f0565b80613180816156e1565b91505061313c565b5061319333846145c0565b5050600160095550565b6001600160a01b0382163314156131c75760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6008546001600160a01b0316331461325d5760405162461bcd60e51b815260040161185890615643565b600f55565b6008546001600160a01b0316331461328c5760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166132b35760405163e6c4247b60e01b815260040160405180910390fd5b602480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9b86171bab9d24e82c2c7748d0fab7c14cb8fb55091a66bf47822c78af1eb58190602001612656565b6025546001600160a01b0316331480159061332757506008546001600160a01b03163314155b15613345576040516319b1226f60e01b815260040160405180910390fd5b60008281526018602090815260408083208484529091529020548290829060ff166133835760405163d0aeeedb60e01b815260040160405180910390fd5b600061338e856113be565b516001600160a01b031614156133b7576040516347ac481b60e01b815260040160405180910390fd5b6000848152601c6020908152604080832080546001600160a01b03191681556001810180546001600160801b031916905560028101849055600301839055601782529182902085905581518681529081018590526000805160206158a48339815191529101612078565b6008546001600160a01b0316331461344b5760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166134725760405163e6c4247b60e01b815260040160405180910390fd5b602680546001600160a01b0319166001600160a01b0383169081179091556040519081527f3ff9503ebb449a398e05d1e0984e6bbebc0b2af8f06707fe1111bfc707a9adfe90602001612656565b600e54828261351c828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b03193360601b1660208201528792506034019050612228565b6135395760405163c8ac23c360e01b815260040160405180910390fd5b336000908152601e602052604090205460ff161561356a5760405163e9d5636f60e01b815260040160405180910390fd5b601354601254141561358f5760405163a055d0d160e01b815260040160405180910390fd5b6001600160f81b0319600089901a60f81b166135be5760405163a0973b4960e01b815260040160405180910390fd5b601a600088886040516020016135de929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561362557604051635488c1b960e11b815260040160405180910390fd5b33600090815260166020526040902054600814156136565760405163a055d0d160e01b815260040160405180910390fd5b33600081815260166020908152604080832080546001908101909155601280548201905581518084018d90528083018c90528251808203840181526060820184528051908501208552601a9093529220805460ff19169092179091556136c891611790918a908a908d906080016155dc565b6012805460009081526015602090815260409182902080546001600160a01b0319166001600160a01b0395909516949094179093559054905133815290917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b910160405180910390a25050505050505050565b6137468484846142e8565b6001600160a01b0383163b1515801561376857506137668484848461495b565b155b15613786576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b601b5460ff166137af57604051631009968f60e01b815260040160405180910390fd5b836137b981612661565b6001600160a01b0316336001600160a01b0316146137ea57604051632afe9a2360e01b815260040160405180910390fd5b612b27858533868661414e565b6026546001600160a01b03163314613822576040516336c24c2360e11b815260040160405180910390fd5b61382c8134614687565b50565b606061383a82613ee4565b61385757604051632194448760e11b815260040160405180910390fd5b601f5460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b15801561389b57600080fd5b505afa1580156138af573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261118c91908101906156fc565b6026546001600160a01b03163314613902576040516336c24c2360e11b815260040160405180910390fd5b61288b346110f3565b6000818152602360205260408120600101548061392b5750600192915050565b600061393782436154ef565b9050600061394862030d408361551c565b9050600a548111156139595750600a545b60006127106139698360016154a2565b6139739085615544565b61397d919061551c565b60008781526023602052604090205461399691906154a2565b905060018110156139a5575060015b95945050505050565b6008546001600160a01b031633146139d85760405162461bcd60e51b815260040161185890615643565b6001600160a01b0381166139ff5760405163e6c4247b60e01b815260040160405180910390fd5b601f80546001600160a01b0319166001600160a01b0383169081179091556040519081527fecd048926e13141636897d3f0d342bef0b1e0f18e90fd56c22ec853f222980b790602001612656565b6008546001600160a01b03163314613a775760405162461bcd60e51b815260040161185890615643565b60125415613a985760405163a055d0d160e01b815260040160405180910390fd5b613aa3608080615544565b8114613ac25760405163a0973b4960e01b815260040160405180910390fd5b60005b6080811015613c9b576000613adb8260016154a2565b905060008080808787613aef608089615544565b90613afb608089615544565b92613b0893929190615769565b810190613b159190615793565b929650909450925090506001600160f81b0319600082901a60f81b16613b4e5760405163a0973b4960e01b815260040160405180910390fd5b601a60008484604051602001613b6e929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615613bb557604051635488c1b960e11b815260040160405180910390fd5b6001600160a01b03841660009081526016602052604090205460081415613bef5760405163a055d0d160e01b815260040160405180910390fd5b6001600160a01b0384166000818152601660209081526040808320805460019081019091558151808401899052808301889052825180820384018152606082018085528151918601919091208652601a90945293829020805460ff19169091179055929052905186917fa6aa7d5bcf392d6f8fb27a0e9837e09984afa852549fd3125bfb294d983f9f5b919081900360800190a250505050508080613c93906156e1565b915050613ac5565b50613cdb82828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506140ef92505050565b6000805260156020527fa31547ce6245cdb9ecea19cf8c7eb9f5974025bb4075011409251ae855b30aed80546001600160a01b0319166001600160a01b039290921691909117905550506080601255565b6008546001600160a01b03163314613d565760405162461bcd60e51b815260040161185890615643565b6001600160a01b038116613dbb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611858565b61382c81614821565b6008546001600160a01b03163314613dee5760405162461bcd60e51b815260040161185890615643565b8060135410613e105760405163a055d0d160e01b815260040160405180910390fd5b60138190556040518181527f5a5dddfeab101151b5fc13ae7871208057836c3980dcb28081a52d59e0f2d94390602001612656565b6008546001600160a01b03163314613e6f5760405162461bcd60e51b815260040161185890615643565b6001600160a01b038116613e965760405163e6c4247b60e01b815260040160405180910390fd5b602580546001600160a01b0319166001600160a01b0383169081179091556040519081527f309760724dfef4345276c369654fa30018f3ad5f76f69ff99b73ea259375b49090602001612656565b600081600111158015613ef8575060005482105b801561118c575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6060613f9a84613f8a8560016154a2565b613f958560016154a2565b614a52565b90505b9392505050565b606061118c826001600019614a52565b60026009541415613fd75760405162461bcd60e51b81526004016118589061560c565b60026009556000818152601d60205260409020546001600160a01b03166140145760405160016259cde560e11b0319815260040160405180910390fd5b6000818152601d6020526040812060018101805482546001600160a01b0319169092559190915580156140bf57600061404c83612661565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114614096576040519150601f19603f3d011682016040523d82523d6000602084013e61409b565b606091505b50509050806140bd57604051632ee66eed60e01b815260040160405180910390fd5b505b6040518281527fc0f85208e35254684c619f02df13c81238b1f82d1ce927b93ac4e320bee43f3190602001612186565b60008061411a8360405160200161410691906157d2565b604051602081830303815290604052614b03565b90508051602082016000f091506001600160a01b0382166116185760405163046a55db60e11b815260040160405180910390fd5b6001600160a01b0383166000908152601e602052604090205460ff16156141885760405163e9d5636f60e01b815260040160405180910390fd5b6001600160f81b0319600085901a60f81b166141b75760405163a0973b4960e01b815260040160405180910390fd5b601a600083836040516020016141d7929190918252602082015260400190565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561421e57604051635488c1b960e11b815260040160405180910390fd5b6000858152601c602090815260409182902080546001600160a01b0319166001600160a01b03871690811782556001820180546001600160801b03191660808a901c179055600282018690556003909101849055915191825286917f91db776821b6cd8516424cca4b60cde3d965102a5a2b2612b538a9bcc7155158910160405180910390a2600085815260176020908152604080832083905560238252808320426003909101558051888152918201929092526000805160206158a483398151915291016113af565b60006142f3826146fa565b80519091506000906001600160a01b0316336001600160a01b03161480614321575081516143219033610ff5565b8061433c57503361433184611224565b6001600160a01b0316145b90508061435c57604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b0316146143915760405162a1148160e81b815260040160405180910390fd5b6001600160a01b0384166143b857604051633a954ecd60e21b815260040160405180910390fd5b6143c58585856001614b2f565b6143d56000848460000151613f1d565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b4290921691909102179092559086018083529120549091166144bf576000548110156144bf57825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612b27565b6000614511826145f0565b600083815260196020908152604080832060019081905560188352818420858552835292819020805460ff191690931790925581518581529081018390529192507ed15c27c63a10a83b4eadb76d945304112b12090976b6bb55e37c7aace877df910160405180910390a1600082815260176020908152604080832084905560238252918290204260039091015581518481529081018390526000805160206158a48339815191529101612555565b611685828260405180602001604052806000815250614b8a565b6000826145e78584614b97565b14949350505050565b60006080821115614683576012548261460a6001436154ef565b604051634f4b504360e01b602082015260248101929092524060448201526001600160601b031941606090811b8216606484015244607884015233901b16609882015260ac016040516020818303038152906040528051906020012060001c6146739190615530565b61467e9060016154a2565b61118c565b5090565b604080516001600160a01b0384168152602081018390527fc022b6ffc9301dc614c4e05b0216e5438a405e79147d64c1ff2ab75b17fba5d5910160405180910390a16001600160a01b038216600090815260226020526040812080548392906146f19084906154a2565b90915550505050565b6040805160608101825260008082526020820181905291810191909152818060011115801561472a575060005481105b1561480857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906148065780516001600160a01b03161561479d579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215614801579392505050565b61479d565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082815260186020908152604080832084845290915290205460ff16156148ae5760405163fbe51aef60e01b815260040160405180910390fd5b60008181526014602052604090205461020014156148df57604051637f13a70f60e11b815260040160405180910390fd5b60008281526018602090815260408083208484528252808320805460ff19166001908117909155858452601983528184208054820190558484526014835292819020805490930190925581518481529081018390527ed15c27c63a10a83b4eadb76d945304112b12090976b6bb55e37c7aace877df9101612555565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906149909033908990889088906004016157f8565b602060405180830381600087803b1580156149aa57600080fd5b505af19250505080156149da575060408051601f3d908101601f191682019092526149d791810190615835565b60015b614a35573d808015614a08576040519150601f19603f3d011682016040523d82523d6000602084013e614a0d565b606091505b508051614a2d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060833b80614a71575050604080516020810190915260008152613f9d565b80841115614a8f575050604080516020810190915260008152613f9d565b83831015614ac15760405163162544fd60e11b8152600481018290526024810185905260448101849052606401611858565b8383038482036000828210614ad65782614ad8565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b6060815182604051602001614b19929190615852565b6040516020818303038152906040529050919050565b60005b81811015612b27576000614b4682856154a2565b9050614b5181614c0b565b6000818152601d60205260409020546001600160a01b031615614b7757614b7781613fb4565b5080614b82816156e1565b915050614b32565b6112f18383836001614c3e565b600081815b8451811015614c03576000858281518110614bb957614bb96155af565b60200260200101519050808311614bdf5760008381526020829052604090209250614bf0565b600081815260208490526040902092505b5080614bfb816156e1565b915050614b9c565b509392505050565b614c148161390b565b60009182526023602052604090912090815543600180830191909155600290910180549091019055565b6000546001600160a01b038516614c6757604051622e076360e81b815260040160405180910390fd5b83614c855760405163b562e8dd60e01b815260040160405180910390fd5b614c926000868387614b2f565b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015614d3a57506001600160a01b0387163b15155b15614dc3575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4614d8b600088848060010195508861495b565b614da8576040516368d2bf6b60e11b815260040160405180910390fd5b80821415614d40578260005414614dbe57600080fd5b614e09565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614dc4575b50600055612b27565b6001600160e01b03198116811461382c57600080fd5b600060208284031215614e3a57600080fd5b8135613f9d81614e12565b60008060408385031215614e5857600080fd5b50508035926020909101359150565b60005b83811015614e82578181015183820152602001614e6a565b838111156137865750506000910152565b60008151808452614eab816020860160208601614e67565b601f01601f19169290920160200192915050565b602081526000613f9d6020830184614e93565b600060208284031215614ee457600080fd5b5035919050565b6001600160a01b038116811461382c57600080fd5b60008060408385031215614f1357600080fd5b8235614f1e81614eeb565b946020939093013593505050565b6001600160801b03198116811461382c57600080fd5b600080600080600060a08688031215614f5a57600080fd5b853594506020860135614f6c81614f2c565b935060408601359250606086013591506080860135614f8a81614eeb565b809150509295509295909350565b60008060008060808587031215614fae57600080fd5b843593506020850135614fc081614f2c565b93969395505050506040820135916060013590565b600080600060608486031215614fea57600080fd5b8335614ff581614eeb565b9250602084013561500581614eeb565b929592945050506040919091013590565b600061080080838503121561502a57600080fd5b83818401111561503957600080fd5b509092915050565b60006080828403121561505357600080fd5b8260808301111561161857600080fd5b6000806040838503121561507657600080fd5b82359150602083013561508881614eeb565b809150509250929050565b6000602082840312156150a557600080fd5b8135613f9d81614eeb565b6000806000606084860312156150c557600080fd5b505081359360208301359350604090920135919050565b60008083601f8401126150ee57600080fd5b5081356001600160401b0381111561510557600080fd5b6020830191508360208260051b8501011115611ae157600080fd5b6000806020838503121561513357600080fd5b82356001600160401b0381111561514957600080fd5b615155858286016150dc565b90969095509350505050565b8035801515811461517157600080fd5b919050565b6000806040838503121561518957600080fd5b823561519481614eeb565b91506151a260208401615161565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600483106151e357634e487b7160e01b600052602160045260246000fd5b91905290565b6000806000604084860312156151fe57600080fd5b8335925060208401356001600160401b0381111561521b57600080fd5b615227868287016150dc565b9497909650939450505050565b60008060006060848603121561524957600080fd5b833592506020840135915061526060408501615161565b90509250925092565b60008060008060006080868803121561528157600080fd5b853561528c81614f2c565b9450602086013593506040860135925060608601356001600160401b038111156152b557600080fd5b6152c1888289016150dc565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715615310576153106152d2565b604052919050565b60006001600160401b03821115615331576153316152d2565b50601f01601f191660200190565b6000806000806080858703121561535557600080fd5b843561536081614eeb565b9350602085013561537081614eeb565b92506040850135915060608501356001600160401b0381111561539257600080fd5b8501601f810187136153a357600080fd5b80356153b66153b182615318565b6152e8565b8181528860208385010111156153cb57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806020838503121561540057600080fd5b82356001600160401b038082111561541757600080fd5b818501915085601f83011261542b57600080fd5b81358181111561543a57600080fd5b86602082850101111561544c57600080fd5b60209290920196919550909350505050565b6000806040838503121561547157600080fd5b823561547c81614eeb565b9150602083013561508881614eeb565b634e487b7160e01b600052601160045260246000fd5b600082198211156154b5576154b561548c565b500190565b600181811c908216806154ce57607f821691505b6020821081141561161857634e487b7160e01b600052602260045260246000fd5b6000828210156155015761550161548c565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261552b5761552b615506565b500490565b60008261553f5761553f615506565b500690565b600081600019048311821515161561555e5761555e61548c565b500290565b6000806000806080858703121561557957600080fd5b845161558481614eeb565b80945050602085015192506040850151915060608501516155a481614f2c565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b6000816155d4576155d461548c565b506000190190565b6001600160a01b03949094168452602084019290925260408301526001600160801b031916606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff808316818114156156905761569061548c565b6001019392505050565b600061ffff8083168185168083038211156156b7576156b761548c565b01949350505050565b600061ffff808416806156d5576156d5615506565b92169190910692915050565b60006000198214156156f5576156f561548c565b5060010190565b60006020828403121561570e57600080fd5b81516001600160401b0381111561572457600080fd5b8201601f8101841361573557600080fd5b80516157436153b182615318565b81815285602083850101111561575857600080fd5b6139a5826020830160208601614e67565b6000808585111561577957600080fd5b8386111561578657600080fd5b5050820193919092039150565b600080600080608085870312156157a957600080fd5b84356157b481614eeb565b9350602085013592506040850135915060608501356155a481614f2c565b60008152600082516157eb816001850160208701614e67565b9190910160010192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061582b90830184614e93565b9695505050505050565b60006020828403121561584757600080fd5b8151613f9d81614e12565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b6005820152815160009061589581600e850160208701614e67565b91909101600e01939250505056fedeea1fc31c86232201bea5a0dc8d7c65c2482e08fee6630c29ace049fdc180a8a2646970667358221220d94b590a62bed82080bcc31c180f6dc806e0ee72bed9e61b30f50fe5dfcb31f964736f6c63430008080033

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

000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000002386f26fc100000

-----Decoded View---------------
Arg [0] : artistsReserved (uint16): 256
Arg [1] : teamReserved (uint16): 256
Arg [2] : maxPerPhase (uint16): 2560
Arg [3] : mintCost (uint256): 160000000000000000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000a00
Arg [3] : 00000000000000000000000000000000000000000000000002386f26fc100000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.