APE Price: $0.17 (-7.88%)

Contract

0xAcfA101ECE167F1894150e090d9471aeE2dD3041

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

More Info

Private Name Tags

TokenTracker

Multichain Info

N/A
Transaction Hash
Block
From
To
Set Approval For...329732282026-01-29 20:00:201 hr ago1769716820IN
0xAcfA101E...eE2dD3041
0 APE0.00470953101.68276
Set Approval For...329625822026-01-29 14:03:577 hrs ago1769695437IN
0xAcfA101E...eE2dD3041
0 APE0.00470953101.68276
Transfer From329540382026-01-29 9:27:4212 hrs ago1769678862IN
0xAcfA101E...eE2dD3041
0 APE0.00855172101.68276
Transfer From329419372026-01-29 2:54:2718 hrs ago1769655267IN
0xAcfA101E...eE2dD3041
0 APE0.01084914101.68276
Safe Transfer Fr...329414102026-01-29 2:22:3219 hrs ago1769653352IN
0xAcfA101E...eE2dD3041
0 APE0.01014326101.68276
Transfer From329408082026-01-29 1:56:2119 hrs ago1769651781IN
0xAcfA101E...eE2dD3041
0 APE0.00951648101.68276
Transfer From329388002026-01-29 0:15:3721 hrs ago1769645737IN
0xAcfA101E...eE2dD3041
0 APE0.01084914101.68276
Set Approval For...329386892026-01-29 0:05:3521 hrs ago1769645135IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Transfer From329309652026-01-28 17:23:3628 hrs ago1769621016IN
0xAcfA101E...eE2dD3041
0 APE0.01084914101.68276
Transfer From329110462026-01-28 3:57:2441 hrs ago1769572644IN
0xAcfA101E...eE2dD3041
0 APE0.00855172101.68276
Set Approval For...328819512026-01-27 6:02:332 days ago1769493753IN
0xAcfA101E...eE2dD3041
0 APE0.00470953101.68276
Set Approval For...328794642026-01-27 4:54:582 days ago1769489698IN
0xAcfA101E...eE2dD3041
0 APE0.00470953101.68276
Set Approval For...328613842026-01-26 15:46:443 days ago1769442404IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Safe Transfer Fr...327965762026-01-24 23:17:254 days ago1769296645IN
0xAcfA101E...eE2dD3041
0 APE0.01014326101.68276
Transfer From327639632026-01-24 6:13:255 days ago1769235205IN
0xAcfA101E...eE2dD3041
0 APE0.00980242101.68276
Set Approval For...326567032026-01-21 20:17:088 days ago1769026628IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Set Approval For...326564322026-01-21 20:06:108 days ago1769025970IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Transfer From326542552026-01-21 18:29:048 days ago1769020144IN
0xAcfA101E...eE2dD3041
0 APE0.01084914101.68276
Transfer From326307262026-01-21 4:04:248 days ago1768968264IN
0xAcfA101E...eE2dD3041
0 APE0.01084914101.68276
Set Approval For...325641042026-01-19 9:36:1610 days ago1768815376IN
0xAcfA101E...eE2dD3041
0 APE0.00470953101.68276
Set Approval For...325337622026-01-18 13:11:0711 days ago1768741867IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Safe Transfer Fr...325330822026-01-18 12:42:3911 days ago1768740159IN
0xAcfA101E...eE2dD3041
0 APE0.00985733101.68276
Set Approval For...324963382026-01-17 16:57:4412 days ago1768669064IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Set Approval For...324859522026-01-17 10:23:3412 days ago1768645414IN
0xAcfA101E...eE2dD3041
0 APE0.00470099101.68276
Set Approval For...324516872026-01-16 14:41:0713 days ago1768574467IN
0xAcfA101E...eE2dD3041
0 APE0.00248146101.68276
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
329733642026-01-29 20:05:041 hr ago1769717104
0xAcfA101E...eE2dD3041
0 APE
329733642026-01-29 20:05:041 hr ago1769717104
0xAcfA101E...eE2dD3041
0 APE
329733642026-01-29 20:05:041 hr ago1769717104
0xAcfA101E...eE2dD3041
0 APE
329540382026-01-29 9:27:4212 hrs ago1769678862
0xAcfA101E...eE2dD3041
0 APE
329540382026-01-29 9:27:4212 hrs ago1769678862
0xAcfA101E...eE2dD3041
0 APE
329419372026-01-29 2:54:2718 hrs ago1769655267
0xAcfA101E...eE2dD3041
0 APE
329419372026-01-29 2:54:2718 hrs ago1769655267
0xAcfA101E...eE2dD3041
0 APE
329414102026-01-29 2:22:3219 hrs ago1769653352
0xAcfA101E...eE2dD3041
0 APE
329414102026-01-29 2:22:3219 hrs ago1769653352
0xAcfA101E...eE2dD3041
0 APE
329408082026-01-29 1:56:2119 hrs ago1769651781
0xAcfA101E...eE2dD3041
0 APE
329408082026-01-29 1:56:2119 hrs ago1769651781
0xAcfA101E...eE2dD3041
0 APE
329406802026-01-29 1:51:5119 hrs ago1769651511
0xAcfA101E...eE2dD3041
0 APE
329406802026-01-29 1:51:5119 hrs ago1769651511
0xAcfA101E...eE2dD3041
0 APE
329406802026-01-29 1:51:5119 hrs ago1769651511
0xAcfA101E...eE2dD3041
0 APE
329388002026-01-29 0:15:3721 hrs ago1769645737
0xAcfA101E...eE2dD3041
0 APE
329388002026-01-29 0:15:3721 hrs ago1769645737
0xAcfA101E...eE2dD3041
0 APE
329330572026-01-28 19:06:5326 hrs ago1769627213
0xAcfA101E...eE2dD3041
0 APE
329330572026-01-28 19:06:5326 hrs ago1769627213
0xAcfA101E...eE2dD3041
0 APE
329330572026-01-28 19:06:5326 hrs ago1769627213
0xAcfA101E...eE2dD3041
0 APE
329309652026-01-28 17:23:3628 hrs ago1769621016
0xAcfA101E...eE2dD3041
0 APE
329309652026-01-28 17:23:3628 hrs ago1769621016
0xAcfA101E...eE2dD3041
0 APE
329277272026-01-28 14:57:3430 hrs ago1769612254
0xAcfA101E...eE2dD3041
0 APE
329277272026-01-28 14:57:3430 hrs ago1769612254
0xAcfA101E...eE2dD3041
0 APE
329277272026-01-28 14:57:3430 hrs ago1769612254
0xAcfA101E...eE2dD3041
0 APE
329137402026-01-28 5:28:3240 hrs ago1769578112
0xAcfA101E...eE2dD3041
0 APE
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Fiendz

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {
  ERC721C,
  ERC721OpenZeppelin,
  ERC721OpenZeppelinBase
} from "@limitbreak/creator-token-standards/src/erc721c/ERC721C.sol";


import {
  IERC20
} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import {
  IERC165,
  IERC721,
  ERC721,
  ERC721Enumerable
} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

import {Delegated} from '../Blimpie/Delegated.sol';
import {Royalties} from '../Blimpie/Royalties.sol';

contract Fiendz is ERC721C, ERC721Enumerable, Delegated, Royalties {
  using Strings for uint256;

  error UnsupportedChain(uint256 chainId);

  uint256 public MAX_SUPPLY = 7777;

  string private _tokenURIPrefix = "https://fiendz.herodevelopment.com/token.php?tokenId=";
  string private _tokenURISuffix = "";

  constructor()
    Delegated()
    ERC721OpenZeppelin("Fiendz", "F")
    Royalties(payable(0xd68BDa6bA77EC2C4a15f6F6825786b5bE738b9D4), 69, 1000)
  {
    setTransferValidator(0x721C002B0059009a671D00aD1700c9748146cd1B);
  }


  //view: external
  fallback() external payable {
    require(false, "fallback() disabled");
  }

  receive() external payable {
    require(false, "receive() disabled");
  }

  function withdraw() external {
    require(address(this).balance >= 0, "No funds available");
    Address.sendValue(payable(owner()), address(this).balance);
  }

  function withdraw(address token) external {
    IERC20 erc20 = IERC20(token);
    erc20.transfer( owner(), erc20.balanceOf(address(this)) );
  }

  //view: ERC721C
  function isApprovedForAll(address owner, address operator) public view override(IERC721, ERC721, ERC721C) returns (bool isApproved) {
    return ERC721C.isApprovedForAll(owner, operator);
  }


  //view: IERC721Metadata
  function name() public view override(ERC721, ERC721OpenZeppelinBase) returns (string memory) {
    return ERC721OpenZeppelinBase.name();
  }

  function symbol() public view override(ERC721, ERC721OpenZeppelinBase) returns (string memory) {
    return ERC721OpenZeppelinBase.symbol();
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(_exists(tokenId), "FelineFiendz: query for nonexistent token");
    return string(abi.encodePacked(_tokenURIPrefix, tokenId.toString(), _tokenURISuffix));
  }

  function supportsInterface(bytes4 interfaceId) public view override(ERC721C, ERC721Enumerable, Royalties) returns (bool) {
    if (ERC721C.supportsInterface(interfaceId))
      return true;
    
    if (ERC721Enumerable.supportsInterface(interfaceId))
      return true;

    if (Royalties.supportsInterface(interfaceId))
      return true;

    return false;
  }

  function walletOfOwner(address account) external view returns (uint256[] memory) {
    uint256 quantity = balanceOf(account);
    uint256[] memory wallet = new uint256[](quantity);
    for (uint256 i = 0; i < quantity; ++i) {
      wallet[i] = tokenOfOwnerByIndex(account, i);
    }

    return wallet;
  }


  //onlyDelegates
  function burnFrom(address account, uint256[] calldata tokenIds) external onlyDelegates {
    unchecked{
      for(uint256 i; i < tokenIds.length; ++i) {
        _burn(account, tokenIds[i]);
      }
    }
  }

  function mintTo(address[] calldata recipients, uint256[][] calldata tokenIds) external payable onlyDelegates{
    require(tokenIds.length == recipients.length, "FelineFiendz: must provide equal quantities and recipients" );

    unchecked{
      uint256 totalQuantity;
      for(uint256 i; i < tokenIds.length; ++i){
        totalQuantity += tokenIds[i].length;
      }
      require(totalSupply() + totalQuantity <= MAX_SUPPLY, "FelineFiendz: mint/order exceeds supply");

      address recipient;
      uint256[] calldata recipientTokens;
      for(uint256 r; r < recipients.length; ++r){
        recipient = recipients[r];
        recipientTokens = tokenIds[r];
        for (uint256 t; t < recipientTokens.length; ++t) {
          _mint(recipient, recipientTokens[t]);
        }
      }
    }
  }

  function resurrect(address[] calldata recipient, uint256[] calldata tokenIds) external onlyDelegates{
    require(tokenIds.length == recipient.length,   "FelineFiendz: must provide equal tokenIds and recipients" );
    require(totalSupply() + tokenIds.length <= MAX_SUPPLY, "FelineFiendz: mint/order exceeds supply");

    unchecked{
      for(uint256 i; i < tokenIds.length; ++i ){
        _mint(recipient[i], tokenIds[i]);
      }
    }
  }

  function retrans(uint256[] calldata tokenIds) external onlyDelegates {  
    address _owner;
    uint256 tokenId;
    uint256 tokenLength = tokenIds.length;
    for(uint256 i = 0; i < tokenLength; ++i){
      tokenId = tokenIds[i];
      _owner = ownerOf(tokenId);
      emit Transfer(_owner, _owner, tokenId);
    }
  }

  function setBaseURI(string calldata _newPrefix, string calldata _newSuffix) external onlyDelegates{
    _tokenURIPrefix = _newPrefix;
    _tokenURISuffix = _newSuffix;
  }

  function setDefaultRoyalty(address payable receiver, uint16 feeNumerator, uint16 feeDenominator) public onlyOwner {
    _setDefaultRoyalty(receiver, feeNumerator, feeDenominator);
  }


  //internal
  function _afterTokenTransfer(
    address from,
    address to,
    uint256 firstTokenId,
    uint256 batchSize) internal virtual override(ERC721, ERC721C) {
    ERC721C._afterTokenTransfer(from, to, firstTokenId, batchSize);
  }

  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 firstTokenId,
    uint256 batchSize) internal virtual override(ERC721C, ERC721Enumerable) {
    ERC721C._beforeTokenTransfer(from, to, firstTokenId, batchSize);
    ERC721Enumerable._beforeTokenTransfer(from, to, firstTokenId, batchSize);
  }

  function _burn(address from, uint256 tokenId) internal {
    require(_ownerOf(tokenId) == from, "FelineFiendz: owner mismatch" );
    super._burn(tokenId);
  }

  function _requireCallerIsContractOwner() internal override view {
    require(owner() == _msgSender(), "Ownable: caller is not the owner");
  }
}

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

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

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/AutomaticValidatorTransferApproval.sol";
import "../utils/CreatorTokenBase.sol";
import "../token/erc721/ERC721OpenZeppelin.sol";
import "../interfaces/ITransferValidatorSetTokenType.sol";
import {TOKEN_TYPE_ERC721} from "@limitbreak/permit-c/src/Constants.sol";

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

    /**
     * @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved
     *         for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) {
        isApproved = super.isApprovedForAll(owner, operator);

        if (!isApproved) {
            if (autoApproveTransfersFromValidator) {
                isApproved = operator == address(getTransferValidator());
            }
        }
    }

    /**
     * @notice Indicates whether the contract implements the specified interface.
     * @dev Overrides supportsInterface in ERC165.
     * @param interfaceId The interface id
     * @return true if the contract implements the specified interface, false otherwise
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return 
        interfaceId == type(ICreatorToken).interfaceId || 
        interfaceId == type(ICreatorTokenLegacy).interfaceId || 
        super.supportsInterface(interfaceId);
    }

    /**
     * @notice Returns the function selector for the transfer validator's validation function to be called 
     * @notice for transaction simulation. 
     */
    function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) {
        functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256)"));
        isViewFunction = true;
    }

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

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

    function _tokenType() internal pure override returns(uint16) {
        return uint16(TOKEN_TYPE_ERC721);
    }
}

/**
 * @title ERC721CInitializable
 * @author Limit Break, Inc.
 * @notice Initializable implementation of ERC721C to allow for EIP-1167 proxy clones.
 */
abstract contract ERC721CInitializable is ERC721OpenZeppelinInitializable, CreatorTokenBase, AutomaticValidatorTransferApproval {

    function initializeERC721(string memory name_, string memory symbol_) public override {
        super.initializeERC721(name_, symbol_);

        _emitDefaultTransferValidator();
        _registerTokenType(getTransferValidator());
    }

    /**
     * @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved
     *         for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) {
        isApproved = super.isApprovedForAll(owner, operator);

        if (!isApproved) {
            if (autoApproveTransfersFromValidator) {
                isApproved = operator == address(getTransferValidator());
            }
        }
    }

    /**
     * @notice Indicates whether the contract implements the specified interface.
     * @dev Overrides supportsInterface in ERC165.
     * @param interfaceId The interface id
     * @return true if the contract implements the specified interface, false otherwise
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return 
        interfaceId == type(ICreatorToken).interfaceId || 
        interfaceId == type(ICreatorTokenLegacy).interfaceId || 
        super.supportsInterface(interfaceId);
    }

    /**
     * @notice Returns the function selector for the transfer validator's validation function to be called 
     * @notice for transaction simulation. 
     */
    function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) {
        functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256)"));
        isViewFunction = true;
    }

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

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

    function _tokenType() internal pure override returns(uint16) {
        return uint16(TOKEN_TYPE_ERC721);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ICreatorToken {
    event TransferValidatorUpdated(address oldValidator, address newValidator);
    function getTransferValidator() external view returns (address validator);
    function setTransferValidator(address validator) external;
    function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ICreatorTokenLegacy {
    event TransferValidatorUpdated(address oldValidator, address newValidator);
    function getTransferValidator() external view returns (address validator);
    function setTransferValidator(address validator) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITransferValidator {
    function applyCollectionTransferPolicy(address caller, address from, address to) external view;
    function validateTransfer(address caller, address from, address to) external view;
    function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
    function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;

    function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
    function afterAuthorizedTransfer(address token, uint256 tokenId) external;
    function beforeAuthorizedTransfer(address operator, address token) external;
    function afterAuthorizedTransfer(address token) external;
    function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
    function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
    function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITransferValidatorSetTokenType {
    function setTokenTypeOfCollection(address collection, uint16 tokenType) external;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

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

abstract contract ERC721OpenZeppelinBase is ERC721 {

    // Token name
    string internal _contractName;

    // Token symbol
    string internal _contractSymbol;

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

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

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

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

abstract contract ERC721OpenZeppelinInitializable is OwnablePermissions, ERC721OpenZeppelinBase {

    error ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();

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

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

        if(_erc721Initialized) {
            revert ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();
        }

        _erc721Initialized = true;

        _setNameAndSymbol(name_, symbol_);
    }
}

File 9 of 30 : AutomaticValidatorTransferApproval.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/OwnablePermissions.sol";

/**
 * @title AutomaticValidatorTransferApproval
 * @author Limit Break, Inc.
 * @notice Base contract mix-in that provides boilerplate code giving the contract owner the
 *         option to automatically approve a 721-C transfer validator implementation for transfers.
 */
abstract contract AutomaticValidatorTransferApproval is OwnablePermissions {

    /// @dev Emitted when the automatic approval flag is modified by the creator.
    event AutomaticApprovalOfTransferValidatorSet(bool autoApproved);

    /// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens.
    bool public autoApproveTransfersFromValidator;

    /**
     * @notice Sets if the transfer validator is automatically approved as an operator for all token owners.
     * 
     * @dev    Throws when the caller is not the contract owner.
     * 
     * @param autoApprove If true, the collection's transfer validator will be automatically approved to
     *                    transfer holder's tokens.
     */
    function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external {
        _requireCallerIsContractOwner();
        autoApproveTransfersFromValidator = autoApprove;
        emit AutomaticApprovalOfTransferValidatorSet(autoApprove);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenLegacy.sol";
import "../interfaces/ITransferValidator.sol";
import "./TransferValidation.sol";
import "../interfaces/ITransferValidatorSetTokenType.sol";

/**
 * @title CreatorTokenBase
 * @author Limit Break, Inc.
 * @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token 
 * transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3. 
 * This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer 
 * restrictions and security policies.
 *
 * <h4>Features:</h4>
 * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
 * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
 *
 * <h4>Benefits:</h4>
 * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
 * <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul>
 * <ul>Can be easily integrated into other token contracts as a base contract.</ul>
 *
 * <h4>Intended Usage:</h4>
 * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and 
 *   security policies.</ul>
 * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the 
 *   creator token.</ul>
 *
 * <h4>Compatibility:</h4>
 * <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul>
 */
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {

    /// @dev Thrown when setting a transfer validator address that has no deployed code.
    error CreatorTokenBase__InvalidTransferValidatorContract();

    /// @dev The default transfer validator that will be used if no transfer validator has been set by the creator.
    address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C002B0059009a671D00aD1700c9748146cd1B);

    /// @dev Used to determine if the default transfer validator is applied.
    /// @dev Set to true when the creator sets a transfer validator address.
    bool private isValidatorInitialized;
    /// @dev Address of the transfer validator to apply to transactions.
    address private transferValidator;

    constructor() {
        _emitDefaultTransferValidator();
        _registerTokenType(DEFAULT_TRANSFER_VALIDATOR);
    }

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

        bool isValidTransferValidator = transferValidator_.code.length > 0;

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

        emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_);

        isValidatorInitialized = true;
        transferValidator = transferValidator_;

        _registerTokenType(transferValidator_);
    }

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

        if (validator == address(0)) {
            if (!isValidatorInitialized) {
                validator = DEFAULT_TRANSFER_VALIDATOR;
            }
        }
    }

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

        if (validator != address(0)) {
            if (msg.sender == validator) {
                return;
            }

            ITransferValidator(validator).validateTransfer(caller, from, to, tokenId);
        }
    }

    /**
     * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
     *      Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
     *      and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
     *
     * @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
     *      transfer validator is expected to pre-validate the transfer.
     * 
     * @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator.
     * @dev The `tokenId` for ERC20 tokens should be set to `0`.
     *
     * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
     *      set to a non-zero address.
     *
     * @param caller  The address of the caller.
     * @param from    The address of the sender.
     * @param to      The address of the receiver.
     * @param tokenId The token id being transferred.
     * @param amount  The amount of token being transferred.
     */
    function _preValidateTransfer(
        address caller, 
        address from, 
        address to, 
        uint256 tokenId, 
        uint256 amount,
        uint256 /*value*/) internal virtual override {
        address validator = getTransferValidator();

        if (validator != address(0)) {
            if (msg.sender == validator) {
                return;
            }

            ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount);
        }
    }

    function _tokenType() internal virtual pure returns(uint16);

    function _registerTokenType(address validator) internal {
        if (validator != address(0)) {
            uint256 validatorCodeSize;
            assembly {
                validatorCodeSize := extcodesize(validator)
            }
            if(validatorCodeSize > 0) {
                try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) {
                } catch { }
            }
        }
    }

    /**
     * @dev  Used during contract deployment for constructable and cloneable creator tokens
     * @dev  to emit the `TransferValidatorUpdated` event signaling the validator for the contract
     * @dev  is the default transfer validator.
     */
    function _emitDefaultTransferValidator() internal {
        emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

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

    /*************************************************************************/
    /*                      Transfers Without Amounts                        */
    /*************************************************************************/

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

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

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

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

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

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

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

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

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

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

    /*************************************************************************/
    /*                         Transfers With Amounts                        */
    /*************************************************************************/

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

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

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

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

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

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

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

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

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

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

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

/// @dev Constant bytes32 value of 0x000...000
bytes32 constant ZERO_BYTES32 = bytes32(0);

/// @dev Constant value of 0
uint256 constant ZERO = 0;
/// @dev Constant value of 1
uint256 constant ONE = 1;

/// @dev Constant value representing an open order in storage
uint8 constant ORDER_STATE_OPEN = 0;
/// @dev Constant value representing a filled order in storage
uint8 constant ORDER_STATE_FILLED = 1;
/// @dev Constant value representing a cancelled order in storage
uint8 constant ORDER_STATE_CANCELLED = 2;

/// @dev Constant value representing the ERC721 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC721 = 721;
/// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC1155 = 1155;
/// @dev Constant value representing the ERC20 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC20 = 20;

/// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s`
bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

/// @dev EIP-712 typehash used for validating signature based stored approvals
bytes32 constant UPDATE_APPROVAL_TYPEHASH =
    keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)");

/// @dev EIP-712 typehash used for validating a single use permit without additional data
bytes32 constant SINGLE_USE_PERMIT_TYPEHASH =
    keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)");

/// @dev EIP-712 typehash used for validating a single use permit with additional data
string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB =
    "PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,";

/// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills
string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB =
    "PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,";

/// @dev Pausable flag for stored approval transfers of ERC721 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0;
/// @dev Pausable flag for stored approval transfers of ERC1155 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1;
/// @dev Pausable flag for stored approval transfers of ERC20 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2;

/// @dev Pausable flag for single use permit transfers of ERC721 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3;
/// @dev Pausable flag for single use permit transfers of ERC1155 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4;
/// @dev Pausable flag for single use permit transfers of ERC20 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5;

/// @dev Pausable flag for order fill transfers of ERC1155 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6;
/// @dev Pausable flag for order fill transfers of ERC20 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

        _owners[tokenId] = to;

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

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

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

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

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

        // Clear approvals
        delete _tokenApprovals[tokenId];

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId, 1);

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

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

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

        emit Transfer(from, to, tokenId);

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 21 of 30 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: BSD-3-Clause

pragma solidity ^0.8.0;

/***********************
* @author: squeebo_nft *
************************/

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

contract Delegated is Ownable{
  mapping(address => bool) internal _delegates;

  constructor()
    Ownable()
  {

    _delegates[owner()] = true;
  }

  modifier onlyDelegates {
    require(_delegates[msg.sender], "Invalid delegate" );
    _;
  }

  //onlyOwner
  function isDelegate( address addr ) external view onlyOwner returns ( bool ){
    return _delegates[addr];
  }

  function setDelegate( address addr, bool isDelegate_ ) external onlyOwner{
    _delegates[addr] = isDelegate_;
  }

  function transferOwnership(address newOwner) public virtual override onlyOwner {
    _delegates[newOwner] = true;
    super.transferOwnership(newOwner);
  }
}

// SPDX-License-Identifier: BSD-3
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/interfaces/IERC2981.sol";

contract Royalties is IERC2981{
  struct Fraction{
    uint16 numerator;
    uint16 denominator;
  }

  struct Royalty{
    address payable receiver;
    Fraction fraction;
  }

  Royalty public defaultRoyalty;
  //mapping(uint => Royalty) public tokenRoyalties;

  constructor(address payable receiver, uint16 royaltyNum, uint16 royaltyDenom) {
    _setDefaultRoyalty(receiver, royaltyNum, royaltyDenom);
  }

  //view: IERC2981
  /**
   * @dev See {IERC2981-royaltyInfo}.
   **/
  function royaltyInfo(uint256, uint256 salePrice) public view virtual returns(address, uint256) {
    /*
    Royalty memory royalty = _tokenRoyaltyInfo[_tokenId];
    if (royalty.receiver == address(0)) {
        royalty = _defaultRoyaltyInfo;
    }
    */

    uint256 royaltyAmount = (salePrice * defaultRoyalty.fraction.numerator) / defaultRoyalty.fraction.denominator;
    return (defaultRoyalty.receiver, royaltyAmount);
  }


  //view: IERC165
  /**
   * @dev See {IERC165-supportsInterface}.
   **/
  function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
    return interfaceId == type(IERC2981).interfaceId;
  }

  function _setDefaultRoyalty(address payable receiver, uint16 royaltyNum, uint16 royaltyDenom) internal {
    require(royaltyNum < royaltyDenom, "Royalties: invalid fraction");
    defaultRoyalty.receiver = receiver;
    defaultRoyalty.fraction = Fraction(royaltyNum, royaltyDenom);
  }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"UnsupportedChain","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultRoyalty","outputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"components":[{"internalType":"uint16","name":"numerator","type":"uint16"},{"internalType":"uint16","name":"denominator","type":"uint16"}],"internalType":"struct Royalties.Fraction","name":"fraction","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isDelegate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[][]","name":"tokenIds","type":"uint256[][]"}],"name":"mintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipient","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"resurrect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"retrans","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newPrefix","type":"string"},{"internalType":"string","name":"_newSuffix","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint16","name":"feeNumerator","type":"uint16"},{"internalType":"uint16","name":"feeDenominator","type":"uint16"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"isDelegate_","type":"bool"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"totalSupply","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":[{"internalType":"address","name":"account","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

611e6160115560e06040526035608081815290620038d260a03960129062000028908262000589565b5060408051602081019091526000815260139062000047908262000589565b503480156200005557600080fd5b5073d68bda6ba77ec2c4a15f6f6825786b5be738b9d460456103e8604051806040016040528060068152602001652334b2b7323d60d11b815250604051806040016040528060018152602001602360f91b81525060405180602001604052806000815250604051806020016040528060008152508160009081620000da919062000589565b506001620000e9828262000589565b505050620000fe8282620001b160201b60201c565b506200010b9050620001d3565b6200012a73721c002b0059009a671d00ad1700c9748146cd1b62000211565b62000135336200028f565b6001600e60006200014e600d546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905562000183838383620002e1565b505050620001ab73721c002b0059009a671d00ad1700c9748146cd1b6200039b60201b60201c565b62000655565b6006620001bf838262000589565b506007620001ce828262000589565b505050565b604080516000815273721c002b0059009a671d00ad1700c9748146cd1b6020820152600080516020620038b2833981519152910160405180910390a1565b6001600160a01b038116156200028c57803b80156200028a576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b1580156200027a57600080fd5b505af1925050508015620001ce57505b505b50565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8061ffff168261ffff16106200033e5760405162461bcd60e51b815260206004820152601b60248201527f526f79616c746965733a20696e76616c6964206672616374696f6e000000000060448201526064015b60405180910390fd5b600f80546001600160a01b039094166001600160a01b0319909416939093179092556040805180820190915261ffff918216808252929091166020909101819052601080546201000090920263ffffffff19909216909217179055565b620003a56200044b565b6001600160a01b038116803b15159015801590620003c1575080155b15620003e0576040516332483afb60e01b815260040160405180910390fd5b600080516020620038b2833981519152620003fa620004a9565b604080516001600160a01b03928316815291851660208301520160405180910390a1600880546001600160a01b038416610100026001600160a81b03199091161760011790556200028a8262000211565b600d546001600160a01b03163314620004a75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000335565b565b60085461010090046001600160a01b031680620004e25760085460ff16620004e2575073721c002b0059009a671d00ad1700c9748146cd1b5b90565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200051057607f821691505b6020821081036200053157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001ce57600081815260208120601f850160051c81016020861015620005605750805b601f850160051c820191505b8181101562000581578281556001016200056c565b505050505050565b81516001600160401b03811115620005a557620005a5620004e5565b620005bd81620005b68454620004fb565b8462000537565b602080601f831160018114620005f55760008415620005dc5750858301515b600019600386901b1c1916600185901b17855562000581565b600085815260208120601f198616915b82811015620006265788860151825594840194600190910190840162000605565b5085821015620006455787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61324d80620006656000396000f3fe6080604052600436106102345760003560e01c80634f6ccce71161012e57806389af6107116100ab578063a9fc664e1161006f578063a9fc664e14610779578063b88d4fde14610799578063c87b56dd146107b9578063e985e9c5146107d9578063f2fde38b146107f95761027d565b806389af6107146106e65780638da5cb5b1461070657806395d89b41146107245780639e05d24014610739578063a22cb465146107595761027d565b8063701b664a116100f2578063701b664a1461060657806370a0823114610619578063715018a6146106395780637885fdc71461064e57806380fda1e2146106c65761027d565b80634f6ccce71461056557806351cff8d9146105855780636221d13c146105a55780636352211e146105c65780636790a9de146105e65761027d565b806318160ddd116101bc5780633ccfd60b116101805780633ccfd60b146104c357806341acc66a146104d857806342842e0e146104f8578063438b6300146105185780634a994eef146105455761027d565b806318160ddd1461040f57806323b872dd1461042e5780632a55205a1461044e5780632f745c591461048d57806332cb6b0c146104ad5761027d565b8063081812fc11610203578063081812fc14610372578063095ea7b314610392578063098144d4146103b25780630d705df6146103c7578063129643ae146103ef5761027d565b806301463546146102bb57806301ffc9a71461030057806306fdde031461033057806307779627146103525761027d565b3661027d5760405162461bcd60e51b81526020600482015260126024820152711c9958d95a5d994a0a48191a5cd8589b195960721b60448201526064015b60405180910390fd5b005b60405162461bcd60e51b815260206004820152601360248201527219985b1b189858daca0a48191a5cd8589b1959606a1b6044820152606401610272565b3480156102c757600080fd5b506102e373721c002b0059009a671d00ad1700c9748146cd1b81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561030c57600080fd5b5061032061031b3660046127c1565b610819565b60405190151581526020016102f7565b34801561033c57600080fd5b5061034561086f565b6040516102f7919061282e565b34801561035e57600080fd5b5061032061036d366004612856565b61087e565b34801561037e57600080fd5b506102e361038d366004612873565b6108ab565b34801561039e57600080fd5b5061027b6103ad36600461288c565b6108d2565b3480156103be57600080fd5b506102e36109e7565b3480156103d357600080fd5b506040805163657711f560e11b815260016020820152016102f7565b3480156103fb57600080fd5b5061027b61040a3660046128fd565b610a21565b34801561041b57600080fd5b50600b545b6040519081526020016102f7565b34801561043a57600080fd5b5061027b61044936600461293f565b610ac3565b34801561045a57600080fd5b5061046e610469366004612980565b610af4565b604080516001600160a01b0390931683526020830191909152016102f7565b34801561049957600080fd5b506104206104a836600461288c565b610b38565b3480156104b957600080fd5b5061042060115481565b3480156104cf57600080fd5b5061027b610bd1565b3480156104e457600080fd5b5061027b6104f33660046129b4565b610bee565b34801561050457600080fd5b5061027b61051336600461293f565b610c01565b34801561052457600080fd5b50610538610533366004612856565b610c1c565b6040516102f791906129f9565b34801561055157600080fd5b5061027b610560366004612a4b565b610cbc565b34801561057157600080fd5b50610420610580366004612873565b610cef565b34801561059157600080fd5b5061027b6105a0366004612856565b610d82565b3480156105b157600080fd5b5060085461032090600160a81b900460ff1681565b3480156105d257600080fd5b506102e36105e1366004612873565b610e7b565b3480156105f257600080fd5b5061027b610601366004612ac6565b610edb565b61027b610614366004612b32565b610f2c565b34801561062557600080fd5b50610420610634366004612856565b6110e4565b34801561064557600080fd5b5061027b61116a565b34801561065a57600080fd5b50600f546040805180820190915260105461ffff808216835262010000909104166020820152610691916001600160a01b03169082565b604080516001600160a01b039093168352815161ffff90811660208086019190915290920151909116908201526060016102f7565b3480156106d257600080fd5b5061027b6106e1366004612b32565b61117c565b3480156106f257600080fd5b5061027b610701366004612b92565b6112a4565b34801561071257600080fd5b50600d546001600160a01b03166102e3565b34801561073057600080fd5b5061034561130e565b34801561074557600080fd5b5061027b610754366004612be7565b611318565b34801561076557600080fd5b5061027b610774366004612a4b565b611378565b34801561078557600080fd5b5061027b610794366004612856565b611387565b3480156107a557600080fd5b5061027b6107b4366004612c1a565b611440565b3480156107c557600080fd5b506103456107d4366004612873565b611472565b3480156107e557600080fd5b506103206107f4366004612cfa565b611520565b34801561080557600080fd5b5061027b610814366004612856565b611533565b60006108248261156a565b1561083157506001919050565b61083a826115aa565b1561084757506001919050565b63152a902d60e11b6001600160e01b031983160361086757506001919050565b506000919050565b60606108796115cf565b905090565b6000610888611661565b506001600160a01b0381166000908152600e602052604090205460ff165b919050565b60006108b6826116bb565b506000908152600460205260409020546001600160a01b031690565b60006108dd82610e7b565b9050806001600160a01b0316836001600160a01b03160361094a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610272565b336001600160a01b038216148061096657506109668133611520565b6109d85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610272565b6109e2838361171a565b505050565b60085461010090046001600160a01b031680610a1e5760085460ff16610a1e575073721c002b0059009a671d00ad1700c9748146cd1b5b90565b336000908152600e602052604090205460ff16610a505760405162461bcd60e51b815260040161027290612d28565b60008082815b81811015610abb57858582818110610a7057610a70612d52565b905060200201359250610a8283610e7b565b60405190945083906001600160a01b0386169081906000805160206131f883398151915290600090a4610ab481612d7e565b9050610a56565b505050505050565b610acd3382611788565b610ae95760405162461bcd60e51b815260040161027290612d97565b6109e28383836117e7565b6010546000908190819061ffff620100008204811691610b15911686612de4565b610b1f9190612dfb565b600f546001600160a01b031693509150505b9250929050565b6000610b43836110e4565b8210610ba55760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610272565b506001600160a01b03821660009081526009602090815260408083208484529091529020545b92915050565b610bec610be6600d546001600160a01b031690565b4761194e565b565b610bf6611661565b6109e2838383611a67565b6109e283838360405180602001604052806000815250611440565b60606000610c29836110e4565b905060008167ffffffffffffffff811115610c4657610c46612c04565b604051908082528060200260200182016040528015610c6f578160200160208202803683370190505b50905060005b82811015610cb457610c878582610b38565b828281518110610c9957610c99612d52565b6020908102919091010152610cad81612d7e565b9050610c75565b509392505050565b610cc4611661565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b6000610cfa600b5490565b8210610d5d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610272565b600b8281548110610d7057610d70612d52565b90600052602060002001549050919050565b806001600160a01b03811663a9059cbb610da4600d546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c9190612e1d565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610e57573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e29190612e36565b6000818152600260205260408120546001600160a01b031680610bcb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610272565b336000908152600e602052604090205460ff16610f0a5760405162461bcd60e51b815260040161027290612d28565b6012610f17848683612ed3565b506013610f25828483612ed3565b5050505050565b336000908152600e602052604090205460ff16610f5b5760405162461bcd60e51b815260040161027290612d28565b808314610fd05760405162461bcd60e51b815260206004820152603a60248201527f46656c696e654669656e647a3a206d7573742070726f7669646520657175616c60448201527f207175616e74697469657320616e6420726563697069656e74730000000000006064820152608401610272565b6000805b8281101561100e57838382818110610fee57610fee612d52565b90506020028101906110009190612f93565b929092019150600101610fd4565b506011548161101c600b5490565b01111561103b5760405162461bcd60e51b815260040161027290612fdd565b6000366000805b878110156110d95788888281811061105c5761105c612d52565b90506020020160208101906110719190612856565b935086868281811061108557611085612d52565b90506020028101906110979190612f93565b9250925060005b828110156110d0576110c8858585848181106110bc576110bc612d52565b90506020020135611b1b565b60010161109e565b50600101611042565b505050505050505050565b60006001600160a01b03821661114e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610272565b506001600160a01b031660009081526003602052604090205490565b611172611661565b610bec6000611cac565b336000908152600e602052604090205460ff166111ab5760405162461bcd60e51b815260040161027290612d28565b8083146112205760405162461bcd60e51b815260206004820152603860248201527f46656c696e654669656e647a3a206d7573742070726f7669646520657175616c60448201527f20746f6b656e49647320616e6420726563697069656e747300000000000000006064820152608401610272565b6011548161122d600b5490565b6112379190613024565b11156112555760405162461bcd60e51b815260040161027290612fdd565b60005b81811015610f255761129c85858381811061127557611275612d52565b905060200201602081019061128a9190612856565b8484848181106110bc576110bc612d52565b600101611258565b336000908152600e602052604090205460ff166112d35760405162461bcd60e51b815260040161027290612d28565b60005b8181101561130857611300848484848181106112f4576112f4612d52565b90506020020135611cfe565b6001016112d6565b50505050565b6060610879611d70565b611320611661565b60088054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc9061136d90831515815260200190565b60405180910390a150565b611383338383611d7f565b5050565b61138f611661565b6001600160a01b038116803b151590158015906113aa575080155b156113c8576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac6113f16109e7565b604080516001600160a01b03928316815291851660208301520160405180910390a1600880546001600160a01b038416610100026001600160a81b031990911617600117905561138382611e4d565b61144a3383611788565b6114665760405162461bcd60e51b815260040161027290612d97565b61130884848484611ecd565b6000818152600260205260409020546060906001600160a01b03166114eb5760405162461bcd60e51b815260206004820152602960248201527f46656c696e654669656e647a3a20717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610272565b60126114f683611f00565b601360405160200161150a939291906130aa565b6040516020818303038152906040529050919050565b600061152c8383611f93565b9392505050565b61153b611661565b6001600160a01b0381166000908152600e60205260409020805460ff1916600117905561156781611ff7565b50565b60006001600160e01b03198216632b435fdb60e21b148061159b57506001600160e01b0319821663503e914d60e11b145b80610bcb5750610bcb8261206d565b60006001600160e01b0319821663780e9d6360e01b1480610bcb5750610bcb8261156a565b6060600680546115de90612e53565b80601f016020809104026020016040519081016040528092919081815260200182805461160a90612e53565b80156116575780601f1061162c57610100808354040283529160200191611657565b820191906000526020600020905b81548152906001019060200180831161163a57829003601f168201915b5050505050905090565b600d546001600160a01b03163314610bec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610272565b6000818152600260205260409020546001600160a01b03166115675760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610272565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061174f82610e7b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061179483610e7b565b9050806001600160a01b0316846001600160a01b031614806117bb57506117bb8185611520565b806117df5750836001600160a01b03166117d4846108ab565b6001600160a01b0316145b949350505050565b826001600160a01b03166117fa82610e7b565b6001600160a01b0316146118205760405162461bcd60e51b8152600401610272906130dd565b6001600160a01b0382166118825760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610272565b61188f83838360016120bd565b826001600160a01b03166118a282610e7b565b6001600160a01b0316146118c85760405162461bcd60e51b8152600401610272906130dd565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184936000805160206131f883398151915291a46109e283838360016120d5565b8047101561199e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610272565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119eb576040519150601f19603f3d011682016040523d82523d6000602084013e6119f0565b606091505b50509050806109e25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610272565b8061ffff168261ffff1610611abe5760405162461bcd60e51b815260206004820152601b60248201527f526f79616c746965733a20696e76616c6964206672616374696f6e00000000006044820152606401610272565b600f80546001600160a01b039094166001600160a01b0319909416939093179092556040805180820190915261ffff918216808252929091166020909101819052601080546201000090920263ffffffff19909216909217179055565b6001600160a01b038216611b715760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610272565b6000818152600260205260409020546001600160a01b031615611bd65760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610272565b611be46000838360016120bd565b6000818152600260205260409020546001600160a01b031615611c495760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610272565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291906000805160206131f8833981519152908290a46113836000838360016120d5565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000818152600260205260409020546001600160a01b03838116911614611d675760405162461bcd60e51b815260206004820152601c60248201527f46656c696e654669656e647a3a206f776e6572206d69736d61746368000000006044820152606401610272565b611383816120e1565b6060600780546115de90612e53565b816001600160a01b0316836001600160a01b031603611de05760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610272565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0381161561156757803b8015611383576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b158015611eb357600080fd5b505af1925050508015611ec4575060015b15611383575050565b611ed88484846117e7565b611ee48484848461217c565b6113085760405162461bcd60e51b815260040161027290613122565b60606000611f0d8361227d565b600101905060008167ffffffffffffffff811115611f2d57611f2d612c04565b6040519080825280601f01601f191660200182016040528015611f57576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611f6157509392505050565b6001600160a01b0382811660009081526005602090815260408083209385168352929052205460ff1680610bcb57600854600160a81b900460ff1615610bcb57611fdb6109e7565b6001600160a01b0316826001600160a01b031614905092915050565b611fff611661565b6001600160a01b0381166120645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610272565b61156781611cac565b60006001600160e01b031982166380ac58cd60e01b148061209e57506001600160e01b03198216635b5e139f60e01b145b80610bcb57506301ffc9a760e01b6001600160e01b0319831614610bcb565b6120c984848484612355565b6113088484848461237c565b611308848484846124b5565b60006120ec82610e7b565b90506120fc8160008460016120bd565b61210582610e7b565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084926000805160206131f8833981519152908390a46113838160008460016120d5565b60006001600160a01b0384163b1561227257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906121c0903390899088908890600401613174565b6020604051808303816000875af19250505080156121fb575060408051601f3d908101601f191682019092526121f8918101906131b1565b60015b612258573d808015612229576040519150601f19603f3d011682016040523d82523d6000602084013e61222e565b606091505b5080516000036122505760405162461bcd60e51b815260040161027290613122565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506117df565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122bc5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106122e8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061230657662386f26fc10000830492506010015b6305f5e100831061231e576305f5e100830492506008015b612710831061233257612710830492506004015b60648310612344576064830492506002015b600a8310610bcb5760010192915050565b60005b81811015610f2557612374858561236f8487613024565b6124dc565b600101612358565b61238884848484612355565b60018111156123f75760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610272565b816001600160a01b0385166124535761244e81600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b612476565b836001600160a01b0316856001600160a01b03161461247657612476858261252b565b6001600160a01b0384166124925761248d816125c8565b610f25565b846001600160a01b0316846001600160a01b031614610f2557610f258482612677565b60005b81811015610f25576124d485856124cf8487613024565b6126bb565b6001016124b8565b6001600160a01b0383811615908316158180156124f65750805b1561251457604051635cbd944160e01b815260040160405180910390fd5b8161248d578061248d57610f253386868634612702565b60006001612538846110e4565b61254291906131ce565b6000838152600a6020526040902054909150808214612595576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b546000906125da906001906131ce565b6000838152600c6020526040812054600b805493945090928490811061260257612602612d52565b9060005260206000200154905080600b838154811061262357612623612d52565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b80548061265b5761265b6131e1565b6001900381819060005260206000200160009055905550505050565b6000612682836110e4565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b6001600160a01b0383811615908316158180156126d55750805b156126f357604051635cbd944160e01b815260040160405180910390fd5b8161248d578061248d57610f25565b600061270c6109e7565b90506001600160a01b03811615610abb576001600160a01b03811633036127335750610f25565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea9060840160006040518083038186803b15801561278b57600080fd5b505afa15801561279f573d6000803e3d6000fd5b50505050505050505050565b6001600160e01b03198116811461156757600080fd5b6000602082840312156127d357600080fd5b813561152c816127ab565b60005b838110156127f95781810151838201526020016127e1565b50506000910152565b6000815180845261281a8160208601602086016127de565b601f01601f19169290920160200192915050565b60208152600061152c6020830184612802565b6001600160a01b038116811461156757600080fd5b60006020828403121561286857600080fd5b813561152c81612841565b60006020828403121561288557600080fd5b5035919050565b6000806040838503121561289f57600080fd5b82356128aa81612841565b946020939093013593505050565b60008083601f8401126128ca57600080fd5b50813567ffffffffffffffff8111156128e257600080fd5b6020830191508360208260051b8501011115610b3157600080fd5b6000806020838503121561291057600080fd5b823567ffffffffffffffff81111561292757600080fd5b612933858286016128b8565b90969095509350505050565b60008060006060848603121561295457600080fd5b833561295f81612841565b9250602084013561296f81612841565b929592945050506040919091013590565b6000806040838503121561299357600080fd5b50508035926020909101359150565b803561ffff811681146108a657600080fd5b6000806000606084860312156129c957600080fd5b83356129d481612841565b92506129e2602085016129a2565b91506129f0604085016129a2565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612a3157835183529284019291840191600101612a15565b50909695505050505050565b801515811461156757600080fd5b60008060408385031215612a5e57600080fd5b8235612a6981612841565b91506020830135612a7981612a3d565b809150509250929050565b60008083601f840112612a9657600080fd5b50813567ffffffffffffffff811115612aae57600080fd5b602083019150836020828501011115610b3157600080fd5b60008060008060408587031215612adc57600080fd5b843567ffffffffffffffff80821115612af457600080fd5b612b0088838901612a84565b90965094506020870135915080821115612b1957600080fd5b50612b2687828801612a84565b95989497509550505050565b60008060008060408587031215612b4857600080fd5b843567ffffffffffffffff80821115612b6057600080fd5b612b6c888389016128b8565b90965094506020870135915080821115612b8557600080fd5b50612b26878288016128b8565b600080600060408486031215612ba757600080fd5b8335612bb281612841565b9250602084013567ffffffffffffffff811115612bce57600080fd5b612bda868287016128b8565b9497909650939450505050565b600060208284031215612bf957600080fd5b813561152c81612a3d565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612c3057600080fd5b8435612c3b81612841565b93506020850135612c4b81612841565b925060408501359150606085013567ffffffffffffffff80821115612c6f57600080fd5b818701915087601f830112612c8357600080fd5b813581811115612c9557612c95612c04565b604051601f8201601f19908116603f01168101908382118183101715612cbd57612cbd612c04565b816040528281528a6020848701011115612cd657600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612d0d57600080fd5b8235612d1881612841565b91506020830135612a7981612841565b60208082526010908201526f496e76616c69642064656c656761746560801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612d9057612d90612d68565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b8082028115828204841417610bcb57610bcb612d68565b600082612e1857634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612e2f57600080fd5b5051919050565b600060208284031215612e4857600080fd5b815161152c81612a3d565b600181811c90821680612e6757607f821691505b602082108103612e8757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156109e257600081815260208120601f850160051c81016020861015612eb45750805b601f850160051c820191505b81811015610abb57828155600101612ec0565b67ffffffffffffffff831115612eeb57612eeb612c04565b612eff83612ef98354612e53565b83612e8d565b6000601f841160018114612f335760008515612f1b5750838201355b600019600387901b1c1916600186901b178355610f25565b600083815260209020601f19861690835b82811015612f645786850135825560209485019460019092019101612f44565b5086821015612f815760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000808335601e19843603018112612faa57600080fd5b83018035915067ffffffffffffffff821115612fc557600080fd5b6020019150600581901b3603821315610b3157600080fd5b60208082526027908201527f46656c696e654669656e647a3a206d696e742f6f72646572206578636565647360408201526620737570706c7960c81b606082015260800190565b80820180821115610bcb57610bcb612d68565b6000815461304481612e53565b6001828116801561305c5760018114613071576130a0565b60ff19841687528215158302870194506130a0565b8560005260208060002060005b858110156130975781548a82015290840190820161307e565b50505082870194505b5050505092915050565b60006130b68286613037565b84516130c68183602089016127de565b6130d281830186613037565b979650505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906131a790830184612802565b9695505050505050565b6000602082840312156131c357600080fd5b815161152c816127ab565b81810381811115610bcb57610bcb612d68565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212201b7d8a2b672b2bfc35b90147142ab95a00c21068695725877570f2d5df3b08cf64736f6c63430008140033cc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac68747470733a2f2f6669656e647a2e6865726f646576656c6f706d656e742e636f6d2f746f6b656e2e7068703f746f6b656e49643d

Deployed Bytecode

0x6080604052600436106102345760003560e01c80634f6ccce71161012e57806389af6107116100ab578063a9fc664e1161006f578063a9fc664e14610779578063b88d4fde14610799578063c87b56dd146107b9578063e985e9c5146107d9578063f2fde38b146107f95761027d565b806389af6107146106e65780638da5cb5b1461070657806395d89b41146107245780639e05d24014610739578063a22cb465146107595761027d565b8063701b664a116100f2578063701b664a1461060657806370a0823114610619578063715018a6146106395780637885fdc71461064e57806380fda1e2146106c65761027d565b80634f6ccce71461056557806351cff8d9146105855780636221d13c146105a55780636352211e146105c65780636790a9de146105e65761027d565b806318160ddd116101bc5780633ccfd60b116101805780633ccfd60b146104c357806341acc66a146104d857806342842e0e146104f8578063438b6300146105185780634a994eef146105455761027d565b806318160ddd1461040f57806323b872dd1461042e5780632a55205a1461044e5780632f745c591461048d57806332cb6b0c146104ad5761027d565b8063081812fc11610203578063081812fc14610372578063095ea7b314610392578063098144d4146103b25780630d705df6146103c7578063129643ae146103ef5761027d565b806301463546146102bb57806301ffc9a71461030057806306fdde031461033057806307779627146103525761027d565b3661027d5760405162461bcd60e51b81526020600482015260126024820152711c9958d95a5d994a0a48191a5cd8589b195960721b60448201526064015b60405180910390fd5b005b60405162461bcd60e51b815260206004820152601360248201527219985b1b189858daca0a48191a5cd8589b1959606a1b6044820152606401610272565b3480156102c757600080fd5b506102e373721c002b0059009a671d00ad1700c9748146cd1b81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561030c57600080fd5b5061032061031b3660046127c1565b610819565b60405190151581526020016102f7565b34801561033c57600080fd5b5061034561086f565b6040516102f7919061282e565b34801561035e57600080fd5b5061032061036d366004612856565b61087e565b34801561037e57600080fd5b506102e361038d366004612873565b6108ab565b34801561039e57600080fd5b5061027b6103ad36600461288c565b6108d2565b3480156103be57600080fd5b506102e36109e7565b3480156103d357600080fd5b506040805163657711f560e11b815260016020820152016102f7565b3480156103fb57600080fd5b5061027b61040a3660046128fd565b610a21565b34801561041b57600080fd5b50600b545b6040519081526020016102f7565b34801561043a57600080fd5b5061027b61044936600461293f565b610ac3565b34801561045a57600080fd5b5061046e610469366004612980565b610af4565b604080516001600160a01b0390931683526020830191909152016102f7565b34801561049957600080fd5b506104206104a836600461288c565b610b38565b3480156104b957600080fd5b5061042060115481565b3480156104cf57600080fd5b5061027b610bd1565b3480156104e457600080fd5b5061027b6104f33660046129b4565b610bee565b34801561050457600080fd5b5061027b61051336600461293f565b610c01565b34801561052457600080fd5b50610538610533366004612856565b610c1c565b6040516102f791906129f9565b34801561055157600080fd5b5061027b610560366004612a4b565b610cbc565b34801561057157600080fd5b50610420610580366004612873565b610cef565b34801561059157600080fd5b5061027b6105a0366004612856565b610d82565b3480156105b157600080fd5b5060085461032090600160a81b900460ff1681565b3480156105d257600080fd5b506102e36105e1366004612873565b610e7b565b3480156105f257600080fd5b5061027b610601366004612ac6565b610edb565b61027b610614366004612b32565b610f2c565b34801561062557600080fd5b50610420610634366004612856565b6110e4565b34801561064557600080fd5b5061027b61116a565b34801561065a57600080fd5b50600f546040805180820190915260105461ffff808216835262010000909104166020820152610691916001600160a01b03169082565b604080516001600160a01b039093168352815161ffff90811660208086019190915290920151909116908201526060016102f7565b3480156106d257600080fd5b5061027b6106e1366004612b32565b61117c565b3480156106f257600080fd5b5061027b610701366004612b92565b6112a4565b34801561071257600080fd5b50600d546001600160a01b03166102e3565b34801561073057600080fd5b5061034561130e565b34801561074557600080fd5b5061027b610754366004612be7565b611318565b34801561076557600080fd5b5061027b610774366004612a4b565b611378565b34801561078557600080fd5b5061027b610794366004612856565b611387565b3480156107a557600080fd5b5061027b6107b4366004612c1a565b611440565b3480156107c557600080fd5b506103456107d4366004612873565b611472565b3480156107e557600080fd5b506103206107f4366004612cfa565b611520565b34801561080557600080fd5b5061027b610814366004612856565b611533565b60006108248261156a565b1561083157506001919050565b61083a826115aa565b1561084757506001919050565b63152a902d60e11b6001600160e01b031983160361086757506001919050565b506000919050565b60606108796115cf565b905090565b6000610888611661565b506001600160a01b0381166000908152600e602052604090205460ff165b919050565b60006108b6826116bb565b506000908152600460205260409020546001600160a01b031690565b60006108dd82610e7b565b9050806001600160a01b0316836001600160a01b03160361094a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610272565b336001600160a01b038216148061096657506109668133611520565b6109d85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610272565b6109e2838361171a565b505050565b60085461010090046001600160a01b031680610a1e5760085460ff16610a1e575073721c002b0059009a671d00ad1700c9748146cd1b5b90565b336000908152600e602052604090205460ff16610a505760405162461bcd60e51b815260040161027290612d28565b60008082815b81811015610abb57858582818110610a7057610a70612d52565b905060200201359250610a8283610e7b565b60405190945083906001600160a01b0386169081906000805160206131f883398151915290600090a4610ab481612d7e565b9050610a56565b505050505050565b610acd3382611788565b610ae95760405162461bcd60e51b815260040161027290612d97565b6109e28383836117e7565b6010546000908190819061ffff620100008204811691610b15911686612de4565b610b1f9190612dfb565b600f546001600160a01b031693509150505b9250929050565b6000610b43836110e4565b8210610ba55760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610272565b506001600160a01b03821660009081526009602090815260408083208484529091529020545b92915050565b610bec610be6600d546001600160a01b031690565b4761194e565b565b610bf6611661565b6109e2838383611a67565b6109e283838360405180602001604052806000815250611440565b60606000610c29836110e4565b905060008167ffffffffffffffff811115610c4657610c46612c04565b604051908082528060200260200182016040528015610c6f578160200160208202803683370190505b50905060005b82811015610cb457610c878582610b38565b828281518110610c9957610c99612d52565b6020908102919091010152610cad81612d7e565b9050610c75565b509392505050565b610cc4611661565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b6000610cfa600b5490565b8210610d5d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610272565b600b8281548110610d7057610d70612d52565b90600052602060002001549050919050565b806001600160a01b03811663a9059cbb610da4600d546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c9190612e1d565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610e57573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e29190612e36565b6000818152600260205260408120546001600160a01b031680610bcb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610272565b336000908152600e602052604090205460ff16610f0a5760405162461bcd60e51b815260040161027290612d28565b6012610f17848683612ed3565b506013610f25828483612ed3565b5050505050565b336000908152600e602052604090205460ff16610f5b5760405162461bcd60e51b815260040161027290612d28565b808314610fd05760405162461bcd60e51b815260206004820152603a60248201527f46656c696e654669656e647a3a206d7573742070726f7669646520657175616c60448201527f207175616e74697469657320616e6420726563697069656e74730000000000006064820152608401610272565b6000805b8281101561100e57838382818110610fee57610fee612d52565b90506020028101906110009190612f93565b929092019150600101610fd4565b506011548161101c600b5490565b01111561103b5760405162461bcd60e51b815260040161027290612fdd565b6000366000805b878110156110d95788888281811061105c5761105c612d52565b90506020020160208101906110719190612856565b935086868281811061108557611085612d52565b90506020028101906110979190612f93565b9250925060005b828110156110d0576110c8858585848181106110bc576110bc612d52565b90506020020135611b1b565b60010161109e565b50600101611042565b505050505050505050565b60006001600160a01b03821661114e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610272565b506001600160a01b031660009081526003602052604090205490565b611172611661565b610bec6000611cac565b336000908152600e602052604090205460ff166111ab5760405162461bcd60e51b815260040161027290612d28565b8083146112205760405162461bcd60e51b815260206004820152603860248201527f46656c696e654669656e647a3a206d7573742070726f7669646520657175616c60448201527f20746f6b656e49647320616e6420726563697069656e747300000000000000006064820152608401610272565b6011548161122d600b5490565b6112379190613024565b11156112555760405162461bcd60e51b815260040161027290612fdd565b60005b81811015610f255761129c85858381811061127557611275612d52565b905060200201602081019061128a9190612856565b8484848181106110bc576110bc612d52565b600101611258565b336000908152600e602052604090205460ff166112d35760405162461bcd60e51b815260040161027290612d28565b60005b8181101561130857611300848484848181106112f4576112f4612d52565b90506020020135611cfe565b6001016112d6565b50505050565b6060610879611d70565b611320611661565b60088054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc9061136d90831515815260200190565b60405180910390a150565b611383338383611d7f565b5050565b61138f611661565b6001600160a01b038116803b151590158015906113aa575080155b156113c8576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac6113f16109e7565b604080516001600160a01b03928316815291851660208301520160405180910390a1600880546001600160a01b038416610100026001600160a81b031990911617600117905561138382611e4d565b61144a3383611788565b6114665760405162461bcd60e51b815260040161027290612d97565b61130884848484611ecd565b6000818152600260205260409020546060906001600160a01b03166114eb5760405162461bcd60e51b815260206004820152602960248201527f46656c696e654669656e647a3a20717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610272565b60126114f683611f00565b601360405160200161150a939291906130aa565b6040516020818303038152906040529050919050565b600061152c8383611f93565b9392505050565b61153b611661565b6001600160a01b0381166000908152600e60205260409020805460ff1916600117905561156781611ff7565b50565b60006001600160e01b03198216632b435fdb60e21b148061159b57506001600160e01b0319821663503e914d60e11b145b80610bcb5750610bcb8261206d565b60006001600160e01b0319821663780e9d6360e01b1480610bcb5750610bcb8261156a565b6060600680546115de90612e53565b80601f016020809104026020016040519081016040528092919081815260200182805461160a90612e53565b80156116575780601f1061162c57610100808354040283529160200191611657565b820191906000526020600020905b81548152906001019060200180831161163a57829003601f168201915b5050505050905090565b600d546001600160a01b03163314610bec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610272565b6000818152600260205260409020546001600160a01b03166115675760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610272565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061174f82610e7b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061179483610e7b565b9050806001600160a01b0316846001600160a01b031614806117bb57506117bb8185611520565b806117df5750836001600160a01b03166117d4846108ab565b6001600160a01b0316145b949350505050565b826001600160a01b03166117fa82610e7b565b6001600160a01b0316146118205760405162461bcd60e51b8152600401610272906130dd565b6001600160a01b0382166118825760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610272565b61188f83838360016120bd565b826001600160a01b03166118a282610e7b565b6001600160a01b0316146118c85760405162461bcd60e51b8152600401610272906130dd565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184936000805160206131f883398151915291a46109e283838360016120d5565b8047101561199e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610272565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119eb576040519150601f19603f3d011682016040523d82523d6000602084013e6119f0565b606091505b50509050806109e25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610272565b8061ffff168261ffff1610611abe5760405162461bcd60e51b815260206004820152601b60248201527f526f79616c746965733a20696e76616c6964206672616374696f6e00000000006044820152606401610272565b600f80546001600160a01b039094166001600160a01b0319909416939093179092556040805180820190915261ffff918216808252929091166020909101819052601080546201000090920263ffffffff19909216909217179055565b6001600160a01b038216611b715760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610272565b6000818152600260205260409020546001600160a01b031615611bd65760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610272565b611be46000838360016120bd565b6000818152600260205260409020546001600160a01b031615611c495760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610272565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291906000805160206131f8833981519152908290a46113836000838360016120d5565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000818152600260205260409020546001600160a01b03838116911614611d675760405162461bcd60e51b815260206004820152601c60248201527f46656c696e654669656e647a3a206f776e6572206d69736d61746368000000006044820152606401610272565b611383816120e1565b6060600780546115de90612e53565b816001600160a01b0316836001600160a01b031603611de05760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610272565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0381161561156757803b8015611383576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b158015611eb357600080fd5b505af1925050508015611ec4575060015b15611383575050565b611ed88484846117e7565b611ee48484848461217c565b6113085760405162461bcd60e51b815260040161027290613122565b60606000611f0d8361227d565b600101905060008167ffffffffffffffff811115611f2d57611f2d612c04565b6040519080825280601f01601f191660200182016040528015611f57576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611f6157509392505050565b6001600160a01b0382811660009081526005602090815260408083209385168352929052205460ff1680610bcb57600854600160a81b900460ff1615610bcb57611fdb6109e7565b6001600160a01b0316826001600160a01b031614905092915050565b611fff611661565b6001600160a01b0381166120645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610272565b61156781611cac565b60006001600160e01b031982166380ac58cd60e01b148061209e57506001600160e01b03198216635b5e139f60e01b145b80610bcb57506301ffc9a760e01b6001600160e01b0319831614610bcb565b6120c984848484612355565b6113088484848461237c565b611308848484846124b5565b60006120ec82610e7b565b90506120fc8160008460016120bd565b61210582610e7b565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084926000805160206131f8833981519152908390a46113838160008460016120d5565b60006001600160a01b0384163b1561227257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906121c0903390899088908890600401613174565b6020604051808303816000875af19250505080156121fb575060408051601f3d908101601f191682019092526121f8918101906131b1565b60015b612258573d808015612229576040519150601f19603f3d011682016040523d82523d6000602084013e61222e565b606091505b5080516000036122505760405162461bcd60e51b815260040161027290613122565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506117df565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122bc5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106122e8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061230657662386f26fc10000830492506010015b6305f5e100831061231e576305f5e100830492506008015b612710831061233257612710830492506004015b60648310612344576064830492506002015b600a8310610bcb5760010192915050565b60005b81811015610f2557612374858561236f8487613024565b6124dc565b600101612358565b61238884848484612355565b60018111156123f75760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610272565b816001600160a01b0385166124535761244e81600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b612476565b836001600160a01b0316856001600160a01b03161461247657612476858261252b565b6001600160a01b0384166124925761248d816125c8565b610f25565b846001600160a01b0316846001600160a01b031614610f2557610f258482612677565b60005b81811015610f25576124d485856124cf8487613024565b6126bb565b6001016124b8565b6001600160a01b0383811615908316158180156124f65750805b1561251457604051635cbd944160e01b815260040160405180910390fd5b8161248d578061248d57610f253386868634612702565b60006001612538846110e4565b61254291906131ce565b6000838152600a6020526040902054909150808214612595576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b546000906125da906001906131ce565b6000838152600c6020526040812054600b805493945090928490811061260257612602612d52565b9060005260206000200154905080600b838154811061262357612623612d52565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b80548061265b5761265b6131e1565b6001900381819060005260206000200160009055905550505050565b6000612682836110e4565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b6001600160a01b0383811615908316158180156126d55750805b156126f357604051635cbd944160e01b815260040160405180910390fd5b8161248d578061248d57610f25565b600061270c6109e7565b90506001600160a01b03811615610abb576001600160a01b03811633036127335750610f25565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea9060840160006040518083038186803b15801561278b57600080fd5b505afa15801561279f573d6000803e3d6000fd5b50505050505050505050565b6001600160e01b03198116811461156757600080fd5b6000602082840312156127d357600080fd5b813561152c816127ab565b60005b838110156127f95781810151838201526020016127e1565b50506000910152565b6000815180845261281a8160208601602086016127de565b601f01601f19169290920160200192915050565b60208152600061152c6020830184612802565b6001600160a01b038116811461156757600080fd5b60006020828403121561286857600080fd5b813561152c81612841565b60006020828403121561288557600080fd5b5035919050565b6000806040838503121561289f57600080fd5b82356128aa81612841565b946020939093013593505050565b60008083601f8401126128ca57600080fd5b50813567ffffffffffffffff8111156128e257600080fd5b6020830191508360208260051b8501011115610b3157600080fd5b6000806020838503121561291057600080fd5b823567ffffffffffffffff81111561292757600080fd5b612933858286016128b8565b90969095509350505050565b60008060006060848603121561295457600080fd5b833561295f81612841565b9250602084013561296f81612841565b929592945050506040919091013590565b6000806040838503121561299357600080fd5b50508035926020909101359150565b803561ffff811681146108a657600080fd5b6000806000606084860312156129c957600080fd5b83356129d481612841565b92506129e2602085016129a2565b91506129f0604085016129a2565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612a3157835183529284019291840191600101612a15565b50909695505050505050565b801515811461156757600080fd5b60008060408385031215612a5e57600080fd5b8235612a6981612841565b91506020830135612a7981612a3d565b809150509250929050565b60008083601f840112612a9657600080fd5b50813567ffffffffffffffff811115612aae57600080fd5b602083019150836020828501011115610b3157600080fd5b60008060008060408587031215612adc57600080fd5b843567ffffffffffffffff80821115612af457600080fd5b612b0088838901612a84565b90965094506020870135915080821115612b1957600080fd5b50612b2687828801612a84565b95989497509550505050565b60008060008060408587031215612b4857600080fd5b843567ffffffffffffffff80821115612b6057600080fd5b612b6c888389016128b8565b90965094506020870135915080821115612b8557600080fd5b50612b26878288016128b8565b600080600060408486031215612ba757600080fd5b8335612bb281612841565b9250602084013567ffffffffffffffff811115612bce57600080fd5b612bda868287016128b8565b9497909650939450505050565b600060208284031215612bf957600080fd5b813561152c81612a3d565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612c3057600080fd5b8435612c3b81612841565b93506020850135612c4b81612841565b925060408501359150606085013567ffffffffffffffff80821115612c6f57600080fd5b818701915087601f830112612c8357600080fd5b813581811115612c9557612c95612c04565b604051601f8201601f19908116603f01168101908382118183101715612cbd57612cbd612c04565b816040528281528a6020848701011115612cd657600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612d0d57600080fd5b8235612d1881612841565b91506020830135612a7981612841565b60208082526010908201526f496e76616c69642064656c656761746560801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612d9057612d90612d68565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b8082028115828204841417610bcb57610bcb612d68565b600082612e1857634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612e2f57600080fd5b5051919050565b600060208284031215612e4857600080fd5b815161152c81612a3d565b600181811c90821680612e6757607f821691505b602082108103612e8757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156109e257600081815260208120601f850160051c81016020861015612eb45750805b601f850160051c820191505b81811015610abb57828155600101612ec0565b67ffffffffffffffff831115612eeb57612eeb612c04565b612eff83612ef98354612e53565b83612e8d565b6000601f841160018114612f335760008515612f1b5750838201355b600019600387901b1c1916600186901b178355610f25565b600083815260209020601f19861690835b82811015612f645786850135825560209485019460019092019101612f44565b5086821015612f815760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000808335601e19843603018112612faa57600080fd5b83018035915067ffffffffffffffff821115612fc557600080fd5b6020019150600581901b3603821315610b3157600080fd5b60208082526027908201527f46656c696e654669656e647a3a206d696e742f6f72646572206578636565647360408201526620737570706c7960c81b606082015260800190565b80820180821115610bcb57610bcb612d68565b6000815461304481612e53565b6001828116801561305c5760018114613071576130a0565b60ff19841687528215158302870194506130a0565b8560005260208060002060005b858110156130975781548a82015290840190820161307e565b50505082870194505b5050505092915050565b60006130b68286613037565b84516130c68183602089016127de565b6130d281830186613037565b979650505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906131a790830184612802565b9695505050505050565b6000602082840312156131c357600080fd5b815161152c816127ab565b81810381811115610bcb57610bcb612d68565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212201b7d8a2b672b2bfc35b90147142ab95a00c21068695725877570f2d5df3b08cf64736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0xAcfA101ECE167F1894150e090d9471aeE2dD3041
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

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