ETH Price: $3,527.56 (+4.15%)
Gas: 7.88 Gwei

Token

SCAPE: Founding Citizens (SCPCIT)
 

Overview

Max Total Supply

5,000 SCPCIT

Holders

766

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 SCPCIT
0x57415FdFeEBaBeEaa9C363800e189fB30f7Ef68A
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
ScapeNftCollection

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 5000 runs

Other Settings:
paris EvmVersion
File 1 of 29 : ScapeNftCollection.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IERC2981 } from "@openzeppelin/contracts/interfaces/IERC2981.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { ERC721C, ERC721OpenZeppelin } from "@limitbreak/creator-token-contracts/contracts/erc721c/ERC721C.sol";

/// @title Scape: NFT collection
contract ScapeNftCollection is ERC721C, IERC2981, Ownable, ReentrancyGuard, Pausable {
  uint32 public immutable MAX_SUPPLY;
  uint16 public immutable MAX_PUBLIC_MINT_PER_TRANSACTION;
  uint16 public immutable MAX_ROYALTY_BASIS_POINTS;
  uint32 public maxWhitelistSupply;
  uint32 public totalSupply;

  struct MintSchedule {
    uint32 whitelistStartTime;
    uint32 whitelistEndTime;
    /// If not all whitelist NFTs are minted during whitelist period
    /// then public mint should start at a specified time
    uint32 publicSaleStartTime;
    uint32 publicSaleEndTime;
  }

  /// Access Control
  address public contractManager;

  uint256 public mintPrice;

  /// Collection
  uint256 public tokenIdIndex;
  string public baseURI;

  /// Whitelist related
  bytes32 public merkleRoot;
  mapping(address => uint256) public hasWhitelistUserMinted;

  MintSchedule public mintSchedule;
  /// Default is OFF
  bool public autoPublicMintSwitchover;

  /// Royalty related
  uint32 public royaltyBasisPoints;
  address public royaltyReceiverAddress;

  error MaxSupplyReached();
  error MaxWhitelistReached();
  error WhitelistProofInvalid();
  error WhitelistMintNotAllowed();
  error PublicMintNotAllowed();
  error MintFundsInvalid();
  error WithdrawalFailed();
  error MintScheduleInvalid();
  error MintAmountInvalid();
  error ReserveMintNotAllowed();
  error RoyaltyInvalid();
  error TokenIdInvalid(uint256 tokenId);
  error AddressInvalid(address account);
  error AutoSwitchoverValueInvalid();
  error MaxWhitelistSupplyInvalid();
  error OwnableUnauthorizedAccount(address account);
  error EnforcedPause();
  error ExpectedPause();
  error ERC721InsufficientApproval(address operator, uint256 tokenId);

  event BaseURIChanged(string indexed baseURI);
  event MerkleRootChanged(bytes32 indexed merkleRoot);
  event MintScheduleChanged(MintSchedule mintSchedule);
  event ContractManagerChanged(address indexed oldManager, address indexed newManager);
  event RoyaltyInfoChanged(
    address indexed oldRoyaltyReceiver,
    address indexed newRoyaltyReceiver,
    uint256 indexed royaltyBasisPoints
  );
  event AutoPublicMintSwitchoverChanged(bool indexed autoPublicMintSwitchover);
  event MintPriceChanged(uint256 indexed mintPrice);
  event MaxWhitelistSupplyChanged(uint256 indexed maxWhitelistSupply);

  /// @notice Checks if the caller is the contract manager or contract owner
  /// @dev Relies on Ownable to verify if `msg.sender` is the contract owner
  modifier managerOrOwner() {
    if (contractManager != msg.sender && owner() != msg.sender) {
      revert OwnableUnauthorizedAccount(msg.sender);
    }
    _;
  }

  /// @notice Initializes the contract with main parameters
  /// @dev Initializes Ownable with `msg.sender` as contract owner
  /// Initializes ERC721 with name and symbol
  /// @param _name Collection name
  /// @param _symbol Collection symbol
  /// @param _maxSupply Maximum possible supply for the collection
  /// @param _maxWhitelistSupply Maximum supply for whitelisted minting
  /// @param _maxPublicMintPerTransaction Maximum public mints per tx
  /// @param _maxRoyaltyBasisPoints Maximum possible royalty basis points
  /// @param _mintPrice Price of a single NFT mint
  /// @param _contractManager Contract manager address
  /// @param _merkleRoot Merkle root defining the whitelist
  /// @param _tokenBaseURI Initial collection URI
  /// @param _mintSchedule Timestamps for MintSchedule
  constructor(
    string memory _name,
    string memory _symbol,
    uint32 _maxSupply,
    uint32 _maxWhitelistSupply,
    uint16 _maxPublicMintPerTransaction,
    uint16 _maxRoyaltyBasisPoints,
    uint256 _mintPrice,
    address _contractManager,
    bytes32 _merkleRoot,
    string memory _tokenBaseURI,
    MintSchedule memory _mintSchedule
  )
    ERC721OpenZeppelin(_name, _symbol)
    /// Owner is deployer
    Ownable()
  {
    MAX_SUPPLY = _maxSupply;
    maxWhitelistSupply = _maxWhitelistSupply;
    MAX_PUBLIC_MINT_PER_TRANSACTION = _maxPublicMintPerTransaction;
    MAX_ROYALTY_BASIS_POINTS = _maxRoyaltyBasisPoints;
    mintPrice = _mintPrice;

    contractManager = _contractManager;
    merkleRoot = _merkleRoot;
    baseURI = _tokenBaseURI;

    mintSchedule = _mintSchedule;
    _validateMintSchedule(mintSchedule);

    royaltyReceiverAddress = msg.sender;
    royaltyBasisPoints = _maxRoyaltyBasisPoints;
  }

  /// @notice Mints an NFT for a whitelisted user
  /// @dev Protected by ReentrancyGuard. Can be paused
  /// @param _mintAmount Number of Nfts to be minted
  /// @param _whitelistedAmount Number of Nfts allowed to minted
  /// @param _merkleProof Merkle proof attesting address eligibility
  function whitelistedMint(
    uint32 _mintAmount,
    uint32 _whitelistedAmount,
    bytes32[] calldata _merkleProof
  ) external payable nonReentrant whenNotPaused {
    /// Allow whitelist mint including startTime and excluding endtime
    if (block.timestamp < mintSchedule.whitelistStartTime || block.timestamp >= mintSchedule.whitelistEndTime) {
      revert WhitelistMintNotAllowed();
    }

    if (tokenIdIndex + _mintAmount > maxWhitelistSupply) {
      revert MaxWhitelistReached();
    }

    uint256 totalAmount = hasWhitelistUserMinted[msg.sender] + _mintAmount;

    if (_mintAmount == 0 || totalAmount > _whitelistedAmount) {
      revert MintAmountInvalid();
    }

    if (msg.value != mintPrice * _mintAmount) {
      revert MintFundsInvalid();
    }

    /// Generate the merkle tree leaf using senders address and whitelisted amount
    bytes32 leaf = keccak256(abi.encode(keccak256(abi.encode(msg.sender, _whitelistedAmount))));

    /// Verify if the user is allowed to claim by checking if leaf is part of merkle root or not
    if (!MerkleProof.verifyCalldata(_merkleProof, merkleRoot, leaf)) {
      revert WhitelistProofInvalid();
    }

    hasWhitelistUserMinted[msg.sender] = totalAmount;

    uint256 tokenIdIndexTemp = tokenIdIndex;

    for (uint256 i; i < _mintAmount; ) {
      unchecked {
        tokenIdIndexTemp += 1;
      }

      _safeMint(msg.sender, tokenIdIndexTemp);

      unchecked {
        i += 1;
      }
    }

    tokenIdIndex = tokenIdIndexTemp;

    unchecked {
      totalSupply += _mintAmount;
    }
  }

  /// @notice Mints one or two NFTs
  /// @dev Protected by ReentrancyGuard. Can be paused
  /// @param _amount Number of NFTs to be minted
  function publicMint(uint32 _amount) external payable nonReentrant whenNotPaused {
    /// Allow public mint including startTime and excluding endtime
    if (block.timestamp >= mintSchedule.publicSaleEndTime) {
      revert PublicMintNotAllowed();
    } else if (block.timestamp < mintSchedule.publicSaleStartTime) {
      /// Allow auto switchover to public mint from whitelist mint
      /// if `autoPublicMintSwitchover` is ON
      if (!autoPublicMintSwitchover || tokenIdIndex < maxWhitelistSupply) {
        revert PublicMintNotAllowed();
      }
    }

    if (tokenIdIndex + _amount > MAX_SUPPLY) {
      revert MaxSupplyReached();
    }

    if (_amount == 0 || _amount > MAX_PUBLIC_MINT_PER_TRANSACTION) {
      revert MintAmountInvalid();
    }

    if (msg.value != mintPrice * _amount) {
      revert MintFundsInvalid();
    }

    uint256 tokenIdIndexTemp = tokenIdIndex;

    for (uint256 i; i < _amount; ) {
      unchecked {
        tokenIdIndexTemp += 1;
      }

      _safeMint(msg.sender, tokenIdIndexTemp);

      unchecked {
        i += 1;
      }
    }

    tokenIdIndex = tokenIdIndexTemp;

    unchecked {
      totalSupply += _amount;
    }
  }

  /// @notice Mints a number of remaining NFTs in batches
  /// @dev Access restricted only to owner
  /// @param _amount Number of NFTs to be minted
  function reserveMint(uint32 _amount) external payable onlyOwner {
    if (tokenIdIndex + _amount > MAX_SUPPLY) {
      revert MaxSupplyReached();
    }

    if (block.timestamp < mintSchedule.publicSaleEndTime) {
      revert ReserveMintNotAllowed();
    }

    uint256 tokenIdIndexTemp = tokenIdIndex;

    for (uint256 i; i < _amount; ) {
      unchecked {
        tokenIdIndexTemp += 1;
      }

      /// Note that we are using _mint here instead of _safeMint
      /// as we are sure that this will be called by
      /// a ERC721Receiver contract
      _mint(owner(), tokenIdIndexTemp);

      unchecked {
        i += 1;
      }
    }

    tokenIdIndex = tokenIdIndexTemp;

    unchecked {
      totalSupply += _amount;
    }
  }

  /// @notice Transfers all the accumulated funds to the contract owner
  /// @dev Access restricted only to manager and owner
  function withdraw() external managerOrOwner {
    (bool success, ) = owner().call{ value: address(this).balance }("");
    if (!success) {
      revert WithdrawalFailed();
    }
  }

  /// @notice Changes the collection URI
  /// @dev Access restricted only to owner
  /// @param _tokenBaseURI New collection URI
  function setBaseURI(string memory _tokenBaseURI) external onlyOwner {
    baseURI = _tokenBaseURI;
    emit BaseURIChanged(_tokenBaseURI);
  }

  /// @notice Changes the whitelist
  /// @dev Access restricted only to owner
  /// @param _merkleRoot New merkle root defining the whitelist
  function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
    merkleRoot = _merkleRoot;
    emit MerkleRootChanged(_merkleRoot);
  }

  /// @notice Allows to set mint price
  /// @dev Access restricted only to owner
  /// @param _mintPrice Mint price in wei
  function setMintPrice(uint256 _mintPrice) external onlyOwner {
    mintPrice = _mintPrice;

    emit MintPriceChanged(_mintPrice);
  }

  /// @notice Allows to set maxWhitelistSupply
  /// @dev Access restricted only to owner
  /// @param _maxWhitelistSupply Max allowed whitelist mints
  function setMaxWhitelistSupply(uint16 _maxWhitelistSupply) external onlyOwner {
    if (_maxWhitelistSupply > MAX_SUPPLY) {
      revert MaxWhitelistSupplyInvalid();
    }
    maxWhitelistSupply = _maxWhitelistSupply;

    emit MaxWhitelistSupplyChanged(_maxWhitelistSupply);
  }

  /// @notice Changes the mint schedule
  /// @dev Access restricted only to owner
  /// @param _mintSchedule New mint schedule
  function setMintSchedule(MintSchedule memory _mintSchedule) external onlyOwner {
    _validateMintSchedule(_mintSchedule);
    mintSchedule = _mintSchedule;

    emit MintScheduleChanged(_mintSchedule);
  }

  /// @notice Changes the royalty information for the collection
  /// @dev Access restricted only to owner
  /// @param _royaltyReceiverAddress Address of the new royalty receiver
  /// @param _royaltyBasisPoints Basis points defining the royalty
  function setRoyaltyInfo(address _royaltyReceiverAddress, uint32 _royaltyBasisPoints) external onlyOwner {
    if (_royaltyReceiverAddress == address(0) || _royaltyBasisPoints > MAX_ROYALTY_BASIS_POINTS) {
      revert RoyaltyInvalid();
    }

    address oldReceiver = royaltyReceiverAddress;
    royaltyReceiverAddress = _royaltyReceiverAddress;
    royaltyBasisPoints = _royaltyBasisPoints;

    emit RoyaltyInfoChanged(oldReceiver, _royaltyReceiverAddress, _royaltyBasisPoints);
  }

  /// @notice Set autoPublicMintSwitchover for public mint
  /// @dev Access restricted only to owner
  function setAutoPublicMintSwitchover(bool _autoPublicMintSwitchover) external onlyOwner {
    if (_autoPublicMintSwitchover == autoPublicMintSwitchover) {
      revert AutoSwitchoverValueInvalid();
    }
    autoPublicMintSwitchover = _autoPublicMintSwitchover;

    emit AutoPublicMintSwitchoverChanged(_autoPublicMintSwitchover);
  }

  /// @notice Pauses minting operations
  /// @dev Access restricted only to manager and owner
  function pauseMint() external managerOrOwner {
    if (paused()) {
      revert EnforcedPause();
    }
    _pause();
  }

  /// @notice Un-pauses minting operations
  /// @dev Access restricted only to owner
  function unPauseMint() external onlyOwner {
    if (!paused()) {
      revert ExpectedPause();
    }
    _unpause();
  }

  /// @notice Changes the contract manager address
  /// @dev Access restricted only to owner
  /// @param _newContractManager The address of the new contract manager
  function changeContractManager(address _newContractManager) external onlyOwner {
    if (_newContractManager == address(0)) {
      revert AddressInvalid(_newContractManager);
    }

    address oldManager = contractManager;
    contractManager = _newContractManager;

    emit ContractManagerChanged(oldManager, contractManager);
  }

  /// @notice Burns a specified token by ID
  /// @dev Using implementation of Openzeppelin/ERC721Burnable
  /// @param _tokenId Token ID
  function burn(uint256 _tokenId) external {
    if (!_isApprovedOrOwner(msg.sender, _tokenId)) {
      revert ERC721InsufficientApproval(msg.sender, _tokenId);
    }
    _burn(_tokenId);

    unchecked {
      totalSupply -= 1;
    }
  }

  /// @notice Calculates the royalty amount and provides the royalty receiver address
  /// @dev Provides compatibility with the ERC-2981 standard
  /// @param _tokenId Token ID
  /// @param _salePrice Price of the sale
  /// @return receiver Address of the royalty receiver
  /// @return royaltyAmount Amount of royalty to be honored
  function royaltyInfo(
    uint256 _tokenId,
    uint256 _salePrice
  ) external view override returns (address receiver, uint256 royaltyAmount) {
    if (_tokenId > tokenIdIndex) {
      revert TokenIdInvalid(_tokenId);
    }

    receiver = royaltyReceiverAddress;

    royaltyAmount = (_salePrice * royaltyBasisPoints) / 10000;
  }

  /// @notice Detects if an interface is implemented by the smart contract
  /// @dev Provides compatibility with the ERC-165 standard
  /// @param _interfaceId Identifier of the interface to verify
  /// @return `true` if the contract implements `_interfaceId` and
  ///  `_interfaceId` is not 0xffffffff, `false` otherwise
  function supportsInterface(bytes4 _interfaceId) public view override(ERC721C, IERC165) returns (bool) {
    return _interfaceId == type(IERC2981).interfaceId || super.supportsInterface(_interfaceId);
  }

  /// @dev Helper function validating a mint schedule
  /// @param _mintSchedule Struct of type MintSchedule
  function _validateMintSchedule(MintSchedule memory _mintSchedule) internal pure {
    if (
      _mintSchedule.whitelistStartTime == 0 ||
      _mintSchedule.whitelistStartTime >= _mintSchedule.whitelistEndTime ||
      _mintSchedule.publicSaleStartTime >= _mintSchedule.publicSaleEndTime ||
      _mintSchedule.whitelistEndTime > _mintSchedule.publicSaleStartTime
    ) {
      revert MintScheduleInvalid();
    }
  }

  /// @dev Overriding the _requireCallerIsContractOwner used by ERC721C
  /// Only callable by owner
  /// It is used by ERC721C standard to authorize functions
  /// we achive this by using `onlyOwner`
  function _requireCallerIsContractOwner() internal view override onlyOwner {}

  /// @dev Overriding the default _baseURI ERC721 which returns empty string
  /// @return Base URI string
  function _baseURI() internal view override returns (string memory) {
    return baseURI;
  }
}

File 2 of 29 : OwnablePermissions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/Context.sol";

abstract contract OwnablePermissions is Context {
    function _requireCallerIsContractOwner() internal view virtual;
}

File 3 of 29 : ERC721C.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/CreatorTokenBase.sol";
import "../token/erc721/ERC721OpenZeppelin.sol";

/**
 * @title ERC721C
 * @author Limit Break, Inc.
 * @notice Extends OpenZeppelin's ERC721 implementation with Creator Token functionality, which
 *         allows the contract owner to update the transfer validation logic by managing a security policy in
 *         an external transfer validation security policy registry.  See {CreatorTokenTransferValidator}.
 */
abstract contract ERC721C is ERC721OpenZeppelin, CreatorTokenBase {

    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId);
    }

    /// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateBeforeTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateAfterTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }
}

/**
 * @title ERC721CInitializable
 * @author Limit Break, Inc.
 * @notice Initializable implementation of ERC721C to allow for EIP-1167 proxy clones.
 */
abstract contract ERC721CInitializable is ERC721OpenZeppelinInitializable, CreatorTokenBase {
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId);
    }

    /// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateBeforeTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateAfterTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }
}

File 4 of 29 : ICreatorToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../interfaces/ICreatorTokenTransferValidator.sol";

interface ICreatorToken {
    event TransferValidatorUpdated(address oldValidator, address newValidator);

    function getTransferValidator() external view returns (ICreatorTokenTransferValidator);
    function getSecurityPolicy() external view returns (CollectionSecurityPolicy memory);
    function getWhitelistedOperators() external view returns (address[] memory);
    function getPermittedContractReceivers() external view returns (address[] memory);
    function isOperatorWhitelisted(address operator) external view returns (bool);
    function isContractReceiverPermitted(address receiver) external view returns (bool);
    function isTransferAllowed(address caller, address from, address to) external view returns (bool);
}

File 5 of 29 : ICreatorTokenTransferValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./IEOARegistry.sol";
import "./ITransferSecurityRegistry.sol";
import "./ITransferValidator.sol";

interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {}

File 6 of 29 : IEOARegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

interface IEOARegistry is IERC165 {
    function isVerifiedEOA(address account) external view returns (bool);
}

File 7 of 29 : ITransferSecurityRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/TransferPolicy.sol";

interface ITransferSecurityRegistry {
    event AddedToAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
    event CreatedAllowlist(AllowlistTypes indexed kind, uint256 indexed id, string indexed name);
    event ReassignedAllowlistOwnership(AllowlistTypes indexed kind, uint256 indexed id, address indexed newOwner);
    event RemovedFromAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
    event SetAllowlist(AllowlistTypes indexed kind, address indexed collection, uint120 indexed id);
    event SetTransferSecurityLevel(address indexed collection, TransferSecurityLevels level);

    function createOperatorWhitelist(string calldata name) external returns (uint120);
    function createPermittedContractReceiverAllowlist(string calldata name) external returns (uint120);
    function reassignOwnershipOfOperatorWhitelist(uint120 id, address newOwner) external;
    function reassignOwnershipOfPermittedContractReceiverAllowlist(uint120 id, address newOwner) external;
    function renounceOwnershipOfOperatorWhitelist(uint120 id) external;
    function renounceOwnershipOfPermittedContractReceiverAllowlist(uint120 id) external;
    function setTransferSecurityLevelOfCollection(address collection, TransferSecurityLevels level) external;
    function setOperatorWhitelistOfCollection(address collection, uint120 id) external;
    function setPermittedContractReceiverAllowlistOfCollection(address collection, uint120 id) external;
    function addOperatorToWhitelist(uint120 id, address operator) external;
    function addPermittedContractReceiverToAllowlist(uint120 id, address receiver) external;
    function removeOperatorFromWhitelist(uint120 id, address operator) external;
    function removePermittedContractReceiverFromAllowlist(uint120 id, address receiver) external;
    function getCollectionSecurityPolicy(address collection) external view returns (CollectionSecurityPolicy memory);
    function getWhitelistedOperators(uint120 id) external view returns (address[] memory);
    function getPermittedContractReceivers(uint120 id) external view returns (address[] memory);
    function isOperatorWhitelisted(uint120 id, address operator) external view returns (bool);
    function isContractReceiverPermitted(uint120 id, address receiver) external view returns (bool);
}

File 8 of 29 : ITransferValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/TransferPolicy.sol";

interface ITransferValidator {
    function applyCollectionTransferPolicy(address caller, address from, address to) external view;
}

File 9 of 29 : ERC721OpenZeppelin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

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

abstract contract ERC721OpenZeppelinBase is ERC721 {

    // Token name
    string internal _contractName;

    // Token symbol
    string internal _contractSymbol;

    function name() public view virtual override returns (string memory) {
        return _contractName;
    }

    function symbol() public view virtual override returns (string memory) {
        return _contractSymbol;
    }

    function _setNameAndSymbol(string memory name_, string memory symbol_) internal {
        _contractName = name_;
        _contractSymbol = symbol_;
    }
}

abstract contract ERC721OpenZeppelin is ERC721OpenZeppelinBase {
    constructor(string memory name_, string memory symbol_) ERC721("", "") {
        _setNameAndSymbol(name_, symbol_);
    }
}

abstract contract ERC721OpenZeppelinInitializable is OwnablePermissions, ERC721OpenZeppelinBase {

    error ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();

    /// @notice Specifies whether or not the contract is initialized
    bool private _erc721Initialized;

    /// @dev Initializes parameters of ERC721 tokens.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeERC721(string memory name_, string memory symbol_) public {
        _requireCallerIsContractOwner();

        if(_erc721Initialized) {
            revert ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();
        }

        _erc721Initialized = true;

        _setNameAndSymbol(name_, symbol_);
    }
}

File 10 of 29 : CreatorTokenBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenTransferValidator.sol";
import "../utils/TransferValidation.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";

/**
 * @title CreatorTokenBase
 * @author Limit Break, Inc.
 * @notice CreatorTokenBase is an abstract contract that provides basic functionality for managing token 
 * transfer policies through an implementation of ICreatorTokenTransferValidator. This contract is intended to be used
 * as a base for creator-specific token contracts, enabling customizable transfer restrictions and security policies.
 *
 * <h4>Features:</h4>
 * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
 * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
 * <ul>ICreatorToken: Implements the interface for creator tokens, providing view functions for token security policies.</ul>
 *
 * <h4>Benefits:</h4>
 * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
 * <ul>Allows creators to enforce policies such as whitelisted operators and permitted contract receivers.</ul>
 * <ul>Can be easily integrated into other token contracts as a base contract.</ul>
 *
 * <h4>Intended Usage:</h4>
 * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and 
 *   security policies.</ul>
 * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the 
 *   creator token.</ul>
 */
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {
    
    error CreatorTokenBase__InvalidTransferValidatorContract();
    error CreatorTokenBase__SetTransferValidatorFirst();

    address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x0000721C310194CcfC01E523fc93C9cCcFa2A0Ac);
    TransferSecurityLevels public constant DEFAULT_TRANSFER_SECURITY_LEVEL = TransferSecurityLevels.One;
    uint120 public constant DEFAULT_OPERATOR_WHITELIST_ID = uint120(1);

    ICreatorTokenTransferValidator private transferValidator;

    /**
     * @notice Allows the contract owner to set the transfer validator to the official validator contract
     *         and set the security policy to the recommended default settings.
     * @dev    May be overridden to change the default behavior of an individual collection.
     */
    function setToDefaultSecurityPolicy() public virtual {
        _requireCallerIsContractOwner();
        setTransferValidator(DEFAULT_TRANSFER_VALIDATOR);
        ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setTransferSecurityLevelOfCollection(address(this), DEFAULT_TRANSFER_SECURITY_LEVEL);
        ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setOperatorWhitelistOfCollection(address(this), DEFAULT_OPERATOR_WHITELIST_ID);
    }

    /**
     * @notice Allows the contract owner to set the transfer validator to a custom validator contract
     *         and set the security policy to their own custom settings.
     */
    function setToCustomValidatorAndSecurityPolicy(
        address validator, 
        TransferSecurityLevels level, 
        uint120 operatorWhitelistId, 
        uint120 permittedContractReceiversAllowlistId) public {
        _requireCallerIsContractOwner();

        setTransferValidator(validator);

        ICreatorTokenTransferValidator(validator).
            setTransferSecurityLevelOfCollection(address(this), level);

        ICreatorTokenTransferValidator(validator).
            setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);

        ICreatorTokenTransferValidator(validator).
            setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
    }

    /**
     * @notice Allows the contract owner to set the security policy to their own custom settings.
     * @dev    Reverts if the transfer validator has not been set.
     */
    function setToCustomSecurityPolicy(
        TransferSecurityLevels level, 
        uint120 operatorWhitelistId, 
        uint120 permittedContractReceiversAllowlistId) public {
        _requireCallerIsContractOwner();

        ICreatorTokenTransferValidator validator = getTransferValidator();
        if (address(validator) == address(0)) {
            revert CreatorTokenBase__SetTransferValidatorFirst();
        }

        validator.setTransferSecurityLevelOfCollection(address(this), level);
        validator.setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);
        validator.setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
    }

    /**
     * @notice Sets the transfer validator for the token contract.
     *
     * @dev    Throws when provided validator contract is not the zero address and doesn't support 
     *         the ICreatorTokenTransferValidator interface. 
     * @dev    Throws when the caller is not the contract owner.
     *
     * @dev    <h4>Postconditions:</h4>
     *         1. The transferValidator address is updated.
     *         2. The `TransferValidatorUpdated` event is emitted.
     *
     * @param transferValidator_ The address of the transfer validator contract.
     */
    function setTransferValidator(address transferValidator_) public {
        _requireCallerIsContractOwner();

        bool isValidTransferValidator = false;

        if(transferValidator_.code.length > 0) {
            try IERC165(transferValidator_).supportsInterface(type(ICreatorTokenTransferValidator).interfaceId) 
                returns (bool supportsInterface) {
                isValidTransferValidator = supportsInterface;
            } catch {}
        }

        if(transferValidator_ != address(0) && !isValidTransferValidator) {
            revert CreatorTokenBase__InvalidTransferValidatorContract();
        }

        emit TransferValidatorUpdated(address(transferValidator), transferValidator_);

        transferValidator = ICreatorTokenTransferValidator(transferValidator_);
    }

    /**
     * @notice Returns the transfer validator contract address for this token contract.
     */
    function getTransferValidator() public view override returns (ICreatorTokenTransferValidator) {
        return transferValidator;
    }

    /**
     * @notice Returns the security policy for this token contract, which includes:
     *         Transfer security level, operator whitelist id, permitted contract receiver allowlist id.
     */
    function getSecurityPolicy() public view override returns (CollectionSecurityPolicy memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getCollectionSecurityPolicy(address(this));
        }

        return CollectionSecurityPolicy({
            transferSecurityLevel: TransferSecurityLevels.Zero,
            operatorWhitelistId: 0,
            permittedContractReceiversId: 0
        });
    }

    /**
     * @notice Returns the list of all whitelisted operators for this token contract.
     * @dev    This can be an expensive call and should only be used in view-only functions.
     */
    function getWhitelistedOperators() public view override returns (address[] memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getWhitelistedOperators(
                transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId);
        }

        return new address[](0);
    }

    /**
     * @notice Returns the list of permitted contract receivers for this token contract.
     * @dev    This can be an expensive call and should only be used in view-only functions.
     */
    function getPermittedContractReceivers() public view override returns (address[] memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getPermittedContractReceivers(
                transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId);
        }

        return new address[](0);
    }

    /**
     * @notice Checks if an operator is whitelisted for this token contract.
     * @param operator The address of the operator to check.
     */
    function isOperatorWhitelisted(address operator) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.isOperatorWhitelisted(
                transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId, operator);
        }

        return false;
    }

    /**
     * @notice Checks if a contract receiver is permitted for this token contract.
     * @param receiver The address of the receiver to check.
     */
    function isContractReceiverPermitted(address receiver) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.isContractReceiverPermitted(
                transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId, receiver);
        }

        return false;
    }

    /**
     * @notice Determines if a transfer is allowed based on the token contract's security policy.  Use this function
     *         to simulate whether or not a transfer made by the specified `caller` from the `from` address to the `to`
     *         address would be allowed by this token's security policy.
     *
     * @notice This function only checks the security policy restrictions and does not check whether token ownership
     *         or approvals are in place. 
     *
     * @param caller The address of the simulated caller.
     * @param from   The address of the sender.
     * @param to     The address of the receiver.
     * @return       True if the transfer is allowed, false otherwise.
     */
    function isTransferAllowed(address caller, address from, address to) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            try transferValidator.applyCollectionTransferPolicy(caller, from, to) {
                return true;
            } catch {
                return false;
            }
        }
        return true;
    }

    /**
     * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
     *      Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
     *      and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
     *
     * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
     *      set to a non-zero address.
     *
     * @param caller  The address of the caller.
     * @param from    The address of the sender.
     * @param to      The address of the receiver.
     */
    function _preValidateTransfer(
        address caller, 
        address from, 
        address to, 
        uint256 /*tokenId*/, 
        uint256 /*value*/) internal virtual override {
        if (address(transferValidator) != address(0)) {
            transferValidator.applyCollectionTransferPolicy(caller, from, to);
        }
    }
}

File 11 of 29 : TransferPolicy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

enum AllowlistTypes {
    Operators,
    PermittedContractReceivers
}

enum ReceiverConstraints {
    None,
    NoCode,
    EOA
}

enum CallerConstraints {
    None,
    OperatorWhitelistEnableOTC,
    OperatorWhitelistDisableOTC
}

enum StakerConstraints {
    None,
    CallerIsTxOrigin,
    EOA
}

enum TransferSecurityLevels {
    Zero,
    One,
    Two,
    Three,
    Four,
    Five,
    Six
}

struct TransferSecurityPolicy {
    CallerConstraints callerConstraints;
    ReceiverConstraints receiverConstraints;
}

struct CollectionSecurityPolicy {
    TransferSecurityLevels transferSecurityLevel;
    uint120 operatorWhitelistId;
    uint120 permittedContractReceiversId;
}

File 12 of 29 : TransferValidation.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @title TransferValidation
 * @author Limit Break, Inc.
 * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks.
 * Openzeppelin's ERC721 contract only provides hooks for before and after transfer.  This allows
 * developers to validate or customize transfers within the context of a mint, a burn, or a transfer.
 */
abstract contract TransferValidation is Context {
    
    error ShouldNotMintToBurnAddress();

    /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
    function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual {
        bool fromZeroAddress = from == address(0);
        bool toZeroAddress = to == address(0);

        if(fromZeroAddress && toZeroAddress) {
            revert ShouldNotMintToBurnAddress();
        } else if(fromZeroAddress) {
            _preValidateMint(_msgSender(), to, tokenId, msg.value);
        } else if(toZeroAddress) {
            _preValidateBurn(_msgSender(), from, tokenId, msg.value);
        } else {
            _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
        }
    }

    /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
    function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual {
        bool fromZeroAddress = from == address(0);
        bool toZeroAddress = to == address(0);

        if(fromZeroAddress && toZeroAddress) {
            revert ShouldNotMintToBurnAddress();
        } else if(fromZeroAddress) {
            _postValidateMint(_msgSender(), to, tokenId, msg.value);
        } else if(toZeroAddress) {
            _postValidateBurn(_msgSender(), from, tokenId, msg.value);
        } else {
            _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
        }
    }

    /// @dev Optional validation hook that fires before a mint
    function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a mint
    function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires before a burn
    function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a burn
    function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires before a transfer
    function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a transfer
    function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 14 of 29 : 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 15 of 29 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        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 overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

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

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

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

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

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

File 19 of 29 : 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 20 of 29 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 21 of 29 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 23 of 29 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 24 of 29 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

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

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

File 25 of 29 : 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 26 of 29 : 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 27 of 29 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint32","name":"_maxSupply","type":"uint32"},{"internalType":"uint32","name":"_maxWhitelistSupply","type":"uint32"},{"internalType":"uint16","name":"_maxPublicMintPerTransaction","type":"uint16"},{"internalType":"uint16","name":"_maxRoyaltyBasisPoints","type":"uint16"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"},{"internalType":"address","name":"_contractManager","type":"address"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"string","name":"_tokenBaseURI","type":"string"},{"components":[{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"}],"internalType":"struct ScapeNftCollection.MintSchedule","name":"_mintSchedule","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInvalid","type":"error"},{"inputs":[],"name":"AutoSwitchoverValueInvalid","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"CreatorTokenBase__SetTransferValidatorFirst","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MaxWhitelistReached","type":"error"},{"inputs":[],"name":"MaxWhitelistSupplyInvalid","type":"error"},{"inputs":[],"name":"MintAmountInvalid","type":"error"},{"inputs":[],"name":"MintFundsInvalid","type":"error"},{"inputs":[],"name":"MintScheduleInvalid","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PublicMintNotAllowed","type":"error"},{"inputs":[],"name":"ReserveMintNotAllowed","type":"error"},{"inputs":[],"name":"RoyaltyInvalid","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenIdInvalid","type":"error"},{"inputs":[],"name":"WhitelistMintNotAllowed","type":"error"},{"inputs":[],"name":"WhitelistProofInvalid","type":"error"},{"inputs":[],"name":"WithdrawalFailed","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":true,"internalType":"bool","name":"autoPublicMintSwitchover","type":"bool"}],"name":"AutoPublicMintSwitchoverChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ContractManagerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"maxWhitelistSupply","type":"uint256"}],"name":"MaxWhitelistSupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"MerkleRootChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"mintPrice","type":"uint256"}],"name":"MintPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"}],"indexed":false,"internalType":"struct ScapeNftCollection.MintSchedule","name":"mintSchedule","type":"tuple"}],"name":"MintScheduleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldRoyaltyReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"newRoyaltyReceiver","type":"address"},{"indexed":true,"internalType":"uint256","name":"royaltyBasisPoints","type":"uint256"}],"name":"RoyaltyInfoChanged","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":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_OPERATOR_WHITELIST_ID","outputs":[{"internalType":"uint120","name":"","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_SECURITY_LEVEL","outputs":[{"internalType":"enum TransferSecurityLevels","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PUBLIC_MINT_PER_TRANSACTION","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ROYALTY_BASIS_POINTS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoPublicMintSwitchover","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newContractManager","type":"address"}],"name":"changeContractManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPermittedContractReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecurityPolicy","outputs":[{"components":[{"internalType":"enum TransferSecurityLevels","name":"transferSecurityLevel","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversId","type":"uint120"}],"internalType":"struct CollectionSecurityPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasWhitelistUserMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"address","name":"receiver","type":"address"}],"name":"isContractReceiverPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperatorWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWhitelistSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintSchedule","outputs":[{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"pauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_amount","type":"uint32"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_amount","type":"uint32"}],"name":"reserveMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"royaltyBasisPoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyReceiverAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"bool","name":"_autoPublicMintSwitchover","type":"bool"}],"name":"setAutoPublicMintSwitchover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxWhitelistSupply","type":"uint16"}],"name":"setMaxWhitelistSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"}],"internalType":"struct ScapeNftCollection.MintSchedule","name":"_mintSchedule","type":"tuple"}],"name":"setMintSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyReceiverAddress","type":"address"},{"internalType":"uint32","name":"_royaltyBasisPoints","type":"uint32"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomValidatorAndSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToDefaultSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIdIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","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":[],"name":"unPauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_mintAmount","type":"uint32"},{"internalType":"uint32","name":"_whitelistedAmount","type":"uint32"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"whitelistedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040523480156200001157600080fd5b5060405162005278380380620052788339810160408190526200003491620004c6565b8a8a604051806020016040528060008152506040518060200160405280600081525081600090816200006791906200067a565b5060016200007682826200067a565b5050506200008b82826200022260201b60201c565b506200009990503362000244565b6001600a55600b805463ffffffff8b811660805261ffff8a811660a052891660c052600c8890557fffffff0000000000000000000000000000000000000000ffffffff0000000000909116610100918b1691909102600160481b600160e81b0319161769010000000000000000006001600160a01b03871602179055600f839055600e6200012883826200067a565b5080516011805460208085015160408087015160608089015163ffffffff9889166001600160401b031990971696909617640100000000948916850217600160401b600160801b03191668010000000000000000928916830263ffffffff60601b1916176c01000000000000000000000000968916870217968790558251608081018452878916815293870488169484019490945285048616908201529190920490921690820152620001db9062000296565b505060128054610100600160c81b03191633650100000000000264ffffffff0019161761010061ffff96909616959095029490941790935550620007469650505050505050565b60066200023083826200067a565b5060076200023f82826200067a565b505050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b805163ffffffff161580620002bf5750806020015163ffffffff16816000015163ffffffff1610155b80620002df5750806060015163ffffffff16816040015163ffffffff1610155b80620002fe5750806040015163ffffffff16816020015163ffffffff16115b156200031d5760405163c866ddad60e01b815260040160405180910390fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000361576200036162000320565b604052919050565b600082601f8301126200037b57600080fd5b81516001600160401b0381111562000397576200039762000320565b6020620003ad601f8301601f1916820162000336565b8281528582848701011115620003c257600080fd5b60005b83811015620003e2578581018301518282018401528201620003c5565b506000928101909101919091529392505050565b805163ffffffff811681146200040b57600080fd5b919050565b805161ffff811681146200040b57600080fd5b80516001600160a01b03811681146200040b57600080fd5b6000608082840312156200044e57600080fd5b604051608081016001600160401b038111828210171562000473576200047362000320565b6040529050806200048483620003f6565b81526200049460208401620003f6565b6020820152620004a760408401620003f6565b6040820152620004ba60608401620003f6565b60608201525092915050565b60008060008060008060008060008060006101c08c8e031215620004e957600080fd5b8b516001600160401b038111156200050057600080fd5b6200050e8e828f0162000369565b60208e0151909c5090506001600160401b038111156200052d57600080fd5b6200053b8e828f0162000369565b9a50506200054c60408d01620003f6565b98506200055c60608d01620003f6565b97506200056c60808d0162000410565b96506200057c60a08d0162000410565b955060c08c015194506200059360e08d0162000423565b6101008d01516101208e015191955093506001600160401b03811115620005b957600080fd5b620005c78e828f0162000369565b925050620005da8d6101408e016200043b565b90509295989b509295989b9093969950565b600181811c908216806200060157607f821691505b6020821081036200062257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023f57600081815260208120601f850160051c81016020861015620006515750805b601f850160051c820191505b8181101562000672578281556001016200065d565b505050505050565b81516001600160401b0381111562000696576200069662000320565b620006ae81620006a78454620005ec565b8462000628565b602080601f831160018114620006e65760008415620006cd5750858301515b600019600386901b1c1916600185901b17855562000672565b600085815260208120601f198616915b828110156200071757888601518255948401946001909101908401620006f6565b5085821015620007365787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c051614adf620007996000396000818161054b0152612ae901526000818161065101526128220152600081816106a9015281816118be015281816127a101526129410152614adf6000f3fe6080604052600436106103ad5760003560e01c80636352211e116101e7578063b39e12cf1161010d578063dc7eda7d116100a0578063f2fde38b1161006f578063f2fde38b14610bd7578063f4a0a52814610bf7578063fc186be514610c17578063fd762d9214610c3757600080fd5b8063dc7eda7d14610b32578063e985e9c514610b5b578063f151d79114610ba4578063f209cda114610bb757600080fd5b8063c87b56dd116100dc578063c87b56dd14610ad5578063cc25efde14610af5578063cd85cdb514610b08578063d007af5c14610b1d57600080fd5b8063b39e12cf146109eb578063b53dc8cb14610a18578063b88d4fde14610a93578063be537f4314610ab357600080fd5b80637cb64759116101855780639d645a44116101545780639d645a441461096b578063a22cb4651461098b578063a57b993e146109ab578063a9fc664e146109cb57600080fd5b80637cb64759146108f65780638da5cb5b14610916578063953f049d1461093457806395d89b411461095657600080fd5b80636c3b8699116101c15780636c3b8699146108965780636d5a7411146108ab57806370a08231146108c1578063715018a6146108e157600080fd5b80636352211e1461084b5780636817c76c1461086b5780636c0360eb1461088157600080fd5b80632e8da829116102d757806342966c681161026a5780635d4c1d46116102395780635d4c1d46146107b657806361347162146107eb578063620627cf1461080b578063626543741461081e57600080fd5b806342966c681461073c578063495c8bf91461075c57806355f804b31461077e5780635c975abb1461079e57600080fd5b8063384be102116102a6578063384be102146106cb5780633ccfd60b146106e557806342260b5d146106fa57806342842e0e1461071c57600080fd5b80632e8da8291461061f5780632e9231ab1461063f5780632eb4a7ab1461067357806332cb6b0c1461069757600080fd5b806318160ddd1161034f5780631e1f62c81161031e5780631e1f62c8146105805780631e279a5c146105a057806323b872dd146105c05780632a55205a146105e057600080fd5b806318160ddd146104bc5780631b25b077146104f75780631c33b328146105175780631ccff3f51461053957600080fd5b8063081812fc1161038b578063081812fc14610447578063095ea7b314610467578063098144d4146104895780630be218d6146104a757600080fd5b806301463546146103b257806301ffc9a7146103f557806306fdde0314610425575b600080fd5b3480156103be57600080fd5b506103d871721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561040157600080fd5b50610415610410366004613f7f565b610c57565b60405190151581526020016103ec565b34801561043157600080fd5b5061043a610cb3565b6040516103ec9190613fec565b34801561045357600080fd5b506103d8610462366004613fff565b610d45565b34801561047357600080fd5b5061048761048236600461402d565b610d6c565b005b34801561049557600080fd5b506008546001600160a01b03166103d8565b3480156104b357600080fd5b50610487610ec0565b3480156104c857600080fd5b50600b546104e29065010000000000900463ffffffff1681565b60405163ffffffff90911681526020016103ec565b34801561050357600080fd5b50610415610512366004614059565b610f0e565b34801561052357600080fd5b5061052c600181565b6040516103ec91906140df565b34801561054557600080fd5b5061056d7f000000000000000000000000000000000000000000000000000000000000000081565b60405161ffff90911681526020016103ec565b34801561058c57600080fd5b5061048761059b3660046140ed565b610fc0565b3480156105ac57600080fd5b506104876105bb366004614118565b611091565b3480156105cc57600080fd5b506104876105db366004614135565b611118565b3480156105ec57600080fd5b506106006105fb366004614176565b61119f565b604080516001600160a01b0390931683526020830191909152016103ec565b34801561062b57600080fd5b5061041561063a3660046140ed565b611224565b34801561064b57600080fd5b5061056d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561067f57600080fd5b50610689600f5481565b6040519081526020016103ec565b3480156106a357600080fd5b506104e27f000000000000000000000000000000000000000000000000000000000000000081565b3480156106d757600080fd5b506012546104159060ff1681565b3480156106f157600080fd5b50610487611369565b34801561070657600080fd5b506012546104e290610100900463ffffffff1681565b34801561072857600080fd5b50610487610737366004614135565b611485565b34801561074857600080fd5b50610487610757366004613fff565b6114a0565b34801561076857600080fd5b50610771611524565b6040516103ec9190614198565b34801561078a57600080fd5b5061048761079936600461429d565b61166e565b3480156107aa57600080fd5b50600b5460ff16610415565b3480156107c257600080fd5b506107cb600181565b6040516effffffffffffffffffffffffffffff90911681526020016103ec565b3480156107f757600080fd5b50610487610806366004614310565b6116c4565b610487610819366004614369565b6118b4565b34801561082a57600080fd5b506106896108393660046140ed565b60106020526000908152604090205481565b34801561085757600080fd5b506103d8610866366004613fff565b6119f4565b34801561087757600080fd5b50610689600c5481565b34801561088d57600080fd5b5061043a611a59565b3480156108a257600080fd5b50610487611ae7565b3480156108b757600080fd5b50610689600d5481565b3480156108cd57600080fd5b506106896108dc3660046140ed565b611c11565b3480156108ed57600080fd5b50610487611cab565b34801561090257600080fd5b50610487610911366004613fff565b611cbd565b34801561092257600080fd5b506009546001600160a01b03166103d8565b34801561094057600080fd5b50600b546104e290610100900463ffffffff1681565b34801561096257600080fd5b5061043a611cf8565b34801561097757600080fd5b506104156109863660046140ed565b611d07565b34801561099757600080fd5b506104876109a6366004614384565b611e08565b3480156109b757600080fd5b506104876109c63660046143bd565b611e17565b3480156109d757600080fd5b506104876109e63660046140ed565b611f57565b3480156109f757600080fd5b50600b546103d890690100000000000000000090046001600160a01b031681565b348015610a2457600080fd5b50601154610a639063ffffffff8082169164010000000081048216916801000000000000000082048116916c0100000000000000000000000090041684565b6040805163ffffffff958616815293851660208501529184169183019190915290911660608201526080016103ec565b348015610a9f57600080fd5b50610487610aae36600461443a565b6120c2565b348015610abf57600080fd5b50610ac861214a565b6040516103ec91906144ba565b348015610ae157600080fd5b5061043a610af0366004613fff565b61221e565b610487610b033660046144fe565b612284565b348015610b1457600080fd5b50610487612518565b348015610b2957600080fd5b506107716125d8565b348015610b3e57600080fd5b506012546103d8906501000000000090046001600160a01b031681565b348015610b6757600080fd5b50610415610b7636600461458f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610487610bb2366004614369565b6126ca565b348015610bc357600080fd5b50610487610bd23660046145bd565b612937565b348015610be357600080fd5b50610487610bf23660046140ed565b612a06565b348015610c0357600080fd5b50610487610c12366004613fff565b612a93565b348015610c2357600080fd5b50610487610c323660046145e1565b612ace565b348015610c4357600080fd5b50610487610c5236600461460d565b612bfa565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610cad5750610cad82612d69565b92915050565b606060068054610cc290614669565b80601f0160208091040260200160405190810160405280929190818152602001828054610cee90614669565b8015610d3b5780601f10610d1057610100808354040283529160200191610d3b565b820191906000526020600020905b815481529060010190602001808311610d1e57829003601f168201915b5050505050905090565b6000610d5082612dbf565b506000908152600460205260409020546001600160a01b031690565b6000610d77826119f4565b9050806001600160a01b0316836001600160a01b031603610e055760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610e3f57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b610eb15760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610dfc565b610ebb8383612e23565b505050565b610ec8612ea9565b600b5460ff16610f04576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f0c612f03565b565b6008546000906001600160a01b031615610fb5576008546040517f285fb8c80000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015610f9057600080fd5b505afa925050508015610fa1575060015b610fad57506000610fb9565b506001610fb9565b5060015b9392505050565b610fc8612ea9565b6001600160a01b038116611013576040517f864143510000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610dfc565b600b80546001600160a01b0383811669010000000000000000009081027fffffff0000000000000000000000000000000000000000ffffffffffffffffff841617938490556040519281900482169304169082907fb70ce6e6da6df145d6a9b4b90fa1e0dbd33d341f98d3aad7c793bca4217b63be90600090a35050565b611099612ea9565b60125460ff161515811515036110db576040517fe5b8151900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012805460ff19168215159081179091556040517fafafec7b2aa486c98441b3d03b40e5659dab3c0f30c9129acc90b43a79a91dda90600090a250565b6111223382612f55565b6111945760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610dfc565b610ebb838383612fd4565b600080600d548411156111e1576040517f5be3786c00000000000000000000000000000000000000000000000000000000815260048101859052602401610dfc565b6012546501000000000081046001600160a01b031692506127109061121190610100900463ffffffff16856146eb565b61121b9190614702565b90509250929050565b6008546000906001600160a01b031615611361576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b039091169063d72dde5e90829063b955455290602401606060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c5919061473d565b602001516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526001600160a01b03851660248201526044015b602060405180830381865afa15801561133d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906147af565b506000919050565b600b54690100000000000000000090046001600160a01b031633148015906113ab57503361139f6009546001600160a01b031690565b6001600160a01b031614155b156113e4576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610dfc565b60006113f86009546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611442576040519150601f19603f3d011682016040523d82523d6000602084013e611447565b606091505b5050905080611482576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b610ebb838383604051806020016040528060008152506120c2565b6114aa3382612f55565b6114e9576040517f177e802f00000000000000000000000000000000000000000000000000000000815233600482015260248101829052604401610dfc565b6114f28161322a565b50600b805460001963ffffffff65010000000000808404821692909201160268ffffffff000000000019909116179055565b6008546060906001600160a01b03161561165b576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690633fe5df9990829063b955455290602401606060405180830381865afa1580156115a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c5919061473d565b602001516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526024015b600060405180830381865afa15801561162e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261165691908101906147cc565b905090565b5060408051600081526020810190915290565b611676612ea9565b600e61168282826148cc565b5080604051611691919061498c565b604051908190038120907f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf690600090a250565b6116cc6132ef565b60006116e06008546001600160a01b031690565b90506001600160a01b038116611722576040517f39ffc7ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fda0194c00000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063da0194c09061176990309088906004016149a8565b600060405180830381600087803b15801561178357600080fd5b505af1158015611797573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff861660248201526001600160a01b0384169250632304aa029150604401600060405180830381600087803b15801561180c57600080fd5b505af1158015611820573d6000803e3d6000fd5b50506040517f8d7443140000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff851660248201526001600160a01b0384169250638d74431491506044015b600060405180830381600087803b15801561189657600080fd5b505af11580156118aa573d6000803e3d6000fd5b5050505050505050565b6118bc612ea9565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff16600d546118f791906149c5565b111561192f576040517fd05cb60900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011546c01000000000000000000000000900463ffffffff16421015611981576040517fda7c55ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d5460005b8263ffffffff168110156119be576001820191506119b66119b06009546001600160a01b031690565b836132f7565b600101611987565b50600d55600b805463ffffffff6501000000000080830482169094011690920268ffffffff000000000019909216919091179055565b6000818152600260205260408120546001600160a01b031680610cad5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610dfc565b600e8054611a6690614669565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9290614669565b8015611adf5780601f10611ab457610100808354040283529160200191611adf565b820191906000526020600020905b815481529060010190602001808311611ac257829003601f168201915b505050505081565b611aef6132ef565b611b0a71721c310194ccfc01e523fc93c9cccfa2a0ac611f57565b6040517fda0194c000000000000000000000000000000000000000000000000000000000815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090611b5b9030906001906004016149a8565b600060405180830381600087803b158015611b7557600080fd5b505af1158015611b89573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526001602482015271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa029150604401600060405180830381600087803b158015611bf757600080fd5b505af1158015611c0b573d6000803e3d6000fd5b50505050565b60006001600160a01b038216611c8f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610dfc565b506001600160a01b031660009081526003602052604090205490565b611cb3612ea9565b610f0c60006134b2565b611cc5612ea9565b600f81905560405181907f1b930366dfeaa7eb3b325021e4ae81e36527063452ee55b86c95f85b36f4c31c90600090a250565b606060078054610cc290614669565b6008546000906001600160a01b031615611361576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690639445f53090829063b955455290602401606060405180830381865afa158015611d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da8919061473d565b60409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526001600160a01b0385166024820152604401611320565b611e1333838361351c565b5050565b611e1f612ea9565b611e28816135ea565b8051601180546020840151604080860151606087015163ffffffff9081166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff9282166801000000000000000002929092167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff948216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009096169190971617939093179190911693909317179055517f5fcf1902453005cab6e707e2d2c55134e12b8282f5002c5951e370d2900a055f90611f4c908390815163ffffffff9081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b60405180910390a150565b611f5f6132ef565b60006001600160a01b0382163b15611ff3576040517f01ffc9a7000000000000000000000000000000000000000000000000000000008152600060048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa925050508015611feb575060408051601f3d908101601f19168201909252611fe8918101906147af565b60015b15611ff35790505b6001600160a01b03821615801590612009575080155b15612040576040517f32483afb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600854604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6120cc3383612f55565b61213e5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610dfc565b611c0b84848484613686565b60408051606081018252600080825260208201819052918101919091526008546001600160a01b0316156121fd576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b039091169063b955455290602401606060405180830381865afa1580156121d9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611656919061473d565b50604080516060810182526000808252602082018190529181019190915290565b606061222982612dbf565b600061223361370f565b905060008151116122535760405180602001604052806000815250610fb9565b8061225d8461371e565b60405160200161226e9291906149d8565b6040516020818303038152906040529392505050565b61228c6137be565b612294613817565b60115463ffffffff164210806122ba5750601154640100000000900463ffffffff164210155b156122f1576040517f76a7745c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b54600d5463ffffffff61010090920482169161231291908716906149c5565b111561234a576040517fa554e6e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526010602052604081205461236b9063ffffffff8716906149c5565b905063ffffffff8516158061238557508363ffffffff1681115b156123bc576040517f60d26a7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8463ffffffff16600c546123d091906146eb565b3414612408576040517f9044fe6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805133602082015263ffffffff86169181019190915260009060600160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506124698484600f548461386a565b61249f576040517fc799103e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152601060205260408120839055600d54905b8763ffffffff168110156124dc576001820191506124d43383613882565b6001016124b6565b50600d555050600b805463ffffffff65010000000000808304821688019091160268ffffffff000000000019909116179055611c0b6001600a55565b600b54690100000000000000000090046001600160a01b0316331480159061255a57503361254e6009546001600160a01b031690565b6001600160a01b031614155b15612593576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610dfc565b600b5460ff16156125d0576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f0c61389c565b6008546060906001600160a01b03161561165b576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906317e94a6c90829063b955455290602401606060405180830381865afa158015612655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612679919061473d565b60409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff9091166004820152602401611611565b6126d26137be565b6126da613817565b6011546c01000000000000000000000000900463ffffffff16421061272b576040517fb1f931f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60115468010000000000000000900463ffffffff1642101561279f5760125460ff1615806127685750600b54600d5461010090910463ffffffff16115b1561279f576040517fb1f931f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff16600d546127da91906149c5565b1115612812576040517fd05cb60900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8116158061284e57507f000000000000000000000000000000000000000000000000000000000000000061ffff168163ffffffff16115b15612885576040517f60d26a7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff16600c5461289991906146eb565b34146128d1576040517f9044fe6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d5460005b8263ffffffff168110156128fd576001820191506128f53383613882565b6001016128d7565b50600d55600b805463ffffffff65010000000000808304821685019091160268ffffffff0000000000199091161790556114826001600a55565b61293f612ea9565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168161ffff1611156129a3576040517f77bb8b7300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff1661ffff83166101008102919091179091556040517f81dc3419b12ce721201c86b96b04956b9e74ebeac990014d6613c48692deb1d790600090a250565b612a0e612ea9565b6001600160a01b038116612a8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610dfc565b611482816134b2565b612a9b612ea9565b600c81905560405181907f25b1f9f6b6e61dfca5575239769e4450ed2e49176670837f5d1a82a9a2fc693f90600090a250565b612ad6612ea9565b6001600160a01b0382161580612b1557507f000000000000000000000000000000000000000000000000000000000000000061ffff168163ffffffff16115b15612b4c576040517f272248f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012805463ffffffff831661010081027fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff6001600160a01b0387811665010000000000818102939093167fffffffffffffff000000000000000000000000000000000000000000000000ff8716179390931790955560405193049390931692909183907f3aede373edfa0f8addd19478e359e8eef62a5b01aac36b1319e9d0ef4ca9d0ed90600090a4505050565b612c026132ef565b612c0b84611f57565b6040517fda0194c00000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063da0194c090612c5290309087906004016149a8565b600060405180830381600087803b158015612c6c57600080fd5b505af1158015612c80573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff851660248201526001600160a01b0387169250632304aa029150604401600060405180830381600087803b158015612cf557600080fd5b505af1158015612d09573d6000803e3d6000fd5b50506040517f8d7443140000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff841660248201526001600160a01b0387169250638d744314915060440161187c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f86455d28000000000000000000000000000000000000000000000000000000001480610cad5750610cad826138d9565b6000818152600260205260409020546001600160a01b03166114825760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610dfc565b600081815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091558190612e70826119f4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6009546001600160a01b03163314610f0c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dfc565b612f0b6139bc565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080612f61836119f4565b9050806001600160a01b0316846001600160a01b03161480612fa857506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80612fcc5750836001600160a01b0316612fc184610d45565b6001600160a01b0316145b949350505050565b826001600160a01b0316612fe7826119f4565b6001600160a01b0316146130635760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610dfc565b6001600160a01b0382166130de5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610dfc565b6130eb8383836001613a0e565b826001600160a01b03166130fe826119f4565b6001600160a01b03161461317a5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610dfc565b600081815260046020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ebb8383836001613a3c565b6000613235826119f4565b9050613245816000846001613a0e565b61324e826119f4565b600083815260046020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4611e13816000846001613a3c565b610f0c612ea9565b6001600160a01b03821661334d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610dfc565b6000818152600260205260409020546001600160a01b0316156133b25760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dfc565b6133c0600083836001613a0e565b6000818152600260205260409020546001600160a01b0316156134255760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dfc565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611e13600083836001613a3c565b600980546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361357d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610dfc565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b805163ffffffff1615806136125750806020015163ffffffff16816000015163ffffffff1610155b806136315750806060015163ffffffff16816040015163ffffffff1610155b8061364f5750806040015163ffffffff16816020015163ffffffff16115b15611482576040517fc866ddad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613691848484612fd4565b61369d84848484613a63565b611c0b5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b6060600e8054610cc290614669565b6060600061372b83613c01565b600101905060008167ffffffffffffffff81111561374b5761374b6141e5565b6040519080825280601f01601f191660200182016040528015613775576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461377f57509392505050565b6002600a54036138105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610dfc565b6002600a55565b600b5460ff1615610f0c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610dfc565b600082613878868685613ce3565b1495945050505050565b611e13828260405180602001604052806000815250613d2f565b6138a4613817565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f383390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061396c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610cad57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610cad565b600b5460ff16610f0c5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610dfc565b60005b81811015613a3557613a2d8585613a2884876149c5565b613db8565b600101613a11565b5050505050565b60005b81811015613a3557613a5b8585613a5684876149c5565b613e27565b600101613a3f565b60006001600160a01b0384163b15613bf9576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290613ac0903390899088908890600401614a07565b6020604051808303816000875af1925050508015613afb575060408051601f3d908101601f19168201909252613af891810190614a43565b60015b613bae573d808015613b29576040519150601f19603f3d011682016040523d82523d6000602084013e613b2e565b606091505b508051600003613ba65760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612fcc565b506001612fcc565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613c4a577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613c76576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613c9457662386f26fc10000830492506010015b6305f5e1008310613cac576305f5e100830492506008015b6127108310613cc057612710830492506004015b60648310613cd2576064830492506002015b600a8310610cad5760010192915050565b600081815b84811015613d2657613d1282878784818110613d0657613d06614a60565b90506020020135613e87565b915080613d1e81614a8f565b915050613ce8565b50949350505050565b613d3983836132f7565b613d466000848484613a63565b610ebb5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b6001600160a01b038381161590831615818015613dd25750805b15613e09576040517f5cbd944100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613e15575b613a35565b80613e1057613a353386868634613eb3565b6001600160a01b038381161590831615818015613e415750805b15613e78576040517f5cbd944100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81613e105780613e1057613a35565b6000818310613ea3576000828152602084905260409020610fb9565b5060009182526020526040902090565b6008546001600160a01b031615613a35576008546040517f285fb8c80000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b158015613f3257600080fd5b505afa158015613f46573d6000803e3d6000fd5b505050505050505050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461148257600080fd5b600060208284031215613f9157600080fd5b8135610fb981613f51565b60005b83811015613fb7578181015183820152602001613f9f565b50506000910152565b60008151808452613fd8816020860160208601613f9c565b601f01601f19169290920160200192915050565b602081526000610fb96020830184613fc0565b60006020828403121561401157600080fd5b5035919050565b6001600160a01b038116811461148257600080fd5b6000806040838503121561404057600080fd5b823561404b81614018565b946020939093013593505050565b60008060006060848603121561406e57600080fd5b833561407981614018565b9250602084013561408981614018565b9150604084013561409981614018565b809150509250925092565b600781106140db577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60208101610cad82846140a4565b6000602082840312156140ff57600080fd5b8135610fb981614018565b801515811461148257600080fd5b60006020828403121561412a57600080fd5b8135610fb98161410a565b60008060006060848603121561414a57600080fd5b833561415581614018565b9250602084013561416581614018565b929592945050506040919091013590565b6000806040838503121561418957600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156141d95783516001600160a01b0316835292840192918401916001016141b4565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561423d5761423d6141e5565b604052919050565b600067ffffffffffffffff83111561425f5761425f6141e5565b6142726020601f19601f86011601614214565b905082815283838301111561428657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156142af57600080fd5b813567ffffffffffffffff8111156142c657600080fd5b8201601f810184136142d757600080fd5b612fcc84823560208401614245565b6007811061148257600080fd5b6effffffffffffffffffffffffffffff8116811461148257600080fd5b60008060006060848603121561432557600080fd5b8335614330816142e6565b92506020840135614340816142f3565b91506040840135614099816142f3565b803563ffffffff8116811461436457600080fd5b919050565b60006020828403121561437b57600080fd5b610fb982614350565b6000806040838503121561439757600080fd5b82356143a281614018565b915060208301356143b28161410a565b809150509250929050565b6000608082840312156143cf57600080fd5b6040516080810181811067ffffffffffffffff821117156143f2576143f26141e5565b6040526143fe83614350565b815261440c60208401614350565b602082015261441d60408401614350565b604082015261442e60608401614350565b60608201529392505050565b6000806000806080858703121561445057600080fd5b843561445b81614018565b9350602085013561446b81614018565b925060408501359150606085013567ffffffffffffffff81111561448e57600080fd5b8501601f8101871361449f57600080fd5b6144ae87823560208401614245565b91505092959194509250565b60006060820190506144cd8284516140a4565b60208301516effffffffffffffffffffffffffffff8082166020850152806040860151166040850152505092915050565b6000806000806060858703121561451457600080fd5b61451d85614350565b935061452b60208601614350565b9250604085013567ffffffffffffffff8082111561454857600080fd5b818701915087601f83011261455c57600080fd5b81358181111561456b57600080fd5b8860208260051b850101111561458057600080fd5b95989497505060200194505050565b600080604083850312156145a257600080fd5b82356145ad81614018565b915060208301356143b281614018565b6000602082840312156145cf57600080fd5b813561ffff81168114610fb957600080fd5b600080604083850312156145f457600080fd5b82356145ff81614018565b915061121b60208401614350565b6000806000806080858703121561462357600080fd5b843561462e81614018565b9350602085013561463e816142e6565b9250604085013561464e816142f3565b9150606085013561465e816142f3565b939692955090935050565b600181811c9082168061467d57607f821691505b6020821081036146b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610cad57610cad6146bc565b600082614738577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006060828403121561474f57600080fd5b6040516060810181811067ffffffffffffffff82111715614772576147726141e5565b6040528251614780816142e6565b81526020830151614790816142f3565b602082015260408301516147a3816142f3565b60408201529392505050565b6000602082840312156147c157600080fd5b8151610fb98161410a565b600060208083850312156147df57600080fd5b825167ffffffffffffffff808211156147f757600080fd5b818501915085601f83011261480b57600080fd5b81518181111561481d5761481d6141e5565b8060051b915061482e848301614214565b818152918301840191848101908884111561484857600080fd5b938501935b83851015614872578451925061486283614018565b828252938501939085019061484d565b98975050505050505050565b601f821115610ebb57600081815260208120601f850160051c810160208610156148a55750805b601f850160051c820191505b818110156148c4578281556001016148b1565b505050505050565b815167ffffffffffffffff8111156148e6576148e66141e5565b6148fa816148f48454614669565b8461487e565b602080601f83116001811461492f57600084156149175750858301515b600019600386901b1c1916600185901b1785556148c4565b600085815260208120601f198616915b8281101561495e5788860151825594840194600190910190840161493f565b508582101561497c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825161499e818460208701613f9c565b9190910192915050565b6001600160a01b038316815260408101610fb960208301846140a4565b80820180821115610cad57610cad6146bc565b600083516149ea818460208801613f9c565b8351908301906149fe818360208801613f9c565b01949350505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a396080830184613fc0565b9695505050505050565b600060208284031215614a5557600080fd5b8151610fb981613f51565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006000198203614aa257614aa26146bc565b506001019056fea2646970667358221220c4290a20d48e0b2445aa81155590d0a24f5fc53bce8ba5cef8e15100e4dbf6e864736f6c6343000815003300000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000002bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bae3d0d4ac7982044146a735c4a8a85bfe6aac4a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001853434150453a20466f756e64696e6720436974697a656e730000000000000000000000000000000000000000000000000000000000000000000000000000000653435043495400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656963666972326c667961376c646e6532783777777837777567623374786771797a7a69327a6c79357765346d736a6f626c626b34792f0000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106103ad5760003560e01c80636352211e116101e7578063b39e12cf1161010d578063dc7eda7d116100a0578063f2fde38b1161006f578063f2fde38b14610bd7578063f4a0a52814610bf7578063fc186be514610c17578063fd762d9214610c3757600080fd5b8063dc7eda7d14610b32578063e985e9c514610b5b578063f151d79114610ba4578063f209cda114610bb757600080fd5b8063c87b56dd116100dc578063c87b56dd14610ad5578063cc25efde14610af5578063cd85cdb514610b08578063d007af5c14610b1d57600080fd5b8063b39e12cf146109eb578063b53dc8cb14610a18578063b88d4fde14610a93578063be537f4314610ab357600080fd5b80637cb64759116101855780639d645a44116101545780639d645a441461096b578063a22cb4651461098b578063a57b993e146109ab578063a9fc664e146109cb57600080fd5b80637cb64759146108f65780638da5cb5b14610916578063953f049d1461093457806395d89b411461095657600080fd5b80636c3b8699116101c15780636c3b8699146108965780636d5a7411146108ab57806370a08231146108c1578063715018a6146108e157600080fd5b80636352211e1461084b5780636817c76c1461086b5780636c0360eb1461088157600080fd5b80632e8da829116102d757806342966c681161026a5780635d4c1d46116102395780635d4c1d46146107b657806361347162146107eb578063620627cf1461080b578063626543741461081e57600080fd5b806342966c681461073c578063495c8bf91461075c57806355f804b31461077e5780635c975abb1461079e57600080fd5b8063384be102116102a6578063384be102146106cb5780633ccfd60b146106e557806342260b5d146106fa57806342842e0e1461071c57600080fd5b80632e8da8291461061f5780632e9231ab1461063f5780632eb4a7ab1461067357806332cb6b0c1461069757600080fd5b806318160ddd1161034f5780631e1f62c81161031e5780631e1f62c8146105805780631e279a5c146105a057806323b872dd146105c05780632a55205a146105e057600080fd5b806318160ddd146104bc5780631b25b077146104f75780631c33b328146105175780631ccff3f51461053957600080fd5b8063081812fc1161038b578063081812fc14610447578063095ea7b314610467578063098144d4146104895780630be218d6146104a757600080fd5b806301463546146103b257806301ffc9a7146103f557806306fdde0314610425575b600080fd5b3480156103be57600080fd5b506103d871721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561040157600080fd5b50610415610410366004613f7f565b610c57565b60405190151581526020016103ec565b34801561043157600080fd5b5061043a610cb3565b6040516103ec9190613fec565b34801561045357600080fd5b506103d8610462366004613fff565b610d45565b34801561047357600080fd5b5061048761048236600461402d565b610d6c565b005b34801561049557600080fd5b506008546001600160a01b03166103d8565b3480156104b357600080fd5b50610487610ec0565b3480156104c857600080fd5b50600b546104e29065010000000000900463ffffffff1681565b60405163ffffffff90911681526020016103ec565b34801561050357600080fd5b50610415610512366004614059565b610f0e565b34801561052357600080fd5b5061052c600181565b6040516103ec91906140df565b34801561054557600080fd5b5061056d7f00000000000000000000000000000000000000000000000000000000000002bc81565b60405161ffff90911681526020016103ec565b34801561058c57600080fd5b5061048761059b3660046140ed565b610fc0565b3480156105ac57600080fd5b506104876105bb366004614118565b611091565b3480156105cc57600080fd5b506104876105db366004614135565b611118565b3480156105ec57600080fd5b506106006105fb366004614176565b61119f565b604080516001600160a01b0390931683526020830191909152016103ec565b34801561062b57600080fd5b5061041561063a3660046140ed565b611224565b34801561064b57600080fd5b5061056d7f000000000000000000000000000000000000000000000000000000000000000581565b34801561067f57600080fd5b50610689600f5481565b6040519081526020016103ec565b3480156106a357600080fd5b506104e27f000000000000000000000000000000000000000000000000000000000000138881565b3480156106d757600080fd5b506012546104159060ff1681565b3480156106f157600080fd5b50610487611369565b34801561070657600080fd5b506012546104e290610100900463ffffffff1681565b34801561072857600080fd5b50610487610737366004614135565b611485565b34801561074857600080fd5b50610487610757366004613fff565b6114a0565b34801561076857600080fd5b50610771611524565b6040516103ec9190614198565b34801561078a57600080fd5b5061048761079936600461429d565b61166e565b3480156107aa57600080fd5b50600b5460ff16610415565b3480156107c257600080fd5b506107cb600181565b6040516effffffffffffffffffffffffffffff90911681526020016103ec565b3480156107f757600080fd5b50610487610806366004614310565b6116c4565b610487610819366004614369565b6118b4565b34801561082a57600080fd5b506106896108393660046140ed565b60106020526000908152604090205481565b34801561085757600080fd5b506103d8610866366004613fff565b6119f4565b34801561087757600080fd5b50610689600c5481565b34801561088d57600080fd5b5061043a611a59565b3480156108a257600080fd5b50610487611ae7565b3480156108b757600080fd5b50610689600d5481565b3480156108cd57600080fd5b506106896108dc3660046140ed565b611c11565b3480156108ed57600080fd5b50610487611cab565b34801561090257600080fd5b50610487610911366004613fff565b611cbd565b34801561092257600080fd5b506009546001600160a01b03166103d8565b34801561094057600080fd5b50600b546104e290610100900463ffffffff1681565b34801561096257600080fd5b5061043a611cf8565b34801561097757600080fd5b506104156109863660046140ed565b611d07565b34801561099757600080fd5b506104876109a6366004614384565b611e08565b3480156109b757600080fd5b506104876109c63660046143bd565b611e17565b3480156109d757600080fd5b506104876109e63660046140ed565b611f57565b3480156109f757600080fd5b50600b546103d890690100000000000000000090046001600160a01b031681565b348015610a2457600080fd5b50601154610a639063ffffffff8082169164010000000081048216916801000000000000000082048116916c0100000000000000000000000090041684565b6040805163ffffffff958616815293851660208501529184169183019190915290911660608201526080016103ec565b348015610a9f57600080fd5b50610487610aae36600461443a565b6120c2565b348015610abf57600080fd5b50610ac861214a565b6040516103ec91906144ba565b348015610ae157600080fd5b5061043a610af0366004613fff565b61221e565b610487610b033660046144fe565b612284565b348015610b1457600080fd5b50610487612518565b348015610b2957600080fd5b506107716125d8565b348015610b3e57600080fd5b506012546103d8906501000000000090046001600160a01b031681565b348015610b6757600080fd5b50610415610b7636600461458f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610487610bb2366004614369565b6126ca565b348015610bc357600080fd5b50610487610bd23660046145bd565b612937565b348015610be357600080fd5b50610487610bf23660046140ed565b612a06565b348015610c0357600080fd5b50610487610c12366004613fff565b612a93565b348015610c2357600080fd5b50610487610c323660046145e1565b612ace565b348015610c4357600080fd5b50610487610c5236600461460d565b612bfa565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610cad5750610cad82612d69565b92915050565b606060068054610cc290614669565b80601f0160208091040260200160405190810160405280929190818152602001828054610cee90614669565b8015610d3b5780601f10610d1057610100808354040283529160200191610d3b565b820191906000526020600020905b815481529060010190602001808311610d1e57829003601f168201915b5050505050905090565b6000610d5082612dbf565b506000908152600460205260409020546001600160a01b031690565b6000610d77826119f4565b9050806001600160a01b0316836001600160a01b031603610e055760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610e3f57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b610eb15760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610dfc565b610ebb8383612e23565b505050565b610ec8612ea9565b600b5460ff16610f04576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f0c612f03565b565b6008546000906001600160a01b031615610fb5576008546040517f285fb8c80000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015610f9057600080fd5b505afa925050508015610fa1575060015b610fad57506000610fb9565b506001610fb9565b5060015b9392505050565b610fc8612ea9565b6001600160a01b038116611013576040517f864143510000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610dfc565b600b80546001600160a01b0383811669010000000000000000009081027fffffff0000000000000000000000000000000000000000ffffffffffffffffff841617938490556040519281900482169304169082907fb70ce6e6da6df145d6a9b4b90fa1e0dbd33d341f98d3aad7c793bca4217b63be90600090a35050565b611099612ea9565b60125460ff161515811515036110db576040517fe5b8151900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012805460ff19168215159081179091556040517fafafec7b2aa486c98441b3d03b40e5659dab3c0f30c9129acc90b43a79a91dda90600090a250565b6111223382612f55565b6111945760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610dfc565b610ebb838383612fd4565b600080600d548411156111e1576040517f5be3786c00000000000000000000000000000000000000000000000000000000815260048101859052602401610dfc565b6012546501000000000081046001600160a01b031692506127109061121190610100900463ffffffff16856146eb565b61121b9190614702565b90509250929050565b6008546000906001600160a01b031615611361576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b039091169063d72dde5e90829063b955455290602401606060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c5919061473d565b602001516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526001600160a01b03851660248201526044015b602060405180830381865afa15801561133d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906147af565b506000919050565b600b54690100000000000000000090046001600160a01b031633148015906113ab57503361139f6009546001600160a01b031690565b6001600160a01b031614155b156113e4576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610dfc565b60006113f86009546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611442576040519150601f19603f3d011682016040523d82523d6000602084013e611447565b606091505b5050905080611482576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b610ebb838383604051806020016040528060008152506120c2565b6114aa3382612f55565b6114e9576040517f177e802f00000000000000000000000000000000000000000000000000000000815233600482015260248101829052604401610dfc565b6114f28161322a565b50600b805460001963ffffffff65010000000000808404821692909201160268ffffffff000000000019909116179055565b6008546060906001600160a01b03161561165b576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690633fe5df9990829063b955455290602401606060405180830381865afa1580156115a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c5919061473d565b602001516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526024015b600060405180830381865afa15801561162e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261165691908101906147cc565b905090565b5060408051600081526020810190915290565b611676612ea9565b600e61168282826148cc565b5080604051611691919061498c565b604051908190038120907f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf690600090a250565b6116cc6132ef565b60006116e06008546001600160a01b031690565b90506001600160a01b038116611722576040517f39ffc7ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fda0194c00000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063da0194c09061176990309088906004016149a8565b600060405180830381600087803b15801561178357600080fd5b505af1158015611797573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff861660248201526001600160a01b0384169250632304aa029150604401600060405180830381600087803b15801561180c57600080fd5b505af1158015611820573d6000803e3d6000fd5b50506040517f8d7443140000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff851660248201526001600160a01b0384169250638d74431491506044015b600060405180830381600087803b15801561189657600080fd5b505af11580156118aa573d6000803e3d6000fd5b5050505050505050565b6118bc612ea9565b7f000000000000000000000000000000000000000000000000000000000000138863ffffffff168163ffffffff16600d546118f791906149c5565b111561192f576040517fd05cb60900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011546c01000000000000000000000000900463ffffffff16421015611981576040517fda7c55ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d5460005b8263ffffffff168110156119be576001820191506119b66119b06009546001600160a01b031690565b836132f7565b600101611987565b50600d55600b805463ffffffff6501000000000080830482169094011690920268ffffffff000000000019909216919091179055565b6000818152600260205260408120546001600160a01b031680610cad5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610dfc565b600e8054611a6690614669565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9290614669565b8015611adf5780601f10611ab457610100808354040283529160200191611adf565b820191906000526020600020905b815481529060010190602001808311611ac257829003601f168201915b505050505081565b611aef6132ef565b611b0a71721c310194ccfc01e523fc93c9cccfa2a0ac611f57565b6040517fda0194c000000000000000000000000000000000000000000000000000000000815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090611b5b9030906001906004016149a8565b600060405180830381600087803b158015611b7557600080fd5b505af1158015611b89573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526001602482015271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa029150604401600060405180830381600087803b158015611bf757600080fd5b505af1158015611c0b573d6000803e3d6000fd5b50505050565b60006001600160a01b038216611c8f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610dfc565b506001600160a01b031660009081526003602052604090205490565b611cb3612ea9565b610f0c60006134b2565b611cc5612ea9565b600f81905560405181907f1b930366dfeaa7eb3b325021e4ae81e36527063452ee55b86c95f85b36f4c31c90600090a250565b606060078054610cc290614669565b6008546000906001600160a01b031615611361576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690639445f53090829063b955455290602401606060405180830381865afa158015611d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da8919061473d565b60409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff90911660048201526001600160a01b0385166024820152604401611320565b611e1333838361351c565b5050565b611e1f612ea9565b611e28816135ea565b8051601180546020840151604080860151606087015163ffffffff9081166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff9282166801000000000000000002929092167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff948216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009096169190971617939093179190911693909317179055517f5fcf1902453005cab6e707e2d2c55134e12b8282f5002c5951e370d2900a055f90611f4c908390815163ffffffff9081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b60405180910390a150565b611f5f6132ef565b60006001600160a01b0382163b15611ff3576040517f01ffc9a7000000000000000000000000000000000000000000000000000000008152600060048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa925050508015611feb575060408051601f3d908101601f19168201909252611fe8918101906147af565b60015b15611ff35790505b6001600160a01b03821615801590612009575080155b15612040576040517f32483afb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600854604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6120cc3383612f55565b61213e5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610dfc565b611c0b84848484613686565b60408051606081018252600080825260208201819052918101919091526008546001600160a01b0316156121fd576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b039091169063b955455290602401606060405180830381865afa1580156121d9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611656919061473d565b50604080516060810182526000808252602082018190529181019190915290565b606061222982612dbf565b600061223361370f565b905060008151116122535760405180602001604052806000815250610fb9565b8061225d8461371e565b60405160200161226e9291906149d8565b6040516020818303038152906040529392505050565b61228c6137be565b612294613817565b60115463ffffffff164210806122ba5750601154640100000000900463ffffffff164210155b156122f1576040517f76a7745c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b54600d5463ffffffff61010090920482169161231291908716906149c5565b111561234a576040517fa554e6e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526010602052604081205461236b9063ffffffff8716906149c5565b905063ffffffff8516158061238557508363ffffffff1681115b156123bc576040517f60d26a7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8463ffffffff16600c546123d091906146eb565b3414612408576040517f9044fe6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805133602082015263ffffffff86169181019190915260009060600160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506124698484600f548461386a565b61249f576040517fc799103e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152601060205260408120839055600d54905b8763ffffffff168110156124dc576001820191506124d43383613882565b6001016124b6565b50600d555050600b805463ffffffff65010000000000808304821688019091160268ffffffff000000000019909116179055611c0b6001600a55565b600b54690100000000000000000090046001600160a01b0316331480159061255a57503361254e6009546001600160a01b031690565b6001600160a01b031614155b15612593576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610dfc565b600b5460ff16156125d0576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f0c61389c565b6008546060906001600160a01b03161561165b576008546040517fb95545520000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906317e94a6c90829063b955455290602401606060405180830381865afa158015612655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612679919061473d565b60409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526effffffffffffffffffffffffffffff9091166004820152602401611611565b6126d26137be565b6126da613817565b6011546c01000000000000000000000000900463ffffffff16421061272b576040517fb1f931f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60115468010000000000000000900463ffffffff1642101561279f5760125460ff1615806127685750600b54600d5461010090910463ffffffff16115b1561279f576040517fb1f931f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000138863ffffffff168163ffffffff16600d546127da91906149c5565b1115612812576040517fd05cb60900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8116158061284e57507f000000000000000000000000000000000000000000000000000000000000000561ffff168163ffffffff16115b15612885576040517f60d26a7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff16600c5461289991906146eb565b34146128d1576040517f9044fe6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d5460005b8263ffffffff168110156128fd576001820191506128f53383613882565b6001016128d7565b50600d55600b805463ffffffff65010000000000808304821685019091160268ffffffff0000000000199091161790556114826001600a55565b61293f612ea9565b7f000000000000000000000000000000000000000000000000000000000000138863ffffffff168161ffff1611156129a3576040517f77bb8b7300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff1661ffff83166101008102919091179091556040517f81dc3419b12ce721201c86b96b04956b9e74ebeac990014d6613c48692deb1d790600090a250565b612a0e612ea9565b6001600160a01b038116612a8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610dfc565b611482816134b2565b612a9b612ea9565b600c81905560405181907f25b1f9f6b6e61dfca5575239769e4450ed2e49176670837f5d1a82a9a2fc693f90600090a250565b612ad6612ea9565b6001600160a01b0382161580612b1557507f00000000000000000000000000000000000000000000000000000000000002bc61ffff168163ffffffff16115b15612b4c576040517f272248f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012805463ffffffff831661010081027fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff6001600160a01b0387811665010000000000818102939093167fffffffffffffff000000000000000000000000000000000000000000000000ff8716179390931790955560405193049390931692909183907f3aede373edfa0f8addd19478e359e8eef62a5b01aac36b1319e9d0ef4ca9d0ed90600090a4505050565b612c026132ef565b612c0b84611f57565b6040517fda0194c00000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063da0194c090612c5290309087906004016149a8565b600060405180830381600087803b158015612c6c57600080fd5b505af1158015612c80573d6000803e3d6000fd5b50506040517f2304aa020000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff851660248201526001600160a01b0387169250632304aa029150604401600060405180830381600087803b158015612cf557600080fd5b505af1158015612d09573d6000803e3d6000fd5b50506040517f8d7443140000000000000000000000000000000000000000000000000000000081523060048201526effffffffffffffffffffffffffffff841660248201526001600160a01b0387169250638d744314915060440161187c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f86455d28000000000000000000000000000000000000000000000000000000001480610cad5750610cad826138d9565b6000818152600260205260409020546001600160a01b03166114825760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610dfc565b600081815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091558190612e70826119f4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6009546001600160a01b03163314610f0c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dfc565b612f0b6139bc565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080612f61836119f4565b9050806001600160a01b0316846001600160a01b03161480612fa857506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80612fcc5750836001600160a01b0316612fc184610d45565b6001600160a01b0316145b949350505050565b826001600160a01b0316612fe7826119f4565b6001600160a01b0316146130635760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610dfc565b6001600160a01b0382166130de5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610dfc565b6130eb8383836001613a0e565b826001600160a01b03166130fe826119f4565b6001600160a01b03161461317a5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610dfc565b600081815260046020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ebb8383836001613a3c565b6000613235826119f4565b9050613245816000846001613a0e565b61324e826119f4565b600083815260046020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4611e13816000846001613a3c565b610f0c612ea9565b6001600160a01b03821661334d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610dfc565b6000818152600260205260409020546001600160a01b0316156133b25760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dfc565b6133c0600083836001613a0e565b6000818152600260205260409020546001600160a01b0316156134255760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dfc565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611e13600083836001613a3c565b600980546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361357d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610dfc565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b805163ffffffff1615806136125750806020015163ffffffff16816000015163ffffffff1610155b806136315750806060015163ffffffff16816040015163ffffffff1610155b8061364f5750806040015163ffffffff16816020015163ffffffff16115b15611482576040517fc866ddad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613691848484612fd4565b61369d84848484613a63565b611c0b5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b6060600e8054610cc290614669565b6060600061372b83613c01565b600101905060008167ffffffffffffffff81111561374b5761374b6141e5565b6040519080825280601f01601f191660200182016040528015613775576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461377f57509392505050565b6002600a54036138105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610dfc565b6002600a55565b600b5460ff1615610f0c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610dfc565b600082613878868685613ce3565b1495945050505050565b611e13828260405180602001604052806000815250613d2f565b6138a4613817565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f383390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061396c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610cad57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610cad565b600b5460ff16610f0c5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610dfc565b60005b81811015613a3557613a2d8585613a2884876149c5565b613db8565b600101613a11565b5050505050565b60005b81811015613a3557613a5b8585613a5684876149c5565b613e27565b600101613a3f565b60006001600160a01b0384163b15613bf9576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290613ac0903390899088908890600401614a07565b6020604051808303816000875af1925050508015613afb575060408051601f3d908101601f19168201909252613af891810190614a43565b60015b613bae573d808015613b29576040519150601f19603f3d011682016040523d82523d6000602084013e613b2e565b606091505b508051600003613ba65760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612fcc565b506001612fcc565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613c4a577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613c76576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613c9457662386f26fc10000830492506010015b6305f5e1008310613cac576305f5e100830492506008015b6127108310613cc057612710830492506004015b60648310613cd2576064830492506002015b600a8310610cad5760010192915050565b600081815b84811015613d2657613d1282878784818110613d0657613d06614a60565b90506020020135613e87565b915080613d1e81614a8f565b915050613ce8565b50949350505050565b613d3983836132f7565b613d466000848484613a63565b610ebb5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610dfc565b6001600160a01b038381161590831615818015613dd25750805b15613e09576040517f5cbd944100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613e15575b613a35565b80613e1057613a353386868634613eb3565b6001600160a01b038381161590831615818015613e415750805b15613e78576040517f5cbd944100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81613e105780613e1057613a35565b6000818310613ea3576000828152602084905260409020610fb9565b5060009182526020526040902090565b6008546001600160a01b031615613a35576008546040517f285fb8c80000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b158015613f3257600080fd5b505afa158015613f46573d6000803e3d6000fd5b505050505050505050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461148257600080fd5b600060208284031215613f9157600080fd5b8135610fb981613f51565b60005b83811015613fb7578181015183820152602001613f9f565b50506000910152565b60008151808452613fd8816020860160208601613f9c565b601f01601f19169290920160200192915050565b602081526000610fb96020830184613fc0565b60006020828403121561401157600080fd5b5035919050565b6001600160a01b038116811461148257600080fd5b6000806040838503121561404057600080fd5b823561404b81614018565b946020939093013593505050565b60008060006060848603121561406e57600080fd5b833561407981614018565b9250602084013561408981614018565b9150604084013561409981614018565b809150509250925092565b600781106140db577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60208101610cad82846140a4565b6000602082840312156140ff57600080fd5b8135610fb981614018565b801515811461148257600080fd5b60006020828403121561412a57600080fd5b8135610fb98161410a565b60008060006060848603121561414a57600080fd5b833561415581614018565b9250602084013561416581614018565b929592945050506040919091013590565b6000806040838503121561418957600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156141d95783516001600160a01b0316835292840192918401916001016141b4565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561423d5761423d6141e5565b604052919050565b600067ffffffffffffffff83111561425f5761425f6141e5565b6142726020601f19601f86011601614214565b905082815283838301111561428657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156142af57600080fd5b813567ffffffffffffffff8111156142c657600080fd5b8201601f810184136142d757600080fd5b612fcc84823560208401614245565b6007811061148257600080fd5b6effffffffffffffffffffffffffffff8116811461148257600080fd5b60008060006060848603121561432557600080fd5b8335614330816142e6565b92506020840135614340816142f3565b91506040840135614099816142f3565b803563ffffffff8116811461436457600080fd5b919050565b60006020828403121561437b57600080fd5b610fb982614350565b6000806040838503121561439757600080fd5b82356143a281614018565b915060208301356143b28161410a565b809150509250929050565b6000608082840312156143cf57600080fd5b6040516080810181811067ffffffffffffffff821117156143f2576143f26141e5565b6040526143fe83614350565b815261440c60208401614350565b602082015261441d60408401614350565b604082015261442e60608401614350565b60608201529392505050565b6000806000806080858703121561445057600080fd5b843561445b81614018565b9350602085013561446b81614018565b925060408501359150606085013567ffffffffffffffff81111561448e57600080fd5b8501601f8101871361449f57600080fd5b6144ae87823560208401614245565b91505092959194509250565b60006060820190506144cd8284516140a4565b60208301516effffffffffffffffffffffffffffff8082166020850152806040860151166040850152505092915050565b6000806000806060858703121561451457600080fd5b61451d85614350565b935061452b60208601614350565b9250604085013567ffffffffffffffff8082111561454857600080fd5b818701915087601f83011261455c57600080fd5b81358181111561456b57600080fd5b8860208260051b850101111561458057600080fd5b95989497505060200194505050565b600080604083850312156145a257600080fd5b82356145ad81614018565b915060208301356143b281614018565b6000602082840312156145cf57600080fd5b813561ffff81168114610fb957600080fd5b600080604083850312156145f457600080fd5b82356145ff81614018565b915061121b60208401614350565b6000806000806080858703121561462357600080fd5b843561462e81614018565b9350602085013561463e816142e6565b9250604085013561464e816142f3565b9150606085013561465e816142f3565b939692955090935050565b600181811c9082168061467d57607f821691505b6020821081036146b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610cad57610cad6146bc565b600082614738577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006060828403121561474f57600080fd5b6040516060810181811067ffffffffffffffff82111715614772576147726141e5565b6040528251614780816142e6565b81526020830151614790816142f3565b602082015260408301516147a3816142f3565b60408201529392505050565b6000602082840312156147c157600080fd5b8151610fb98161410a565b600060208083850312156147df57600080fd5b825167ffffffffffffffff808211156147f757600080fd5b818501915085601f83011261480b57600080fd5b81518181111561481d5761481d6141e5565b8060051b915061482e848301614214565b818152918301840191848101908884111561484857600080fd5b938501935b83851015614872578451925061486283614018565b828252938501939085019061484d565b98975050505050505050565b601f821115610ebb57600081815260208120601f850160051c810160208610156148a55750805b601f850160051c820191505b818110156148c4578281556001016148b1565b505050505050565b815167ffffffffffffffff8111156148e6576148e66141e5565b6148fa816148f48454614669565b8461487e565b602080601f83116001811461492f57600084156149175750858301515b600019600386901b1c1916600185901b1785556148c4565b600085815260208120601f198616915b8281101561495e5788860151825594840194600190910190840161493f565b508582101561497c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825161499e818460208701613f9c565b9190910192915050565b6001600160a01b038316815260408101610fb960208301846140a4565b80820180821115610cad57610cad6146bc565b600083516149ea818460208801613f9c565b8351908301906149fe818360208801613f9c565b01949350505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a396080830184613fc0565b9695505050505050565b600060208284031215614a5557600080fd5b8151610fb981613f51565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006000198203614aa257614aa26146bc565b506001019056fea2646970667358221220c4290a20d48e0b2445aa81155590d0a24f5fc53bce8ba5cef8e15100e4dbf6e864736f6c63430008150033

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

00000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000002bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bae3d0d4ac7982044146a735c4a8a85bfe6aac4a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001853434150453a20466f756e64696e6720436974697a656e730000000000000000000000000000000000000000000000000000000000000000000000000000000653435043495400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656963666972326c667961376c646e6532783777777837777567623374786771797a7a69327a6c79357765346d736a6f626c626b34792f0000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): SCAPE: Founding Citizens
Arg [1] : _symbol (string): SCPCIT
Arg [2] : _maxSupply (uint32): 5000
Arg [3] : _maxWhitelistSupply (uint32): 5000
Arg [4] : _maxPublicMintPerTransaction (uint16): 5
Arg [5] : _maxRoyaltyBasisPoints (uint16): 700
Arg [6] : _mintPrice (uint256): 0
Arg [7] : _contractManager (address): 0xBae3d0d4AC7982044146A735c4a8A85bFe6AaC4a
Arg [8] : _merkleRoot (bytes32): 0x0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : _tokenBaseURI (string): ipfs://bafybeicfir2lfya7ldne2x7wwx7wugb3txgqyzzi2zly5we4msjoblbk4y/
Arg [10] : _mintSchedule (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [2] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [3] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [5] : 00000000000000000000000000000000000000000000000000000000000002bc
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 000000000000000000000000bae3d0d4ac7982044146a735c4a8a85bfe6aac4a
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [15] : 53434150453a20466f756e64696e6720436974697a656e730000000000000000
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [17] : 5343504349540000000000000000000000000000000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [19] : 697066733a2f2f6261667962656963666972326c667961376c646e6532783777
Arg [20] : 777837777567623374786771797a7a69327a6c79357765346d736a6f626c626b
Arg [21] : 34792f0000000000000000000000000000000000000000000000000000000000


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.