ETH Price: $3,604.72 (+6.03%)

Contract

0xC609596bd470353D1b5Fa6479a1eaC360112BB56
 

Overview

ETH Balance

0.300000000000000001 ETH

Eth Value

$1,081.41 (@ $3,604.72/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint212753582024-11-26 23:57:4728 hrs ago1732665467IN
0xC609596b...60112BB56
0.1 ETH0.001092159.94520055
Set Approval For...212730192024-11-26 16:08:3536 hrs ago1732637315IN
0xC609596b...60112BB56
0 ETH0.0011471418.89456462
Safe Transfer Fr...212618302024-11-25 2:37:233 days ago1732502243IN
0xC609596b...60112BB56
0 ETH0.000711088.53443128
Safe Transfer Fr...212435932024-11-22 13:32:595 days ago1732282379IN
0xC609596b...60112BB56
0 ETH0.0021517125.82846228
Set Approval For...212379272024-11-21 18:34:356 days ago1732214075IN
0xC609596b...60112BB56
0 ETH0.0013511622.25488741
Safe Transfer Fr...211967062024-11-16 0:35:1112 days ago1731717311IN
0xC609596b...60112BB56
0 ETH0.0013510116.21477215
Mint211966902024-11-16 0:31:5912 days ago1731717119IN
0xC609596b...60112BB56
0.1 ETH0.0017758616.17112239
Safe Transfer Fr...211740512024-11-12 20:40:2315 days ago1731444023IN
0xC609596b...60112BB56
0 ETH0.0018710128.25447564
Safe Transfer Fr...211739922024-11-12 20:28:3515 days ago1731443315IN
0xC609596b...60112BB56
0 ETH0.0020633131.15854363
Transfer From211725472024-11-12 15:38:3515 days ago1731425915IN
0xC609596b...60112BB56
0 ETH0.0020803232.99490385
Safe Transfer Fr...211725312024-11-12 15:35:2315 days ago1731425723IN
0xC609596b...60112BB56
0 ETH0.0020694731.25143662
Safe Transfer Fr...211725202024-11-12 15:33:1115 days ago1731425591IN
0xC609596b...60112BB56
0 ETH0.0018308527.64808389
Mint211476242024-11-09 4:11:4719 days ago1731125507IN
0xC609596b...60112BB56
0.1 ETH0.000883588.04598931
Withdraw211382692024-11-07 20:50:3520 days ago1731012635IN
0xC609596b...60112BB56
0 ETH0.0012100618.75431557
Withdraw211382662024-11-07 20:49:5920 days ago1731012599IN
0xC609596b...60112BB56
0 ETH0.0018943219.32550875
Set Approval For...211315532024-11-06 22:20:1121 days ago1730931611IN
0xC609596b...60112BB56
0 ETH0.0010708717.63835561
Safe Transfer Fr...211188782024-11-05 3:51:3523 days ago1730778695IN
0xC609596b...60112BB56
0 ETH0.000438775.26616268
Mint211186062024-11-05 2:56:3523 days ago1730775395IN
0xC609596b...60112BB56
0.1 ETH0.000591935.3902006
Mint211158672024-11-04 17:46:2323 days ago1730742383IN
0xC609596b...60112BB56
0.1 ETH0.000620188.20159662
Mint211120262024-11-04 4:54:5923 days ago1730696099IN
0xC609596b...60112BB56
0.1 ETH0.00044985.94944547
Mint211108752024-11-04 1:03:4724 days ago1730682227IN
0xC609596b...60112BB56
0.1 ETH0.000455874.15124045
Mint211093452024-11-03 19:56:4724 days ago1730663807IN
0xC609596b...60112BB56
0.1 ETH0.000504794.59669681
Mint211085242024-11-03 17:11:4724 days ago1730653907IN
0xC609596b...60112BB56
0.1 ETH0.000361624.78227214
Mint210903832024-11-01 4:23:4727 days ago1730435027IN
0xC609596b...60112BB56
0.1 ETH0.000513776.79556554
Mint210903292024-11-01 4:12:5927 days ago1730434379IN
0xC609596b...60112BB56
0.1 ETH0.000527716.97983999
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
211382662024-11-07 20:49:5920 days ago1731012599
0xC609596b...60112BB56
0.045 ETH
211382662024-11-07 20:49:5920 days ago1731012599
0xC609596b...60112BB56
0.045 ETH
211382662024-11-07 20:49:5920 days ago1731012599
0xC609596b...60112BB56
0.09 ETH
211382662024-11-07 20:49:5920 days ago1731012599
0xC609596b...60112BB56
0.09 ETH
211382662024-11-07 20:49:5920 days ago1731012599
0xC609596b...60112BB56
1.53 ETH
209306092024-10-09 21:04:4749 days ago1728507887
0xC609596b...60112BB56
0.0125 ETH
209306092024-10-09 21:04:4749 days ago1728507887
0xC609596b...60112BB56
0.0125 ETH
209306092024-10-09 21:04:4749 days ago1728507887
0xC609596b...60112BB56
0.025 ETH
209306092024-10-09 21:04:4749 days ago1728507887
0xC609596b...60112BB56
0.025 ETH
209306092024-10-09 21:04:4749 days ago1728507887
0xC609596b...60112BB56
0.425 ETH
207287332024-09-11 17:02:5977 days ago1726074179
0xC609596b...60112BB56
0.065 ETH
207287332024-09-11 17:02:5977 days ago1726074179
0xC609596b...60112BB56
0.065 ETH
207287332024-09-11 17:02:5977 days ago1726074179
0xC609596b...60112BB56
0.13 ETH
207287332024-09-11 17:02:5977 days ago1726074179
0xC609596b...60112BB56
0.13 ETH
207287332024-09-11 17:02:5977 days ago1726074179
0xC609596b...60112BB56
2.21 ETH
204790912024-08-07 20:28:59112 days ago1723062539
0xC609596b...60112BB56
0.0275 ETH
204790912024-08-07 20:28:59112 days ago1723062539
0xC609596b...60112BB56
0.0275 ETH
204790912024-08-07 20:28:59112 days ago1723062539
0xC609596b...60112BB56
0.055 ETH
204790912024-08-07 20:28:59112 days ago1723062539
0xC609596b...60112BB56
0.055 ETH
204790912024-08-07 20:28:59112 days ago1723062539
0xC609596b...60112BB56
0.935 ETH
200632222024-06-10 18:28:59170 days ago1718044139
0xC609596b...60112BB56
0.0425 ETH
200632222024-06-10 18:28:59170 days ago1718044139
0xC609596b...60112BB56
0.0425 ETH
200632222024-06-10 18:28:59170 days ago1718044139
0xC609596b...60112BB56
0.085 ETH
200632222024-06-10 18:28:59170 days ago1718044139
0xC609596b...60112BB56
0.085 ETH
200632222024-06-10 18:28:59170 days ago1718044139
0xC609596b...60112BB56
1.445 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MDD

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 22 : MDD.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@limitbreak/creator-token-contracts/contracts/erc721c/ERC721AC.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@limitbreak/creator-token-contracts/contracts/access/OwnableBasic.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract MDD is ERC721AC, OwnableBasic, ReentrancyGuard {
    event MintSuccess(uint256 tokenId, uint256 amount);

    enum MintType {
        ALLOWLIST,
        PUBLIC
    }

    address public signer = 0x2f2A13462f6d4aF64954ee84641D265932849b64;

    bool public paused = true;

    string public metadata = "ipfs://Qmbe8E6pVtwYxdMWkEDgLbzu9rTqt3Yf8fqe9a8Q6ZqM5t/";

    uint256 constant MAX_SUPPLY = 5000;
    uint256 public maxAllowlist = 1000;

    mapping(MintType => uint256) public mintCost;
    mapping(MintType => uint256) public mintMax;

    mapping(MintType => bool) public mintActive;

    mapping(MintType => mapping(address => uint256)) public typeToWalletMinted;

    bool public isBurnActive = false;

    uint256 public allowlistMinted;

    mapping(uint16 => uint16) public tokenToType;
    mapping(uint16 => bool) public genesisMinted;

    Payments[] public payments;

    address lastSender;

    struct Payments {
        address to;
        uint256 percent;
    }

    constructor() ERC721AC("Megadeth Digital", "MDD") {
        
        mintCost[MintType.ALLOWLIST] = 0.06 ether;
        mintCost[MintType.PUBLIC] = 0.1 ether;

        mintMax[MintType.ALLOWLIST] = 2;
        mintMax[MintType.PUBLIC] = 10;

        mintActive[MintType.ALLOWLIST] = false;
        mintActive[MintType.PUBLIC] = false;

        payments.push(Payments(0x37fBDA81678AC81A6D2c4af662ca5956F2233E6D, 850));
        payments.push(Payments(0xa69B6935B0F38506b81224B4612d7Ea49A4B0aCC, 50));
        payments.push(Payments(0x51fdd7da748EC810c3b3aBF264126AB37b9E5cB6, 50));
        payments.push(Payments(0x34BeE8456e70C91E674Ed1CaacF29d54819153Ff, 25));
        payments.push(Payments(0x051B983476c797D780DAee02f729616a3c92c2bE, 25));

        uint256 basisPoints = 0;

        for (uint i = 0; i < payments.length; i++)
            basisPoints += payments[i].percent;

        require(basisPoints == 1000, "Basis points must equal 1000");
    }

    receive() external payable {}

    function mint(
        address wallet,
        bytes calldata voucher,
        uint256 amount,
        MintType mintType
    ) external payable nonReentrant {
        uint256 costPerMint = mintCost[mintType];
        uint256 maxToMint = mintMax[mintType];

        require(mintActive[mintType], "Mint type not active");

        require(_totalMinted() + amount <= MAX_SUPPLY, "Minted out");

        require(msg.value >= costPerMint * amount, "Ether value sent is not correct");
        require(typeToWalletMinted[mintType][wallet] + amount <= maxToMint, "Too many");

        if (mintType != MintType.PUBLIC) {
            require(allowlistMinted + amount <= maxAllowlist, "Allowlist minted out");

            bytes32 hash = keccak256(abi.encodePacked(wallet));
            require(_verifySignature(signer, hash, voucher), "Invalid voucher");

            allowlistMinted += amount;
        }

        typeToWalletMinted[mintType][wallet] += amount;
        _mint(wallet, amount);

        emit MintSuccess(_totalMinted(), amount);
    }

    function mintAdmin(uint256 amount) external payable nonReentrant onlyOwner {
        require(_totalMinted() + amount <= MAX_SUPPLY, "Minted out");

        _mint(msg.sender, amount);

        emit MintSuccess(_totalMinted(), amount);
    }

    function burn(uint256[] memory tokenIds) public nonReentrant {
        require(isBurnActive);

        for (uint i = 0; i < tokenIds.length; i++) _burn(tokenIds[i], true);
    }

    function _verifySignature(
        address _signer,
        bytes32 _hash,
        bytes memory _signature
    ) internal pure returns (bool) {
        return
            _signer ==
            ECDSA.recover(
                ECDSA.toEthSignedMessageHash(_hash),
                _signature
            );
    }

    function setSigner(address _signer) external onlyOwner {
        signer = _signer;
    }

    function togglePause() external onlyOwner {
        paused = !paused;
    }

    function setMetadata(string memory _metadata) public onlyOwner {
        metadata = _metadata;
    }

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

    function setMintActive(MintType mintType, bool state) public onlyOwner {
        mintActive[mintType] = state;
    }

    function setBurnActive() public onlyOwner {
        isBurnActive = !isBurnActive;
    }

    function setMintCost(MintType mintType, uint256 newCost) public onlyOwner {
        mintCost[mintType] = newCost;
    }

    function setMintMax(MintType mintType, uint256 newMax) public onlyOwner {
        mintMax[mintType] = newMax;
    }

    function updateMaxAllowlist(uint256 newMaxAllowlist) public onlyOwner {
        require(newMaxAllowlist <= MAX_SUPPLY, "New max allowlist must be less than or equal to max supply");
        maxAllowlist = newMaxAllowlist;
    }

    function emergencyWithdraw() public onlyOwner {
        uint256 total = address(this).balance;

        (bool success, ) = payable(owner()).call{value: total}("");
        require(success);
    }

    function withdraw() public onlyOwner {
        uint256 total = address(this).balance;

        for (uint i = 0; i < payments.length; i++)
            _sendETH(payments[i].to, payments[i].percent, total);
    }

    function _sendETH(address to, uint256 percent, uint256 total) internal {
        uint256 toSend = (total * percent) / 1000;

        (bool success, ) = payable(to).call{value: toSend}("");
        require(success);
    }

    function getAmountMintedPerType(
        MintType mintType,
        address _address
    ) public view returns (uint256) {
        return typeToWalletMinted[mintType][_address];
    }

    function setApprovalForAll(
        address operator,
        bool approved
    ) public override(ERC721A) {
        require(!paused, "Contract is paused");
        require(isOperatorWhitelisted(operator), "Operator not whitelisted");

        super.setApprovalForAll(operator, approved);
    }

    function approve(
        address operator,
        uint256 tokenId
    ) public payable override(ERC721A) {
        require(!paused, "Contract is paused");
        require(isOperatorWhitelisted(operator), "Operator not whitelisted");

        super.approve(operator, tokenId);
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable override(ERC721A) {
        require(!paused, "Contract is paused");
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable override(ERC721A) {
        require(!paused, "Contract is paused");
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public payable override(ERC721A) {
        require(!paused, "Contract is paused");
        super.safeTransferFrom(from, to, tokenId, data);
    }

    function tokensOfOwner(address owner) external view returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 2 of 22 : OwnableBasic.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

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

abstract contract OwnableBasic is OwnablePermissions, Ownable {
    function _requireCallerIsContractOwner() internal view virtual override {
        _checkOwner();
    }
}

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

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

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

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

import "../utils/CreatorTokenBase.sol";
import "erc721a/contracts/ERC721A.sol";

/**
 * @title ERC721AC
 * @author Limit Break, Inc.
 * @notice Extends Azuki's ERC721-A 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 ERC721AC is ERC721A, CreatorTokenBase {

    constructor(string memory name_, string memory symbol_) CreatorTokenBase() ERC721A(name_, symbol_) {}

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

    /// @dev Ties the erc721a _beforeTokenTransfers hook to more granular transfer validation logic
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        for (uint256 i = 0; i < quantity;) {
            _validateBeforeTransfer(from, to, startTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the erc721a _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        for (uint256 i = 0; i < quantity;) {
            _validateAfterTransfer(from, to, startTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    function _msgSenderERC721A() internal view virtual override returns (address) {
        return _msgSender();
    }
}

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

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

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

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

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

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

interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    ICreatorTokenTransferValidator private transferValidator;

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

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

        setTransferValidator(validator);

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

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

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

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

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

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

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

        bool isValidTransferValidator = false;

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

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

        emit TransferValidatorUpdated(address(transferValidator), transferValidator_);

        transferValidator = ICreatorTokenTransferValidator(transferValidator_);
    }

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

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

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

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

        return new address[](0);
    }

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

        return new address[](0);
    }

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

        return false;
    }

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

        return false;
    }

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

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

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

enum AllowlistTypes {
    Operators,
    PermittedContractReceivers
}

enum ReceiverConstraints {
    None,
    NoCode,
    EOA
}

enum CallerConstraints {
    None,
    OperatorWhitelistEnableOTC,
    OperatorWhitelistDisableOTC
}

enum StakerConstraints {
    None,
    CallerIsTxOrigin,
    EOA
}

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

struct TransferSecurityPolicy {
    CallerConstraints callerConstraints;
    ReceiverConstraints receiverConstraints;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 13 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

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

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

pragma solidity ^0.8.0;

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

File 15 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 17 of 22 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

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

File 19 of 22 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 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 10, 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 * 8) < value ? 1 : 0);
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.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 `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);
    }
}

File 21 of 22 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

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

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

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

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

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

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

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

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

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

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @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. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

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

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

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

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

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

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

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

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

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

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

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

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

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

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

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 22 of 22 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

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

    /**
     * @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 payable;

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"CreatorTokenBase__SetTransferValidatorFirst","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintSuccess","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"},{"inputs":[],"name":"DEFAULT_OPERATOR_WHITELIST_ID","outputs":[{"internalType":"uint120","name":"","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_SECURITY_LEVEL","outputs":[{"internalType":"enum TransferSecurityLevels","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"genesisMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"mintType","type":"uint8"},{"internalType":"address","name":"_address","type":"address"}],"name":"getAmountMintedPerType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPermittedContractReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecurityPolicy","outputs":[{"components":[{"internalType":"enum TransferSecurityLevels","name":"transferSecurityLevel","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversId","type":"uint120"}],"internalType":"struct CollectionSecurityPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBurnActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"isContractReceiverPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperatorWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAllowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadata","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes","name":"voucher","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum MDD.MintType","name":"mintType","type":"uint8"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"","type":"uint8"}],"name":"mintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintAdmin","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"","type":"uint8"}],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"","type":"uint8"}],"name":"mintMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payments","outputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setBurnActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_metadata","type":"string"}],"name":"setMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"mintType","type":"uint8"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setMintActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"mintType","type":"uint8"},{"internalType":"uint256","name":"newCost","type":"uint256"}],"name":"setMintCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"mintType","type":"uint8"},{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMintMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomValidatorAndSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToDefaultSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"togglePause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"tokenToType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MDD.MintType","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"name":"typeToWalletMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxAllowlist","type":"uint256"}],"name":"updateMaxAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

600b80546001600160a81b03191674012f2a13462f6d4af64954ee84641d265932849b6417905560e060405260366080818152906200444460a03980516200005091600c91602090910190620004e0565b506103e8600d556012805460ff191690553480156200006e57600080fd5b50604080518082018252601081526f135959d859195d1a08111a59da5d185b60821b60208083019182528351808501909452600384526213511160ea1b90840152815191929183918391620000c691600291620004e0565b508051620000dc906003906020840190620004e0565b50506000805550620000f291503390506200048e565b6001600a81815566d529ae9e8600007fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5567016345785d8a00007fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582075560027ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec3758190557f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f91909155601060209081527f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb01805460ff199081169091557f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b5f805490911690556040805180820182527337fbda81678ac81a6d2c4af662ca5956f2233e6d8152610352818401908152601680548088018255600082815293517fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428991880282810180546001600160a01b03199081166001600160a01b039485161790915594517fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428a918201558651808801885273a69b6935b0f38506b81224b4612d7ea49a4b0acc81526032818a018181528654808e018855878a529251928c0280870180548a16948716949094179093555191830191909155875180890189527351fdd7da748ec810c3b3abf264126ab37b9e5cb68152808a019182528554808d0187558689529051908b028086018054891692861692909217909155905190820155865180880188527334bee8456e70c91e674ed1caacf29d54819153ff81526019818a018181528654808e018855878a529251928c0280870180548a16948716949094179093555191830191909155875180890190985273051b983476c797d780daee02f729616a3c92c2be88529787019788528354998a018455928552945197909602958601805490921696909316959095179094559051910155805b601654811015620004305760168181548110620003fa57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060020201600101548262000419919062000586565b9150806200042781620005de565b915050620003cd565b50806103e814620004875760405162461bcd60e51b815260206004820152601c60248201527f426173697320706f696e7473206d75737420657175616c203130303000000000604482015260640160405180910390fd5b5062000612565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620004ee90620005a1565b90600052602060002090601f0160209004810192826200051257600085556200055d565b82601f106200052d57805160ff19168380011785556200055d565b828001600101855582156200055d579182015b828111156200055d57825182559160200191906001019062000540565b506200056b9291506200056f565b5090565b5b808211156200056b576000815560010162000570565b600082198211156200059c576200059c620005fc565b500190565b600181811c90821680620005b657607f821691505b60208210811415620005d857634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415620005f557620005f5620005fc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b613e2280620006226000396000f3fe6080604052600436106103905760003560e01c8063715018a6116101dc578063b42fa82011610102578063c87b56dd116100a0578063e985e9c51161006f578063e985e9c514610a8d578063f22fb1d314610ad6578063f2fde38b14610b06578063fd762d9214610b2657600080fd5b8063c87b56dd14610a2e578063d007af5c14610a4e578063d20f2b4814610a63578063db2e21bc14610a7857600080fd5b8063bd96237d116100dc578063bd96237d146109aa578063be537f43146109d7578063c4ae3168146109f9578063c4be715314610a0e57600080fd5b8063b42fa82014610961578063b80f55c914610977578063b88d4fde1461099757600080fd5b806397a08fab1161017a578063a3f5809a11610149578063a3f5809a146108f4578063a49a1e7d14610907578063a9fc664e14610927578063b1a6676e1461094757600080fd5b806397a08fab146108645780639d645a4414610894578063a22cb465146108b4578063a28cd752146108d457600080fd5b806387d81789116101b657806387d81789146107ae5780638da5cb5b146107ed578063909401151461080b57806395d89b411461084f57600080fd5b8063715018a61461073457806377cee13b146107495780638462151c1461078157600080fd5b8063392f37e9116102c15780635d4914921161025f578063677ab70b1161022e578063677ab70b146106cc5780636c19e783146106df5780636c3b8699146106ff57806370a082311461071457600080fd5b80635d491492146106325780635d4c1d461461065f578063613471621461068c5780636352211e146106ac57600080fd5b8063495c8bf91161029b578063495c8bf9146105af5780635314da4e146105d15780635398fb80146105f15780635c975abb1461061157600080fd5b8063392f37e9146105725780633ccfd60b1461058757806342842e0e1461059c57600080fd5b80631b25b0771161032e57806323b872dd1161030857806323b872dd146105095780632e8da8291461051c57806332c8d9321461053c57806332d6f0321461055c57600080fd5b80631b25b077146104a75780631c33b328146104c7578063238ac933146104e957600080fd5b8063081812fc1161036a578063081812fc14610431578063095ea7b314610451578063098144d41461046657806318160ddd1461048457600080fd5b8063014635461461039c57806301ffc9a7146103df57806306fdde031461040f57600080fd5b3661039757005b600080fd5b3480156103a857600080fd5b506103c271721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103eb57600080fd5b506103ff6103fa366004613849565b610b46565b60405190151581526020016103d6565b34801561041b57600080fd5b50610424610b71565b6040516103d69190613b9c565b34801561043d57600080fd5b506103c261044c366004613a04565b610c03565b61046461045f3660046136da565b610c47565b005b34801561047257600080fd5b506008546001600160a01b03166103c2565b34801561049057600080fd5b50600154600054035b6040519081526020016103d6565b3480156104b357600080fd5b506103ff6104c23660046134b0565b610cd8565b3480156104d357600080fd5b506104dc600181565b6040516103d69190613b8e565b3480156104f557600080fd5b50600b546103c2906001600160a01b031681565b6104646105173660046134fa565b610d71565b34801561052857600080fd5b506103ff61053736600461345c565b610dab565b34801561054857600080fd5b50610464610557366004613a04565b610ed5565b34801561056857600080fd5b5061049960135481565b34801561057e57600080fd5b50610424610f5a565b34801561059357600080fd5b50610464610fe8565b6104646105aa3660046134fa565b61108b565b3480156105bb57600080fd5b506105c46110c0565b6040516103d69190613b15565b3480156105dd57600080fd5b506104646105ec3660046138b6565b6111ef565b3480156105fd57600080fd5b5061046461060c3660046138d1565b61125e565b34801561061d57600080fd5b50600b546103ff90600160a01b900460ff1681565b34801561063e57600080fd5b5061049961064d366004613881565b600f6020526000908152604090205481565b34801561066b57600080fd5b50610674600181565b6040516001600160781b0390911681526020016103d6565b34801561069857600080fd5b506104646106a73660046138ec565b6112bf565b3480156106b857600080fd5b506103c26106c7366004613a04565b61142a565b6104646106da366004613a04565b611435565b3480156106eb57600080fd5b506104646106fa36600461345c565b6114ef565b34801561070b57600080fd5b50610464611519565b34801561072057600080fd5b5061049961072f36600461345c565b611612565b34801561074057600080fd5b50610464611661565b34801561075557600080fd5b5061049961076436600461389b565b601160209081526000928352604080842090915290825290205481565b34801561078d57600080fd5b506107a161079c36600461345c565b611675565b6040516103d69190613b56565b3480156107ba57600080fd5b506107ce6107c9366004613a04565b6117a1565b604080516001600160a01b0390931683526020830191909152016103d6565b3480156107f957600080fd5b506009546001600160a01b03166103c2565b34801561081757600080fd5b5061083c6108263660046139e2565b60146020526000908152604090205461ffff1681565b60405161ffff90911681526020016103d6565b34801561085b57600080fd5b506104246117d9565b34801561087057600080fd5b506103ff61087f3660046139e2565b60156020526000908152604090205460ff1681565b3480156108a057600080fd5b506103ff6108af36600461345c565b6117e8565b3480156108c057600080fd5b506104646108cf3660046135b7565b6118bf565b3480156108e057600080fd5b506104996108ef36600461389b565b611943565b6104646109023660046135e4565b6119c2565b34801561091357600080fd5b5061046461092236600461392b565b611eb5565b34801561093357600080fd5b5061046461094236600461345c565b611ed0565b34801561095357600080fd5b506012546103ff9060ff1681565b34801561096d57600080fd5b50610499600d5481565b34801561098357600080fd5b506104646109923660046137a6565b612004565b6104646109a536600461353a565b612076565b3480156109b657600080fd5b506104996109c5366004613881565b600e6020526000908152604090205481565b3480156109e357600080fd5b506109ec6120ac565b6040516103d69190613bdb565b348015610a0557600080fd5b50610464612176565b348015610a1a57600080fd5b50610464610a293660046138d1565b61219f565b348015610a3a57600080fd5b50610424610a49366004613a04565b6121cc565b348015610a5a57600080fd5b506105c4612250565b348015610a6f57600080fd5b50610464612318565b348015610a8457600080fd5b50610464612334565b348015610a9957600080fd5b506103ff610aa8366004613478565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610ae257600080fd5b506103ff610af1366004613881565b60106020526000908152604090205460ff1681565b348015610b1257600080fd5b50610464610b2136600461345c565b6123ae565b348015610b3257600080fd5b50610464610b4136600461367f565b612424565b60006001600160e01b031982166310c8aba560e31b1480610b6b5750610b6b82612523565b92915050565b606060028054610b8090613cef565b80601f0160208091040260200160405190810160405280929190818152602001828054610bac90613cef565b8015610bf95780601f10610bce57610100808354040283529160200191610bf9565b820191906000526020600020905b815481529060010190602001808311610bdc57829003601f168201915b5050505050905090565b6000610c0e82612571565b610c2b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600b54600160a01b900460ff1615610c7a5760405162461bcd60e51b8152600401610c7190613baf565b60405180910390fd5b610c8382610dab565b610cca5760405162461bcd60e51b815260206004820152601860248201527713dc195c985d1bdc881b9bdd081dda1a5d195b1a5cdd195960421b6044820152606401610c71565b610cd48282612598565b5050565b6008546000906001600160a01b031615610d665760085460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015610d4157600080fd5b505afa925050508015610d52575060015b610d5e57506000610d6a565b506001610d6a565b5060015b9392505050565b600b54600160a01b900460ff1615610d9b5760405162461bcd60e51b8152600401610c7190613baf565b610da6838383612638565b505050565b6008546000906001600160a01b031615610ecd57600854604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b95545529060240160606040518083038186803b158015610e0a57600080fd5b505afa158015610e1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e429190613971565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b60206040518083038186803b158015610e9557600080fd5b505afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b919061382d565b506000919050565b610edd6127db565b611388811115610f555760405162461bcd60e51b815260206004820152603a60248201527f4e6577206d617820616c6c6f776c697374206d757374206265206c657373207460448201527f68616e206f7220657175616c20746f206d617820737570706c790000000000006064820152608401610c71565b600d55565b600c8054610f6790613cef565b80601f0160208091040260200160405190810160405280929190818152602001828054610f9390613cef565b8015610fe05780601f10610fb557610100808354040283529160200191610fe0565b820191906000526020600020905b815481529060010190602001808311610fc357829003601f168201915b505050505081565b610ff06127db565b4760005b601654811015610cd4576110796016828154811061102257634e487b7160e01b600052603260045260246000fd5b6000918252602090912060029091020154601680546001600160a01b03909216918490811061106157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600202016001015484612835565b8061108381613d2a565b915050610ff4565b600b54600160a01b900460ff16156110b55760405162461bcd60e51b8152600401610c7190613baf565b610da68383836128b0565b6008546060906001600160a01b0316156111dc57600854604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b95545529060240160606040518083038186803b15801561111f57600080fd5b505afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111579190613971565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b60006040518083038186803b15801561119b57600080fd5b505afa1580156111af573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d79190810190613705565b905090565b5060408051600081526020810190915290565b6111f76127db565b806010600084600181111561121c57634e487b7160e01b600052602160045260246000fd5b600181111561123b57634e487b7160e01b600052602160045260246000fd5b81526020810191909152604001600020805460ff19169115159190911790555050565b6112666127db565b80600f600084600181111561128b57634e487b7160e01b600052602160045260246000fd5b60018111156112aa57634e487b7160e01b600052602160045260246000fd5b81526020810191909152604001600020555050565b6112c76128cb565b60006112db6008546001600160a01b031690565b90506001600160a01b03811661130457604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c0906113329030908890600401613ad6565b600060405180830381600087803b15801561134c57600080fd5b505af1158015611360573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa0291506113929030908790600401613af3565b600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0384169250638d74431491506113f29030908690600401613af3565b600060405180830381600087803b15801561140c57600080fd5b505af1158015611420573d6000803e3d6000fd5b5050505050505050565b6000610b6b826128d3565b61143d612934565b6114456127db565b6113888161145260005490565b61145c9190613c6c565b11156114975760405162461bcd60e51b815260206004820152600a602482015269135a5b9d1959081bdd5d60b21b6044820152606401610c71565b6114a1338261298e565b7fd9ed5ae93233f5e89d74172aa9d0292dd5433f058dd14695c51bf9c80e5d46056114cb60005490565b60408051918252602082018490520160405180910390a16114ec6001600a55565b50565b6114f76127db565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6115216128cb565b61153c71721c310194ccfc01e523fc93c9cccfa2a0ac611ed0565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090611574903090600190600401613ad6565b600060405180830381600087803b15801561158e57600080fd5b505af11580156115a2573d6000803e3d6000fd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa0291506115de903090600190600401613af3565b600060405180830381600087803b1580156115f857600080fd5b505af115801561160c573d6000803e3d6000fd5b50505050565b60006001600160a01b03821661163b576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6116696127db565b6116736000612a77565b565b6060600080600061168585611612565b905060008167ffffffffffffffff8111156116b057634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116d9578160200160208202803683370190505b50905061170660408051608081018252600080825260208201819052918101829052606081019190915290565b60005b8386146117955761171981612ac9565b915081604001511561172a5761178d565b81516001600160a01b03161561173f57815194505b876001600160a01b0316856001600160a01b0316141561178d578083878060010198508151811061178057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101611709565b50909695505050505050565b601681815481106117b157600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b606060038054610b8090613cef565b6008546000906001600160a01b031615610ecd57600854604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b95545529060240160606040518083038186803b15801561184757600080fd5b505afa15801561185b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187f9190613971565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401610e7d565b600b54600160a01b900460ff16156118e95760405162461bcd60e51b8152600401610c7190613baf565b6118f282610dab565b6119395760405162461bcd60e51b815260206004820152601860248201527713dc195c985d1bdc881b9bdd081dda1a5d195b1a5cdd195960421b6044820152606401610c71565b610cd48282612b48565b60006011600084600181111561196957634e487b7160e01b600052602160045260246000fd5b600181111561198857634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000206000836001600160a01b03166001600160a01b0316815260200190815260200160002054905092915050565b6119ca612934565b6000600e60008360018111156119f057634e487b7160e01b600052602160045260246000fd5b6001811115611a0f57634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000205490506000600f6000846001811115611a4657634e487b7160e01b600052602160045260246000fd5b6001811115611a6557634e487b7160e01b600052602160045260246000fd5b815260200190815260200160002054905060106000846001811115611a9a57634e487b7160e01b600052602160045260246000fd5b6001811115611ab957634e487b7160e01b600052602160045260246000fd5b815260208101919091526040016000205460ff16611b105760405162461bcd60e51b81526020600482015260146024820152734d696e742074797065206e6f742061637469766560601b6044820152606401610c71565b61138884611b1d60005490565b611b279190613c6c565b1115611b625760405162461bcd60e51b815260206004820152600a602482015269135a5b9d1959081bdd5d60b21b6044820152606401610c71565b611b6c8483613ca4565b341015611bbb5760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610c71565b808460116000866001811115611be157634e487b7160e01b600052602160045260246000fd5b6001811115611c0057634e487b7160e01b600052602160045260246000fd5b815260200190815260200160002060008a6001600160a01b03166001600160a01b0316815260200190815260200160002054611c3c9190613c6c565b1115611c755760405162461bcd60e51b8152602060048201526008602482015267546f6f206d616e7960c01b6044820152606401610c71565b6001836001811115611c9757634e487b7160e01b600052602160045260246000fd5b14611dcd57600d5484601354611cad9190613c6c565b1115611cf25760405162461bcd60e51b8152602060048201526014602482015273105b1b1bdddb1a5cdd081b5a5b9d1959081bdd5d60621b6044820152606401610c71565b6040516bffffffffffffffffffffffff19606089901b16602082015260009060340160408051601f198184030181528282528051602091820120600b54601f8b018390048302850183019093528984529350611d76926001600160a01b039092169184918b908b9081908401838280828437600092019190915250612bc192505050565b611db45760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b2103b37bab1b432b960891b6044820152606401610c71565b8460136000828254611dc69190613c6c565b9091555050505b8360116000856001811115611df257634e487b7160e01b600052602160045260246000fd5b6001811115611e1157634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000206000896001600160a01b03166001600160a01b031681526020019081526020016000206000828254611e519190613c6c565b90915550611e619050878561298e565b7fd9ed5ae93233f5e89d74172aa9d0292dd5433f058dd14695c51bf9c80e5d4605611e8b60005490565b60408051918252602082018790520160405180910390a15050611eae6001600a55565b5050505050565b611ebd6127db565b8051610cd490600c906020840190613357565b611ed86128cb565b60006001600160a01b0382163b15611f66576040516301ffc9a760e01b8152600060048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015611f2a57600080fd5b505afa925050508015611f5a575060408051601f3d908101601f19168201909252611f579181019061382d565b60015b611f6357611f66565b90505b6001600160a01b03821615801590611f7c575080155b15611f9a576040516332483afb60e01b815260040160405180910390fd5b600854604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600880546001600160a01b0319166001600160a01b0392909216919091179055565b61200c612934565b60125460ff1661201b57600080fd5b60005b815181101561206b5761205982828151811061204a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001612c40565b8061206381613d2a565b91505061201e565b506114ec6001600a55565b600b54600160a01b900460ff16156120a05760405162461bcd60e51b8152600401610c7190613baf565b61160c84848484612d8d565b60408051606081018252600080825260208201819052918101919091526008546001600160a01b03161561215557600854604051635caaa2a960e11b81523060048201526001600160a01b039091169063b95545529060240160606040518083038186803b15801561211d57600080fd5b505afa158015612131573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d79190613971565b50604080516060810182526000808252602082018190529181019190915290565b61217e6127db565b600b805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6121a76127db565b80600e600084600181111561128b57634e487b7160e01b600052602160045260246000fd5b60606121d782612571565b6121f457604051630a14c4b560e41b815260040160405180910390fd5b60006121fe612dd1565b905080516000141561221f5760405180602001604052806000815250610d6a565b8061222984612de0565b60405160200161223a929190613a6a565b6040516020818303038152906040529392505050565b6008546060906001600160a01b0316156111dc57600854604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b95545529060240160606040518083038186803b1580156122af57600080fd5b505afa1580156122c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e79190613971565b60409081015190516001600160e01b031960e084901b1681526001600160781b039091166004820152602401611183565b6123206127db565b6012805460ff19811660ff90911615179055565b61233c6127db565b4760006123516009546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d806000811461239b576040519150601f19603f3d011682016040523d82523d6000602084013e6123a0565b606091505b5050905080610cd457600080fd5b6123b66127db565b6001600160a01b03811661241b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c71565b6114ec81612a77565b61242c6128cb565b61243584611ed0565b604051630368065360e61b81526001600160a01b0385169063da0194c0906124639030908790600401613ad6565b600060405180830381600087803b15801561247d57600080fd5b505af1158015612491573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa0291506124c39030908690600401613af3565b600060405180830381600087803b1580156124dd57600080fd5b505af11580156124f1573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0387169250638d74431491506113f29030908590600401613af3565b60006301ffc9a760e01b6001600160e01b03198316148061255457506380ac58cd60e01b6001600160e01b03198316145b80610b6b5750506001600160e01b031916635b5e139f60e01b1490565b6000805482108015610b6b575050600090815260046020526040902054600160e01b161590565b60006125a38261142a565b9050336001600160a01b038216146125dc576125bf8133610aa8565b6125dc576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000612643826128d3565b9050836001600160a01b0316816001600160a01b0316146126765760405162a1148160e81b815260040160405180910390fd5b600082815260066020526040902080546126a28187335b6001600160a01b039081169116811491141790565b6126cd576126b08633610aa8565b6126cd57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166126f457604051633a954ecd60e21b815260040160405180910390fd5b6127018686866001612e2e565b801561270c57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b831661279757600184016000818152600460205260409020546127955760005481146127955760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613dcd83398151915260405160405180910390a46127d38686866001612e55565b505050505050565b6009546001600160a01b031633146116735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c71565b60006103e86128448484613ca4565b61284e9190613c84565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d806000811461289d576040519150601f19603f3d011682016040523d82523d6000602084013e6128a2565b606091505b5050905080611eae57600080fd5b610da683838360405180602001604052806000815250612076565b6116736127db565b60008160005481101561291b57600081815260046020526040902054600160e01b8116612919575b80610d6a5750600019016000818152600460205260409020546128fb565b505b604051636f96cda160e11b815260040160405180910390fd5b6002600a5414156129875760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c71565b6002600a55565b600054816129af5760405163b562e8dd60e01b815260040160405180910390fd5b6129bc6000848385612e2e565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020613dcd8339815191528180a4600183015b818114612a475780836000600080516020613dcd833981519152600080a4600101612a21565b5081612a6557604051622e076360e81b815260040160405180910390fd5b6000908155610da69150848385612e55565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260046020526040902054610b6b90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612bb5911515815260200190565b60405180910390a35050565b6000612c23612c1d846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b83612e7c565b6001600160a01b0316846001600160a01b03161490509392505050565b6000612c4b836128d3565b905080600080612c6986600090815260066020526040902080549091565b915091508415612ca957612c7e81843361268d565b612ca957612c8c8333610aa8565b612ca957604051632ce44b5f60e11b815260040160405180910390fd5b612cb7836000886001612e2e565b8015612cc257600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040902055600160e11b8416612d495760018601600081815260046020526040902054612d47576000548114612d475760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613dcd833981519152908390a4612d7d836000886001612e55565b5050600180548101905550505050565b612d98848484610d71565b6001600160a01b0383163b1561160c57612db484848484612ea0565b61160c576040516368d2bf6b60e11b815260040160405180910390fd5b6060600c8054610b8090613cef565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612e1757612e1c565b612dfa565b50819003601f19909101908152919050565b60005b81811015611eae57612e4d8585612e488487613c6c565b612f98565b600101612e31565b60005b81811015611eae57612e748585612e6f8487613c6c565b612ff4565b600101612e58565b6000806000612e8b8585613042565b91509150612e9881613088565b509392505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612ed5903390899088908890600401613a99565b602060405180830381600087803b158015612eef57600080fd5b505af1925050508015612f1f575060408051601f3d908101601f19168201909252612f1c91810190613865565b60015b612f7a573d808015612f4d576040519150601f19603f3d011682016040523d82523d6000602084013e612f52565b606091505b508051612f72576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6001600160a01b038381161590831615818015612fb25750805b15612fd057604051635cbd944160e01b815260040160405180910390fd5b8115612fdc575b611eae565b8015612fe757612fd7565b611eae338686863461320e565b6001600160a01b03838116159083161581801561300e5750805b1561302c57604051635cbd944160e01b815260040160405180910390fd5b811561303757612fd7565b8015612fd757612fd7565b6000808251604114156130795760208301516040840151606085015160001a61306d87828585613293565b94509450505050613081565b506000905060025b9250929050565b60008160048111156130aa57634e487b7160e01b600052602160045260246000fd5b14156130b35750565b60018160048111156130d557634e487b7160e01b600052602160045260246000fd5b14156131235760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c71565b600281600481111561314557634e487b7160e01b600052602160045260246000fd5b14156131935760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c71565b60038160048111156131b557634e487b7160e01b600052602160045260246000fd5b14156114ec5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c71565b6008546001600160a01b031615611eae5760085460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b15801561327457600080fd5b505afa158015613288573d6000803e3d6000fd5b505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ca575060009050600361334e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561331e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166133475760006001925092505061334e565b9150600090505b94509492505050565b82805461336390613cef565b90600052602060002090601f01602090048101928261338557600085556133cb565b82601f1061339e57805160ff19168380011785556133cb565b828001600101855582156133cb579182015b828111156133cb5782518255916020019190600101906133b0565b506133d79291506133db565b5090565b5b808211156133d757600081556001016133dc565b600067ffffffffffffffff83111561340a5761340a613d5b565b61341d601f8401601f1916602001613c17565b905082815283838301111561343157600080fd5b828260208301376000602084830101529392505050565b80356002811061345757600080fd5b919050565b60006020828403121561346d578081fd5b8135610d6a81613d71565b6000806040838503121561348a578081fd5b823561349581613d71565b915060208301356134a581613d71565b809150509250929050565b6000806000606084860312156134c4578081fd5b83356134cf81613d71565b925060208401356134df81613d71565b915060408401356134ef81613d71565b809150509250925092565b60008060006060848603121561350e578283fd5b833561351981613d71565b9250602084013561352981613d71565b929592945050506040919091013590565b6000806000806080858703121561354f578182fd5b843561355a81613d71565b9350602085013561356a81613d71565b925060408501359150606085013567ffffffffffffffff81111561358c578182fd5b8501601f8101871361359c578182fd5b6135ab878235602084016133f0565b91505092959194509250565b600080604083850312156135c9578182fd5b82356135d481613d71565b915060208301356134a581613d86565b6000806000806000608086880312156135fb578283fd5b853561360681613d71565b9450602086013567ffffffffffffffff80821115613622578485fd5b818801915088601f830112613635578485fd5b813581811115613643578586fd5b896020828501011115613654578586fd5b6020830196508095505050506040860135915061367360608701613448565b90509295509295909350565b60008060008060808587031215613694578182fd5b843561369f81613d71565b935060208501356136af81613daa565b925060408501356136bf81613db7565b915060608501356136cf81613db7565b939692955090935050565b600080604083850312156136ec578182fd5b82356136f781613d71565b946020939093013593505050565b60006020808385031215613717578182fd5b825167ffffffffffffffff81111561372d578283fd5b8301601f8101851361373d578283fd5b805161375061374b82613c48565b613c17565b80828252848201915084840188868560051b870101111561376f578687fd5b8694505b8385101561379a57805161378681613d71565b835260019490940193918501918501613773565b50979650505050505050565b600060208083850312156137b8578182fd5b823567ffffffffffffffff8111156137ce578283fd5b8301601f810185136137de578283fd5b80356137ec61374b82613c48565b80828252848201915084840188868560051b870101111561380b578687fd5b8694505b8385101561379a57803583526001949094019391850191850161380f565b60006020828403121561383e578081fd5b8151610d6a81613d86565b60006020828403121561385a578081fd5b8135610d6a81613d94565b600060208284031215613876578081fd5b8151610d6a81613d94565b600060208284031215613892578081fd5b610d6a82613448565b600080604083850312156138ad578182fd5b61349583613448565b600080604083850312156138c8578182fd5b6135d483613448565b600080604083850312156138e3578182fd5b6136f783613448565b600080600060608486031215613900578081fd5b833561390b81613daa565b9250602084013561391b81613db7565b915060408401356134ef81613db7565b60006020828403121561393c578081fd5b813567ffffffffffffffff811115613952578182fd5b8201601f81018413613962578182fd5b612f90848235602084016133f0565b600060608284031215613982578081fd5b6040516060810181811067ffffffffffffffff821117156139a5576139a5613d5b565b60405282516139b381613daa565b815260208301516139c381613db7565b602082015260408301516139d681613db7565b60408201529392505050565b6000602082840312156139f3578081fd5b813561ffff81168114610d6a578182fd5b600060208284031215613a15578081fd5b5035919050565b60008151808452613a34816020860160208601613cc3565b601f01601f19169290920160200192915050565b60078110613a6657634e487b7160e01b600052602160045260246000fd5b9052565b60008351613a7c818460208801613cc3565b835190830190613a90818360208801613cc3565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613acc90830184613a1c565b9695505050505050565b6001600160a01b038316815260408101610d6a6020830184613a48565b6001600160a01b039290921682526001600160781b0316602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156117955783516001600160a01b031683529284019291840191600101613b31565b6020808252825182820181905260009190848201906040850190845b8181101561179557835183529284019291840191600101613b72565b60208101610b6b8284613a48565b602081526000610d6a6020830184613a1c565b60208082526012908201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b604082015260600190565b6000606082019050613bee828451613a48565b60208301516001600160781b038082166020850152806040860151166040850152505092915050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613c4057613c40613d5b565b604052919050565b600067ffffffffffffffff821115613c6257613c62613d5b565b5060051b60200190565b60008219821115613c7f57613c7f613d45565b500190565b600082613c9f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613cbe57613cbe613d45565b500290565b60005b83811015613cde578181015183820152602001613cc6565b8381111561160c5750506000910152565b600181811c90821680613d0357607f821691505b60208210811415613d2457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613d3e57613d3e613d45565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114ec57600080fd5b80151581146114ec57600080fd5b6001600160e01b0319811681146114ec57600080fd5b600781106114ec57600080fd5b6001600160781b03811681146114ec57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ef2e858a9fb7ad87277ffb8be7dc8a04d08e8f49bd1a0162b678432e77a30a1364736f6c63430008040033697066733a2f2f516d6265384536705674775978644d576b4544674c627a7539725471743359663866716539613851365a714d35742f

Deployed Bytecode

0x6080604052600436106103905760003560e01c8063715018a6116101dc578063b42fa82011610102578063c87b56dd116100a0578063e985e9c51161006f578063e985e9c514610a8d578063f22fb1d314610ad6578063f2fde38b14610b06578063fd762d9214610b2657600080fd5b8063c87b56dd14610a2e578063d007af5c14610a4e578063d20f2b4814610a63578063db2e21bc14610a7857600080fd5b8063bd96237d116100dc578063bd96237d146109aa578063be537f43146109d7578063c4ae3168146109f9578063c4be715314610a0e57600080fd5b8063b42fa82014610961578063b80f55c914610977578063b88d4fde1461099757600080fd5b806397a08fab1161017a578063a3f5809a11610149578063a3f5809a146108f4578063a49a1e7d14610907578063a9fc664e14610927578063b1a6676e1461094757600080fd5b806397a08fab146108645780639d645a4414610894578063a22cb465146108b4578063a28cd752146108d457600080fd5b806387d81789116101b657806387d81789146107ae5780638da5cb5b146107ed578063909401151461080b57806395d89b411461084f57600080fd5b8063715018a61461073457806377cee13b146107495780638462151c1461078157600080fd5b8063392f37e9116102c15780635d4914921161025f578063677ab70b1161022e578063677ab70b146106cc5780636c19e783146106df5780636c3b8699146106ff57806370a082311461071457600080fd5b80635d491492146106325780635d4c1d461461065f578063613471621461068c5780636352211e146106ac57600080fd5b8063495c8bf91161029b578063495c8bf9146105af5780635314da4e146105d15780635398fb80146105f15780635c975abb1461061157600080fd5b8063392f37e9146105725780633ccfd60b1461058757806342842e0e1461059c57600080fd5b80631b25b0771161032e57806323b872dd1161030857806323b872dd146105095780632e8da8291461051c57806332c8d9321461053c57806332d6f0321461055c57600080fd5b80631b25b077146104a75780631c33b328146104c7578063238ac933146104e957600080fd5b8063081812fc1161036a578063081812fc14610431578063095ea7b314610451578063098144d41461046657806318160ddd1461048457600080fd5b8063014635461461039c57806301ffc9a7146103df57806306fdde031461040f57600080fd5b3661039757005b600080fd5b3480156103a857600080fd5b506103c271721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103eb57600080fd5b506103ff6103fa366004613849565b610b46565b60405190151581526020016103d6565b34801561041b57600080fd5b50610424610b71565b6040516103d69190613b9c565b34801561043d57600080fd5b506103c261044c366004613a04565b610c03565b61046461045f3660046136da565b610c47565b005b34801561047257600080fd5b506008546001600160a01b03166103c2565b34801561049057600080fd5b50600154600054035b6040519081526020016103d6565b3480156104b357600080fd5b506103ff6104c23660046134b0565b610cd8565b3480156104d357600080fd5b506104dc600181565b6040516103d69190613b8e565b3480156104f557600080fd5b50600b546103c2906001600160a01b031681565b6104646105173660046134fa565b610d71565b34801561052857600080fd5b506103ff61053736600461345c565b610dab565b34801561054857600080fd5b50610464610557366004613a04565b610ed5565b34801561056857600080fd5b5061049960135481565b34801561057e57600080fd5b50610424610f5a565b34801561059357600080fd5b50610464610fe8565b6104646105aa3660046134fa565b61108b565b3480156105bb57600080fd5b506105c46110c0565b6040516103d69190613b15565b3480156105dd57600080fd5b506104646105ec3660046138b6565b6111ef565b3480156105fd57600080fd5b5061046461060c3660046138d1565b61125e565b34801561061d57600080fd5b50600b546103ff90600160a01b900460ff1681565b34801561063e57600080fd5b5061049961064d366004613881565b600f6020526000908152604090205481565b34801561066b57600080fd5b50610674600181565b6040516001600160781b0390911681526020016103d6565b34801561069857600080fd5b506104646106a73660046138ec565b6112bf565b3480156106b857600080fd5b506103c26106c7366004613a04565b61142a565b6104646106da366004613a04565b611435565b3480156106eb57600080fd5b506104646106fa36600461345c565b6114ef565b34801561070b57600080fd5b50610464611519565b34801561072057600080fd5b5061049961072f36600461345c565b611612565b34801561074057600080fd5b50610464611661565b34801561075557600080fd5b5061049961076436600461389b565b601160209081526000928352604080842090915290825290205481565b34801561078d57600080fd5b506107a161079c36600461345c565b611675565b6040516103d69190613b56565b3480156107ba57600080fd5b506107ce6107c9366004613a04565b6117a1565b604080516001600160a01b0390931683526020830191909152016103d6565b3480156107f957600080fd5b506009546001600160a01b03166103c2565b34801561081757600080fd5b5061083c6108263660046139e2565b60146020526000908152604090205461ffff1681565b60405161ffff90911681526020016103d6565b34801561085b57600080fd5b506104246117d9565b34801561087057600080fd5b506103ff61087f3660046139e2565b60156020526000908152604090205460ff1681565b3480156108a057600080fd5b506103ff6108af36600461345c565b6117e8565b3480156108c057600080fd5b506104646108cf3660046135b7565b6118bf565b3480156108e057600080fd5b506104996108ef36600461389b565b611943565b6104646109023660046135e4565b6119c2565b34801561091357600080fd5b5061046461092236600461392b565b611eb5565b34801561093357600080fd5b5061046461094236600461345c565b611ed0565b34801561095357600080fd5b506012546103ff9060ff1681565b34801561096d57600080fd5b50610499600d5481565b34801561098357600080fd5b506104646109923660046137a6565b612004565b6104646109a536600461353a565b612076565b3480156109b657600080fd5b506104996109c5366004613881565b600e6020526000908152604090205481565b3480156109e357600080fd5b506109ec6120ac565b6040516103d69190613bdb565b348015610a0557600080fd5b50610464612176565b348015610a1a57600080fd5b50610464610a293660046138d1565b61219f565b348015610a3a57600080fd5b50610424610a49366004613a04565b6121cc565b348015610a5a57600080fd5b506105c4612250565b348015610a6f57600080fd5b50610464612318565b348015610a8457600080fd5b50610464612334565b348015610a9957600080fd5b506103ff610aa8366004613478565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610ae257600080fd5b506103ff610af1366004613881565b60106020526000908152604090205460ff1681565b348015610b1257600080fd5b50610464610b2136600461345c565b6123ae565b348015610b3257600080fd5b50610464610b4136600461367f565b612424565b60006001600160e01b031982166310c8aba560e31b1480610b6b5750610b6b82612523565b92915050565b606060028054610b8090613cef565b80601f0160208091040260200160405190810160405280929190818152602001828054610bac90613cef565b8015610bf95780601f10610bce57610100808354040283529160200191610bf9565b820191906000526020600020905b815481529060010190602001808311610bdc57829003601f168201915b5050505050905090565b6000610c0e82612571565b610c2b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600b54600160a01b900460ff1615610c7a5760405162461bcd60e51b8152600401610c7190613baf565b60405180910390fd5b610c8382610dab565b610cca5760405162461bcd60e51b815260206004820152601860248201527713dc195c985d1bdc881b9bdd081dda1a5d195b1a5cdd195960421b6044820152606401610c71565b610cd48282612598565b5050565b6008546000906001600160a01b031615610d665760085460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015610d4157600080fd5b505afa925050508015610d52575060015b610d5e57506000610d6a565b506001610d6a565b5060015b9392505050565b600b54600160a01b900460ff1615610d9b5760405162461bcd60e51b8152600401610c7190613baf565b610da6838383612638565b505050565b6008546000906001600160a01b031615610ecd57600854604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b95545529060240160606040518083038186803b158015610e0a57600080fd5b505afa158015610e1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e429190613971565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b60206040518083038186803b158015610e9557600080fd5b505afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b919061382d565b506000919050565b610edd6127db565b611388811115610f555760405162461bcd60e51b815260206004820152603a60248201527f4e6577206d617820616c6c6f776c697374206d757374206265206c657373207460448201527f68616e206f7220657175616c20746f206d617820737570706c790000000000006064820152608401610c71565b600d55565b600c8054610f6790613cef565b80601f0160208091040260200160405190810160405280929190818152602001828054610f9390613cef565b8015610fe05780601f10610fb557610100808354040283529160200191610fe0565b820191906000526020600020905b815481529060010190602001808311610fc357829003601f168201915b505050505081565b610ff06127db565b4760005b601654811015610cd4576110796016828154811061102257634e487b7160e01b600052603260045260246000fd5b6000918252602090912060029091020154601680546001600160a01b03909216918490811061106157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600202016001015484612835565b8061108381613d2a565b915050610ff4565b600b54600160a01b900460ff16156110b55760405162461bcd60e51b8152600401610c7190613baf565b610da68383836128b0565b6008546060906001600160a01b0316156111dc57600854604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b95545529060240160606040518083038186803b15801561111f57600080fd5b505afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111579190613971565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b60006040518083038186803b15801561119b57600080fd5b505afa1580156111af573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d79190810190613705565b905090565b5060408051600081526020810190915290565b6111f76127db565b806010600084600181111561121c57634e487b7160e01b600052602160045260246000fd5b600181111561123b57634e487b7160e01b600052602160045260246000fd5b81526020810191909152604001600020805460ff19169115159190911790555050565b6112666127db565b80600f600084600181111561128b57634e487b7160e01b600052602160045260246000fd5b60018111156112aa57634e487b7160e01b600052602160045260246000fd5b81526020810191909152604001600020555050565b6112c76128cb565b60006112db6008546001600160a01b031690565b90506001600160a01b03811661130457604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c0906113329030908890600401613ad6565b600060405180830381600087803b15801561134c57600080fd5b505af1158015611360573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa0291506113929030908790600401613af3565b600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0384169250638d74431491506113f29030908690600401613af3565b600060405180830381600087803b15801561140c57600080fd5b505af1158015611420573d6000803e3d6000fd5b5050505050505050565b6000610b6b826128d3565b61143d612934565b6114456127db565b6113888161145260005490565b61145c9190613c6c565b11156114975760405162461bcd60e51b815260206004820152600a602482015269135a5b9d1959081bdd5d60b21b6044820152606401610c71565b6114a1338261298e565b7fd9ed5ae93233f5e89d74172aa9d0292dd5433f058dd14695c51bf9c80e5d46056114cb60005490565b60408051918252602082018490520160405180910390a16114ec6001600a55565b50565b6114f76127db565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6115216128cb565b61153c71721c310194ccfc01e523fc93c9cccfa2a0ac611ed0565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090611574903090600190600401613ad6565b600060405180830381600087803b15801561158e57600080fd5b505af11580156115a2573d6000803e3d6000fd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa0291506115de903090600190600401613af3565b600060405180830381600087803b1580156115f857600080fd5b505af115801561160c573d6000803e3d6000fd5b50505050565b60006001600160a01b03821661163b576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6116696127db565b6116736000612a77565b565b6060600080600061168585611612565b905060008167ffffffffffffffff8111156116b057634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116d9578160200160208202803683370190505b50905061170660408051608081018252600080825260208201819052918101829052606081019190915290565b60005b8386146117955761171981612ac9565b915081604001511561172a5761178d565b81516001600160a01b03161561173f57815194505b876001600160a01b0316856001600160a01b0316141561178d578083878060010198508151811061178057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101611709565b50909695505050505050565b601681815481106117b157600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b606060038054610b8090613cef565b6008546000906001600160a01b031615610ecd57600854604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b95545529060240160606040518083038186803b15801561184757600080fd5b505afa15801561185b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187f9190613971565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401610e7d565b600b54600160a01b900460ff16156118e95760405162461bcd60e51b8152600401610c7190613baf565b6118f282610dab565b6119395760405162461bcd60e51b815260206004820152601860248201527713dc195c985d1bdc881b9bdd081dda1a5d195b1a5cdd195960421b6044820152606401610c71565b610cd48282612b48565b60006011600084600181111561196957634e487b7160e01b600052602160045260246000fd5b600181111561198857634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000206000836001600160a01b03166001600160a01b0316815260200190815260200160002054905092915050565b6119ca612934565b6000600e60008360018111156119f057634e487b7160e01b600052602160045260246000fd5b6001811115611a0f57634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000205490506000600f6000846001811115611a4657634e487b7160e01b600052602160045260246000fd5b6001811115611a6557634e487b7160e01b600052602160045260246000fd5b815260200190815260200160002054905060106000846001811115611a9a57634e487b7160e01b600052602160045260246000fd5b6001811115611ab957634e487b7160e01b600052602160045260246000fd5b815260208101919091526040016000205460ff16611b105760405162461bcd60e51b81526020600482015260146024820152734d696e742074797065206e6f742061637469766560601b6044820152606401610c71565b61138884611b1d60005490565b611b279190613c6c565b1115611b625760405162461bcd60e51b815260206004820152600a602482015269135a5b9d1959081bdd5d60b21b6044820152606401610c71565b611b6c8483613ca4565b341015611bbb5760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610c71565b808460116000866001811115611be157634e487b7160e01b600052602160045260246000fd5b6001811115611c0057634e487b7160e01b600052602160045260246000fd5b815260200190815260200160002060008a6001600160a01b03166001600160a01b0316815260200190815260200160002054611c3c9190613c6c565b1115611c755760405162461bcd60e51b8152602060048201526008602482015267546f6f206d616e7960c01b6044820152606401610c71565b6001836001811115611c9757634e487b7160e01b600052602160045260246000fd5b14611dcd57600d5484601354611cad9190613c6c565b1115611cf25760405162461bcd60e51b8152602060048201526014602482015273105b1b1bdddb1a5cdd081b5a5b9d1959081bdd5d60621b6044820152606401610c71565b6040516bffffffffffffffffffffffff19606089901b16602082015260009060340160408051601f198184030181528282528051602091820120600b54601f8b018390048302850183019093528984529350611d76926001600160a01b039092169184918b908b9081908401838280828437600092019190915250612bc192505050565b611db45760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b2103b37bab1b432b960891b6044820152606401610c71565b8460136000828254611dc69190613c6c565b9091555050505b8360116000856001811115611df257634e487b7160e01b600052602160045260246000fd5b6001811115611e1157634e487b7160e01b600052602160045260246000fd5b81526020019081526020016000206000896001600160a01b03166001600160a01b031681526020019081526020016000206000828254611e519190613c6c565b90915550611e619050878561298e565b7fd9ed5ae93233f5e89d74172aa9d0292dd5433f058dd14695c51bf9c80e5d4605611e8b60005490565b60408051918252602082018790520160405180910390a15050611eae6001600a55565b5050505050565b611ebd6127db565b8051610cd490600c906020840190613357565b611ed86128cb565b60006001600160a01b0382163b15611f66576040516301ffc9a760e01b8152600060048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015611f2a57600080fd5b505afa925050508015611f5a575060408051601f3d908101601f19168201909252611f579181019061382d565b60015b611f6357611f66565b90505b6001600160a01b03821615801590611f7c575080155b15611f9a576040516332483afb60e01b815260040160405180910390fd5b600854604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600880546001600160a01b0319166001600160a01b0392909216919091179055565b61200c612934565b60125460ff1661201b57600080fd5b60005b815181101561206b5761205982828151811061204a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001612c40565b8061206381613d2a565b91505061201e565b506114ec6001600a55565b600b54600160a01b900460ff16156120a05760405162461bcd60e51b8152600401610c7190613baf565b61160c84848484612d8d565b60408051606081018252600080825260208201819052918101919091526008546001600160a01b03161561215557600854604051635caaa2a960e11b81523060048201526001600160a01b039091169063b95545529060240160606040518083038186803b15801561211d57600080fd5b505afa158015612131573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d79190613971565b50604080516060810182526000808252602082018190529181019190915290565b61217e6127db565b600b805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6121a76127db565b80600e600084600181111561128b57634e487b7160e01b600052602160045260246000fd5b60606121d782612571565b6121f457604051630a14c4b560e41b815260040160405180910390fd5b60006121fe612dd1565b905080516000141561221f5760405180602001604052806000815250610d6a565b8061222984612de0565b60405160200161223a929190613a6a565b6040516020818303038152906040529392505050565b6008546060906001600160a01b0316156111dc57600854604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b95545529060240160606040518083038186803b1580156122af57600080fd5b505afa1580156122c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e79190613971565b60409081015190516001600160e01b031960e084901b1681526001600160781b039091166004820152602401611183565b6123206127db565b6012805460ff19811660ff90911615179055565b61233c6127db565b4760006123516009546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d806000811461239b576040519150601f19603f3d011682016040523d82523d6000602084013e6123a0565b606091505b5050905080610cd457600080fd5b6123b66127db565b6001600160a01b03811661241b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c71565b6114ec81612a77565b61242c6128cb565b61243584611ed0565b604051630368065360e61b81526001600160a01b0385169063da0194c0906124639030908790600401613ad6565b600060405180830381600087803b15801561247d57600080fd5b505af1158015612491573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa0291506124c39030908690600401613af3565b600060405180830381600087803b1580156124dd57600080fd5b505af11580156124f1573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0387169250638d74431491506113f29030908590600401613af3565b60006301ffc9a760e01b6001600160e01b03198316148061255457506380ac58cd60e01b6001600160e01b03198316145b80610b6b5750506001600160e01b031916635b5e139f60e01b1490565b6000805482108015610b6b575050600090815260046020526040902054600160e01b161590565b60006125a38261142a565b9050336001600160a01b038216146125dc576125bf8133610aa8565b6125dc576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000612643826128d3565b9050836001600160a01b0316816001600160a01b0316146126765760405162a1148160e81b815260040160405180910390fd5b600082815260066020526040902080546126a28187335b6001600160a01b039081169116811491141790565b6126cd576126b08633610aa8565b6126cd57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166126f457604051633a954ecd60e21b815260040160405180910390fd5b6127018686866001612e2e565b801561270c57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b831661279757600184016000818152600460205260409020546127955760005481146127955760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613dcd83398151915260405160405180910390a46127d38686866001612e55565b505050505050565b6009546001600160a01b031633146116735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c71565b60006103e86128448484613ca4565b61284e9190613c84565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d806000811461289d576040519150601f19603f3d011682016040523d82523d6000602084013e6128a2565b606091505b5050905080611eae57600080fd5b610da683838360405180602001604052806000815250612076565b6116736127db565b60008160005481101561291b57600081815260046020526040902054600160e01b8116612919575b80610d6a5750600019016000818152600460205260409020546128fb565b505b604051636f96cda160e11b815260040160405180910390fd5b6002600a5414156129875760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c71565b6002600a55565b600054816129af5760405163b562e8dd60e01b815260040160405180910390fd5b6129bc6000848385612e2e565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020613dcd8339815191528180a4600183015b818114612a475780836000600080516020613dcd833981519152600080a4600101612a21565b5081612a6557604051622e076360e81b815260040160405180910390fd5b6000908155610da69150848385612e55565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260046020526040902054610b6b90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612bb5911515815260200190565b60405180910390a35050565b6000612c23612c1d846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b83612e7c565b6001600160a01b0316846001600160a01b03161490509392505050565b6000612c4b836128d3565b905080600080612c6986600090815260066020526040902080549091565b915091508415612ca957612c7e81843361268d565b612ca957612c8c8333610aa8565b612ca957604051632ce44b5f60e11b815260040160405180910390fd5b612cb7836000886001612e2e565b8015612cc257600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040902055600160e11b8416612d495760018601600081815260046020526040902054612d47576000548114612d475760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613dcd833981519152908390a4612d7d836000886001612e55565b5050600180548101905550505050565b612d98848484610d71565b6001600160a01b0383163b1561160c57612db484848484612ea0565b61160c576040516368d2bf6b60e11b815260040160405180910390fd5b6060600c8054610b8090613cef565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612e1757612e1c565b612dfa565b50819003601f19909101908152919050565b60005b81811015611eae57612e4d8585612e488487613c6c565b612f98565b600101612e31565b60005b81811015611eae57612e748585612e6f8487613c6c565b612ff4565b600101612e58565b6000806000612e8b8585613042565b91509150612e9881613088565b509392505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612ed5903390899088908890600401613a99565b602060405180830381600087803b158015612eef57600080fd5b505af1925050508015612f1f575060408051601f3d908101601f19168201909252612f1c91810190613865565b60015b612f7a573d808015612f4d576040519150601f19603f3d011682016040523d82523d6000602084013e612f52565b606091505b508051612f72576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6001600160a01b038381161590831615818015612fb25750805b15612fd057604051635cbd944160e01b815260040160405180910390fd5b8115612fdc575b611eae565b8015612fe757612fd7565b611eae338686863461320e565b6001600160a01b03838116159083161581801561300e5750805b1561302c57604051635cbd944160e01b815260040160405180910390fd5b811561303757612fd7565b8015612fd757612fd7565b6000808251604114156130795760208301516040840151606085015160001a61306d87828585613293565b94509450505050613081565b506000905060025b9250929050565b60008160048111156130aa57634e487b7160e01b600052602160045260246000fd5b14156130b35750565b60018160048111156130d557634e487b7160e01b600052602160045260246000fd5b14156131235760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c71565b600281600481111561314557634e487b7160e01b600052602160045260246000fd5b14156131935760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c71565b60038160048111156131b557634e487b7160e01b600052602160045260246000fd5b14156114ec5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c71565b6008546001600160a01b031615611eae5760085460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b15801561327457600080fd5b505afa158015613288573d6000803e3d6000fd5b505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ca575060009050600361334e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561331e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166133475760006001925092505061334e565b9150600090505b94509492505050565b82805461336390613cef565b90600052602060002090601f01602090048101928261338557600085556133cb565b82601f1061339e57805160ff19168380011785556133cb565b828001600101855582156133cb579182015b828111156133cb5782518255916020019190600101906133b0565b506133d79291506133db565b5090565b5b808211156133d757600081556001016133dc565b600067ffffffffffffffff83111561340a5761340a613d5b565b61341d601f8401601f1916602001613c17565b905082815283838301111561343157600080fd5b828260208301376000602084830101529392505050565b80356002811061345757600080fd5b919050565b60006020828403121561346d578081fd5b8135610d6a81613d71565b6000806040838503121561348a578081fd5b823561349581613d71565b915060208301356134a581613d71565b809150509250929050565b6000806000606084860312156134c4578081fd5b83356134cf81613d71565b925060208401356134df81613d71565b915060408401356134ef81613d71565b809150509250925092565b60008060006060848603121561350e578283fd5b833561351981613d71565b9250602084013561352981613d71565b929592945050506040919091013590565b6000806000806080858703121561354f578182fd5b843561355a81613d71565b9350602085013561356a81613d71565b925060408501359150606085013567ffffffffffffffff81111561358c578182fd5b8501601f8101871361359c578182fd5b6135ab878235602084016133f0565b91505092959194509250565b600080604083850312156135c9578182fd5b82356135d481613d71565b915060208301356134a581613d86565b6000806000806000608086880312156135fb578283fd5b853561360681613d71565b9450602086013567ffffffffffffffff80821115613622578485fd5b818801915088601f830112613635578485fd5b813581811115613643578586fd5b896020828501011115613654578586fd5b6020830196508095505050506040860135915061367360608701613448565b90509295509295909350565b60008060008060808587031215613694578182fd5b843561369f81613d71565b935060208501356136af81613daa565b925060408501356136bf81613db7565b915060608501356136cf81613db7565b939692955090935050565b600080604083850312156136ec578182fd5b82356136f781613d71565b946020939093013593505050565b60006020808385031215613717578182fd5b825167ffffffffffffffff81111561372d578283fd5b8301601f8101851361373d578283fd5b805161375061374b82613c48565b613c17565b80828252848201915084840188868560051b870101111561376f578687fd5b8694505b8385101561379a57805161378681613d71565b835260019490940193918501918501613773565b50979650505050505050565b600060208083850312156137b8578182fd5b823567ffffffffffffffff8111156137ce578283fd5b8301601f810185136137de578283fd5b80356137ec61374b82613c48565b80828252848201915084840188868560051b870101111561380b578687fd5b8694505b8385101561379a57803583526001949094019391850191850161380f565b60006020828403121561383e578081fd5b8151610d6a81613d86565b60006020828403121561385a578081fd5b8135610d6a81613d94565b600060208284031215613876578081fd5b8151610d6a81613d94565b600060208284031215613892578081fd5b610d6a82613448565b600080604083850312156138ad578182fd5b61349583613448565b600080604083850312156138c8578182fd5b6135d483613448565b600080604083850312156138e3578182fd5b6136f783613448565b600080600060608486031215613900578081fd5b833561390b81613daa565b9250602084013561391b81613db7565b915060408401356134ef81613db7565b60006020828403121561393c578081fd5b813567ffffffffffffffff811115613952578182fd5b8201601f81018413613962578182fd5b612f90848235602084016133f0565b600060608284031215613982578081fd5b6040516060810181811067ffffffffffffffff821117156139a5576139a5613d5b565b60405282516139b381613daa565b815260208301516139c381613db7565b602082015260408301516139d681613db7565b60408201529392505050565b6000602082840312156139f3578081fd5b813561ffff81168114610d6a578182fd5b600060208284031215613a15578081fd5b5035919050565b60008151808452613a34816020860160208601613cc3565b601f01601f19169290920160200192915050565b60078110613a6657634e487b7160e01b600052602160045260246000fd5b9052565b60008351613a7c818460208801613cc3565b835190830190613a90818360208801613cc3565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613acc90830184613a1c565b9695505050505050565b6001600160a01b038316815260408101610d6a6020830184613a48565b6001600160a01b039290921682526001600160781b0316602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156117955783516001600160a01b031683529284019291840191600101613b31565b6020808252825182820181905260009190848201906040850190845b8181101561179557835183529284019291840191600101613b72565b60208101610b6b8284613a48565b602081526000610d6a6020830184613a1c565b60208082526012908201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b604082015260600190565b6000606082019050613bee828451613a48565b60208301516001600160781b038082166020850152806040860151166040850152505092915050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613c4057613c40613d5b565b604052919050565b600067ffffffffffffffff821115613c6257613c62613d5b565b5060051b60200190565b60008219821115613c7f57613c7f613d45565b500190565b600082613c9f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613cbe57613cbe613d45565b500290565b60005b83811015613cde578181015183820152602001613cc6565b8381111561160c5750506000910152565b600181811c90821680613d0357607f821691505b60208210811415613d2457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613d3e57613d3e613d45565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114ec57600080fd5b80151581146114ec57600080fd5b6001600160e01b0319811681146114ec57600080fd5b600781106114ec57600080fd5b6001600160781b03811681146114ec57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ef2e858a9fb7ad87277ffb8be7dc8a04d08e8f49bd1a0162b678432e77a30a1364736f6c63430008040033

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
Loading...
Loading
[ Download: CSV Export  ]
[ 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.