ETH Price: $3,466.32 (+4.80%)

Token

NotRealDigitalAsset (NRDA)
 

Overview

Max Total Supply

43 NRDA

Holders

26

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
christinebarnum.eth
Balance
1 NRDA
0x1200a40c18804f6b5e01f465d5489e53340d61ec
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
NotRealDigitalAssetV2

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : NotRealDigitalAssetV2.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.6.12;

//
//                     _░▒███████
//                     ░██▓▒░░▒▓██
//                     ██▓▒░__░▒▓██___██████
//                     ██▓▒░____░▓███▓__░▒▓██
//                     ██▓▒░___░▓██▓_____░▒▓██
//                     ██▓▒░_______________░▒▓██
//                     _██▓▒░______________░▒▓██
//                     __██▓▒░____________░▒▓██
//                     ___██▓▒░__________░▒▓██
//                     ____██▓▒░________░▒▓██
//                     _____██▓▒░_____░▒▓██
//  ██░▀██████████████▀░██_██▓▒░__░▒▓██
//  █▌▒▒░████████████░▒▒▐█__█▓▒░░▒▓██
//  █░▒▒▒░██████████░▒▒▒░█____░▒▓██
//  ▌░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▐__░▒▓██
//  ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▓██
//  ███▀▀▀██▄▒▒▒▒▒▒▒▄██▀▀▀██
//  ██░░░▐█░▀█▒▒▒▒▒█▀░█▌░░░█ 
//  ▐▌░░░▐▄▌░▐▌▒▒▒▐▌░▐▄▌░░▐▌
//  █░░░▐█▌░░▌▒▒▒▐░░▐█▌░░█
//  ▒▀▄▄▄█▄▄▄▌░▄░▐▄▄▄█▄▄▀▒
//  ░░░░░░░░░░└┴┘░░░░░░░░░
//  ██▄▄░░░░░░░░░░░░░░▄▄██
//  ████████▒▒▒▒▒▒████████
//  █▀░░███▒▒░░▒░░▒▀██████
//  █▒░███▒▒╖░░╥░░╓▒▐█████
//  █▒░▀▀▀░░║░░║░░║░░█████
//  ██▄▄▄▄▀▀┴┴╚╧╧╝╧╧╝┴┴███
//  ██████████████████████
//

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

// ERC721
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

// ERC20
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

// For safe maths operations
import "@openzeppelin/contracts/math/SafeMath.sol";

// Utils only
import "./StringsUtil.sol";

interface IERC20Burnable {
    function burn(uint256 amount) external;
    function burnFrom(address account, uint256 amount) external;
    function burnAmount() external view returns (uint256 _amount);
}

/**
* @title NotRealDigitalAsset - V2
*
* http://www.notreal.ai/
*
* ERC721 compliant digital assets for real-world artwork.
*
* Base NFT Issuance Contract
*
* AMPLIFY ART.
*
*/
contract NotRealDigitalAssetV2 is
AccessControl,
Ownable,
ERC721,
Pausable,
ReentrancyGuard
{

  bytes32 public constant ROLE_NOT_REAL = keccak256('ROLE_NOT_REAL');
  bytes32 public constant ROLE_MINTER = keccak256('ROLE_MINTER');
  bytes32 public constant ROLE_MARKET = keccak256('ROLE_MARKET');

  ///////////////
  // Modifiers //
  ///////////////

  // Modifiers are wrapped around functions because it shaves off contract size 
  modifier onlyAvailableEdition(uint256 _editionNumber, uint256 _numTokens) {
    _onlyAvailableEdition(_editionNumber, _numTokens);
    _;
  }

  modifier onlyActiveEdition(uint256 _editionNumber) {
    _onlyActiveEdition(_editionNumber);
    _;
  }

  modifier onlyRealEdition(uint256 _editionNumber) {
    _onlyRealEdition(_editionNumber);
    _;
  }

  modifier onlyValidTokenId(uint256 _tokenId) {
    _onlyValidTokenId(_tokenId);
    _;
  }

  modifier onlyPurchaseDuringWindow(uint256 _editionNumber) {
    _onlyPurchaseDuringWindow(_editionNumber);
    _;
  }

  function _onlyAvailableEdition(uint256 _editionNumber, uint256 _numTokens) internal view {
    require(editionNumberToEditionDetails[_editionNumber].totalSupply.add(_numTokens) <= editionNumberToEditionDetails[_editionNumber].totalAvailable);
  }

  function _onlyActiveEdition(uint256 _editionNumber) internal view {
    require(editionNumberToEditionDetails[_editionNumber].active);
  }

  function _onlyRealEdition(uint256 _editionNumber) internal view {
    require(editionNumberToEditionDetails[_editionNumber].editionNumber > 0);
  }

  function _onlyValidTokenId(uint256 _tokenId) internal view {
    require(_exists(_tokenId));
  }

  function _onlyPurchaseDuringWindow(uint256 _editionNumber) internal view {
    require(editionNumberToEditionDetails[_editionNumber].startDate <= block.timestamp);
    require(editionNumberToEditionDetails[_editionNumber].endDate >= block.timestamp);
  }

  modifier onlyIfNotReal() {
    _onlyIfNotReal();
    _;
  }

  modifier onlyIfMinter() {
    _onlyIfMinter();
    _;
  }

  function _onlyIfNotReal()  internal view {
    require(_msgSender() == owner() || hasRole(ROLE_NOT_REAL, _msgSender()));
  }

  function _onlyIfMinter() internal view {
    require(_msgSender() == owner() || hasRole(ROLE_NOT_REAL, _msgSender()) || hasRole(ROLE_MINTER, _msgSender()));
  }

  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  ////////////
  // Events //
  ////////////

  // Emitted on purchases from within this contract
  event Purchase(
    uint256 indexed _tokenId,
    uint256 indexed _editionNumber,
    address indexed _buyer,
    uint256 _priceInWei,
    uint256 _numTokens
  );

  // Emitted on every mint
  event Minted(
    uint256 indexed _tokenId,
    uint256 indexed _editionNumber,
    address indexed _buyer,
    uint256 _numTokens
  );

  // Emitted on every edition created
  event EditionCreated(
    uint256 indexed _editionNumber,
    bytes32 indexed _editionData,
    uint256 indexed _editionType
  );

  event NameChange(uint256 indexed _tokenId, string _newName);

  ////////////////
  // Properties //
  ////////////////

  uint256 constant internal MAX_UINT32 = ~uint32(0);

  string public tokenBaseURI = "https://ipfs.infura.io/ipfs/";

  // simple counter to keep track of the highest edition number used
  uint256 public highestEditionNumber;

  // number of assets minted of any type
  uint256 public totalNumberMinted;

  // number of assets minted of any type
  uint256 public totalPurchaseValueInWei;

  // number of assets available of any type
  uint256 public totalNumberAvailable;

  // Max number of tokens that can be minted/purchased in a batch
  uint256 public maxBatch = 100;
  uint256 public maxGas = 100000000000;

  // the NR account which can receive commission
  address public nrCommissionAccount;

  // Accepted ERC20 token
  IERC20 public acceptedToken;

  IERC20Burnable public nameToken;

  // Optional commission split can be defined per edition
  mapping(uint256 => CommissionSplit) internal editionNumberToOptionalCommissionSplit;

  // Simple structure providing an optional commission split per edition purchase
  struct CommissionSplit {
    uint256 rate;
    address recipient;
  }

  // Object for edition details
  struct EditionDetails {
    // Identifiers
    uint256 editionNumber;    // the range e.g. 10000
    bytes32 editionData;      // some data about the edition
    uint256 editionType;      // e.g. 1 = NRDA, 4 = Deactivated
    // Config
    uint256 startDate;        // date when the edition goes on sale
    uint256 endDate;          // date when the edition is available until
    address artistAccount;    // artists account
    uint256 artistCommission; // base artists commission, could be overridden by external contracts
    uint256 priceInWei;       // base price for edition, could be overridden by external contracts
    string tokenURI;          // IPFS hash - see base URI
    bool active;              // Root control - on/off for the edition
    // Counters
    uint256 totalSupply;      // Total purchases or mints
    uint256 totalAvailable;   // Total number available to be purchased
  }

  // _editionNumber : EditionDetails
  mapping(uint256 => EditionDetails) internal editionNumberToEditionDetails;

  // _tokenId : _editionNumber
  mapping(uint256 => uint256) internal tokenIdToEditionNumber;

  // _editionNumber : [_tokenId, _tokenId]
  mapping(uint256 => uint256[]) internal editionNumberToTokenIds;
  mapping(uint256 => uint256[]) internal editionNumberToBurnedTokenIds;

  // _artistAccount : [_editionNumber, _editionNumber]
  mapping(address => uint256[]) internal artistToEditionNumbers;
  mapping(uint256 => uint256) internal editionNumberToArtistIndex;

  // _editionType : [_editionNumber, _editionNumber]
  mapping(uint256 => uint256[]) internal editionTypeToEditionNumber;
  mapping(uint256 => uint256) internal editionNumberToTypeIndex;

  mapping (uint256 => string) public tokenName;
  mapping (string => bool) internal reservedName;


  /*
   * Constructor
   */
  constructor (IERC20 _acceptedToken) public payable ERC721("NotRealDigitalAsset", "NRDA") {
    // set commission account to contract creator
    nrCommissionAccount = _msgSender();
    acceptedToken = _acceptedToken;

    _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    _setBaseURI(tokenBaseURI);
  }


  // Function wrapper for using native Ether or ERC20
  function _acceptedTokenSafeTransferFrom(address _from, address _to, uint256 _msgValue) internal {
    require(tx.gasprice <= maxGas, "Gas price too high");

    if(address(acceptedToken) == address(0)) {
      require(msg.value == _msgValue);
      require(_from == _msgSender());
      require(_to == address(this));
    } else {
      acceptedToken.safeTransferFrom(_from, _to, _msgValue);
    }
  }

  function _acceptedTokenSafeTransfer(address _to, uint256 _msgValue) internal {
    if(address(acceptedToken) == address(0)) {
      payable(_to).transfer(_msgValue);
    } else {
      acceptedToken.safeTransfer(_to, _msgValue);
    }
  }


  function pause() public onlyIfNotReal {
      _pause();
  }

  function unpause() public onlyIfNotReal {
      _unpause();
  }

  function setNameToken(address _nameToken) external onlyOwner {
      nameToken = IERC20Burnable(_nameToken);
  }

  // Spend name tokens to give this ERC721 a unique name
  function changeName(uint256 _tokenId, string memory _newName) public onlyValidTokenId(_tokenId) {
      string memory _newNameLower = StringsUtil.toLower(_newName);
  
      require(_msgSender() == ownerOf(_tokenId), "ERC721: caller is not the owner");
      require(StringsUtil.validateName(_newName), "Not a valid new name");
      require(!reservedName[_newNameLower], "Name already reserved");
  
      reservedName[StringsUtil.toLower(tokenName[_tokenId])] = false;
      reservedName[_newNameLower] = true;

      nameToken.burnFrom(_msgSender(), nameToken.burnAmount());
      tokenName[_tokenId] = _newName;
  
      emit NameChange(_tokenId, _newName);
  }

  function mint(address _to, uint256 _editionNumber)
  public
  onlyIfMinter
  returns (uint256) {
    return mintMany(_to, _editionNumber, 1);
  }

  /**
   * @dev Private (NR only) method for minting editions
   * @dev Payment not needed for this method
   */
  function mintMany(address _to, uint256 _editionNumber, uint256 _numTokens)
  public
  onlyIfMinter
  onlyRealEdition(_editionNumber)
  onlyAvailableEdition(_editionNumber, _numTokens)
  returns (uint256) {

    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    uint256 _tokenId = _editionDetails.editionNumber.add(_editionDetails.totalSupply).add(1);

    for (uint256 i = 0; i < _numTokens; i++) {
      // Construct next token ID e.g. 100000 + 1 = ID of 100001 (this first in the edition set)
      // Create the token
      _mintToken(_to, _tokenId.add(i), _editionNumber, _editionDetails.tokenURI);
    }

    totalNumberMinted = totalNumberMinted.add(_numTokens);
    _editionDetails.totalSupply = _editionDetails.totalSupply.add(_numTokens);

    // Emit minted event
    emit Minted(_tokenId, _editionNumber, _to, _numTokens);

    return _tokenId;
  }

  /**
   * @dev Internal factory method for building editions
   */
  function createEdition(
    uint256 _editionNumber,
    bytes32 _editionData,
    uint256 _editionType,
    uint256 _startDate,
    uint256 _endDate,
    address _artistAccount,
    uint256 _artistCommission,
    uint256 _priceInWei,
    string memory _tokenURI,
    uint256 _totalAvailable,
    bool _active
  )
  public
  onlyIfNotReal
  returns (bool)
  {
    // Prevent missing edition number
    require(_editionNumber != 0);

    // Prevent edition number lower than last one used
    require(_editionNumber > highestEditionNumber);

    // Check previously edition plus total available is less than new edition number
    require(highestEditionNumber.add(editionNumberToEditionDetails[highestEditionNumber].totalAvailable) < _editionNumber);

    // Prevent missing types
    require(_editionType != 0);

    // Prevent missing token URI
    require(bytes(_tokenURI).length != 0);

    // Prevent empty artists address
    require(_artistAccount != address(0));

    // Prevent invalid commissions
    require(_artistCommission <= 100 && _artistCommission >= 0);

    // Prevent duplicate editions
    require(editionNumberToEditionDetails[_editionNumber].editionNumber == 0);

    // Default end date to max uint256
    uint256 endDate = _endDate;
    if (_endDate == 0) {
      endDate = MAX_UINT32;
    }

    editionNumberToEditionDetails[_editionNumber] = EditionDetails({
      editionNumber : _editionNumber,
      editionData : _editionData,
      editionType : _editionType,
      startDate : _startDate,
      endDate : endDate,
      artistAccount : _artistAccount,
      artistCommission : _artistCommission,
      priceInWei : _priceInWei,
      tokenURI : StringsUtil.strConcat(_tokenURI, "/"),
      totalSupply : 0, // default to all available
      totalAvailable : _totalAvailable,
      active : _active
    });

    // Add to total available count
    totalNumberAvailable = totalNumberAvailable.add(_totalAvailable);

    // Update mappings
    _updateArtistLookupData(_artistAccount, _editionNumber);
    _updateEditionTypeLookupData(_editionType, _editionNumber);

    emit EditionCreated(_editionNumber, _editionData, _editionType);

    // Update the edition pointer if needs be
    highestEditionNumber = _editionNumber;

    return true;
  }

  function _updateEditionTypeLookupData(uint256 _editionType, uint256 _editionNumber) internal {
    uint256 typeEditionIndex = editionTypeToEditionNumber[_editionType].length;
    editionTypeToEditionNumber[_editionType].push(_editionNumber);
    editionNumberToTypeIndex[_editionNumber] = typeEditionIndex;
  }

  function _updateArtistLookupData(address _artistAccount, uint256 _editionNumber) internal {
    uint256 artistEditionIndex = artistToEditionNumbers[_artistAccount].length;
    artistToEditionNumbers[_artistAccount].push(_editionNumber);
    editionNumberToArtistIndex[_editionNumber] = artistEditionIndex;
  }


  ///**
  // * @dev Public entry point for purchasing an edition on behalf of someone else
  // * @dev Reverts if edition is invalid
  // * @dev Reverts if payment not provided in full
  // * @dev Reverts if edition is sold out
  // * @dev Reverts if edition is not active or available
  // */
  function purchaseMany(address _to, uint256 _editionNumber, uint256 _numTokens, uint256 _msgValue)
  public
  payable
  whenNotPaused
  nonReentrant
  onlyRealEdition(_editionNumber)
  onlyActiveEdition(_editionNumber)
  onlyAvailableEdition(_editionNumber, _numTokens)
  onlyPurchaseDuringWindow(_editionNumber)
  returns (uint256) {

    require(_numTokens <= maxBatch && _numTokens >= 1);
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];

    require(_msgValue >= _editionDetails.priceInWei.mul(_numTokens));
    _acceptedTokenSafeTransferFrom(_msgSender(), address(this), _msgValue);

    uint256 _tokenId = _editionDetails.editionNumber.add(_editionDetails.totalSupply).add(1);
    for (uint256 i = 0; i < _numTokens; i++) {
      // Transfer token to this contract
      // Construct next token ID e.g. 100000 + 1 = ID of 100001 (this first in the edition set)
      // Create the token
      _mintToken(_to, _tokenId.add(i), _editionNumber, _editionDetails.tokenURI);
    }

    totalNumberMinted = totalNumberMinted.add(_numTokens);
    _editionDetails.totalSupply = _editionDetails.totalSupply.add(_numTokens);

    // Splice funds and handle commissions
    _handleFunds(_editionNumber, _msgValue, _editionDetails.artistAccount, _editionDetails.artistCommission);

    // Emit minted event
    emit Minted(_tokenId, _editionNumber, _to, _numTokens);

    // Broadcast purchase
    emit Purchase(_tokenId, _editionNumber, _to, _editionDetails.priceInWei, _numTokens);

    return _tokenId;
  }


  function _nextTokenId(uint256 _editionNumber) internal returns (uint256) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];

    // Bump number totalSupply
    _editionDetails.totalSupply = _editionDetails.totalSupply.add(1);

    // Construct next token ID e.g. 100000 + 1 = ID of 100001 (this first in the edition set)
    return _editionDetails.editionNumber.add(_editionDetails.totalSupply);
  }

  function _mintToken(address _to, uint256 _tokenId, uint256 _editionNumber, string memory _tokenURI) internal {

    // Mint new base token
    super._mint(_to, _tokenId);
    super._setTokenURI(_tokenId, StringsUtil.strConcat(_tokenURI, StringsUtil.uint2str(_tokenId)));

    // Maintain mapping for tokenId to edition for lookup
    tokenIdToEditionNumber[_tokenId] = _editionNumber;

    // Maintain mapping of edition to token array for "edition minted tokens"
    editionNumberToTokenIds[_editionNumber].push(_tokenId);
  }

  function _handleFunds(uint256 _editionNumber, uint256 _priceInWei, address _artistAccount, uint256 _artistCommission) internal {

    // Extract the artists commission and send it
    uint256 artistPayment = _priceInWei.div(100).mul(_artistCommission);
    if (artistPayment > 0) {
      _acceptedTokenSafeTransfer(_artistAccount, artistPayment); 
    }

    // Load any commission overrides
    CommissionSplit storage commission = editionNumberToOptionalCommissionSplit[_editionNumber];

    // Apply optional commission structure
    uint256 rateSplit = 0;
    if (commission.rate > 0) {
      rateSplit = _priceInWei.div(100).mul(commission.rate);
      _acceptedTokenSafeTransfer(commission.recipient, rateSplit); 
    }

    // Send remaining eth to NR
    uint256 remainingCommission = _priceInWei.sub(artistPayment).sub(rateSplit);
    _acceptedTokenSafeTransfer(nrCommissionAccount, remainingCommission); 

    // Record wei sale value
    totalPurchaseValueInWei = totalPurchaseValueInWei.add(_priceInWei);
  }

  /**
   * @dev Private (NR only) method for burning tokens which have been created incorrectly
   */
  function burn(uint256 _tokenId) external onlyIfNotReal {

    // Clear from parents
    super._burn(_tokenId);

    // Get hold of the edition for cleanup
    uint256 _editionNumber = tokenIdToEditionNumber[_tokenId];

    // Delete token ID mapping
    delete tokenIdToEditionNumber[_tokenId];
    editionNumberToBurnedTokenIds[_editionNumber].push(_tokenId);
  }

  //////////////////
  // Base Updates //
  //////////////////
  //

  function updateTokenBaseURI(string calldata _newBaseURI)
  external
  onlyIfNotReal {
    require(bytes(_newBaseURI).length != 0);
    tokenBaseURI = _newBaseURI;
  }

  function updateNrCommissionAccount(address _nrCommissionAccount)
  external
  onlyIfNotReal {
    require(_nrCommissionAccount != address(0));
    nrCommissionAccount = _nrCommissionAccount;
  }

  function updateMaxBatch(uint256 _maxBatch)
  external
  onlyIfNotReal {
    maxBatch = _maxBatch;
  }

  function updateMaxGas(uint256 _maxGas)
  external
  onlyIfNotReal {
    maxGas = _maxGas;
  }

  /////////////////////
  // Edition Updates //
  /////////////////////

  function updateEditionTokenURI(uint256 _editionNumber, string calldata _uri)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    editionNumberToEditionDetails[_editionNumber].tokenURI = StringsUtil.strConcat(_uri, "/");
  }

  function updatePriceInWei(uint256 _editionNumber, uint256 _priceInWei)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    editionNumberToEditionDetails[_editionNumber].priceInWei = _priceInWei;
  }

  function updateArtistCommission(uint256 _editionNumber, uint256 _rate)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    editionNumberToEditionDetails[_editionNumber].artistCommission = _rate;
  }
  

  function updateEditionType(uint256 _editionNumber, uint256 _editionType)
  external 
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {

    EditionDetails storage _originalEditionDetails = editionNumberToEditionDetails[_editionNumber];

    // Get list of editions for old type
    uint256[] storage editionNumbersForType = editionTypeToEditionNumber[_originalEditionDetails.editionType];

    // Remove edition from old type list
    uint256 editionTypeIndex = editionNumberToTypeIndex[_editionNumber];
    delete editionNumbersForType[editionTypeIndex];

    // Add new type to the list
    uint256 newTypeEditionIndex = editionTypeToEditionNumber[_editionType].length;
    editionTypeToEditionNumber[_editionType].push(_editionNumber);
    editionNumberToTypeIndex[_editionNumber] = newTypeEditionIndex;

    // Update the edition
    _originalEditionDetails.editionType = _editionType;
  }
  
  function updateTotalSupply(uint256 _editionNumber, uint256 _totalSupply)
  external 
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    require(editionNumberToTokenIds[_editionNumber].length <= _totalSupply);
    editionNumberToEditionDetails[_editionNumber].totalSupply = _totalSupply;
  }
  
  function updateTotalAvailable(uint256 _editionNumber, uint256 _totalAvailable)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];

    require(_editionDetails.totalSupply <= _totalAvailable);

    uint256 originalAvailability = _editionDetails.totalAvailable;
    _editionDetails.totalAvailable = _totalAvailable;
    totalNumberAvailable = totalNumberAvailable.sub(originalAvailability).add(_totalAvailable);
  }
  

  function updateActive(uint256 _editionNumber, bool _active)
  external 
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    editionNumberToEditionDetails[_editionNumber].active = _active;
  }

  function updateStartDate(uint256 _editionNumber, uint256 _startDate)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    editionNumberToEditionDetails[_editionNumber].startDate = _startDate;
  }

  function updateEndDate(uint256 _editionNumber, uint256 _endDate)
  external
  onlyRealEdition(_editionNumber) {
    require(_msgSender() == owner() || hasRole(ROLE_NOT_REAL, _msgSender()) || hasRole(ROLE_MARKET, _msgSender()));
    editionNumberToEditionDetails[_editionNumber].endDate = _endDate;
  }

  function updateArtistsAccount(uint256 _editionNumber, address _artistAccount)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {

    EditionDetails storage _originalEditionDetails = editionNumberToEditionDetails[_editionNumber];

    uint256 editionArtistIndex = editionNumberToArtistIndex[_editionNumber];

    // Get list of editions old artist works with
    uint256[] storage editionNumbersForArtist = artistToEditionNumbers[_originalEditionDetails.artistAccount];

    // Remove edition from artists lists
    delete editionNumbersForArtist[editionArtistIndex];

    // Add new artists to the list
    uint256 newArtistsEditionIndex = artistToEditionNumbers[_artistAccount].length;
    artistToEditionNumbers[_artistAccount].push(_editionNumber);
    editionNumberToArtistIndex[_editionNumber] = newArtistsEditionIndex;

    // Update the edition
    _originalEditionDetails.artistAccount = _artistAccount;
  }

  function updateOptionalCommission(uint256 _editionNumber, uint256 _rate, address _recipient)
  external
  onlyIfNotReal
  onlyRealEdition(_editionNumber) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    uint256 artistCommission = _editionDetails.artistCommission;

    if (_rate > 0) {
      require(_recipient != address(0));
    }
    require(artistCommission.add(_rate) <= 100);

    editionNumberToOptionalCommissionSplit[_editionNumber] = CommissionSplit({rate : _rate, recipient : _recipient});
  }

  ///////////////////
  // Token Updates //
  ///////////////////

  function setTokenURI(uint256 _tokenId, string calldata _uri)
  external
  onlyIfNotReal
  onlyValidTokenId(_tokenId) {
    _setTokenURI(_tokenId, _uri);
  }

  ///////////////////
  // Query Methods //
  ///////////////////

  /**
   * @dev Lookup the edition of the provided token ID
   * @dev Returns 0 if not valid
   */
  function editionOfTokenId(uint256 _tokenId) external view returns (uint256 _editionNumber) {
    return tokenIdToEditionNumber[_tokenId];
  }

  /**
   * @dev Lookup all editions added for the given edition type
   * @dev Returns array of edition numbers, any zero edition ids can be ignore/stripped
   */
  function editionsOfType(uint256 _type) external view returns (uint256[] memory _editionNumbers) {
    return editionTypeToEditionNumber[_type];
  }

  /**
   * @dev Lookup all editions for the given artist account
   * @dev Returns empty list if not valid
   */
  function artistsEditions(address _artistsAccount) external view returns (uint256[] memory _editionNumbers) {
    return artistToEditionNumbers[_artistsAccount];
  }

  /**
   * @dev Lookup all tokens minted for the given edition number
   * @dev Returns array of token IDs, any zero edition ids can be ignore/stripped
   */
  function tokensOfEdition(uint256 _editionNumber) external view returns (uint256[] memory _tokenIds) {
    return editionNumberToTokenIds[_editionNumber];
  }

  /**
   * @dev Lookup all owned tokens for the provided address
   * @dev Returns array of token IDs
   */
  function tokensOf(address _owner) external view returns (uint256[] memory _tokenIds) {
    uint256[] memory results = new uint256[](balanceOf(_owner));

    for (uint256 idx = 0; idx < results.length; idx++) {
        results[idx] = tokenOfOwnerByIndex(_owner, idx);
    }

    return results;
  }

  /**
   * @dev Checks to see if the edition exists, assumes edition of zero is invalid
   */
  function editionExists(uint256 _editionNumber) external view returns (bool) {
    if (_editionNumber == 0) {
      return false;
    }
    EditionDetails storage editionNumber = editionNumberToEditionDetails[_editionNumber];
    return editionNumber.editionNumber == _editionNumber;
  }

  /**
   * @dev Checks to see if the token exists
   */
  function exists(uint256 _tokenId) external view returns (bool) {
    return _exists(_tokenId);
  }

  /**
   * @dev Lookup any optional commission split set for the edition
   * @dev Both values will be zero if not present
   */
  function editionOptionalCommission(uint256 _editionNumber) external view returns (uint256 _rate, address _recipient) {
    CommissionSplit storage commission = editionNumberToOptionalCommissionSplit[_editionNumber];
    return (commission.rate, commission.recipient);
  }

  /**
   * @dev Main entry point for looking up edition config/metadata
   * @dev Reverts if invalid edition number provided
   */
  function detailsOfEdition(uint256 editionNumber)
  external view
  onlyRealEdition(editionNumber)
  returns (
    bytes32 _editionData,
    uint256 _editionType,
    uint256 _startDate,
    uint256 _endDate,
    address _artistAccount,
    uint256 _artistCommission,
    uint256 _priceInWei,
    string memory _tokenURI,
    uint256 _totalSupply,
    uint256 _totalAvailable,
    bool _active
  ) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[editionNumber];
    return (
    _editionDetails.editionData,
    _editionDetails.editionType,
    _editionDetails.startDate,
    _editionDetails.endDate,
    _editionDetails.artistAccount,
    _editionDetails.artistCommission,
    _editionDetails.priceInWei,
    StringsUtil.strConcat(tokenBaseURI, _editionDetails.tokenURI),
    _editionDetails.totalSupply,
    _editionDetails.totalAvailable,
    _editionDetails.active
    );
  }

  /**
   * @dev Lookup a tokens common identifying characteristics
   * @dev Reverts if invalid token ID provided
   */
  function tokenData(uint256 _tokenId)
  external view
  onlyValidTokenId(_tokenId)
  returns (
    uint256 _editionNumber,
    uint256 _editionType,
    bytes32 _editionData,
    string memory _tokenURI,
    address _owner
  ) {
    uint256 editionNumber = tokenIdToEditionNumber[_tokenId];
    EditionDetails storage editionDetails = editionNumberToEditionDetails[editionNumber];
    return (
    editionNumber,
    editionDetails.editionType,
    editionDetails.editionData,
    tokenURI(_tokenId),
    ownerOf(_tokenId)
    );
  }


  //////////////////////////
  // Edition config query //
  //////////////////////////

  function purchaseDatesEdition(uint256 _editionNumber) public view returns (uint256 _startDate, uint256 _endDate) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return (
    _editionDetails.startDate,
    _editionDetails.endDate
    );
  }

  function artistCommission(uint256 _editionNumber) external view returns (address _artistAccount, uint256 _artistCommission) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return (
    _editionDetails.artistAccount,
    _editionDetails.artistCommission
    );
  }

  function priceInWeiEdition(uint256 _editionNumber) public view returns (uint256 _priceInWei) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return _editionDetails.priceInWei;
  }

  function editionActive(uint256 _editionNumber) public view returns (bool) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return _editionDetails.active;
  }

  function totalRemaining(uint256 _editionNumber) external view returns (uint256) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return _editionDetails.totalAvailable.sub(_editionDetails.totalSupply);
  }

  function totalAvailableEdition(uint256 _editionNumber) public view returns (uint256) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return _editionDetails.totalAvailable;
  }

  function totalSupplyEdition(uint256 _editionNumber) public view returns (uint256) {
    EditionDetails storage _editionDetails = editionNumberToEditionDetails[_editionNumber];
    return _editionDetails.totalSupply;
  }

  function reclaimEther() external onlyOwner {
    payable(owner()).transfer(address(this).balance);
    if (address(acceptedToken) != address(0)) {
      acceptedToken.transfer(owner(), acceptedToken.balanceOf(address(this)));
    }
  }

}

File 2 of 21 : StringsUtil.sol
pragma solidity ^0.6.12;

library StringsUtil {
  // via https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol
    function strConcat(string memory _a, string memory _b) internal pure returns (string memory _concatenatedString) {
        return strConcat(_a, _b, "", "", "");
    }

    function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory _concatenatedString) {
        return strConcat(_a, _b, _c, "", "");
    }

    function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) {
        bytes memory _ba = bytes(_a);
        bytes memory _bb = bytes(_b);
        bytes memory _bc = bytes(_c);
        bytes memory _bd = bytes(_d);
        bytes memory _be = bytes(_e);
        string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
        bytes memory babcde = bytes(abcde);
        uint k = 0;
        uint i = 0;
        for (i = 0; i < _ba.length; i++) {
            babcde[k++] = _ba[i];
        }
        for (i = 0; i < _bb.length; i++) {
            babcde[k++] = _bb[i];
        }
        for (i = 0; i < _bc.length; i++) {
            babcde[k++] = _bc[i];
        }
        for (i = 0; i < _bd.length; i++) {
            babcde[k++] = _bd[i];
        }
        for (i = 0; i < _be.length; i++) {
            babcde[k++] = _be[i];
        }
        return string(babcde);
  } 

  function equal(string memory a, string memory b) internal pure returns (bool) {
      return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b))));
  }

   // NOTE! If you don't make library functions internal, then you have to do annoying linking steps during migration

   /**
   * @dev Check if the name string is valid (Alphanumeric and spaces without leading or trailing space)
   */
  function validateName(string memory str) internal pure returns (bool){
      bytes memory b = bytes(str);
      if(b.length < 1 ||
         b.length > 25 || // Cannot be longer than 25 characters
         b[0] == 0x20 || // Leading space
        // Trailing space
         b[b.length - 1] == 0x20) {

        return false; 
      }
           

      bytes1 lastChar = b[0];

      for(uint i; i<b.length; i++){
          bytes1 char = b[i];

          if (char == 0x20 && lastChar == 0x20) return false; // Cannot contain continous spaces

          if(
              !(char >= 0x30 && char <= 0x39) && //9-0
              !(char >= 0x41 && char <= 0x5A) && //A-Z
              !(char >= 0x61 && char <= 0x7A) && //a-z
              !(char == 0x20) //space
          )
              return false;

          lastChar = char;
      }

      return true;
  }


  function toLower(string memory str) internal pure returns (string memory){
       bytes memory bStr = bytes(str);
       bytes memory bLower = new bytes(bStr.length);
       for (uint i = 0; i < bStr.length; i++) {
           // Uppercase character
           if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) {
               bLower[i] = bytes1(uint8(bStr[i]) + 32);
           } else {
               bLower[i] = bStr[i];
           }
       }
       return string(bLower);
  }

  function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
       if (_i == 0) {
           return "0";
       }
       uint j = _i;
       uint len;
       while (j != 0) {
           len++;
           j /= 10;
       }
       bytes memory bstr = new bytes(len);
       uint k = len - 1;
       while (_i != 0) {
           bstr[k--] = byte(uint8(48 + _i % 10));
           _i /= 10;
       }
       return string(bstr);
  }
}

File 3 of 21 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT

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

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

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

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

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

File 5 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

File 6 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 7 of 21 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 8 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 9 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

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

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 10 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../utils/EnumerableSet.sol";
import "../../utils/EnumerableMap.sol";
import "../../utils/Strings.sol";

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using SafeMath for uint256;
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from holder address to their (enumerable) set of owned tokens
    mapping (address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Base URI
    string private _baseURI;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    /*
     *     bytes4(keccak256('name()')) == 0x06fdde03
     *     bytes4(keccak256('symbol()')) == 0x95d89b41
     *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
     *
     *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
     */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

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

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
    }

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

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

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

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

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

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a prefix in {tokenURI} to each token's URI, or
    * to the token ID if no specific URI is set for that token ID.
    */
    function baseURI() public view virtual returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

    /**
     * @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 || ERC721.isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     d*
     * - `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);

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

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

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

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

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

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @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()) {
            return true;
        }
        bytes memory returndata = to.functionCall(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ), "ERC721: transfer to non ERC721Receiver implementer");
        bytes4 retval = abi.decode(returndata, (bytes4));
        return (retval == _ERC721_RECEIVED);
    }

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

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

File 11 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

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

File 12 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "./IERC721.sol";

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

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

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

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

File 13 of 21 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <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 14 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

File 15 of 21 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 17 of 21 : EnumerableMap.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;

        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) { // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({ _key: key, _value: value }));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) { // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

   /**
    * @dev Returns the key-value pair stored at position `index` in the map. O(1).
    *
    * Note that there are no guarantees on the ordering of entries inside the
    * array, and it may change when more entries are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
        require(map._entries.length > index, "EnumerableMap: index out of bounds");

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
        uint256 keyIndex = map._indexes[key];
        if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)
        return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, "EnumerableMap: nonexistent key"); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {_tryGet}.
     */
    function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return _length(map._inner);
    }

   /**
    * @dev Returns the element stored at position `index` in the set. O(1).
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint160(uint256(value))));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
        (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
        return (success, address(uint160(uint256(value))));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint160(uint256(_get(map._inner, bytes32(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
        return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
    }
}

File 18 of 21 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 19 of 21 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./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 () internal {
        _paused = false;
    }

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

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

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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 20 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity >=0.6.0 <0.8.0;

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

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

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_acceptedToken","type":"address"}],"stateMutability":"payable","type":"constructor"},{"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":"uint256","name":"_editionNumber","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"_editionData","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"_editionType","type":"uint256"}],"name":"EditionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"indexed":true,"internalType":"address","name":"_buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"_numTokens","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"_newName","type":"string"}],"name":"NameChange","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":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"indexed":true,"internalType":"address","name":"_buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_numTokens","type":"uint256"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_MARKET","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_MINTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_NOT_REAL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"artistCommission","outputs":[{"internalType":"address","name":"_artistAccount","type":"address"},{"internalType":"uint256","name":"_artistCommission","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_artistsAccount","type":"address"}],"name":"artistsEditions","outputs":[{"internalType":"uint256[]","name":"_editionNumbers","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newName","type":"string"}],"name":"changeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"bytes32","name":"_editionData","type":"bytes32"},{"internalType":"uint256","name":"_editionType","type":"uint256"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"},{"internalType":"address","name":"_artistAccount","type":"address"},{"internalType":"uint256","name":"_artistCommission","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_totalAvailable","type":"uint256"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"createEdition","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionNumber","type":"uint256"}],"name":"detailsOfEdition","outputs":[{"internalType":"bytes32","name":"_editionData","type":"bytes32"},{"internalType":"uint256","name":"_editionType","type":"uint256"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"},{"internalType":"address","name":"_artistAccount","type":"address"},{"internalType":"uint256","name":"_artistCommission","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_totalAvailable","type":"uint256"},{"internalType":"bool","name":"_active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"editionActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"editionExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"editionOfTokenId","outputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"editionOptionalCommission","outputs":[{"internalType":"uint256","name":"_rate","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"editionsOfType","outputs":[{"internalType":"uint256[]","name":"_editionNumbers","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"highestEditionNumber","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":[],"name":"maxBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"}],"name":"mintMany","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameToken","outputs":[{"internalType":"contract IERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nrCommissionAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"priceInWeiEdition","outputs":[{"internalType":"uint256","name":"_priceInWei","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"purchaseDatesEdition","outputs":[{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"uint256","name":"_msgValue","type":"uint256"}],"name":"purchaseMany","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"reclaimEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"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":"address","name":"_nameToken","type":"address"}],"name":"setNameToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","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":"tokenBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenData","outputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_editionType","type":"uint256"},{"internalType":"bytes32","name":"_editionData","type":"bytes32"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","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":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOf","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"tokensOfEdition","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"totalAvailableEdition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalNumberAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalNumberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPurchaseValueInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"totalRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"}],"name":"totalSupplyEdition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"updateActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"updateArtistCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"address","name":"_artistAccount","type":"address"}],"name":"updateArtistsAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"updateEditionTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_editionType","type":"uint256"}],"name":"updateEditionType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"}],"name":"updateEndDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxBatch","type":"uint256"}],"name":"updateMaxBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxGas","type":"uint256"}],"name":"updateMaxGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nrCommissionAccount","type":"address"}],"name":"updateNrCommissionAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_rate","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"updateOptionalCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"}],"name":"updatePriceInWei","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_startDate","type":"uint256"}],"name":"updateStartDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"updateTokenBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_totalAvailable","type":"uint256"}],"name":"updateTotalAvailable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_editionNumber","type":"uint256"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"name":"updateTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052601c60808190527f68747470733a2f2f697066732e696e667572612e696f2f697066732f0000000060a09081526200004091600e919062000447565b50606460135564174876e800601455604051620064b0380380620064b0833981810160405260208110156200007457600080fd5b5051604080518082018252601381527f4e6f745265616c4469676974616c417373657400000000000000000000000000602082810191909152825180840190935260048352634e52444160e01b90830152906000620000d262000299565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620001326301ffc9a760e01b6200029d565b81516200014790600890602085019062000447565b5080516200015d90600990602084019062000447565b50620001706380ac58cd60e01b6200029d565b62000182635b5e139f60e01b6200029d565b6200019463780e9d6360e01b6200029d565b5050600c805460ff191690556001600d55620001af62000299565b601580546001600160a01b03199081166001600160a01b039384161790915560168054909116918316919091179055620001f46000620001ee62000299565b62000322565b600e8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152620002929390929091830182828015620002865780601f106200025a5761010080835404028352916020019162000286565b820191906000526020600020905b8154815290600101906020018083116200026857829003601f168201915b50506200033292505050565b50620004e3565b3390565b6001600160e01b03198082161415620002fd576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152600260205260409020805460ff19166001179055565b6200032e828262000347565b5050565b80516200032e90600b90602084019062000447565b6000828152602081815260409091206200036c91839062003dbc620003c0821b17901c565b156200032e576200037c62000299565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620003d7836001600160a01b038416620003e0565b90505b92915050565b6000620003ee83836200042f565b6200042657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003da565b506000620003da565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200048a57805160ff1916838001178555620004ba565b82800160010185558215620004ba579182015b82811115620004ba5782518255916020019190600101906200049d565b50620004c8929150620004cc565b5090565b5b80821115620004c85760008155600101620004cd565b615fbd80620004f36000396000f3fe6080604052600436106104b55760003560e01c8063715018a61161026b578063b378b4f81161014f578063ca15c873116100c1578063e725f87711610085578063e725f8771461171f578063e7b8d97714611749578063e985e9c514611773578063f1ff3d4b146117ae578063f2fde38b146117c3578063f8b4ab7a146117f6576104b5565b8063ca15c87314611611578063d4f3d6b81461163b578063d547741f1461166b578063de56a245146116a4578063e6232ba1146116ef576104b5565b8063bc02844c11610113578063bc02844c14611481578063bdcdc0bc146114ab578063c2b2fb5e146114db578063c39cbef114611505578063c4124474146115bd578063c87b56dd146115e7576104b5565b8063b378b4f81461125d578063b4b5b48f14611295578063b6f4df341461135c578063b88d4fde14611386578063bbd1e1fc14611457576104b5565b80638da5cb5b116101e857806397e851f6116101ac57806397e851f61461116b5780639f727c27146111aa578063a217fddf146111bf578063a22cb465146111d4578063abf3260f1461120f578063afa7a25f14611224576104b5565b80638da5cb5b146110c35780639010d07c146110d857806391d148541461110857806392afc33a1461114157806395d89b4114611156576104b5565b80637d9fb3711161022f5780637d9fb3711461102a5780637eb9f04a1461103f578063824eec3b1461106f5780638456cb591461109957806385daee54146110ae576104b5565b8063715018a614610e4c57806371c847b214610e6157806375dcb70a14610f545780637a85c02a14610fd65780637ce3ef6114611000576104b5565b806340c10f191161039d5780635091f8811161030f5780636641179e116102d35780636641179e14610d7d57806367765b8714610db05780636a02869214610dc55780636c0360eb14610def5780636e31178414610e0457806370a0823114610e19576104b5565b80635091f88114610c485780635a3f267214610c785780635c975abb14610cfb5780636352211e14610d10578063652edd4114610d3a576104b5565b8063451c3d8011610361578063451c3d8014610b82578063458031b314610b975780634e99b80014610bca5780634f558e7914610bdf5780634f6ccce714610c09578063501d815c14610c33576104b5565b806340c10f1914610a9d57806342842e0e14610ad657806342966c6814610b1957806342c7ea5f14610b4357806343bf63e814610b58576104b5565b8063248a9ca3116104365780632f2ff15d116103fa5780632f2ff15d146109605780632f745c5914610999578063328a2c2d146109d257806332fd847814610a0257806336568abe14610a4f5780633f4ba83a14610a88576104b5565b8063248a9ca31461089a57806328dadb8f146108c45780632948ed12146109035780632b04a833146109365780632bbd84e81461094b576104b5565b806311e6ae0a1161047d57806311e6ae0a1461063f578063162094c41461073357806318160ddd146107b55780632295ee5b146107dc57806323b872dd14610857576104b5565b806301ffc9a7146104ba57806304bb1e3d1461050257806306fdde0314610536578063081812fc146105c0578063095ea7b314610606575b600080fd5b3480156104c657600080fd5b506104ee600480360360208110156104dd57600080fd5b50356001600160e01b031916611826565b604080519115158252519081900360200190f35b34801561050e57600080fd5b506105346004803603604081101561052557600080fd5b50803590602001351515611849565b005b34801561054257600080fd5b5061054b61187f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561058557818101518382015260200161056d565b50505050905090810190601f1680156105b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105cc57600080fd5b506105ea600480360360208110156105e357600080fd5b5035611915565b604080516001600160a01b039092168252519081900360200190f35b34801561061257600080fd5b506105346004803603604081101561062957600080fd5b506001600160a01b038135169060200135611977565b34801561064b57600080fd5b506104ee600480360361016081101561066357600080fd5b8135916020810135916040820135916060810135916080820135916001600160a01b0360a0820135169160c08201359160e0810135918101906101208101610100820135600160201b8111156106b857600080fd5b8201836020820111156106ca57600080fd5b803590602001918460018302840111600160201b831117156106eb57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001351515611a52565b34801561073f57600080fd5b506105346004803603604081101561075657600080fd5b81359190810190604081016020820135600160201b81111561077757600080fd5b82018360208201111561078957600080fd5b803590602001918460018302840111600160201b831117156107aa57600080fd5b509092509050611cc4565b3480156107c157600080fd5b506107ca611d1c565b60408051918252519081900360200190f35b3480156107e857600080fd5b50610534600480360360208110156107ff57600080fd5b810190602081018135600160201b81111561081957600080fd5b82018360208201111561082b57600080fd5b803590602001918460018302840111600160201b8311171561084c57600080fd5b509092509050611d2d565b34801561086357600080fd5b506105346004803603606081101561087a57600080fd5b506001600160a01b03813581169160208101359091169060400135611d4b565b3480156108a657600080fd5b506107ca600480360360208110156108bd57600080fd5b5035611da2565b3480156108d057600080fd5b506107ca600480360360608110156108e757600080fd5b506001600160a01b038135169060208101359060400135611db7565b34801561090f57600080fd5b506105346004803603602081101561092657600080fd5b50356001600160a01b0316611f33565b34801561094257600080fd5b506107ca611f70565b34801561095757600080fd5b506107ca611f82565b34801561096c57600080fd5b506105346004803603604081101561098357600080fd5b50803590602001356001600160a01b0316611f88565b3480156109a557600080fd5b506107ca600480360360408110156109bc57600080fd5b506001600160a01b038135169060200135611ff4565b3480156109de57600080fd5b50610534600480360360408110156109f557600080fd5b508035906020013561201f565b348015610a0e57600080fd5b50610a2c60048036036020811015610a2557600080fd5b5035612047565b604080516001600160a01b03909316835260208301919091528051918290030190f35b348015610a5b57600080fd5b5061053460048036036040811015610a7257600080fd5b50803590602001356001600160a01b031661206e565b348015610a9457600080fd5b506105346120cf565b348015610aa957600080fd5b506107ca60048036036040811015610ac057600080fd5b506001600160a01b0381351690602001356120e1565b348015610ae257600080fd5b5061053460048036036060811015610af957600080fd5b506001600160a01b038135811691602081013590911690604001356120f7565b348015610b2557600080fd5b5061053460048036036020811015610b3c57600080fd5b5035612112565b348015610b4f57600080fd5b506107ca612153565b348015610b6457600080fd5b506107ca60048036036020811015610b7b57600080fd5b5035612159565b348015610b8e57600080fd5b506105ea61216e565b348015610ba357600080fd5b5061053460048036036020811015610bba57600080fd5b50356001600160a01b031661217d565b348015610bd657600080fd5b5061054b612201565b348015610beb57600080fd5b506104ee60048036036020811015610c0257600080fd5b503561228f565b348015610c1557600080fd5b506107ca60048036036020811015610c2c57600080fd5b503561229a565b348015610c3f57600080fd5b506107ca6122b0565b348015610c5457600080fd5b5061053460048036036040811015610c6b57600080fd5b50803590602001356122b6565b348015610c8457600080fd5b50610cab60048036036020811015610c9b57600080fd5b50356001600160a01b03166122de565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610ce7578181015183820152602001610ccf565b505050509050019250505060405180910390f35b348015610d0757600080fd5b506104ee612369565b348015610d1c57600080fd5b506105ea60048036036020811015610d3357600080fd5b5035612372565b348015610d4657600080fd5b50610d6460048036036020811015610d5d57600080fd5b503561239a565b6040805192835260208301919091528051918290030190f35b348015610d8957600080fd5b50610cab60048036036020811015610da057600080fd5b50356001600160a01b03166123b7565b348015610dbc57600080fd5b506107ca612423565b348015610dd157600080fd5b506107ca60048036036020811015610de857600080fd5b5035612429565b348015610dfb57600080fd5b5061054b61243e565b348015610e1057600080fd5b506105ea61249f565b348015610e2557600080fd5b506107ca60048036036020811015610e3c57600080fd5b50356001600160a01b03166124ae565b348015610e5857600080fd5b50610534612516565b348015610e6d57600080fd5b50610e8b60048036036020811015610e8457600080fd5b50356125c2565b604051808c81526020018b81526020018a8152602001898152602001886001600160a01b03168152602001878152602001868152602001806020018581526020018481526020018315158152602001828103825286818151815260200191508051906020019080838360005b83811015610f0f578181015183820152602001610ef7565b50505050905090810190601f168015610f3c5780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b348015610f6057600080fd5b5061053460048036036040811015610f7757600080fd5b81359190810190604081016020820135600160201b811115610f9857600080fd5b820183602082011115610faa57600080fd5b803590602001918460018302840111600160201b83111715610fcb57600080fd5b50909250905061279e565b348015610fe257600080fd5b50610cab60048036036020811015610ff957600080fd5b5035612838565b34801561100c57600080fd5b506105346004803603602081101561102357600080fd5b5035612898565b34801561103657600080fd5b506105ea6128a5565b34801561104b57600080fd5b506105346004803603604081101561106257600080fd5b50803590602001356128b4565b34801561107b57600080fd5b506107ca6004803603602081101561109257600080fd5b50356128dc565b3480156110a557600080fd5b506105346128ee565b3480156110ba57600080fd5b506107ca6128fe565b3480156110cf57600080fd5b506105ea612922565b3480156110e457600080fd5b506105ea600480360360408110156110fb57600080fd5b5080359060200135612931565b34801561111457600080fd5b506104ee6004803603604081101561112b57600080fd5b50803590602001356001600160a01b0316612949565b34801561114d57600080fd5b506107ca612961565b34801561116257600080fd5b5061054b612985565b34801561117757600080fd5b506105346004803603606081101561118e57600080fd5b50803590602081013590604001356001600160a01b03166129e6565b3480156111b657600080fd5b50610534612a88565b3480156111cb57600080fd5b506107ca612c45565b3480156111e057600080fd5b50610534600480360360408110156111f757600080fd5b506001600160a01b0381351690602001351515612c4a565b34801561121b57600080fd5b506107ca612d4f565b34801561123057600080fd5b506105346004803603604081101561124757600080fd5b50803590602001356001600160a01b0316612d55565b6107ca6004803603608081101561127357600080fd5b506001600160a01b038135169060208101359060408101359060600135612e08565b3480156112a157600080fd5b506112bf600480360360208110156112b857600080fd5b50356130d4565b6040518086815260200185815260200184815260200180602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b8381101561131d578181015183820152602001611305565b50505050905090810190601f16801561134a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561136857600080fd5b506107ca6004803603602081101561137f57600080fd5b5035613138565b34801561139257600080fd5b50610534600480360360808110156113a957600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156113e357600080fd5b8201836020820111156113f557600080fd5b803590602001918460018302840111600160201b8311171561141657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061314d945050505050565b34801561146357600080fd5b506104ee6004803603602081101561147a57600080fd5b50356131a5565b34801561148d57600080fd5b506107ca600480360360208110156114a457600080fd5b50356131bd565b3480156114b757600080fd5b50610534600480360360408110156114ce57600080fd5b50803590602001356131e5565b3480156114e757600080fd5b506104ee600480360360208110156114fe57600080fd5b503561323d565b34801561151157600080fd5b506105346004803603604081101561152857600080fd5b81359190810190604081016020820135600160201b81111561154957600080fd5b82018360208201111561155b57600080fd5b803590602001918460018302840111600160201b8311171561157c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613260945050505050565b3480156115c957600080fd5b50610534600480360360208110156115e057600080fd5b5035613729565b3480156115f357600080fd5b5061054b6004803603602081101561160a57600080fd5b5035613736565b34801561161d57600080fd5b506107ca6004803603602081101561163457600080fd5b50356139b9565b34801561164757600080fd5b506105346004803603604081101561165e57600080fd5b50803590602001356139d0565b34801561167757600080fd5b506105346004803603604081101561168e57600080fd5b50803590602001356001600160a01b0316613a5f565b3480156116b057600080fd5b506116ce600480360360208110156116c757600080fd5b5035613ab8565b604080519283526001600160a01b0390911660208301528051918290030190f35b3480156116fb57600080fd5b506105346004803603604081101561171257600080fd5b5080359060200135613adc565b34801561172b57600080fd5b5061054b6004803603602081101561174257600080fd5b5035613b7a565b34801561175557600080fd5b50610cab6004803603602081101561176c57600080fd5b5035613be2565b34801561177f57600080fd5b506104ee6004803603604081101561179657600080fd5b506001600160a01b0381358116916020013516613c42565b3480156117ba57600080fd5b506107ca613c70565b3480156117cf57600080fd5b50610534600480360360208110156117e657600080fd5b50356001600160a01b0316613c76565b34801561180257600080fd5b506105346004803603604081101561181957600080fd5b5080359060200135613d79565b6001600160e01b0319811660009081526002602052604090205460ff165b919050565b611851613dd1565b8161185b81613e1d565b50600091825260196020526040909120600901805460ff1916911515919091179055565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b820191906000526020600020905b8154815290600101906020018083116118ee57829003601f168201915b5050505050905090565b600061192082613e38565b61195b5760405162461bcd60e51b815260040180806020018281038252602c815260200180615ded602c913960400191505060405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061198282612372565b9050806001600160a01b0316836001600160a01b031614156119d55760405162461bcd60e51b8152600401808060200182810382526021815260200180615ebd6021913960400191505060405180910390fd5b806001600160a01b03166119e7613e45565b6001600160a01b03161480611a085750611a0881611a03613e45565b613c42565b611a435760405162461bcd60e51b8152600401808060200182810382526038815260200180615d1f6038913960400191505060405180910390fd5b611a4d8383613e49565b505050565b6000611a5c613dd1565b8b611a6657600080fd5b600f548c11611a7457600080fd5b600f546000818152601960205260409020600b01548d91611a9491613eb7565b10611a9e57600080fd5b89611aa857600080fd5b8351611ab357600080fd5b6001600160a01b038716611ac657600080fd5b60648611158015611ad5575060015b611ade57600080fd5b60008c81526019602052604090205415611af757600080fd5b8780611b04575063ffffffff5b6040518061018001604052808e81526020018d81526020018c81526020018b8152602001828152602001896001600160a01b03168152602001888152602001878152602001611b6c87604051806040016040528060018152602001602f60f81b815250613f11565b815260200184151581526020016000815260200185815250601960008f8152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c0820151816006015560e08201518160070155610100820151816008019080519060200190611c27929190615ab4565b5061012082015160098201805460ff1916911515919091179055610140820151600a82015561016090910151600b90910155601254611c669085613eb7565b601255611c73888e613f4d565b611c7d8b8e613f89565b8a8c8e7ff702f09ce66e1a7f60e909cfb5b6400ce4967f4fd691158bd96066cb89c5c07860405160405180910390a45050600f8b905560019b9a5050505050505050505050565b611ccc613dd1565b82611cd681613fb9565b611d168484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613fcb92505050565b50505050565b6000611d28600461402e565b905090565b611d35613dd1565b80611d3f57600080fd5b611a4d600e8383615b32565b611d5c611d56613e45565b82614039565b611d975760405162461bcd60e51b8152600401808060200182810382526031815260200180615ede6031913960400191505060405180910390fd5b611a4d8383836140dd565b60009081526020819052604090206002015490565b6000611dc1614229565b82611dcb81613e1d565b8383611dd7828261429e565b6000868152601960205260408120600a8101548154919291611e0591600191611dff91613eb7565b90613eb7565b905060005b87811015611ebf57611eb78a611e208484613eb7565b600886018054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281528f9390929091830182828015611ead5780601f10611e8257610100808354040283529160200191611ead565b820191906000526020600020905b815481529060010190602001808311611e9057829003601f168201915b50505050506142cc565b600101611e0a565b50601054611ecd9088613eb7565b601055600a820154611edf9088613eb7565b600a8301556040805188815290516001600160a01b038b16918a9184917fd8b8d2d3ace608730456d04af4e0923470195af40bf23302e9291aeb64c6f67e919081900360200190a498975050505050505050565b611f3b613dd1565b6001600160a01b038116611f4e57600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615f0f83398151915281565b60115481565b600082815260208190526040902060020154611fab90611fa6613e45565b612949565b611fe65760405162461bcd60e51b815260040180806020018281038252602f815260200180615c18602f913960400191505060405180910390fd5b611ff08282614323565b5050565b6001600160a01b0382166000908152600360205260408120612016908361438c565b90505b92915050565b612027613dd1565b8161203181613e1d565b5060009182526019602052604090912060030155565b600090815260196020526040902060058101546006909101546001600160a01b0390911691565b612076613e45565b6001600160a01b0316816001600160a01b0316146120c55760405162461bcd60e51b815260040180806020018281038252602f815260200180615f59602f913960400191505060405180910390fd5b611ff08282614398565b6120d7613dd1565b6120df614401565b565b60006120eb614229565b61201683836001611db7565b611a4d8383836040518060200160405280600081525061314d565b61211a613dd1565b612123816144a1565b6000818152601a602090815260408083208054908490558352601c82528220805460018101825590835291200155565b60125481565b60009081526019602052604090206007015490565b6016546001600160a01b031681565b612185613e45565b6001600160a01b0316612196612922565b6001600160a01b0316146121df576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600e805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156122875780601f1061225c57610100808354040283529160200191612287565b820191906000526020600020905b81548152906001019060200180831161226a57829003601f168201915b505050505081565b600061201982613e38565b6000806122a860048461456e565b509392505050565b60145481565b6122be613dd1565b816122c881613e1d565b5060009182526019602052604090912060060155565b6060806122ea836124ae565b67ffffffffffffffff8111801561230057600080fd5b5060405190808252806020026020018201604052801561232a578160200160208202803683370190505b50905060005b8151811015612362576123438482611ff4565b82828151811061234f57fe5b6020908102919091010152600101612330565b5092915050565b600c5460ff1690565b600061201982604051806060016040528060298152602001615d81602991396004919061458a565b600090815260196020526040902060038101546004909101549091565b6001600160a01b0381166000908152601d602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020905b815481526020019060010190808311612403575b50505050509050919050565b60135481565b6000908152601960205260409020600b015490565b600b8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b6017546001600160a01b031681565b60006001600160a01b0382166124f55760405162461bcd60e51b815260040180806020018281038252602a815260200180615d57602a913960400191505060405180910390fd5b6001600160a01b03821660009081526003602052604090206120199061402e565b61251e613e45565b6001600160a01b031661252f612922565b6001600160a01b031614612578576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6000806000806000806000606060008060008b6125de81613e1d565b6000601960008f8152602001908152602001600020905080600101548160020154826003015483600401548460050160009054906101000a90046001600160a01b03168560060154866007015461275b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126c45780601f10612699576101008083540402835291602001916126c4565b820191906000526020600020905b8154815290600101906020018083116126a757829003601f168201915b5050505060088b01805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529350908301828280156127515780601f1061272657610100808354040283529160200191612751565b820191906000526020600020905b81548152906001019060200180831161273457829003601f168201915b5050505050613f11565b88600a015489600b01548a60090160009054906101000a900460ff169c509c509c509c509c509c509c509c509c509c509c50505091939597999b90929496989a50565b6127a6613dd1565b826127b081613e1d565b61280883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152602f60f81b60208201529150613f119050565b601960008681526020019081526020016000206008019080519060200190612831929190615ab4565b5050505050565b6000818152601b602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020908154815260200190600101908083116124035750505050509050919050565b6128a0613dd1565b601355565b6015546001600160a01b031681565b6128bc613dd1565b816128c681613e1d565b5060009182526019602052604090912060070155565b6000908152601a602052604090205490565b6128f6613dd1565b6120df614597565b7f8900d1af596b37c48c1812f165742a5d17e5c9b657efa92b232bc7a894d610ba81565b6001546001600160a01b031690565b6000828152602081905260408120612016908361438c565b6000828152602081905260408120612016908361461a565b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b60146181565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b6129ee613dd1565b826129f881613e1d565b600084815260196020526040902060068101548415612a24576001600160a01b038416612a2457600080fd5b6064612a308287613eb7565b1115612a3b57600080fd5b50506040805180820182529384526001600160a01b039283166020808601918252600096875260189052942092518355509151600190910180546001600160a01b03191691909216179055565b612a90613e45565b6001600160a01b0316612aa1612922565b6001600160a01b031614612aea576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b612af2612922565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015612b2a573d6000803e3d6000fd5b506016546001600160a01b0316156120df576016546001600160a01b031663a9059cbb612b55612922565b601654604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015612ba057600080fd5b505afa158015612bb4573d6000803e3d6000fd5b505050506040513d6020811015612bca57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015612c1b57600080fd5b505af1158015612c2f573d6000803e3d6000fd5b505050506040513d6020811015611ff057600080fd5b600081565b612c52613e45565b6001600160a01b0316826001600160a01b03161415612cb8576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8060076000612cc5613e45565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612d09613e45565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b600f5481565b612d5d613dd1565b81612d6781613e1d565b6000838152601960209081526040808320601e83528184205460058201546001600160a01b03168552601d90935292208054819083908110612da557fe5b600091825260208083209091018290556001600160a01b03909616808252601d87526040808320805460018101825590845288842081018a9055988352601e909752959020959095555060050180546001600160a01b0319169092179091555050565b6000612e12612369565b15612e57576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002600d541415612eaf576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d5583612ebe81613e1d565b84612ec88161462f565b8585612ed4828261429e565b87612ede8161464d565b6013548811158015612ef1575060018810155b612efa57600080fd5b60008981526019602052604090206007810154612f17908a614689565b881015612f2357600080fd5b612f35612f2e613e45565b308a6146e2565b6000612f576001611dff84600a01548560000154613eb790919063ffffffff16565b905060005b8a811015612fe857612fe08d612f728484613eb7565b8e866008018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ead5780601f10611e8257610100808354040283529160200191611ead565b600101612f5c565b50601054612ff6908b613eb7565b601055600a820154613008908b613eb7565b600a8301556005820154600683015461302e918d918c916001600160a01b0316906147a1565b8b6001600160a01b03168b827fd8b8d2d3ace608730456d04af4e0923470195af40bf23302e9291aeb64c6f67e8d6040518082815260200191505060405180910390a48b6001600160a01b03168b827f9a82e72908527175222bf72a1c3dae8a869d11b3643f8e25cc7859b74222504585600701548e604051808381526020018281526020019250505060405180910390a46001600d559b9a5050505050505050505050565b600080600060606000856130e781613fb9565b6000878152601a602090815260408083205480845260199092529091206002810154600182015483919061311a8c613736565b6131238d612372565b939d929c50909a509850909650945050505050565b6000908152601960205260409020600a015490565b61315e613158613e45565b83614039565b6131995760405162461bcd60e51b8152600401808060200182810382526031815260200180615ede6031913960400191505060405180910390fd5b611d1684848484614857565b60009081526019602052604090206009015460ff1690565b6000818152601960205260408120600a810154600b8201546131de916148a9565b9392505050565b6131ed613dd1565b816131f781613e1d565b6000838152601960205260409020600a81015483101561321657600080fd5b600b8101805490849055601254613233908590611dff90846148a9565b6012555050505050565b60008161324c57506000611844565b506000818152601960205260409020541490565b8161326a81613fb9565b606061327583614906565b905061328084612372565b6001600160a01b0316613291613e45565b6001600160a01b0316146132ec576040805162461bcd60e51b815260206004820152601f60248201527f4552433732313a2063616c6c6572206973206e6f7420746865206f776e657200604482015290519081900360640190fd5b6132f583614a28565b61333d576040805162461bcd60e51b81526020600482015260146024820152734e6f7420612076616c6964206e6577206e616d6560601b604482015290519081900360640190fd5b6022816040518082805190602001908083835b6020831061336f5780518252601f199092019160209182019101613350565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff161591506133ec9050576040805162461bcd60e51b815260206004820152601560248201527413985b5948185b1c9958591e481c995cd95c9d9959605a1b604482015290519081900360640190fd5b600084815260216020908152604080832080548251601f60026000196101006001861615020190931692909204918201859004850281018501909352808352602293613490939291908301828280156134865780601f1061345b57610100808354040283529160200191613486565b820191906000526020600020905b81548152906001019060200180831161346957829003601f168201915b5050505050614906565b6040518082805190602001908083835b602083106134bf5780518252601f1990920191602091820191016134a0565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805460ff19169515159590951790945550508251600192602292859290918291908401908083835b602083106135315780518252601f199092019160209182019101613512565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220805460ff19169315159390931790925550506017546001600160a01b03166379cc6790613587613e45565b601760009054906101000a90046001600160a01b03166001600160a01b031663486a7e6b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156135d557600080fd5b505afa1580156135e9573d6000803e3d6000fd5b505050506040513d60208110156135ff57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152602483019190915251604480830192600092919082900301818387803b15801561364f57600080fd5b505af1158015613663573d6000803e3d6000fd5b5050506000858152602160209081526040909120855161368893509091860190615ab4565b50837f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b846040518080602001828103825283818151815260200191508051906020019080838360005b838110156136e95781810151838201526020016136d1565b50505050905090810190601f1680156137165780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050565b613731613dd1565b601455565b606061374182613e38565b61377c5760405162461bcd60e51b815260040180806020018281038252602f815260200180615e8e602f913960400191505060405180910390fd5b6000828152600a602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156138115780601f106137e657610100808354040283529160200191613811565b820191906000526020600020905b8154815290600101906020018083116137f457829003601f168201915b50505050509050606061382261243e565b905080516000141561383657509050611844565b8151156138f75780826040516020018083805190602001908083835b602083106138715780518252601f199092019160209182019101613852565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106138b95780518252601f19909201916020918201910161389a565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050611844565b8061390185614bfb565b6040516020018083805190602001908083835b602083106139335780518252601f199092019160209182019101613914565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831061397b5780518252601f19909201916020918201910161395c565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050919050565b60008181526020819052604081206120199061402e565b6139d8613dd1565b816139e281613e1d565b600083815260196020908152604080832060028101548452601f83528184208785529280529220548154829082908110613a1857fe5b60009182526020808320909101829055868252601f81526040808320805460018101825590845282842081018a905598835290805290209590955550600201919091555050565b600082815260208190526040902060020154613a7d90611fa6613e45565b6120c55760405162461bcd60e51b8152600401808060200182810382526030815260200180615cef6030913960400191505060405180910390fd5b600081815260186020526040902080546001909101546001600160a01b0316915091565b81613ae681613e1d565b613aee612922565b6001600160a01b0316613aff613e45565b6001600160a01b03161480613b295750613b29600080516020615f0f833981519152611fa6613e45565b80613b5b5750613b5b7f8900d1af596b37c48c1812f165742a5d17e5c9b657efa92b232bc7a894d610ba611fa6613e45565b613b6457600080fd5b5060009182526019602052604090912060040155565b60216020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156122875780601f1061225c57610100808354040283529160200191612287565b6000818152601f602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020908154815260200190600101908083116124035750505050509050919050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60105481565b613c7e613e45565b6001600160a01b0316613c8f612922565b6001600160a01b031614613cd8576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b6001600160a01b038116613d1d5760405162461bcd60e51b8152600401808060200182810382526026815260200180615c796026913960400191505060405180910390fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b613d81613dd1565b81613d8b81613e1d565b6000838152601b6020526040902054821015613da657600080fd5b50600091825260196020526040909120600a0155565b6000612016836001600160a01b038416614cd6565b613dd9612922565b6001600160a01b0316613dea613e45565b6001600160a01b03161480613e145750613e14600080516020615f0f833981519152611fa6613e45565b6120df57600080fd5b600081815260196020526040902054613e3557600080fd5b50565b6000612019600483614d20565b3390565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613e7e82612372565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082820183811015612016576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60606120168383604051806020016040528060008152506040518060200160405280600081525060405180602001604052806000815250614d2c565b6001600160a01b039091166000908152601d6020908152604080832080546001810182559084528284208101859055938352601e909152902055565b6000918252601f602090815260408084208054600181018255908552828520810184905592845290805290912055565b613fc281613e38565b613e3557600080fd5b613fd482613e38565b61400f5760405162461bcd60e51b815260040180806020018281038252602c815260200180615e19602c913960400191505060405180910390fd5b6000828152600a602090815260409091208251611a4d92840190615ab4565b600061201982614f51565b600061404482613e38565b61407f5760405162461bcd60e51b815260040180806020018281038252602c815260200180615cc3602c913960400191505060405180910390fd5b600061408a83612372565b9050806001600160a01b0316846001600160a01b031614806140c55750836001600160a01b03166140ba84611915565b6001600160a01b0316145b806140d557506140d58185613c42565b949350505050565b826001600160a01b03166140f082612372565b6001600160a01b0316146141355760405162461bcd60e51b8152600401808060200182810382526029815260200180615e656029913960400191505060405180910390fd5b6001600160a01b03821661417a5760405162461bcd60e51b8152600401808060200182810382526024815260200180615c9f6024913960400191505060405180910390fd5b614185838383611a4d565b614190600082613e49565b6001600160a01b03831660009081526003602052604090206141b29082614f55565b506001600160a01b03821660009081526003602052604090206141d59082614f61565b506141e260048284614f6d565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b614231612922565b6001600160a01b0316614242613e45565b6001600160a01b0316148061426c575061426c600080516020615f0f833981519152611fa6613e45565b80613e145750613e147faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b601461611fa6613e45565b6000828152601960205260409020600b810154600a909101546142c19083613eb7565b1115611ff057600080fd5b6142d68484614f83565b6142f1836142ec836142e7876150b1565b613f11565b613fcb565b506000828152601a60209081526040808320849055928252601b81529181208054600181018255908252919020015550565b600082815260208190526040902061433b9082613dbc565b15611ff057614348613e45565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006120168383615180565b60008281526020819052604090206143b090826151e4565b15611ff0576143bd613e45565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b614409612369565b614451576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa614484613e45565b604080516001600160a01b039092168252519081900360200190a1565b60006144ac82612372565b90506144ba81600084611a4d565b6144c5600083613e49565b6000828152600a60205260409020546002600019610100600184161502019091160415614503576000828152600a6020526040812061450391615ba0565b6001600160a01b03811660009081526003602052604090206145259083614f55565b506145316004836151f9565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600080808061457d8686615205565b9097909650945050505050565b60006140d5848484615280565b61459f612369565b156145e4576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258614484613e45565b6000612016836001600160a01b03841661534a565b60008181526019602052604090206009015460ff16613e3557600080fd5b60008181526019602052604090206003015442101561466b57600080fd5b600081815260196020526040902060040154421115613e3557600080fd5b60008261469857506000612019565b828202828482816146a557fe5b04146120165760405162461bcd60e51b8152600401808060200182810382526021815260200180615dcc6021913960400191505060405180910390fd5b6014543a111561472e576040805162461bcd60e51b815260206004820152601260248201527108ec2e640e0e4d2c6ca40e8dede40d0d2ced60731b604482015290519081900360640190fd5b6016546001600160a01b03166147895780341461474a57600080fd5b614752613e45565b6001600160a01b0316836001600160a01b03161461476f57600080fd5b6001600160a01b038216301461478457600080fd5b611a4d565b601654611a4d906001600160a01b0316848484615362565b60006147b8826147b28660646153bc565b90614689565b905080156147ca576147ca8382615423565b600085815260186020526040812080549091901561480e5781546147f3906147b28860646153bc565b600183015490915061480e906001600160a01b031682615423565b60006148248261481e89876148a9565b906148a9565b60155490915061483d906001600160a01b031682615423565b60115461484a9088613eb7565b6011555050505050505050565b6148628484846140dd565b61486e84848484615486565b611d165760405162461bcd60e51b8152600401808060200182810382526032815260200180615c476032913960400191505060405180910390fd5b600082821115614900576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6060808290506060815167ffffffffffffffff8111801561492657600080fd5b506040519080825280601f01601f191660200182016040528015614951576020820181803683370190505b50905060005b82518110156122a857604183828151811061496e57fe5b016020015160f81c108015906149985750605a83828151811061498d57fe5b016020015160f81c11155b156149e5578281815181106149a957fe5b602001015160f81c60f81b60f81c60200160f81b8282815181106149c957fe5b60200101906001600160f81b031916908160001a905350614a20565b8281815181106149f157fe5b602001015160f81c60f81b828281518110614a0857fe5b60200101906001600160f81b031916908160001a9053505b600101614957565b60006060829050600181511080614a40575060198151115b80614a6a575080600081518110614a5357fe5b6020910101516001600160f81b031916600160fd1b145b80614a97575080600182510381518110614a8057fe5b6020910101516001600160f81b031916600160fd1b145b15614aa6576000915050611844565b600081600081518110614ab557fe5b01602001516001600160f81b031916905060005b8251811015614bf0576000838281518110614ae057fe5b01602001516001600160f81b0319169050600160fd1b81148015614b115750600160fd1b6001600160f81b03198416145b15614b23576000945050505050611844565b600360fc1b6001600160f81b0319821610801590614b4f5750603960f81b6001600160f81b0319821611155b158015614b855750604160f81b6001600160f81b0319821610801590614b835750602d60f91b6001600160f81b0319821611155b155b8015614bba5750606160f81b6001600160f81b0319821610801590614bb85750603d60f91b6001600160f81b0319821611155b155b8015614bd45750600160fd1b6001600160f81b0319821614155b15614be6576000945050505050611844565b9150600101614ac9565b506001949350505050565b606081614c2057506040805180820190915260018152600360fc1b6020820152611844565b8160005b8115614c3857600101600a82049150614c24565b60608167ffffffffffffffff81118015614c5157600080fd5b506040519080825280601f01601f191660200182016040528015614c7c576020820181803683370190505b50859350905060001982015b8315614ccd57600a840660300160f81b82828060019003935081518110614cab57fe5b60200101906001600160f81b031916908160001a905350600a84049350614c88565b50949350505050565b6000614ce2838361534a565b614d1857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612019565b506000612019565b6000612016838361534a565b805182518451865188516060948a948a948a948a948a948a94919092019092019091010167ffffffffffffffff81118015614d6657600080fd5b506040519080825280601f01601f191660200182016040528015614d91576020820181803683370190505b509050806000805b8851811015614dea57888181518110614dae57fe5b602001015160f81c60f81b838380600101945081518110614dcb57fe5b60200101906001600160f81b031916908160001a905350600101614d99565b5060005b8751811015614e3f57878181518110614e0357fe5b602001015160f81c60f81b838380600101945081518110614e2057fe5b60200101906001600160f81b031916908160001a905350600101614dee565b5060005b8651811015614e9457868181518110614e5857fe5b602001015160f81c60f81b838380600101945081518110614e7557fe5b60200101906001600160f81b031916908160001a905350600101614e43565b5060005b8551811015614ee957858181518110614ead57fe5b602001015160f81c60f81b838380600101945081518110614eca57fe5b60200101906001600160f81b031916908160001a905350600101614e98565b5060005b8451811015614f3e57848181518110614f0257fe5b602001015160f81c60f81b838380600101945081518110614f1f57fe5b60200101906001600160f81b031916908160001a905350600101614eed565b50909d9c50505050505050505050505050565b5490565b600061201683836155ee565b60006120168383614cd6565b60006140d584846001600160a01b0385166156b4565b6001600160a01b038216614fde576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b614fe781613e38565b15615039576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b61504560008383611a4d565b6001600160a01b03821660009081526003602052604090206150679082614f61565b5061507460048284614f6d565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060816150d657506040805180820190915260018152600360fc1b6020820152611844565b8160005b81156150ee57600101600a820491506150da565b60608167ffffffffffffffff8111801561510757600080fd5b506040519080825280601f01601f191660200182016040528015615132576020820181803683370190505b50905060001982015b8515614ccd57600a860660300160f81b8282806001900393508151811061515e57fe5b60200101906001600160f81b031916908160001a905350600a8604955061513b565b815460009082106151c25760405162461bcd60e51b8152600401808060200182810382526022815260200180615bf66022913960400191505060405180910390fd5b8260000182815481106151d157fe5b9060005260206000200154905092915050565b6000612016836001600160a01b0384166155ee565b6000612016838361574b565b8154600090819083106152495760405162461bcd60e51b8152600401808060200182810382526022815260200180615daa6022913960400191505060405180910390fd5b600084600001848154811061525a57fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000828152600184016020526040812054828161531b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156152e05781810151838201526020016152c8565b50505050905090810190601f16801561530d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5084600001600182038154811061532e57fe5b9060005260206000209060020201600101549150509392505050565b60009081526001919091016020526040902054151590565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611d1690859061581f565b6000808211615412576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161541b57fe5b049392505050565b6016546001600160a01b031661546f576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015615469573d6000803e3d6000fd5b50611ff0565b601654611ff0906001600160a01b031683836158d0565b600061549a846001600160a01b0316615922565b6154a6575060016140d5565b60606155b4630a85bd0160e11b6154bb613e45565b88878760405160240180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561552257818101518382015260200161550a565b50505050905090810190601f16801561554f5780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001615c47603291396001600160a01b0388169190615928565b905060008180602001905160208110156155cd57600080fd5b50516001600160e01b031916630a85bd0160e11b1492505050949350505050565b600081815260018301602052604081205480156156aa578354600019808301919081019060009087908390811061562157fe5b906000526020600020015490508087600001848154811061563e57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061566e57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612019565b6000915050612019565b6000828152600184016020526040812054806157195750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556131de565b8285600001600183038154811061572c57fe5b90600052602060002090600202016001018190555060009150506131de565b600081815260018301602052604081205480156156aa578354600019808301919081019060009087908390811061577e57fe5b906000526020600020906002020190508087600001848154811061579e57fe5b6000918252602080832084546002909302019182556001938401549184019190915583548252898301905260409020908401905586548790806157dd57fe5b60008281526020808220600260001990940193840201828155600190810183905592909355888152898201909252604082209190915594506120199350505050565b6060615874826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166159289092919063ffffffff16565b805190915015611a4d5780806020019051602081101561589357600080fd5b5051611a4d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615f2f602a913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a4d90849061581f565b3b151590565b60606140d584846000858561593c85615922565b61598d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106159cc5780518252601f1990920191602091820191016159ad565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615a2e576040519150601f19603f3d011682016040523d82523d6000602084013e615a33565b606091505b5091509150615a43828286615a4e565b979650505050505050565b60608315615a5d5750816131de565b825115615a6d5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156152e05781810151838201526020016152c8565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615af557805160ff1916838001178555615b22565b82800160010185558215615b22579182015b82811115615b22578251825591602001919060010190615b07565b50615b2e929150615be0565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615b735782800160ff19823516178555615b22565b82800160010185558215615b22579182015b82811115615b22578235825591602001919060010190615b85565b50805460018160011615610100020316600290046000825580601f10615bc65750613e35565b601f016020900490600052602060002090810190613e3591905b5b80821115615b2e5760008155600101615be156fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e6473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564014d9b39b34d4f99586cf0d2ffdb8a06bab2543d3564d6431d8a315b9cad257e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212200fa51e6ceb42fabaf0d75de8527b65b5c1b246737698125e5172818f7d3e1fe464736f6c634300060c00330000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106104b55760003560e01c8063715018a61161026b578063b378b4f81161014f578063ca15c873116100c1578063e725f87711610085578063e725f8771461171f578063e7b8d97714611749578063e985e9c514611773578063f1ff3d4b146117ae578063f2fde38b146117c3578063f8b4ab7a146117f6576104b5565b8063ca15c87314611611578063d4f3d6b81461163b578063d547741f1461166b578063de56a245146116a4578063e6232ba1146116ef576104b5565b8063bc02844c11610113578063bc02844c14611481578063bdcdc0bc146114ab578063c2b2fb5e146114db578063c39cbef114611505578063c4124474146115bd578063c87b56dd146115e7576104b5565b8063b378b4f81461125d578063b4b5b48f14611295578063b6f4df341461135c578063b88d4fde14611386578063bbd1e1fc14611457576104b5565b80638da5cb5b116101e857806397e851f6116101ac57806397e851f61461116b5780639f727c27146111aa578063a217fddf146111bf578063a22cb465146111d4578063abf3260f1461120f578063afa7a25f14611224576104b5565b80638da5cb5b146110c35780639010d07c146110d857806391d148541461110857806392afc33a1461114157806395d89b4114611156576104b5565b80637d9fb3711161022f5780637d9fb3711461102a5780637eb9f04a1461103f578063824eec3b1461106f5780638456cb591461109957806385daee54146110ae576104b5565b8063715018a614610e4c57806371c847b214610e6157806375dcb70a14610f545780637a85c02a14610fd65780637ce3ef6114611000576104b5565b806340c10f191161039d5780635091f8811161030f5780636641179e116102d35780636641179e14610d7d57806367765b8714610db05780636a02869214610dc55780636c0360eb14610def5780636e31178414610e0457806370a0823114610e19576104b5565b80635091f88114610c485780635a3f267214610c785780635c975abb14610cfb5780636352211e14610d10578063652edd4114610d3a576104b5565b8063451c3d8011610361578063451c3d8014610b82578063458031b314610b975780634e99b80014610bca5780634f558e7914610bdf5780634f6ccce714610c09578063501d815c14610c33576104b5565b806340c10f1914610a9d57806342842e0e14610ad657806342966c6814610b1957806342c7ea5f14610b4357806343bf63e814610b58576104b5565b8063248a9ca3116104365780632f2ff15d116103fa5780632f2ff15d146109605780632f745c5914610999578063328a2c2d146109d257806332fd847814610a0257806336568abe14610a4f5780633f4ba83a14610a88576104b5565b8063248a9ca31461089a57806328dadb8f146108c45780632948ed12146109035780632b04a833146109365780632bbd84e81461094b576104b5565b806311e6ae0a1161047d57806311e6ae0a1461063f578063162094c41461073357806318160ddd146107b55780632295ee5b146107dc57806323b872dd14610857576104b5565b806301ffc9a7146104ba57806304bb1e3d1461050257806306fdde0314610536578063081812fc146105c0578063095ea7b314610606575b600080fd5b3480156104c657600080fd5b506104ee600480360360208110156104dd57600080fd5b50356001600160e01b031916611826565b604080519115158252519081900360200190f35b34801561050e57600080fd5b506105346004803603604081101561052557600080fd5b50803590602001351515611849565b005b34801561054257600080fd5b5061054b61187f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561058557818101518382015260200161056d565b50505050905090810190601f1680156105b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105cc57600080fd5b506105ea600480360360208110156105e357600080fd5b5035611915565b604080516001600160a01b039092168252519081900360200190f35b34801561061257600080fd5b506105346004803603604081101561062957600080fd5b506001600160a01b038135169060200135611977565b34801561064b57600080fd5b506104ee600480360361016081101561066357600080fd5b8135916020810135916040820135916060810135916080820135916001600160a01b0360a0820135169160c08201359160e0810135918101906101208101610100820135600160201b8111156106b857600080fd5b8201836020820111156106ca57600080fd5b803590602001918460018302840111600160201b831117156106eb57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001351515611a52565b34801561073f57600080fd5b506105346004803603604081101561075657600080fd5b81359190810190604081016020820135600160201b81111561077757600080fd5b82018360208201111561078957600080fd5b803590602001918460018302840111600160201b831117156107aa57600080fd5b509092509050611cc4565b3480156107c157600080fd5b506107ca611d1c565b60408051918252519081900360200190f35b3480156107e857600080fd5b50610534600480360360208110156107ff57600080fd5b810190602081018135600160201b81111561081957600080fd5b82018360208201111561082b57600080fd5b803590602001918460018302840111600160201b8311171561084c57600080fd5b509092509050611d2d565b34801561086357600080fd5b506105346004803603606081101561087a57600080fd5b506001600160a01b03813581169160208101359091169060400135611d4b565b3480156108a657600080fd5b506107ca600480360360208110156108bd57600080fd5b5035611da2565b3480156108d057600080fd5b506107ca600480360360608110156108e757600080fd5b506001600160a01b038135169060208101359060400135611db7565b34801561090f57600080fd5b506105346004803603602081101561092657600080fd5b50356001600160a01b0316611f33565b34801561094257600080fd5b506107ca611f70565b34801561095757600080fd5b506107ca611f82565b34801561096c57600080fd5b506105346004803603604081101561098357600080fd5b50803590602001356001600160a01b0316611f88565b3480156109a557600080fd5b506107ca600480360360408110156109bc57600080fd5b506001600160a01b038135169060200135611ff4565b3480156109de57600080fd5b50610534600480360360408110156109f557600080fd5b508035906020013561201f565b348015610a0e57600080fd5b50610a2c60048036036020811015610a2557600080fd5b5035612047565b604080516001600160a01b03909316835260208301919091528051918290030190f35b348015610a5b57600080fd5b5061053460048036036040811015610a7257600080fd5b50803590602001356001600160a01b031661206e565b348015610a9457600080fd5b506105346120cf565b348015610aa957600080fd5b506107ca60048036036040811015610ac057600080fd5b506001600160a01b0381351690602001356120e1565b348015610ae257600080fd5b5061053460048036036060811015610af957600080fd5b506001600160a01b038135811691602081013590911690604001356120f7565b348015610b2557600080fd5b5061053460048036036020811015610b3c57600080fd5b5035612112565b348015610b4f57600080fd5b506107ca612153565b348015610b6457600080fd5b506107ca60048036036020811015610b7b57600080fd5b5035612159565b348015610b8e57600080fd5b506105ea61216e565b348015610ba357600080fd5b5061053460048036036020811015610bba57600080fd5b50356001600160a01b031661217d565b348015610bd657600080fd5b5061054b612201565b348015610beb57600080fd5b506104ee60048036036020811015610c0257600080fd5b503561228f565b348015610c1557600080fd5b506107ca60048036036020811015610c2c57600080fd5b503561229a565b348015610c3f57600080fd5b506107ca6122b0565b348015610c5457600080fd5b5061053460048036036040811015610c6b57600080fd5b50803590602001356122b6565b348015610c8457600080fd5b50610cab60048036036020811015610c9b57600080fd5b50356001600160a01b03166122de565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610ce7578181015183820152602001610ccf565b505050509050019250505060405180910390f35b348015610d0757600080fd5b506104ee612369565b348015610d1c57600080fd5b506105ea60048036036020811015610d3357600080fd5b5035612372565b348015610d4657600080fd5b50610d6460048036036020811015610d5d57600080fd5b503561239a565b6040805192835260208301919091528051918290030190f35b348015610d8957600080fd5b50610cab60048036036020811015610da057600080fd5b50356001600160a01b03166123b7565b348015610dbc57600080fd5b506107ca612423565b348015610dd157600080fd5b506107ca60048036036020811015610de857600080fd5b5035612429565b348015610dfb57600080fd5b5061054b61243e565b348015610e1057600080fd5b506105ea61249f565b348015610e2557600080fd5b506107ca60048036036020811015610e3c57600080fd5b50356001600160a01b03166124ae565b348015610e5857600080fd5b50610534612516565b348015610e6d57600080fd5b50610e8b60048036036020811015610e8457600080fd5b50356125c2565b604051808c81526020018b81526020018a8152602001898152602001886001600160a01b03168152602001878152602001868152602001806020018581526020018481526020018315158152602001828103825286818151815260200191508051906020019080838360005b83811015610f0f578181015183820152602001610ef7565b50505050905090810190601f168015610f3c5780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b348015610f6057600080fd5b5061053460048036036040811015610f7757600080fd5b81359190810190604081016020820135600160201b811115610f9857600080fd5b820183602082011115610faa57600080fd5b803590602001918460018302840111600160201b83111715610fcb57600080fd5b50909250905061279e565b348015610fe257600080fd5b50610cab60048036036020811015610ff957600080fd5b5035612838565b34801561100c57600080fd5b506105346004803603602081101561102357600080fd5b5035612898565b34801561103657600080fd5b506105ea6128a5565b34801561104b57600080fd5b506105346004803603604081101561106257600080fd5b50803590602001356128b4565b34801561107b57600080fd5b506107ca6004803603602081101561109257600080fd5b50356128dc565b3480156110a557600080fd5b506105346128ee565b3480156110ba57600080fd5b506107ca6128fe565b3480156110cf57600080fd5b506105ea612922565b3480156110e457600080fd5b506105ea600480360360408110156110fb57600080fd5b5080359060200135612931565b34801561111457600080fd5b506104ee6004803603604081101561112b57600080fd5b50803590602001356001600160a01b0316612949565b34801561114d57600080fd5b506107ca612961565b34801561116257600080fd5b5061054b612985565b34801561117757600080fd5b506105346004803603606081101561118e57600080fd5b50803590602081013590604001356001600160a01b03166129e6565b3480156111b657600080fd5b50610534612a88565b3480156111cb57600080fd5b506107ca612c45565b3480156111e057600080fd5b50610534600480360360408110156111f757600080fd5b506001600160a01b0381351690602001351515612c4a565b34801561121b57600080fd5b506107ca612d4f565b34801561123057600080fd5b506105346004803603604081101561124757600080fd5b50803590602001356001600160a01b0316612d55565b6107ca6004803603608081101561127357600080fd5b506001600160a01b038135169060208101359060408101359060600135612e08565b3480156112a157600080fd5b506112bf600480360360208110156112b857600080fd5b50356130d4565b6040518086815260200185815260200184815260200180602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b8381101561131d578181015183820152602001611305565b50505050905090810190601f16801561134a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561136857600080fd5b506107ca6004803603602081101561137f57600080fd5b5035613138565b34801561139257600080fd5b50610534600480360360808110156113a957600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156113e357600080fd5b8201836020820111156113f557600080fd5b803590602001918460018302840111600160201b8311171561141657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061314d945050505050565b34801561146357600080fd5b506104ee6004803603602081101561147a57600080fd5b50356131a5565b34801561148d57600080fd5b506107ca600480360360208110156114a457600080fd5b50356131bd565b3480156114b757600080fd5b50610534600480360360408110156114ce57600080fd5b50803590602001356131e5565b3480156114e757600080fd5b506104ee600480360360208110156114fe57600080fd5b503561323d565b34801561151157600080fd5b506105346004803603604081101561152857600080fd5b81359190810190604081016020820135600160201b81111561154957600080fd5b82018360208201111561155b57600080fd5b803590602001918460018302840111600160201b8311171561157c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613260945050505050565b3480156115c957600080fd5b50610534600480360360208110156115e057600080fd5b5035613729565b3480156115f357600080fd5b5061054b6004803603602081101561160a57600080fd5b5035613736565b34801561161d57600080fd5b506107ca6004803603602081101561163457600080fd5b50356139b9565b34801561164757600080fd5b506105346004803603604081101561165e57600080fd5b50803590602001356139d0565b34801561167757600080fd5b506105346004803603604081101561168e57600080fd5b50803590602001356001600160a01b0316613a5f565b3480156116b057600080fd5b506116ce600480360360208110156116c757600080fd5b5035613ab8565b604080519283526001600160a01b0390911660208301528051918290030190f35b3480156116fb57600080fd5b506105346004803603604081101561171257600080fd5b5080359060200135613adc565b34801561172b57600080fd5b5061054b6004803603602081101561174257600080fd5b5035613b7a565b34801561175557600080fd5b50610cab6004803603602081101561176c57600080fd5b5035613be2565b34801561177f57600080fd5b506104ee6004803603604081101561179657600080fd5b506001600160a01b0381358116916020013516613c42565b3480156117ba57600080fd5b506107ca613c70565b3480156117cf57600080fd5b50610534600480360360208110156117e657600080fd5b50356001600160a01b0316613c76565b34801561180257600080fd5b506105346004803603604081101561181957600080fd5b5080359060200135613d79565b6001600160e01b0319811660009081526002602052604090205460ff165b919050565b611851613dd1565b8161185b81613e1d565b50600091825260196020526040909120600901805460ff1916911515919091179055565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b820191906000526020600020905b8154815290600101906020018083116118ee57829003601f168201915b5050505050905090565b600061192082613e38565b61195b5760405162461bcd60e51b815260040180806020018281038252602c815260200180615ded602c913960400191505060405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061198282612372565b9050806001600160a01b0316836001600160a01b031614156119d55760405162461bcd60e51b8152600401808060200182810382526021815260200180615ebd6021913960400191505060405180910390fd5b806001600160a01b03166119e7613e45565b6001600160a01b03161480611a085750611a0881611a03613e45565b613c42565b611a435760405162461bcd60e51b8152600401808060200182810382526038815260200180615d1f6038913960400191505060405180910390fd5b611a4d8383613e49565b505050565b6000611a5c613dd1565b8b611a6657600080fd5b600f548c11611a7457600080fd5b600f546000818152601960205260409020600b01548d91611a9491613eb7565b10611a9e57600080fd5b89611aa857600080fd5b8351611ab357600080fd5b6001600160a01b038716611ac657600080fd5b60648611158015611ad5575060015b611ade57600080fd5b60008c81526019602052604090205415611af757600080fd5b8780611b04575063ffffffff5b6040518061018001604052808e81526020018d81526020018c81526020018b8152602001828152602001896001600160a01b03168152602001888152602001878152602001611b6c87604051806040016040528060018152602001602f60f81b815250613f11565b815260200184151581526020016000815260200185815250601960008f8152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c0820151816006015560e08201518160070155610100820151816008019080519060200190611c27929190615ab4565b5061012082015160098201805460ff1916911515919091179055610140820151600a82015561016090910151600b90910155601254611c669085613eb7565b601255611c73888e613f4d565b611c7d8b8e613f89565b8a8c8e7ff702f09ce66e1a7f60e909cfb5b6400ce4967f4fd691158bd96066cb89c5c07860405160405180910390a45050600f8b905560019b9a5050505050505050505050565b611ccc613dd1565b82611cd681613fb9565b611d168484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613fcb92505050565b50505050565b6000611d28600461402e565b905090565b611d35613dd1565b80611d3f57600080fd5b611a4d600e8383615b32565b611d5c611d56613e45565b82614039565b611d975760405162461bcd60e51b8152600401808060200182810382526031815260200180615ede6031913960400191505060405180910390fd5b611a4d8383836140dd565b60009081526020819052604090206002015490565b6000611dc1614229565b82611dcb81613e1d565b8383611dd7828261429e565b6000868152601960205260408120600a8101548154919291611e0591600191611dff91613eb7565b90613eb7565b905060005b87811015611ebf57611eb78a611e208484613eb7565b600886018054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281528f9390929091830182828015611ead5780601f10611e8257610100808354040283529160200191611ead565b820191906000526020600020905b815481529060010190602001808311611e9057829003601f168201915b50505050506142cc565b600101611e0a565b50601054611ecd9088613eb7565b601055600a820154611edf9088613eb7565b600a8301556040805188815290516001600160a01b038b16918a9184917fd8b8d2d3ace608730456d04af4e0923470195af40bf23302e9291aeb64c6f67e919081900360200190a498975050505050505050565b611f3b613dd1565b6001600160a01b038116611f4e57600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615f0f83398151915281565b60115481565b600082815260208190526040902060020154611fab90611fa6613e45565b612949565b611fe65760405162461bcd60e51b815260040180806020018281038252602f815260200180615c18602f913960400191505060405180910390fd5b611ff08282614323565b5050565b6001600160a01b0382166000908152600360205260408120612016908361438c565b90505b92915050565b612027613dd1565b8161203181613e1d565b5060009182526019602052604090912060030155565b600090815260196020526040902060058101546006909101546001600160a01b0390911691565b612076613e45565b6001600160a01b0316816001600160a01b0316146120c55760405162461bcd60e51b815260040180806020018281038252602f815260200180615f59602f913960400191505060405180910390fd5b611ff08282614398565b6120d7613dd1565b6120df614401565b565b60006120eb614229565b61201683836001611db7565b611a4d8383836040518060200160405280600081525061314d565b61211a613dd1565b612123816144a1565b6000818152601a602090815260408083208054908490558352601c82528220805460018101825590835291200155565b60125481565b60009081526019602052604090206007015490565b6016546001600160a01b031681565b612185613e45565b6001600160a01b0316612196612922565b6001600160a01b0316146121df576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600e805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156122875780601f1061225c57610100808354040283529160200191612287565b820191906000526020600020905b81548152906001019060200180831161226a57829003601f168201915b505050505081565b600061201982613e38565b6000806122a860048461456e565b509392505050565b60145481565b6122be613dd1565b816122c881613e1d565b5060009182526019602052604090912060060155565b6060806122ea836124ae565b67ffffffffffffffff8111801561230057600080fd5b5060405190808252806020026020018201604052801561232a578160200160208202803683370190505b50905060005b8151811015612362576123438482611ff4565b82828151811061234f57fe5b6020908102919091010152600101612330565b5092915050565b600c5460ff1690565b600061201982604051806060016040528060298152602001615d81602991396004919061458a565b600090815260196020526040902060038101546004909101549091565b6001600160a01b0381166000908152601d602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020905b815481526020019060010190808311612403575b50505050509050919050565b60135481565b6000908152601960205260409020600b015490565b600b8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b6017546001600160a01b031681565b60006001600160a01b0382166124f55760405162461bcd60e51b815260040180806020018281038252602a815260200180615d57602a913960400191505060405180910390fd5b6001600160a01b03821660009081526003602052604090206120199061402e565b61251e613e45565b6001600160a01b031661252f612922565b6001600160a01b031614612578576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6000806000806000806000606060008060008b6125de81613e1d565b6000601960008f8152602001908152602001600020905080600101548160020154826003015483600401548460050160009054906101000a90046001600160a01b03168560060154866007015461275b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126c45780601f10612699576101008083540402835291602001916126c4565b820191906000526020600020905b8154815290600101906020018083116126a757829003601f168201915b5050505060088b01805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529350908301828280156127515780601f1061272657610100808354040283529160200191612751565b820191906000526020600020905b81548152906001019060200180831161273457829003601f168201915b5050505050613f11565b88600a015489600b01548a60090160009054906101000a900460ff169c509c509c509c509c509c509c509c509c509c509c50505091939597999b90929496989a50565b6127a6613dd1565b826127b081613e1d565b61280883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152602f60f81b60208201529150613f119050565b601960008681526020019081526020016000206008019080519060200190612831929190615ab4565b5050505050565b6000818152601b602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020908154815260200190600101908083116124035750505050509050919050565b6128a0613dd1565b601355565b6015546001600160a01b031681565b6128bc613dd1565b816128c681613e1d565b5060009182526019602052604090912060070155565b6000908152601a602052604090205490565b6128f6613dd1565b6120df614597565b7f8900d1af596b37c48c1812f165742a5d17e5c9b657efa92b232bc7a894d610ba81565b6001546001600160a01b031690565b6000828152602081905260408120612016908361438c565b6000828152602081905260408120612016908361461a565b7faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b60146181565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561190b5780601f106118e05761010080835404028352916020019161190b565b6129ee613dd1565b826129f881613e1d565b600084815260196020526040902060068101548415612a24576001600160a01b038416612a2457600080fd5b6064612a308287613eb7565b1115612a3b57600080fd5b50506040805180820182529384526001600160a01b039283166020808601918252600096875260189052942092518355509151600190910180546001600160a01b03191691909216179055565b612a90613e45565b6001600160a01b0316612aa1612922565b6001600160a01b031614612aea576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b612af2612922565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015612b2a573d6000803e3d6000fd5b506016546001600160a01b0316156120df576016546001600160a01b031663a9059cbb612b55612922565b601654604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015612ba057600080fd5b505afa158015612bb4573d6000803e3d6000fd5b505050506040513d6020811015612bca57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015612c1b57600080fd5b505af1158015612c2f573d6000803e3d6000fd5b505050506040513d6020811015611ff057600080fd5b600081565b612c52613e45565b6001600160a01b0316826001600160a01b03161415612cb8576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8060076000612cc5613e45565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612d09613e45565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b600f5481565b612d5d613dd1565b81612d6781613e1d565b6000838152601960209081526040808320601e83528184205460058201546001600160a01b03168552601d90935292208054819083908110612da557fe5b600091825260208083209091018290556001600160a01b03909616808252601d87526040808320805460018101825590845288842081018a9055988352601e909752959020959095555060050180546001600160a01b0319169092179091555050565b6000612e12612369565b15612e57576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002600d541415612eaf576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d5583612ebe81613e1d565b84612ec88161462f565b8585612ed4828261429e565b87612ede8161464d565b6013548811158015612ef1575060018810155b612efa57600080fd5b60008981526019602052604090206007810154612f17908a614689565b881015612f2357600080fd5b612f35612f2e613e45565b308a6146e2565b6000612f576001611dff84600a01548560000154613eb790919063ffffffff16565b905060005b8a811015612fe857612fe08d612f728484613eb7565b8e866008018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ead5780601f10611e8257610100808354040283529160200191611ead565b600101612f5c565b50601054612ff6908b613eb7565b601055600a820154613008908b613eb7565b600a8301556005820154600683015461302e918d918c916001600160a01b0316906147a1565b8b6001600160a01b03168b827fd8b8d2d3ace608730456d04af4e0923470195af40bf23302e9291aeb64c6f67e8d6040518082815260200191505060405180910390a48b6001600160a01b03168b827f9a82e72908527175222bf72a1c3dae8a869d11b3643f8e25cc7859b74222504585600701548e604051808381526020018281526020019250505060405180910390a46001600d559b9a5050505050505050505050565b600080600060606000856130e781613fb9565b6000878152601a602090815260408083205480845260199092529091206002810154600182015483919061311a8c613736565b6131238d612372565b939d929c50909a509850909650945050505050565b6000908152601960205260409020600a015490565b61315e613158613e45565b83614039565b6131995760405162461bcd60e51b8152600401808060200182810382526031815260200180615ede6031913960400191505060405180910390fd5b611d1684848484614857565b60009081526019602052604090206009015460ff1690565b6000818152601960205260408120600a810154600b8201546131de916148a9565b9392505050565b6131ed613dd1565b816131f781613e1d565b6000838152601960205260409020600a81015483101561321657600080fd5b600b8101805490849055601254613233908590611dff90846148a9565b6012555050505050565b60008161324c57506000611844565b506000818152601960205260409020541490565b8161326a81613fb9565b606061327583614906565b905061328084612372565b6001600160a01b0316613291613e45565b6001600160a01b0316146132ec576040805162461bcd60e51b815260206004820152601f60248201527f4552433732313a2063616c6c6572206973206e6f7420746865206f776e657200604482015290519081900360640190fd5b6132f583614a28565b61333d576040805162461bcd60e51b81526020600482015260146024820152734e6f7420612076616c6964206e6577206e616d6560601b604482015290519081900360640190fd5b6022816040518082805190602001908083835b6020831061336f5780518252601f199092019160209182019101613350565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff161591506133ec9050576040805162461bcd60e51b815260206004820152601560248201527413985b5948185b1c9958591e481c995cd95c9d9959605a1b604482015290519081900360640190fd5b600084815260216020908152604080832080548251601f60026000196101006001861615020190931692909204918201859004850281018501909352808352602293613490939291908301828280156134865780601f1061345b57610100808354040283529160200191613486565b820191906000526020600020905b81548152906001019060200180831161346957829003601f168201915b5050505050614906565b6040518082805190602001908083835b602083106134bf5780518252601f1990920191602091820191016134a0565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805460ff19169515159590951790945550508251600192602292859290918291908401908083835b602083106135315780518252601f199092019160209182019101613512565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220805460ff19169315159390931790925550506017546001600160a01b03166379cc6790613587613e45565b601760009054906101000a90046001600160a01b03166001600160a01b031663486a7e6b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156135d557600080fd5b505afa1580156135e9573d6000803e3d6000fd5b505050506040513d60208110156135ff57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152602483019190915251604480830192600092919082900301818387803b15801561364f57600080fd5b505af1158015613663573d6000803e3d6000fd5b5050506000858152602160209081526040909120855161368893509091860190615ab4565b50837f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b846040518080602001828103825283818151815260200191508051906020019080838360005b838110156136e95781810151838201526020016136d1565b50505050905090810190601f1680156137165780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050565b613731613dd1565b601455565b606061374182613e38565b61377c5760405162461bcd60e51b815260040180806020018281038252602f815260200180615e8e602f913960400191505060405180910390fd5b6000828152600a602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156138115780601f106137e657610100808354040283529160200191613811565b820191906000526020600020905b8154815290600101906020018083116137f457829003601f168201915b50505050509050606061382261243e565b905080516000141561383657509050611844565b8151156138f75780826040516020018083805190602001908083835b602083106138715780518252601f199092019160209182019101613852565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106138b95780518252601f19909201916020918201910161389a565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050611844565b8061390185614bfb565b6040516020018083805190602001908083835b602083106139335780518252601f199092019160209182019101613914565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831061397b5780518252601f19909201916020918201910161395c565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050919050565b60008181526020819052604081206120199061402e565b6139d8613dd1565b816139e281613e1d565b600083815260196020908152604080832060028101548452601f83528184208785529280529220548154829082908110613a1857fe5b60009182526020808320909101829055868252601f81526040808320805460018101825590845282842081018a905598835290805290209590955550600201919091555050565b600082815260208190526040902060020154613a7d90611fa6613e45565b6120c55760405162461bcd60e51b8152600401808060200182810382526030815260200180615cef6030913960400191505060405180910390fd5b600081815260186020526040902080546001909101546001600160a01b0316915091565b81613ae681613e1d565b613aee612922565b6001600160a01b0316613aff613e45565b6001600160a01b03161480613b295750613b29600080516020615f0f833981519152611fa6613e45565b80613b5b5750613b5b7f8900d1af596b37c48c1812f165742a5d17e5c9b657efa92b232bc7a894d610ba611fa6613e45565b613b6457600080fd5b5060009182526019602052604090912060040155565b60216020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156122875780601f1061225c57610100808354040283529160200191612287565b6000818152601f602090815260409182902080548351818402810184019094528084526060939283018282801561241757602002820191906000526020600020908154815260200190600101908083116124035750505050509050919050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60105481565b613c7e613e45565b6001600160a01b0316613c8f612922565b6001600160a01b031614613cd8576040805162461bcd60e51b81526020600482018190526024820152600080516020615e45833981519152604482015290519081900360640190fd5b6001600160a01b038116613d1d5760405162461bcd60e51b8152600401808060200182810382526026815260200180615c796026913960400191505060405180910390fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b613d81613dd1565b81613d8b81613e1d565b6000838152601b6020526040902054821015613da657600080fd5b50600091825260196020526040909120600a0155565b6000612016836001600160a01b038416614cd6565b613dd9612922565b6001600160a01b0316613dea613e45565b6001600160a01b03161480613e145750613e14600080516020615f0f833981519152611fa6613e45565b6120df57600080fd5b600081815260196020526040902054613e3557600080fd5b50565b6000612019600483614d20565b3390565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613e7e82612372565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082820183811015612016576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60606120168383604051806020016040528060008152506040518060200160405280600081525060405180602001604052806000815250614d2c565b6001600160a01b039091166000908152601d6020908152604080832080546001810182559084528284208101859055938352601e909152902055565b6000918252601f602090815260408084208054600181018255908552828520810184905592845290805290912055565b613fc281613e38565b613e3557600080fd5b613fd482613e38565b61400f5760405162461bcd60e51b815260040180806020018281038252602c815260200180615e19602c913960400191505060405180910390fd5b6000828152600a602090815260409091208251611a4d92840190615ab4565b600061201982614f51565b600061404482613e38565b61407f5760405162461bcd60e51b815260040180806020018281038252602c815260200180615cc3602c913960400191505060405180910390fd5b600061408a83612372565b9050806001600160a01b0316846001600160a01b031614806140c55750836001600160a01b03166140ba84611915565b6001600160a01b0316145b806140d557506140d58185613c42565b949350505050565b826001600160a01b03166140f082612372565b6001600160a01b0316146141355760405162461bcd60e51b8152600401808060200182810382526029815260200180615e656029913960400191505060405180910390fd5b6001600160a01b03821661417a5760405162461bcd60e51b8152600401808060200182810382526024815260200180615c9f6024913960400191505060405180910390fd5b614185838383611a4d565b614190600082613e49565b6001600160a01b03831660009081526003602052604090206141b29082614f55565b506001600160a01b03821660009081526003602052604090206141d59082614f61565b506141e260048284614f6d565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b614231612922565b6001600160a01b0316614242613e45565b6001600160a01b0316148061426c575061426c600080516020615f0f833981519152611fa6613e45565b80613e145750613e147faeaef46186eb59f884e36929b6d682a6ae35e1e43d8f05f058dcefb92b601461611fa6613e45565b6000828152601960205260409020600b810154600a909101546142c19083613eb7565b1115611ff057600080fd5b6142d68484614f83565b6142f1836142ec836142e7876150b1565b613f11565b613fcb565b506000828152601a60209081526040808320849055928252601b81529181208054600181018255908252919020015550565b600082815260208190526040902061433b9082613dbc565b15611ff057614348613e45565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006120168383615180565b60008281526020819052604090206143b090826151e4565b15611ff0576143bd613e45565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b614409612369565b614451576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa614484613e45565b604080516001600160a01b039092168252519081900360200190a1565b60006144ac82612372565b90506144ba81600084611a4d565b6144c5600083613e49565b6000828152600a60205260409020546002600019610100600184161502019091160415614503576000828152600a6020526040812061450391615ba0565b6001600160a01b03811660009081526003602052604090206145259083614f55565b506145316004836151f9565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600080808061457d8686615205565b9097909650945050505050565b60006140d5848484615280565b61459f612369565b156145e4576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258614484613e45565b6000612016836001600160a01b03841661534a565b60008181526019602052604090206009015460ff16613e3557600080fd5b60008181526019602052604090206003015442101561466b57600080fd5b600081815260196020526040902060040154421115613e3557600080fd5b60008261469857506000612019565b828202828482816146a557fe5b04146120165760405162461bcd60e51b8152600401808060200182810382526021815260200180615dcc6021913960400191505060405180910390fd5b6014543a111561472e576040805162461bcd60e51b815260206004820152601260248201527108ec2e640e0e4d2c6ca40e8dede40d0d2ced60731b604482015290519081900360640190fd5b6016546001600160a01b03166147895780341461474a57600080fd5b614752613e45565b6001600160a01b0316836001600160a01b03161461476f57600080fd5b6001600160a01b038216301461478457600080fd5b611a4d565b601654611a4d906001600160a01b0316848484615362565b60006147b8826147b28660646153bc565b90614689565b905080156147ca576147ca8382615423565b600085815260186020526040812080549091901561480e5781546147f3906147b28860646153bc565b600183015490915061480e906001600160a01b031682615423565b60006148248261481e89876148a9565b906148a9565b60155490915061483d906001600160a01b031682615423565b60115461484a9088613eb7565b6011555050505050505050565b6148628484846140dd565b61486e84848484615486565b611d165760405162461bcd60e51b8152600401808060200182810382526032815260200180615c476032913960400191505060405180910390fd5b600082821115614900576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6060808290506060815167ffffffffffffffff8111801561492657600080fd5b506040519080825280601f01601f191660200182016040528015614951576020820181803683370190505b50905060005b82518110156122a857604183828151811061496e57fe5b016020015160f81c108015906149985750605a83828151811061498d57fe5b016020015160f81c11155b156149e5578281815181106149a957fe5b602001015160f81c60f81b60f81c60200160f81b8282815181106149c957fe5b60200101906001600160f81b031916908160001a905350614a20565b8281815181106149f157fe5b602001015160f81c60f81b828281518110614a0857fe5b60200101906001600160f81b031916908160001a9053505b600101614957565b60006060829050600181511080614a40575060198151115b80614a6a575080600081518110614a5357fe5b6020910101516001600160f81b031916600160fd1b145b80614a97575080600182510381518110614a8057fe5b6020910101516001600160f81b031916600160fd1b145b15614aa6576000915050611844565b600081600081518110614ab557fe5b01602001516001600160f81b031916905060005b8251811015614bf0576000838281518110614ae057fe5b01602001516001600160f81b0319169050600160fd1b81148015614b115750600160fd1b6001600160f81b03198416145b15614b23576000945050505050611844565b600360fc1b6001600160f81b0319821610801590614b4f5750603960f81b6001600160f81b0319821611155b158015614b855750604160f81b6001600160f81b0319821610801590614b835750602d60f91b6001600160f81b0319821611155b155b8015614bba5750606160f81b6001600160f81b0319821610801590614bb85750603d60f91b6001600160f81b0319821611155b155b8015614bd45750600160fd1b6001600160f81b0319821614155b15614be6576000945050505050611844565b9150600101614ac9565b506001949350505050565b606081614c2057506040805180820190915260018152600360fc1b6020820152611844565b8160005b8115614c3857600101600a82049150614c24565b60608167ffffffffffffffff81118015614c5157600080fd5b506040519080825280601f01601f191660200182016040528015614c7c576020820181803683370190505b50859350905060001982015b8315614ccd57600a840660300160f81b82828060019003935081518110614cab57fe5b60200101906001600160f81b031916908160001a905350600a84049350614c88565b50949350505050565b6000614ce2838361534a565b614d1857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612019565b506000612019565b6000612016838361534a565b805182518451865188516060948a948a948a948a948a948a94919092019092019091010167ffffffffffffffff81118015614d6657600080fd5b506040519080825280601f01601f191660200182016040528015614d91576020820181803683370190505b509050806000805b8851811015614dea57888181518110614dae57fe5b602001015160f81c60f81b838380600101945081518110614dcb57fe5b60200101906001600160f81b031916908160001a905350600101614d99565b5060005b8751811015614e3f57878181518110614e0357fe5b602001015160f81c60f81b838380600101945081518110614e2057fe5b60200101906001600160f81b031916908160001a905350600101614dee565b5060005b8651811015614e9457868181518110614e5857fe5b602001015160f81c60f81b838380600101945081518110614e7557fe5b60200101906001600160f81b031916908160001a905350600101614e43565b5060005b8551811015614ee957858181518110614ead57fe5b602001015160f81c60f81b838380600101945081518110614eca57fe5b60200101906001600160f81b031916908160001a905350600101614e98565b5060005b8451811015614f3e57848181518110614f0257fe5b602001015160f81c60f81b838380600101945081518110614f1f57fe5b60200101906001600160f81b031916908160001a905350600101614eed565b50909d9c50505050505050505050505050565b5490565b600061201683836155ee565b60006120168383614cd6565b60006140d584846001600160a01b0385166156b4565b6001600160a01b038216614fde576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b614fe781613e38565b15615039576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b61504560008383611a4d565b6001600160a01b03821660009081526003602052604090206150679082614f61565b5061507460048284614f6d565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060816150d657506040805180820190915260018152600360fc1b6020820152611844565b8160005b81156150ee57600101600a820491506150da565b60608167ffffffffffffffff8111801561510757600080fd5b506040519080825280601f01601f191660200182016040528015615132576020820181803683370190505b50905060001982015b8515614ccd57600a860660300160f81b8282806001900393508151811061515e57fe5b60200101906001600160f81b031916908160001a905350600a8604955061513b565b815460009082106151c25760405162461bcd60e51b8152600401808060200182810382526022815260200180615bf66022913960400191505060405180910390fd5b8260000182815481106151d157fe5b9060005260206000200154905092915050565b6000612016836001600160a01b0384166155ee565b6000612016838361574b565b8154600090819083106152495760405162461bcd60e51b8152600401808060200182810382526022815260200180615daa6022913960400191505060405180910390fd5b600084600001848154811061525a57fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000828152600184016020526040812054828161531b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156152e05781810151838201526020016152c8565b50505050905090810190601f16801561530d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5084600001600182038154811061532e57fe5b9060005260206000209060020201600101549150509392505050565b60009081526001919091016020526040902054151590565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611d1690859061581f565b6000808211615412576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161541b57fe5b049392505050565b6016546001600160a01b031661546f576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015615469573d6000803e3d6000fd5b50611ff0565b601654611ff0906001600160a01b031683836158d0565b600061549a846001600160a01b0316615922565b6154a6575060016140d5565b60606155b4630a85bd0160e11b6154bb613e45565b88878760405160240180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561552257818101518382015260200161550a565b50505050905090810190601f16801561554f5780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001615c47603291396001600160a01b0388169190615928565b905060008180602001905160208110156155cd57600080fd5b50516001600160e01b031916630a85bd0160e11b1492505050949350505050565b600081815260018301602052604081205480156156aa578354600019808301919081019060009087908390811061562157fe5b906000526020600020015490508087600001848154811061563e57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061566e57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612019565b6000915050612019565b6000828152600184016020526040812054806157195750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556131de565b8285600001600183038154811061572c57fe5b90600052602060002090600202016001018190555060009150506131de565b600081815260018301602052604081205480156156aa578354600019808301919081019060009087908390811061577e57fe5b906000526020600020906002020190508087600001848154811061579e57fe5b6000918252602080832084546002909302019182556001938401549184019190915583548252898301905260409020908401905586548790806157dd57fe5b60008281526020808220600260001990940193840201828155600190810183905592909355888152898201909252604082209190915594506120199350505050565b6060615874826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166159289092919063ffffffff16565b805190915015611a4d5780806020019051602081101561589357600080fd5b5051611a4d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615f2f602a913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a4d90849061581f565b3b151590565b60606140d584846000858561593c85615922565b61598d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106159cc5780518252601f1990920191602091820191016159ad565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615a2e576040519150601f19603f3d011682016040523d82523d6000602084013e615a33565b606091505b5091509150615a43828286615a4e565b979650505050505050565b60608315615a5d5750816131de565b825115615a6d5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156152e05781810151838201526020016152c8565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615af557805160ff1916838001178555615b22565b82800160010185558215615b22579182015b82811115615b22578251825591602001919060010190615b07565b50615b2e929150615be0565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615b735782800160ff19823516178555615b22565b82800160010185558215615b22579182015b82811115615b22578235825591602001919060010190615b85565b50805460018160011615610100020316600290046000825580601f10615bc65750613e35565b601f016020900490600052602060002090810190613e3591905b5b80821115615b2e5760008155600101615be156fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e6473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564014d9b39b34d4f99586cf0d2ffdb8a06bab2543d3564d6431d8a315b9cad257e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212200fa51e6ceb42fabaf0d75de8527b65b5c1b246737698125e5172818f7d3e1fe464736f6c634300060c0033

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

0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _acceptedToken (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000


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.