ETH Price: $2,973.23 (-1.31%)
Gas: 4 Gwei

Token

AIBOLT (BOLT)
 

Overview

Max Total Supply

1,445 BOLT

Holders

405

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
autom8ed.eth
Balance
6 BOLT
0x2ba34c711fbd3ab880f32c87889191a663152400
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
AIBOLT

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 28 : AIBOLT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./AIORBIT.sol";
import "./BoltLib.sol";
import "./IEventNFT.sol";
import "./ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import {Base64} from "./Base64.sol";

contract AIBOLT is ERC721A, Ownable, IERC2981, ReentrancyGuard, Pausable {
    address public eventsNFT;

    address payable public royaltiesRecipient;
    uint256 public royaltyRate = 75; // Default 7.5% royalty rate
    uint16 public constant AIORBIT_PER_AIBOLT = 5;

    AIORBIT public aiorbit;

    mapping(uint16 => uint256[]) public tokenIdToEvents;
    mapping(uint16 => uint16[AIORBIT_PER_AIBOLT]) public _aiorbitPerAibolt;

    uint256 public tokenPrice;
    mapping(address => bool) public allowList;

    event TokenEventAdded(
        uint16 indexed tokenId,
        uint256 indexed eventId,
        address indexed originalCaller
    );

    event TokenForged(uint16[] indexed tokenIds, uint16[] indexed _aiorbitIds);

    modifier onlyEventNFT() {
        require(
            msg.sender == eventsNFT,
            "Only EventNFT can call this function"
        );
        _;
    }

    constructor(
        string memory name,
        string memory symbol,
        address payable _royaltiesRecipient,
        address _eventsNFT,
        AIORBIT _aiorbit,
        uint256 _tokenPrice
    ) ERC721A(name, symbol) {
        royaltiesRecipient = _royaltiesRecipient;
        aiorbit = _aiorbit;
        eventsNFT = _eventsNFT;
        tokenPrice = _tokenPrice;
        pause();
    }

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

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

    function setEventNFT(address _eventsNFT) public onlyOwner {
        eventsNFT = _eventsNFT;
    }

    function setTokenPrice(uint256 _tokenPrice) public onlyOwner {
        tokenPrice = _tokenPrice;
    }

    // Mint function for owner to airdrop tokens
    function airdrop(
        address[] memory recipients,
        uint8[] memory howMany
    ) public onlyOwner {
        unchecked {
            for (uint16 i = 0; i < recipients.length; i++) {
                _mint(recipients[i], howMany[i]);
            }
        }
    }

    // New mint function for users to purchase token
    function mint(uint8 howMany) public payable nonReentrant whenNotPaused {
        require(
            totalSupply() + howMany <= 2000,
            "Maximum supply of 2,000 reached"
        );
        require(
            balanceOf(msg.sender) + howMany <= 5,
            "Cannot exceed mint limit of 5 per wallet"
        );
        require(allowList[msg.sender], "Not on the allow list");
        require(msg.value == tokenPrice * howMany, "Incorrect payment value");
        _mint(msg.sender, howMany);

        // Transfer the ether to the contract's owner
        payable(owner()).transfer(msg.value);
    }

    function addToAllowList(address[] memory addrs) public onlyOwner {
        for (uint i = 0; i < addrs.length; i++) {
            allowList[addrs[i]] = true;
        }
    }

    function removeFromAllowList(address[] memory addrs) public onlyOwner {
        for (uint i = 0; i < addrs.length; i++) {
            allowList[addrs[i]] = false;
        }
    }

    function forge(
        uint16[] memory tokenIds,
        uint16[] memory _aiorbitIds
    ) public {
        require(
            _aiorbitIds.length % AIORBIT_PER_AIBOLT == 0,
            "Incorrect number of AIORBIT IDs provided"
        );
        require(
            tokenIds.length * AIORBIT_PER_AIBOLT == _aiorbitIds.length,
            "Mismatch between number of tokens and aiorbits"
        );

        uint16 aiorbitIndex = 0;
        for (uint16 k = 0; k < tokenIds.length; k++) {
            uint16 tokenId = tokenIds[k];
            require(
                ownerOf(tokenId) == msg.sender,
                "Caller must own the AIBOLT"
            );

            uint16[AIORBIT_PER_AIBOLT] memory aiorbitIdsForToken;

            for (uint16 j = 0; j < AIORBIT_PER_AIBOLT; j++) {
                uint16 aiorbitId = _aiorbitIds[aiorbitIndex + j];
                require(
                    aiorbit.ownerOf(aiorbitId) == msg.sender,
                    "Caller must own the AIORBITs"
                );
                aiorbitIdsForToken[j] = aiorbitId;
                aiorbit.transferFrom(
                    msg.sender,
                    0x000000000000000000000000000000000000dEaD,
                    aiorbitId
                );
            }

            _aiorbitPerAibolt[tokenId] = aiorbitIdsForToken;
            tokenIdToEvents[tokenId].push(1); // Event #1: Inception (Reveal)
            aiorbitIndex += AIORBIT_PER_AIBOLT;
        }

        emit TokenForged(tokenIds, _aiorbitIds);
    }

    function tokenURI(
        uint256 _tokenId
    ) public view override returns (string memory) {
        require(_exists(_tokenId), "Token does not exist");

        IEventNFT eventNFT = IEventNFT(eventsNFT);
        uint256[] memory tokenEvents = tokenIdToEvents[uint16(_tokenId)];
        uint256 tokenEventsLength = tokenEvents.length;
        uint16[AIORBIT_PER_AIBOLT] memory _aiorbitTokenIds = [
            uint16(1),
            uint16(1),
            uint16(1),
            uint16(1),
            uint16(1)
        ];

        // Revealed
        if (tokenEventsLength != 0) {
            _aiorbitTokenIds = _aiorbitPerAibolt[uint16(_tokenId)];
        }

        BoltLib.AIBOLTData memory data = BoltLib.generateAIBOLTData(
            _aiorbitTokenIds
        );

        if (tokenEvents.length > 0) {
            data = getLatestEventData(data, tokenEvents[tokenEventsLength - 1]);
        }

        string memory svg = BoltLib.generateSVG(data, tokenEvents, eventNFT);

        // Generate traits JSON string
        string memory traits = BoltLib.generateTraits(
            data,
            tokenEvents,
            eventNFT
        );

        // Combine all parts to create the final JSON string
        string memory json = Base64.encode(
            bytes(
                string(
                    abi.encodePacked(
                        '{"name": "AIBOLT #',
                        toString(_tokenId),
                        '", "description": "The first ever dynamic on-chain storytelling NFTs. Every AIBOLT is fully on-chain, and their traits (visually and rarity) are upgradeable by causing Events. Events are transactions recorded on-chain. When chain of Events are stacked, a lore is written by AI that can be adapted to other mediums.", "image": "data:image/svg+xml;base64,',
                        Base64.encode(bytes(svg)),
                        '", "attributes": ',
                        traits,
                        "}"
                    )
                )
            )
        );

        return string(abi.encodePacked("data:application/json;base64,", json));
    }

    function getLatestEventData(
        BoltLib.AIBOLTData memory data,
        uint256 latestEventId
    ) public view returns (BoltLib.AIBOLTData memory) {
        IEventNFT.Event memory eventNFT = IEventNFT(eventsNFT).getEvent(
            latestEventId
        );

        if (bytes(eventNFT.sun).length != 0) {
            data.sun = eventNFT.sun;
            data.sunSvg = eventNFT.sunSvg;
        }

        if (bytes(eventNFT.planet1).length != 0) {
            data.planets[0].theme = eventNFT.planet1;
            data.planets[0].svg = eventNFT.planet1Svg;
        }

        if (bytes(eventNFT.planet2).length != 0) {
            data.planets[1].theme = eventNFT.planet2;
            data.planets[1].svg = eventNFT.planet2Svg;
        }

        if (bytes(eventNFT.planet3).length != 0) {
            data.planets[2].theme = eventNFT.planet3;
            data.planets[2].svg = eventNFT.planet3Svg;
        }

        if (eventNFT.numPlanets != 0) {
            data.numPlanets = eventNFT.numPlanets;
        }

        return data;
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC721A, IERC165) returns (bool) {
        // Supports the following `interfaceId`s:
        // - IERC165: 0x01ffc9a7
        // - IERC721: 0x80ac58cd
        // - IERC721Metadata: 0x5b5e139f
        // - IERC2981: 0x2a55205a
        return ERC721A.supportsInterface(interfaceId);
    }

    function addTokenEvent(
        uint16 tokenId,
        uint256 eventId,
        address originalCaller
    ) public onlyEventNFT {
        require(
            _exists(tokenId),
            "ERC721: operator query for nonexistent token"
        );
        require(
            ownerOf(tokenId) == originalCaller,
            "Caller must own the AIBOLT"
        );
        require(msg.sender == eventsNFT, "Not authorized Event contract");
        tokenIdToEvents[tokenId].push(eventId);

        emit TokenEventAdded(tokenId, eventId, originalCaller);
    }

    // Override royaltyInfo function from EIP-2981
    function royaltyInfo(
        uint256 _tokenId,
        uint256 _salePrice
    ) external view override returns (address receiver, uint256 royaltyAmount) {
        return (royaltiesRecipient, (_salePrice * royaltyRate) / 1000);
    }
}

File 2 of 28 : OrbitProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

library OrbitProxy {
    // AIORBIT Contract Used To Forge AIBOLT (This Contract)

    struct CommonValues {
        uint256 hue;
        uint256 rotationSpeed;
        uint256 numCircles;
        uint256[] radius;
        uint256[] distance;
        uint256[] strokeWidth;
    }

    function generateAIORBITTraits(
        uint256 _tokenId
    ) public pure returns (CommonValues memory) {
        uint256 hue = uint256(keccak256(abi.encodePacked(_tokenId, "hue"))) %
            360;
        uint256 rotationSpeed = (uint256(
            keccak256(abi.encodePacked(_tokenId, "rotationSpeed"))
        ) % 11) + 5;

        uint256 numCircles = (uint256(
            keccak256(abi.encodePacked(_tokenId, "numCircles"))
        ) % 3) + 3;
        uint256[] memory radius = new uint256[](numCircles);
        uint256[] memory distance = new uint256[](numCircles);
        uint256[] memory strokeWidth = new uint256[](numCircles);

        for (uint256 i = 0; i < numCircles; i++) {
            radius[i] =
                (uint256(keccak256(abi.encodePacked(_tokenId, "radius", i))) %
                    40) +
                20;
            distance[i] =
                (uint256(keccak256(abi.encodePacked(_tokenId, "distance", i))) %
                    80) +
                40;
            strokeWidth[i] =
                (uint256(
                    keccak256(abi.encodePacked(_tokenId, "strokeWidth", i))
                ) % 16) +
                5;
        }

        return
            CommonValues(
                hue,
                rotationSpeed,
                numCircles,
                radius,
                distance,
                strokeWidth
            );
    }
}

File 3 of 28 : IEventNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IEventNFT {
    struct Event {
        string name;
        string bottomSvg;
        string topSvg;
        string planet1;
        string planet1Svg;
        string planet2;
        string planet2Svg;
        string planet3;
        string planet3Svg;
        string sun;
        string sunSvg;
        uint256 numPlanets;
    }

    struct EventParams {
        string name;
        string bottomSvg;
        string topSvg;
        string planet1;
        string planet1Svg;
        string planet2;
        string planet2Svg;
        string planet3;
        string planet3Svg;
        string sun;
        string sunSvg;
        uint256 numPlanets;
    }

    function getEvent(uint256 eventId) external view returns (Event memory);
}

File 4 of 28 : 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);
}

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

pragma solidity ^0.8.4;

import "./IERC721A.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.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, DefaultOperatorFilterer {
    // 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 onlyAllowedOperator(to) {
        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 onlyAllowedOperatorApproval(operator) {
        _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 onlyAllowedOperator(from) {
        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 onlyAllowedOperator(from) {
        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 onlyAllowedOperator(from) {
        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 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++;
        }
    }

    /**
     * @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 6 of 28 : BoltLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Strings.sol";
import "./IEventNFT.sol";
import "./OrbitProxy.sol";

library BoltLib {
    uint256 public constant MAX_PLANETS = 3;

    struct AIBOLTData {
        string sun;
        string sunSvg;
        uint256 numPlanets;
        Planet[MAX_PLANETS] planets;
    }

    struct Planet {
        OrbitSpeed orbitSpeed;
        PlanetSize size;
        string theme;
        string svg;
    }

    enum OrbitSpeed {
        Crawl,
        Cruise,
        Dash
    }

    enum PlanetSize {
        Speck,
        Globe,
        Titan
    }

    function generateAIBOLTData(
        uint16[5] memory _tokenIds
    ) public pure returns (AIBOLTData memory) {
        uint256 totalHue = 0;
        uint256 totalRotationSpeed = 0;
        uint256 totalNumCircles = 0;
        uint256[] memory totalRadius = new uint256[](5);
        uint256[] memory totalDistance = new uint256[](5);
        uint256[] memory totalStrokeWidth = new uint256[](5);

        for (uint256 j = 0; j < 5; j++) {
            OrbitProxy.CommonValues memory commonValues = OrbitProxy
                .generateAIORBITTraits(_tokenIds[j]);
            totalHue += commonValues.hue;
            totalRotationSpeed += commonValues.rotationSpeed;
            totalNumCircles += commonValues.numCircles;
            for (uint256 i = 0; i < commonValues.numCircles; i++) {
                totalRadius[i] += commonValues.radius[i];
                totalDistance[i] += commonValues.distance[i];
                totalStrokeWidth[i] += commonValues.strokeWidth[i];
            }
        }

        OrbitProxy.CommonValues memory averagedValues = OrbitProxy.CommonValues(
            totalHue / 5,
            totalRotationSpeed / 5,
            totalNumCircles / 5,
            new uint256[](5),
            new uint256[](5),
            new uint256[](5)
        );

        for (uint256 i = 0; i < averagedValues.numCircles; i++) {
            averagedValues.radius[i] = totalRadius[i] / 5;
            averagedValues.distance[i] = totalDistance[i] / 5;
            averagedValues.strokeWidth[i] = totalStrokeWidth[i] / 5;
        }
        uint256 numPlanets;

        if (averagedValues.numCircles >= 1 && averagedValues.numCircles <= 3) {
            numPlanets = 1;
        } else if (
            averagedValues.numCircles > 3 && averagedValues.numCircles <= 4
        ) {
            numPlanets = 2;
        } else if (
            averagedValues.numCircles > 4 && averagedValues.numCircles <= 5
        ) {
            numPlanets = 3;
        }
        uint256[3] memory planetBiomes;

        // Set range for hue
        uint256 hue_start = 0;
        uint256 hue_end = 359;

        // Set range for planetBiomes
        uint256 biome_start = 0;
        uint256 biome_end = 5;

        for (uint256 i = 0; i < 3; i++) {
            // Add an offset to the hue for each planet
            uint256 hue = (averagedValues.hue + i * 60) % 360;

            // Scale hue to biome
            uint256 biome = ((hue - hue_start) * (biome_end - biome_start)) /
                (hue_end - hue_start) +
                biome_start;

            // Ensure biome is within valid range and convert it to an integer
            planetBiomes[i] = biome > biome_end
                ? biome_end
                : (biome < biome_start ? biome_start : uint256(biome));
        }

        Planet[MAX_PLANETS] memory planets = generatePlanetData(
            averagedValues,
            numPlanets,
            planetBiomes
        );

        // Default sun values
        string memory sun = [
            "Pulsar",
            "Red-Giant",
            "White-Dwarf",
            "Neutron-Star"
        ][averagedValues.hue % 4];

        return AIBOLTData(sun, "", numPlanets, planets);
    }

    function generatePlanetData(
        OrbitProxy.CommonValues memory averagedValues,
        uint256 numPlanets,
        uint256[3] memory planetBiomes
    ) public pure returns (Planet[MAX_PLANETS] memory) {
        Planet[MAX_PLANETS] memory planets;

        // Set range for rotationSpeed
        uint256 rotationSpeed_start = 5;
        uint256 rotationSpeed_end = 15;

        // Set range for orbitSpeed
        uint256 orbitSpeed_start = 0;
        uint256 orbitSpeed_end = 2;

        for (uint256 i = 0; i < numPlanets; i++) {
            // Scale rotationSpeed to orbitSpeed
            uint256 orbitSpeed = ((averagedValues.rotationSpeed -
                rotationSpeed_start) * (orbitSpeed_end - orbitSpeed_start)) /
                (rotationSpeed_end - rotationSpeed_start) +
                orbitSpeed_start;

            // Ensure orbitSpeed is within valid range
            orbitSpeed = orbitSpeed > orbitSpeed_end
                ? orbitSpeed_end
                : (
                    orbitSpeed < orbitSpeed_start
                        ? orbitSpeed_start
                        : orbitSpeed
                );

            PlanetSize size = PlanetSize(averagedValues.radius[i] % numPlanets);
            string memory theme = [
                "Habitable",
                "Gas-Giant",
                "Ice-Giant",
                "Artificial",
                "Terraformed"
            ][planetBiomes[i]];

            planets[i] = Planet(OrbitSpeed(orbitSpeed), size, theme, "");
        }
        return planets;
    }

    function generateTraits(
        AIBOLTData memory data,
        uint256[] memory tokenEvents,
        IEventNFT eventNFT
    ) public view returns (string memory) {
        string memory traits = "[";

        if (tokenEvents.length != 0) {
            traits = string(
                abi.encodePacked(
                    traits,
                    '{ "trait_type": "Sun", "value": "',
                    data.sun,
                    '" }'
                )
            );
            for (uint256 i = 0; i < data.numPlanets; i++) {
                traits = string(
                    abi.encodePacked(
                        traits,
                        ',{ "trait_type": "Planet #',
                        Strings.toString(i + 1),
                        '", "value": "',
                        data.planets[i].theme,
                        '" }'
                    )
                );
            }
            for (uint256 i = data.numPlanets; i < MAX_PLANETS; i++) {
                traits = string(
                    abi.encodePacked(
                        traits,
                        ',{ "trait_type": "Planet #',
                        Strings.toString(i + 1),
                        '", "value": "Non-Existent" }'
                    )
                );
            }
            traits = string(
                abi.encodePacked(
                    traits,
                    ',{ "trait_type": "Speed", "value": "',
                    getOrbitSpeed(getAverageOrbitSpeed(data.planets)),
                    '" },',
                    '{ "trait_type": "Size", "value": "',
                    getPlanetSize(
                        getAveragePlanetSize(data.planets, data.numPlanets)
                    ),
                    '" }'
                )
            );
        }

        for (uint256 i = 0; i < tokenEvents.length; i++) {
            string memory eventName = "";

            if (i == 0 || tokenEvents[i] == 1) {
                eventName = "Inception";
            } else {
                eventName = eventNFT.getEvent(tokenEvents[i]).name;
            }

            traits = string(
                abi.encodePacked(
                    traits,
                    i == 0 &&
                        keccak256(abi.encodePacked((traits))) ==
                        keccak256(abi.encodePacked(("[")))
                        ? ""
                        : ",",
                    '{ "trait_type": "Event #',
                    Strings.toString(i + 1),
                    '", "value": "',
                    eventName,
                    '" }'
                )
            );
        }

        if (tokenEvents.length == 0) {
            traits = string(
                abi.encodePacked(
                    traits,
                    keccak256(abi.encodePacked((traits))) ==
                        keccak256(abi.encodePacked(("[")))
                        ? ""
                        : ",",
                    '{ "trait_type": "Event #0", "value": "The Void" }'
                )
            );
        }

        traits = string(abi.encodePacked(traits, "]"));
        return traits;
    }

    function generateSVG(
        BoltLib.AIBOLTData memory data,
        uint256[] memory tokenEvents,
        IEventNFT eventNFT
    ) public view returns (string memory) {
        uint256 tokenEventLength = tokenEvents.length;

        string memory eventName = "The Void";
        string memory eventSVGBottom = "";
        string memory eventSVGTop = "";

        uint256 latestTokenEventId = 0;
        if (tokenEventLength != 0) {
            latestTokenEventId = tokenEvents[tokenEventLength - 1];
        }

        // Generate stars
        string memory starsSVG = "";
        if (tokenEventLength != 0) {
            // Revealed
            for (uint256 i = 0; i < 50; i++) {
                starsSVG = string(
                    abi.encodePacked(starsSVG, generateStar(block.timestamp, i))
                );
            }
        }

        if (tokenEventLength == 1 || latestTokenEventId == 1) {
            eventName = "Inception";
        } else if (tokenEventLength > 1) {
            if (latestTokenEventId != 1) {
                // Event is Inception
                eventName = eventNFT.getEvent(latestTokenEventId).name;
                eventSVGBottom = eventNFT
                    .getEvent(latestTokenEventId)
                    .bottomSvg;
                eventSVGTop = eventNFT.getEvent(latestTokenEventId).topSvg;
            }
        }

        string memory planetsSVG = "";
        for (uint256 i = 0; i < data.numPlanets; i++) {
            planetsSVG = string(
                abi.encodePacked(planetsSVG, getPlanetSVG(data.planets[i], i))
            );
        }

        string memory sunColor = getSunColor(data.sun);
        string memory svg = string(
            abi.encodePacked(
                '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 640 640" style="background-color: black;">',
                '<rect width="100%" height="100%" fill="#000" />',
                starsSVG,
                eventSVGBottom,
                '<g transform="translate(320,320)">'
            )
        );

        if (tokenEventLength == 0) {
            svg = string(
                abi.encodePacked(
                    svg,
                    '<circle cx="0" cy="0" r="0">',
                    '<animate attributeName="r" values="0;800" dur="5s" repeatCount="indefinite" />',
                    '<animate attributeName="opacity" values="0.3;0;0" dur="5s" repeatCount="indefinite" />',
                    '<animate attributeName="fill" values="#FFFFFF; #EDE7F6; #D1C4E9; #FFFFFF;" dur="2s" repeatCount="indefinite" />',
                    "</circle>"
                )
            );
        }

        if (bytes(data.sunSvg).length != 0) {
            svg = string(abi.encodePacked(svg, data.sunSvg));
        } else {
            svg = string(
                abi.encodePacked(
                    svg,
                    '<circle r="40" className="sun">',
                    '<animate attributeName="fill" values="',
                    sunColor,
                    '" dur="3s" repeatCount="indefinite"/>',
                    "</circle>",
                    '<g transform="translate(-40,-40) scale(0.08)" className="bolt"> <path d="M624 267.629L615.767 252L533.433 256.935L377 503.701L385.233 519.33H475.8L385.233 738.129L401.7 748L611.65 462.574L603.417 446.945H508.733L624 267.629Z" fill="black" stroke="black" stroke-width="25" stroke-linejoin="round" /> </g>'
                )
            );
        }

        if (tokenEventLength != 0) {
            svg = string(abi.encodePacked(svg, planetsSVG));
        }

        svg = string(
            abi.encodePacked(
                svg,
                "</g>",
                eventSVGTop,
                '<text x="60" y="590" fill="white" font-family="Monospace" font-size="24" opacity="0">',
                "Event #",
                Strings.toString(tokenEventLength),
                ": ",
                eventName,
                '<animate attributeName="opacity" from="0" to="1" begin="1s" dur="2s" fill="freeze"/>',
                "</text>"
                "</svg>"
            )
        );

        return svg;
    }

    function getPlanetSVG(
        Planet memory planet,
        uint256 index
    ) public pure returns (string memory) {
        if (bytes(planet.svg).length != 0) {
            return string(abi.encodePacked(planet.svg));
        }

        string memory color = getPlanetColor(planet.theme);

        // Adjust planet size based on size trait
        uint256 r;
        if (planet.size == PlanetSize.Speck) {
            r = 5 * 3;
        } else if (planet.size == PlanetSize.Globe) {
            r = 10 * 3;
        } else if (planet.size == PlanetSize.Titan) {
            r = 15 * 3;
        }

        uint256 cy = (index + 1) * 100;

        string memory orbitTrails = generateTrails(index, cy);

        string memory orbitDuration;
        string memory planetColorDuration;
        if (planet.orbitSpeed == OrbitSpeed.Crawl) {
            orbitDuration = "10";
            planetColorDuration = "8s";
        } else if (planet.orbitSpeed == OrbitSpeed.Cruise) {
            orbitDuration = "7";
            planetColorDuration = "5s";
        } else if (planet.orbitSpeed == OrbitSpeed.Dash) {
            orbitDuration = "4";
            planetColorDuration = "3s";
        }

        return
            string(
                abi.encodePacked(
                    "<g>",
                    orbitTrails,
                    '<circle cx="0" cy="-',
                    Strings.toString(cy),
                    '" r="',
                    Strings.toString(r),
                    '" className="planet',
                    Strings.toString(index),
                    '">',
                    '<animate attributeName="fill" dur="',
                    planetColorDuration,
                    '" repeatCount="indefinite" values="',
                    color,
                    '"/></circle>',
                    '<animateTransform attributeName="transform" type="rotate" from="0" to="360" dur="',
                    orbitDuration,
                    's" repeatCount="indefinite"/>',
                    "</g>"
                )
            );
    }

    function generateTrails(
        uint256 index,
        uint256 cy
    ) public pure returns (string memory) {
        string memory begin;
        string memory values;
        if (index == 0) {
            begin = "0s";
            values = "1;0;0;1";
        } else if (index == 1) {
            begin = "2s";
            values = "0;1;0;0";
        } else if (index == 2) {
            begin = "4s";
            values = "0;0;1;0";
        }
        return
            string(
                abi.encodePacked(
                    '<circle cx="0" cy="0" r="',
                    Strings.toString(cy),
                    '" className="trail',
                    Strings.toString(index),
                    '" stroke="gray" fill="transparent" stroke-opacity="0">',
                    '<animate attributeName="stroke-opacity" values="',
                    values,
                    '" dur="6s" repeatCount="indefinite" begin="',
                    begin,
                    '"/>',
                    "</circle>"
                )
            );
    }

    function getAverageOrbitSpeed(
        Planet[MAX_PLANETS] memory planets
    ) private pure returns (OrbitSpeed) {
        uint256 total = 0;
        for (uint256 i = 0; i < planets.length; i++) {
            if (planets[i].orbitSpeed == OrbitSpeed.Crawl) {
                total += 10;
            } else if (planets[i].orbitSpeed == OrbitSpeed.Cruise) {
                total += 7;
            } else if (planets[i].orbitSpeed == OrbitSpeed.Dash) {
                total += 4;
            }
        }

        uint256 average = total / planets.length;

        if (average > 8) {
            return OrbitSpeed.Crawl;
        } else if (average > 6) {
            return OrbitSpeed.Cruise;
        } else {
            return OrbitSpeed.Dash;
        }
    }

    function getAveragePlanetSize(
        Planet[MAX_PLANETS] memory planets,
        uint256 numPlanets
    ) private pure returns (PlanetSize) {
        uint256 total = 0;
        for (uint256 i = 0; i < numPlanets; i++) {
            if (planets[i].size == PlanetSize.Speck) {
                total += 5 * 3; // Updated to 3x size
            } else if (planets[i].size == PlanetSize.Globe) {
                total += 10 * 3; // Updated to 3x size
            } else if (planets[i].size == PlanetSize.Titan) {
                total += 15 * 3; // Updated to 3x size
            }
        }

        uint256 average = total / numPlanets;

        if (average <= 5 * 3) {
            // Updated to 3x size
            return PlanetSize.Speck;
        } else if (average <= 10 * 3) {
            // Updated to 3x size
            return PlanetSize.Globe;
        } else {
            return PlanetSize.Titan;
        }
    }

    function getSunColor(
        string memory sun
    ) private pure returns (string memory sunColor) {
        if (Strings.equal(sun, "Pulsar")) {
            return "#808080; #A9A9A9; #C0C0C0; #808080"; // Shades of grey
        } else if (Strings.equal(sun, "Red-Giant")) {
            return "#FF4500; #FF6347; #FF7F50; #FF4500"; // Shades of orange-red
        } else if (Strings.equal(sun, "White-Dwarf")) {
            return "#FFFFFF; #F8F8FF; #F0F8FF; #FFFFFF"; // Shades of white
        } else if (Strings.equal(sun, "Neutron-Star")) {
            return "#2F4F4F; #708090; #778899; #2F4F4F"; // Shades of slate gray
        }
    }

    function getPlanetColor(
        string memory planet
    ) private pure returns (string memory planetColor) {
        if (Strings.equal(planet, "Habitable")) {
            return "#228B22; #006400; #8FBC8F; #228B22"; // Habitable: Shades of Green
        } else if (Strings.equal(planet, "Gas-Giant")) {
            return "#FFA500; #FF8C00; #FF7F50; #FFA500"; // Gas Giant: Shades of Orange
        } else if (Strings.equal(planet, "Ice-Giant")) {
            return "#00BFFF; #1E90FF; #4169E1; #00BFFF"; // Ice Giant: Shades of Blue
        } else if (Strings.equal(planet, "Artificial")) {
            return "#808080; #A9A9A9; #C0C0C0; #808080"; // Artificial: Shades of Grey
        } else if (Strings.equal(planet, "Terraformed")) {
            return "#FFFF00; #FFD700; #FFA500; #FFFF00"; // Terraformed: Shades of Yellow
        }
    }

    function getOrbitSpeed(
        OrbitSpeed _orbitSpeed
    ) private pure returns (string memory) {
        if (OrbitSpeed.Crawl == _orbitSpeed) {
            return "Crawl";
        } else if (OrbitSpeed.Cruise == _orbitSpeed) {
            return "Cruise";
        } else if (OrbitSpeed.Dash == _orbitSpeed) {
            return "Dash";
        }
        return "Undefined";
    }

    function getPlanetSize(
        PlanetSize _planetSize
    ) private pure returns (string memory) {
        if (PlanetSize.Speck == _planetSize) {
            return "Speck";
        } else if (PlanetSize.Globe == _planetSize) {
            return "Globe";
        } else if (PlanetSize.Titan == _planetSize) {
            return "Titan";
        }
        return "Undefined";
    }

    function generateStar(
        uint256 _seed,
        uint256 _index
    ) public pure returns (string memory) {
        uint256 posX = uint256(
            keccak256(abi.encodePacked(_seed, "starPosX", _index))
        ) % 640;
        uint256 posY = uint256(
            keccak256(abi.encodePacked(_seed, "starPosY", _index))
        ) % 640; // Full height now
        uint256 size = (uint256(
            keccak256(abi.encodePacked(_seed, "starSize", _index))
        ) % 3) + 1; // Smaller stars
        uint256 duration = (uint256(
            keccak256(abi.encodePacked(_seed, "starDuration", _index))
        ) % 4) + 1;

        return
            string(
                abi.encodePacked(
                    '<circle cx="',
                    Strings.toString(posX),
                    '" cy="',
                    Strings.toString(posY),
                    '" r="',
                    Strings.toString(size),
                    '" fill="rgba(255,255,255,0.1)">', // Semi-transparent fill
                    '<animate attributeName="r" values="',
                    Strings.toString(size - 1),
                    ";",
                    Strings.toString(size),
                    ";",
                    Strings.toString(size - 1),
                    '" dur="',
                    Strings.toString(duration),
                    's" repeatCount="indefinite"/>',
                    '<animate attributeName="fill" values="rgb(255,255,255);rgb(192,192,192);rgb(128,128,128);rgb(64,64,64);rgb(255,255,255)" dur="5s" repeatCount="indefinite"/>',
                    "</circle>"
                )
            );
    }
}

File 7 of 28 : Base64.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0;

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
    string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    bytes  internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
                                            hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000"
                                            hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000"
                                            hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000";

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';

        // load the table into memory
        string memory table = TABLE_ENCODE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
                // read 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // write 4 characters
                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(        input,  0x3F))))
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }

        return result;
    }

    function decode(string memory _data) internal pure returns (bytes memory) {
        bytes memory data = bytes(_data);

        if (data.length == 0) return new bytes(0);
        require(data.length % 4 == 0, "invalid base64 decoder input");

        // load the table into memory
        bytes memory table = TABLE_DECODE;

        // every 4 characters represent 3 bytes
        uint256 decodedLen = (data.length / 4) * 3;

        // add some extra buffer at the end required for the writing
        bytes memory result = new bytes(decodedLen + 32);

        assembly {
            // padding with '='
            let lastBytes := mload(add(data, mload(data)))
            if eq(and(lastBytes, 0xFF), 0x3d) {
                decodedLen := sub(decodedLen, 1)
                if eq(and(lastBytes, 0xFFFF), 0x3d3d) {
                    decodedLen := sub(decodedLen, 1)
                }
            }

            // set the actual output length
            mstore(result, decodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 4 characters at a time
            for {} lt(dataPtr, endPtr) {}
            {
               // read 4 characters
               dataPtr := add(dataPtr, 4)
               let input := mload(dataPtr)

               // write 3 bytes
               let output := add(
                   add(
                       shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)),
                       shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))),
                   add(
                       shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)),
                               and(mload(add(tablePtr, and(        input , 0xFF))), 0xFF)
                    )
                )
                mstore(resultPtr, shl(232, output))
                resultPtr := add(resultPtr, 3)
            }
        }

        return result;
    }
}

File 8 of 28 : AIORBIT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import { Base64 } from "./Base64.sol";

contract AIORBIT is ERC721, Ownable {
    using Counters for Counters.Counter;

    uint256 public constant MAX_TOKENS = 10000;
    uint256 public constant MAX_TOKENS_PER_WALLET = 10000;
    uint256 public constant ROYALTY_FEE_PERCENT = 5;
    bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584;

    Counters.Counter private _totalTokensMinted;

    constructor(string memory name, string memory symbol) ERC721(name, symbol) {}

    struct CommonValues {
        uint256 hue;
        uint256 rotationSpeed;
        uint256 numCircles;
        uint256[] radius;
        uint256[] distance;
        uint256[] strokeWidth;
    }

    function _mint(uint256 _numTokens, address _to) internal {
        require(_totalTokensMinted.current() < MAX_TOKENS, "All tokens have been minted");
        require(balanceOf(_to) + _numTokens <= MAX_TOKENS_PER_WALLET, "Cannot mint more tokens than allowed per wallet");

        for (uint256 i = 0; i < _numTokens; i++) {
            uint256 tokenId = _totalTokensMinted.current() + 1;
            _safeMint(_to, tokenId);
            _totalTokensMinted.increment();
        }
    }

    function mint(uint256 _numTokens, address _to) public {
        _mint(_numTokens, _to);
    }

    function royaltyInfo(uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) {
        receiver = owner();
        royaltyAmount = (_salePrice * ROYALTY_FEE_PERCENT) / 100;
    }

    function generateCommonValues(uint256 _tokenId) internal pure returns (CommonValues memory) {
        uint256 hue = uint256(keccak256(abi.encodePacked(_tokenId, "hue"))) % 360;
        uint256 rotationSpeed = uint256(keccak256(abi.encodePacked(_tokenId, "rotationSpeed"))) % 11 + 5;

        uint256 numCircles = uint256(keccak256(abi.encodePacked(_tokenId, "numCircles"))) % 3 + 3;
        uint256[] memory radius = new uint256[](numCircles);
        uint256[] memory distance = new uint256[](numCircles);
        uint256[] memory strokeWidth = new uint256[](numCircles);

        for (uint256 i = 0; i < numCircles; i++) {
            radius[i] = uint256(keccak256(abi.encodePacked(_tokenId, "radius", i))) % 40 + 20;
            distance[i] = uint256(keccak256(abi.encodePacked(_tokenId, "distance", i))) % 80 + 40;
            strokeWidth[i] = uint256(keccak256(abi.encodePacked(_tokenId, "strokeWidth", i))) % 16 + 5;
        }

        return CommonValues(hue, rotationSpeed, numCircles, radius, distance, strokeWidth);
    }

    function generateSVG(uint256 _tokenId) internal pure returns (string memory) {
        CommonValues memory commonValues = generateCommonValues(_tokenId);

        string memory svg = string(
            abi.encodePacked(
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320">',
                '<rect width="320" height="320" fill="#000"/>',
                '<g transform="translate(0,0)">'
            )
        );

        for (uint256 i = 0; i < commonValues.numCircles; i++) {
            uint256 duration = (commonValues.rotationSpeed > i * 2) ? (commonValues.rotationSpeed - i * 2) : 1;

            uint256 hueStep = 360 / commonValues.numCircles;
            uint256 hue = (uint256(keccak256(abi.encodePacked(_tokenId, "hue"))) + (i * hueStep)) % 360;
            uint256 sat = uint256(keccak256(abi.encodePacked(_tokenId, "sat"))) % 50 + 50;

            string memory strokeColor = string(abi.encodePacked("hsl(", Strings.toString(hue), ",", Strings.toString(sat), "%,54%)"));
            string memory strokeAnimate = string(abi.encodePacked("hsl(", Strings.toString(hue), ",50%,54%);", "hsl(", Strings.toString(hue/2), ",50%,54%);", "hsl(", Strings.toString(hue), ",50%,54%);"));

            uint256 circleX = 160 - commonValues.distance[i] + commonValues.radius[i] + commonValues.strokeWidth[i];
            uint256 circleY = circleX;

            string memory circleXStr = Strings.toString(circleX);
            string memory circleYStr = Strings.toString(circleY);
            string memory radiusStr = Strings.toString(commonValues.radius[i]);
            string memory strokeWidthStr = Strings.toString(commonValues.strokeWidth[i]);
            string memory durationStr = Strings.toString(duration);

            string memory circle = string(
                abi.encodePacked(
                    '<circle cx="', circleXStr, '" cy="', circleYStr, '" r="', radiusStr, '" fill="none" stroke="', strokeColor, '" stroke-width="', strokeWidthStr, '">',
                    '<animateTransform attributeName="transform" type="rotate" from="0 160 160" to="360 160 160" dur="', durationStr, 's" repeatCount="indefinite"/>',
                    '<animate attributeName="stroke" values="', strokeAnimate, '" dur="', durationStr, 's" repeatCount="indefinite"/>',
                    '</circle>'
                )
            );

            svg = string(abi.encodePacked(svg, circle));
        }

        svg = string(abi.encodePacked(svg, '</g>', '</svg>'));

        return svg;
    }

    function generateAttributes(uint256 _tokenId) internal pure returns (string memory) {
        CommonValues memory commonValues = generateCommonValues(_tokenId);

        string memory attributes = string(
            abi.encodePacked(
                '{"trait_type": "distance", "value": "', Strings.toString(commonValues.distance[0]), ' - ', Strings.toString(commonValues.distance[commonValues.distance.length - 1]), ' pixels"},',
                '{"trait_type": "radius", "value": "', Strings.toString(commonValues.radius[0]), ' - ', Strings.toString(commonValues.radius[commonValues.radius.length - 1]), ' pixels"},',
                '{"trait_type": "rotation_speed", "value": "', Strings.toString(commonValues.rotationSpeed), ' seconds"},',
                '{"trait_type": "color", "value": "hsl(', Strings.toString(commonValues.hue), ',50%,54%)"},',
                '{"trait_type": "stroke_width", "value": "', Strings.toString(commonValues.strokeWidth[0]), ' - ', Strings.toString(commonValues.strokeWidth[commonValues.strokeWidth.length - 1]), ' pixels"}'
            )
        );

        return attributes;
    }

    function tokenURI(uint256 _tokenId) public view override returns (string memory) {
        require(_exists(_tokenId), "Token does not exist");

        // Generate the SVG string
        string memory svg = generateSVG(_tokenId);

        // Get the attribute values
        string memory attributes = generateAttributes(_tokenId);

        // Encode the SVG in base64
        string memory svgBase64 = Base64.encode(bytes(svg));

        // Generate the JSON metadata
        string memory name = string(abi.encodePacked("AIORBIT #", Strings.toString(_tokenId)));
        string memory description = "Orbits generated on-chain by AI with 6,976,080,000 possibilities.";
        string memory imageUri = string(abi.encodePacked("data:image/svg+xml;base64,", svgBase64));
        string memory backgroundColor = "#000000";

        string memory json = string(
            abi.encodePacked(
                '{',
                '"name": "', name, '",',
                '"description": "', description, '",',
                '"image": "', imageUri, '",',
                '"background_color": "', backgroundColor, '",',
                '"attributes": [', attributes, ']',
                '}'
            )
        );

        // Encode the JSON metadata in base64
        string memory jsonBase64 = Base64.encode(bytes(json));

        // Combine the base64-encoded JSON metadata and SVG into the final URI
        return string(abi.encodePacked("data:application/json;base64,", jsonBase64));
    }

    function withdraw() public onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    function totalSupply() public view returns (uint256) {
        return _totalTokensMinted.current();
    }

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

File 9 of 28 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 10 of 28 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 *         Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract OperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper function to check if an operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

File 11 of 28 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 12 of 28 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 * @dev    Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 15 of 28 : 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 16 of 28 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 18 of 28 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

        _owners[tokenId] = to;

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

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

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

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

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

        // Clear approvals
        delete _tokenApprovals[tokenId];

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId, 1);

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

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

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

        emit Transfer(from, to, tokenId);

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "evmVersion": "shanghai",
  "libraries": {
    "/contracts/BoltLib.sol": {
      "BoltLib": "0xAef27971fda85Dd8B7E2FB90CCC22A43b3B59A67"
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address payable","name":"_royaltiesRecipient","type":"address"},{"internalType":"address","name":"_eventsNFT","type":"address"},{"internalType":"contract AIORBIT","name":"_aiorbit","type":"address"},{"internalType":"uint256","name":"_tokenPrice","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"tokenId","type":"uint16"},{"indexed":true,"internalType":"uint256","name":"eventId","type":"uint256"},{"indexed":true,"internalType":"address","name":"originalCaller","type":"address"}],"name":"TokenEventAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16[]","name":"tokenIds","type":"uint16[]"},{"indexed":true,"internalType":"uint16[]","name":"_aiorbitIds","type":"uint16[]"}],"name":"TokenForged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"AIORBIT_PER_AIBOLT","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_aiorbitPerAibolt","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"addToAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"tokenId","type":"uint16"},{"internalType":"uint256","name":"eventId","type":"uint256"},{"internalType":"address","name":"originalCaller","type":"address"}],"name":"addTokenEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"aiorbit","outputs":[{"internalType":"contract AIORBIT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint8[]","name":"howMany","type":"uint8[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":[],"name":"eventsNFT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"tokenIds","type":"uint16[]"},{"internalType":"uint16[]","name":"_aiorbitIds","type":"uint16[]"}],"name":"forge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"sun","type":"string"},{"internalType":"string","name":"sunSvg","type":"string"},{"internalType":"uint256","name":"numPlanets","type":"uint256"},{"components":[{"internalType":"enum BoltLib.OrbitSpeed","name":"orbitSpeed","type":"uint8"},{"internalType":"enum BoltLib.PlanetSize","name":"size","type":"uint8"},{"internalType":"string","name":"theme","type":"string"},{"internalType":"string","name":"svg","type":"string"}],"internalType":"struct BoltLib.Planet[3]","name":"planets","type":"tuple[3]"}],"internalType":"struct BoltLib.AIBOLTData","name":"data","type":"tuple"},{"internalType":"uint256","name":"latestEventId","type":"uint256"}],"name":"getLatestEventData","outputs":[{"components":[{"internalType":"string","name":"sun","type":"string"},{"internalType":"string","name":"sunSvg","type":"string"},{"internalType":"uint256","name":"numPlanets","type":"uint256"},{"components":[{"internalType":"enum BoltLib.OrbitSpeed","name":"orbitSpeed","type":"uint8"},{"internalType":"enum BoltLib.PlanetSize","name":"size","type":"uint8"},{"internalType":"string","name":"theme","type":"string"},{"internalType":"string","name":"svg","type":"string"}],"internalType":"struct BoltLib.Planet[3]","name":"planets","type":"tuple[3]"}],"internalType":"struct BoltLib.AIBOLTData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"howMany","type":"uint8"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"removeFromAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltiesRecipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyRate","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":"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":[{"internalType":"address","name":"_eventsNFT","type":"address"}],"name":"setEventNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenPrice","type":"uint256"}],"name":"setTokenPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToEvents","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052604b600c5534801562000015575f80fd5b5060405162006d8e38038062006d8e83398181016040528101906200003b9190620008c3565b8585733cc6cdda760b79bafa08df41ecfa224f810dceb660015f6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b11156200023857801562000109576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff16637d3e3dbe30846040518363ffffffff1660e01b8152600401620000d4929190620009aa565b5f604051808303815f87803b158015620000ec575f80fd5b505af1158015620000ff573d5f803e3d5ffd5b5050505062000237565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614620001bd576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663a0af290330846040518363ffffffff1660e01b815260040162000188929190620009aa565b5f604051808303815f87803b158015620001a0575f80fd5b505af1158015620001b3573d5f803e3d5ffd5b5050505062000236565b6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff16634420e486306040518263ffffffff1660e01b8152600401620002069190620009d5565b5f604051808303815f87803b1580156200021e575f80fd5b505af115801562000231573d5f803e3d5ffd5b505050505b5b5b505081600290816200024b919062000c1e565b5080600390816200025d919062000c1e565b506200026e6200039a60201b60201c565b5f81905550505062000295620002896200039e60201b60201c565b620003a560201b60201c565b60016009819055505f600a5f6101000a81548160ff02191690831515021790555083600b5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600d5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600a60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806010819055506200038e6200046860201b60201c565b50505050505062000dee565b5f90565b5f33905090565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b620004786200048a60201b60201c565b620004886200051b60201b60201c565b565b6200049a6200039e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620004c06200058f60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff161462000519576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620005109062000d60565b60405180910390fd5b565b6200052b620005b760201b60201c565b6001600a5f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620005766200039e60201b60201c565b604051620005859190620009d5565b60405180910390a1565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b620005c76200060c60201b60201c565b156200060a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620006019062000dce565b60405180910390fd5b565b5f600a5f9054906101000a900460ff16905090565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b62000682826200063a565b810181811067ffffffffffffffff82111715620006a457620006a36200064a565b5b80604052505050565b5f620006b862000621565b9050620006c6828262000677565b919050565b5f67ffffffffffffffff821115620006e857620006e76200064a565b5b620006f3826200063a565b9050602081019050919050565b5f5b838110156200071f57808201518184015260208101905062000702565b5f8484015250505050565b5f620007406200073a84620006cb565b620006ad565b9050828152602081018484840111156200075f576200075e62000636565b5b6200076c84828562000700565b509392505050565b5f82601f8301126200078b576200078a62000632565b5b81516200079d8482602086016200072a565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f620007d182620007a6565b9050919050565b620007e381620007c5565b8114620007ee575f80fd5b50565b5f815190506200080181620007d8565b92915050565b5f6200081382620007a6565b9050919050565b620008258162000807565b811462000830575f80fd5b50565b5f8151905062000843816200081a565b92915050565b5f620008558262000807565b9050919050565b620008678162000849565b811462000872575f80fd5b50565b5f8151905062000885816200085c565b92915050565b5f819050919050565b6200089f816200088b565b8114620008aa575f80fd5b50565b5f81519050620008bd8162000894565b92915050565b5f805f805f8060c08789031215620008e057620008df6200062a565b5b5f87015167ffffffffffffffff8111156200090057620008ff6200062e565b5b6200090e89828a0162000774565b965050602087015167ffffffffffffffff8111156200093257620009316200062e565b5b6200094089828a0162000774565b95505060406200095389828a01620007f1565b94505060606200096689828a0162000833565b93505060806200097989828a0162000875565b92505060a06200098c89828a01620008ad565b9150509295509295509295565b620009a48162000807565b82525050565b5f604082019050620009bf5f83018562000999565b620009ce602083018462000999565b9392505050565b5f602082019050620009ea5f83018462000999565b92915050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168062000a3f57607f821691505b60208210810362000a555762000a54620009fa565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830262000ab97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000a7c565b62000ac5868362000a7c565b95508019841693508086168417925050509392505050565b5f819050919050565b5f62000b0662000b0062000afa846200088b565b62000add565b6200088b565b9050919050565b5f819050919050565b62000b218362000ae6565b62000b3962000b308262000b0d565b84845462000a88565b825550505050565b5f90565b62000b4f62000b41565b62000b5c81848462000b16565b505050565b5b8181101562000b835762000b775f8262000b45565b60018101905062000b62565b5050565b601f82111562000bd25762000b9c8162000a5b565b62000ba78462000a6d565b8101602085101562000bb7578190505b62000bcf62000bc68562000a6d565b83018262000b61565b50505b505050565b5f82821c905092915050565b5f62000bf45f198460080262000bd7565b1980831691505092915050565b5f62000c0e838362000be3565b9150826002028217905092915050565b62000c2982620009f0565b67ffffffffffffffff81111562000c455762000c446200064a565b5b62000c51825462000a27565b62000c5e82828562000b87565b5f60209050601f83116001811462000c94575f841562000c7f578287015190505b62000c8b858262000c01565b86555062000cfa565b601f19841662000ca48662000a5b565b5f5b8281101562000ccd5784890151825560018201915060208501945060208101905062000ca6565b8683101562000ced578489015162000ce9601f89168262000be3565b8355505b6001600288020188555050505b505050505050565b5f82825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f62000d4860208362000d02565b915062000d558262000d12565b602082019050919050565b5f6020820190508181035f83015262000d798162000d3a565b9050919050565b7f5061757361626c653a20706175736564000000000000000000000000000000005f82015250565b5f62000db660108362000d02565b915062000dc38262000d80565b602082019050919050565b5f6020820190508181035f83015262000de78162000da8565b9050919050565b615f928062000dfc5f395ff3fe60806040526004361061023a575f3560e01c806370a082311161012d578063a22cb465116100aa578063d86a1f651161006e578063d86a1f651461080d578063dae3553f14610837578063e985e9c514610861578063f2fde38b1461089d578063f49153a0146108c55761023a565b8063a22cb4651461073b578063a51312c814610763578063b88d4fde1461078b578063c4d1510d146107a7578063c87b56dd146107d15761023a565b80638da5cb5b116100f15780638da5cb5b1461066f5780639202134a1461069957806395d89b41146106c1578063a061a03a146106eb578063a21f5598146107135761023a565b806370a08231146105b5578063715018a6146105f15780637263cfe2146106075780637ff9b5961461062f5780638456cb59146106595761023a565b806333f416ac116101bb5780635c975abb1161017f5780635c975abb146104cf5780635e8c420e146104f95780636352211e146105355780636a61e5fc146105715780636ecd2306146105995761023a565b806333f416ac1461040f5780633f4ba83a1461044b57806341f434341461046157806342842e0e1461048b5780635becc9e7146104a75761023a565b806318160ddd1161020257806318160ddd146103265780631d96a0821461035057806323b872dd1461037a5780632848aeaf146103965780632a55205a146103d25761023a565b806301ffc9a71461023e57806306fdde031461027a578063081812fc146102a4578063095ea7b3146102e05780630a67319a146102fc575b5f80fd5b348015610249575f80fd5b50610264600480360381019061025f9190613331565b610901565b6040516102719190613376565b60405180910390f35b348015610285575f80fd5b5061028e610912565b60405161029b9190613419565b60405180910390f35b3480156102af575f80fd5b506102ca60048036038101906102c5919061346c565b6109a2565b6040516102d791906134d6565b60405180910390f35b6102fa60048036038101906102f59190613519565b610a1c565b005b348015610307575f80fd5b50610310610b9a565b60405161031d91906134d6565b60405180910390f35b348015610331575f80fd5b5061033a610bc0565b6040516103479190613566565b60405180910390f35b34801561035b575f80fd5b50610364610bd5565b604051610371919061359f565b60405180910390f35b610394600480360381019061038f91906135b8565b610bfa565b005b3480156103a1575f80fd5b506103bc60048036038101906103b79190613608565b610f47565b6040516103c99190613376565b60405180910390f35b3480156103dd575f80fd5b506103f860048036038101906103f39190613633565b610f64565b604051610406929190613671565b60405180910390f35b34801561041a575f80fd5b5061043560048036038101906104309190613a58565b610fae565b6040516104429190613d46565b60405180910390f35b348015610456575f80fd5b5061045f6111c1565b005b34801561046c575f80fd5b506104756111d3565b6040516104829190613dc1565b60405180910390f35b6104a560048036038101906104a091906135b8565b6111e5565b005b3480156104b2575f80fd5b506104cd60048036038101906104c89190613e11565b611243565b005b3480156104da575f80fd5b506104e36114b4565b6040516104f09190613376565b60405180910390f35b348015610504575f80fd5b5061051f600480360381019061051a9190613e61565b6114c9565b60405161052c9190613eae565b60405180910390f35b348015610540575f80fd5b5061055b6004803603810190610556919061346c565b611503565b60405161056891906134d6565b60405180910390f35b34801561057c575f80fd5b506105976004803603810190610592919061346c565b611514565b005b6105b360048036038101906105ae9190613efd565b611526565b005b3480156105c0575f80fd5b506105db60048036038101906105d69190613608565b611728565b6040516105e89190613566565b60405180910390f35b3480156105fc575f80fd5b506106056117dd565b005b348015610612575f80fd5b5061062d60048036038101906106289190613fe8565b6117f0565b005b34801561063a575f80fd5b50610643611889565b6040516106509190613566565b60405180910390f35b348015610664575f80fd5b5061066d61188f565b005b34801561067a575f80fd5b506106836118a1565b60405161069091906134d6565b60405180910390f35b3480156106a4575f80fd5b506106bf60048036038101906106ba9190613608565b6118c9565b005b3480156106cc575f80fd5b506106d5611915565b6040516106e29190613419565b60405180910390f35b3480156106f6575f80fd5b50610711600480360381019061070c91906140ef565b6119a5565b005b34801561071e575f80fd5b5061073960048036038101906107349190614225565b611a17565b005b348015610746575f80fd5b50610761600480360381019061075c91906142c5565b611e6e565b005b34801561076e575f80fd5b5061078960048036038101906107849190613fe8565b611f7f565b005b6107a560048036038101906107a091906143a1565b612017565b005b3480156107b2575f80fd5b506107bb6120c8565b6040516107c89190613566565b60405180910390f35b3480156107dc575f80fd5b506107f760048036038101906107f2919061346c565b6120ce565b6040516108049190613419565b60405180910390f35b348015610818575f80fd5b506108216124af565b60405161082e9190614441565b60405180910390f35b348015610842575f80fd5b5061084b6124d4565b6040516108589190613eae565b60405180910390f35b34801561086c575f80fd5b506108876004803603810190610882919061445a565b6124d9565b6040516108949190613376565b60405180910390f35b3480156108a8575f80fd5b506108c360048036038101906108be9190613608565b612567565b005b3480156108d0575f80fd5b506108eb60048036038101906108e69190613e61565b6125e9565b6040516108f89190613566565b60405180910390f35b5f61090b82612614565b9050919050565b606060028054610921906144c5565b80601f016020809104026020016040519081016040528092919081815260200182805461094d906144c5565b80156109985780601f1061096f57610100808354040283529160200191610998565b820191905f5260205f20905b81548152906001019060200180831161097b57829003601f168201915b5050505050905090565b5f6109ac826126a5565b6109e2576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b813373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a5a57610a59336126ff565b5b5f610a6483611503565b90508073ffffffffffffffffffffffffffffffffffffffff16610a856127f9565b73ffffffffffffffffffffffffffffffffffffffff1614610ae857610ab181610aac6127f9565b6124d9565b610ae7576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610bc9612800565b6001545f540303905090565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610c3857610c37336126ff565b5b5f610c4283612804565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ca9576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80610cb4856128c7565b91509150610cca8188610cc56127f9565b6128ea565b610d1657610cdf87610cda6127f9565b6124d9565b610d15576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5f73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1603610d7b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d88878787600161292d565b8015610d92575f82555b60055f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815460010191905081905550610e5a86610e36898987612933565b7c02000000000000000000000000000000000000000000000000000000001761295a565b60045f8781526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610ed6575f6001860190505f60045f8381526020019081526020015f205403610ed4575f548114610ed3578360045f8381526020019081526020015f20819055505b5b505b848673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610f3e8787876001612984565b50505050505050565b6011602052805f5260405f205f915054906101000a900460ff1681565b5f80600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166103e8600c5485610f999190614522565b610fa39190614590565b915091509250929050565b610fb661314e565b5f600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636d1884e0846040518263ffffffff1660e01b81526004016110129190613566565b5f60405180830381865afa15801561102c573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906110549190614895565b90505f816101200151511461107f57806101200151845f018190525080610140015184602001819052505b5f816060015151146110dc57806060015184606001515f600381106110a7576110a66148dc565b5b602002015160400181905250806080015184606001515f600381106110cf576110ce6148dc565b5b6020020151606001819052505b5f8160a00151511461113b578060a001518460600151600160038110611105576111046148dc565b5b6020020151604001819052508060c00151846060015160016003811061112e5761112d6148dc565b5b6020020151606001819052505b5f8160e00151511461119b578060e001518460600151600260038110611164576111636148dc565b5b602002015160400181905250806101000151846060015160026003811061118e5761118d6148dc565b5b6020020151606001819052505b5f816101600151146111b7578061016001518460400181815250505b8391505092915050565b6111c961298a565b6111d1612a08565b565b6daaeb6d7670e522a718067333cd4e81565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461122357611222336126ff565b5b61123d84848460405180602001604052805f815250612017565b50505050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ca90614979565b60405180910390fd5b6112e08361ffff166126a5565b61131f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131690614a07565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166113438461ffff16611503565b73ffffffffffffffffffffffffffffffffffffffff1614611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090614a6f565b60405180910390fd5b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142090614ad7565b60405180910390fd5b600e5f8461ffff1661ffff1681526020019081526020015f2082908060018154018082558091505060019003905f5260205f20015f90919091909150558073ffffffffffffffffffffffffffffffffffffffff16828461ffff167f9d69bef09b58f2a8c5773662b27e90d9a424d9e37bb20720454e3b757bdaccc260405160405180910390a4505050565b5f600a5f9054906101000a900460ff16905090565b600f602052815f5260405f2081600581106114e2575f80fd5b60109182820401919006600202915091509054906101000a900461ffff1681565b5f61150d82612804565b9050919050565b61151c61298a565b8060108190555050565b61152e612a69565b611536612ab8565b6107d08160ff16611545610bc0565b61154f9190614af5565b1115611590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158790614b72565b60405180910390fd5b60058160ff1661159f33611728565b6115a99190614af5565b11156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e190614c00565b60405180910390fd5b60115f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90614c68565b60405180910390fd5b8060ff166010546116849190614522565b34146116c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bc90614cd0565b60405180910390fd5b6116d2338260ff16612b02565b6116da6118a1565b73ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f1935050505015801561171c573d5f803e3d5ffd5b50611725612cab565b50565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361178e576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b6117e561298a565b6117ee5f612cb5565b565b6117f861298a565b5f5b815181101561188557600160115f84848151811061181b5761181a6148dc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808061187d90614cee565b9150506117fa565b5050565b60105481565b61189761298a565b61189f612d78565b565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6118d161298a565b80600a60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060038054611924906144c5565b80601f0160208091040260200160405190810160405280929190818152602001828054611950906144c5565b801561199b5780601f106119725761010080835404028352916020019161199b565b820191905f5260205f20905b81548152906001019060200180831161197e57829003601f168201915b5050505050905090565b6119ad61298a565b5f5b82518161ffff161015611a1257611a05838261ffff16815181106119d6576119d56148dc565b5b6020026020010151838361ffff16815181106119f5576119f46148dc565b5b602002602001015160ff16612b02565b80806001019150506119af565b505050565b5f600561ffff168251611a2a9190614d35565b14611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6190614dd5565b60405180910390fd5b8051600561ffff168351611a7e9190614522565b14611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab590614e63565b60405180910390fd5b5f805b83518161ffff161015611e10575f848261ffff1681518110611ae657611ae56148dc565b5b602002602001015190503373ffffffffffffffffffffffffffffffffffffffff16611b148261ffff16611503565b73ffffffffffffffffffffffffffffffffffffffff1614611b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6190614a6f565b60405180910390fd5b611b7261317b565b5f5b600561ffff168161ffff161015611d84575f868287611b939190614e81565b61ffff1681518110611ba857611ba76148dc565b5b602002602001015190503373ffffffffffffffffffffffffffffffffffffffff16600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401611c239190614ee6565b602060405180830381865afa158015611c3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c629190614f13565b73ffffffffffffffffffffffffffffffffffffffff1614611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90614f88565b60405180910390fd5b80838361ffff1660058110611cd057611ccf6148dc565b5b602002019061ffff16908161ffff1681525050600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead846040518463ffffffff1660e01b8152600401611d4393929190614fa6565b5f604051808303815f87803b158015611d5a575f80fd5b505af1158015611d6c573d5f803e3d5ffd5b50505050508080611d7c90614fdb565b915050611b74565b5080600f5f8461ffff1661ffff1681526020019081526020015f20906005611dad92919061319d565b50600e5f8361ffff1661ffff1681526020019081526020015f206001908060018154018082558091505060019003905f5260205f20015f9091909190915055600584611df99190614e81565b935050508080611e0890614fdb565b915050611ac1565b5081604051611e1f91906150b5565b604051809103902083604051611e3591906150b5565b60405180910390207fb13fe97217c908f077e6853d10ad07cf88c5263e74cffbbc9c9aa3059a17cc7b60405160405180910390a3505050565b81611e78816126ff565b8160075f611e846127f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff16611f2d6127f9565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051611f729190613376565b60405180910390a3505050565b611f8761298a565b5f5b8151811015612013575f60115f848481518110611fa957611fa86148dc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808061200b90614cee565b915050611f89565b5050565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461205557612054336126ff565b5b612060858585610bfa565b5f8473ffffffffffffffffffffffffffffffffffffffff163b146120c15761208a85858585612dda565b6120c0576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5050505050565b600c5481565b60606120d9826126a5565b612118576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210f90615115565b60405180910390fd5b5f600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f600e5f8561ffff1661ffff1681526020019081526020015f208054806020026020016040519081016040528092919081815260200182805480156121a057602002820191905f5260205f20905b81548152602001906001019080831161218c575b505050505090505f815190505f6040518060a00160405280600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff1681525090505f821461228957600f5f8761ffff1661ffff1681526020019081526020015f20600580602002604051908101604052809291908260058015612281576020028201915f905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116122485790505b505050505090505b5f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a6763630eeb36836040518263ffffffff1660e01b81526004016122c191906151d8565b5f60405180830381865af41580156122db573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906123039190615436565b90505f845111156123415761233e8185600186612320919061547d565b81518110612331576123306148dc565b5b6020026020010151610fae565b90505b5f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a6763fcc8b9e08387896040518463ffffffff1660e01b815260040161237d93929190615752565b5f60405180830381865af4158015612397573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906123bf9190615795565b90505f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a67632850efa684888a6040518463ffffffff1660e01b81526004016123fd93929190615752565b5f60405180830381865af4158015612417573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061243f9190615795565b90505f61247e61244e8b612f25565b61245785612f74565b8460405160200161246a93929190615ae6565b604051602081830303815290604052612f74565b9050806040516020016124919190615b8c565b60405160208183030381529060405298505050505050505050919050565b600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600581565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b61256f61298a565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036125dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125d490615c1d565b60405180910390fd5b6125e681612cb5565b50565b600e602052815f5260405f208181548110612602575f80fd5b905f5260205f20015f91509150505481565b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061266e57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061269e5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b5f816126af612800565b111580156126bd57505f5482105b80156126f857505f7c010000000000000000000000000000000000000000000000000000000060045f8581526020019081526020015f205416145b9050919050565b5f6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b11156127f6576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b8152600401612775929190615c3b565b602060405180830381865afa158015612790573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127b49190615c76565b6127f557806040517fede71dcc0000000000000000000000000000000000000000000000000000000081526004016127ec91906134d6565b60405180910390fd5b5b50565b5f33905090565b5f90565b5f8082905080612812612800565b11612890575f5481101561288f575f60045f8381526020019081526020015f205490505f7c010000000000000000000000000000000000000000000000000000000082160361288d575b5f81036128835760045f836001900393508381526020019081526020015f2054905061285c565b80925050506128c2565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e86129498686846130e7565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6129926130ef565b73ffffffffffffffffffffffffffffffffffffffff166129b06118a1565b73ffffffffffffffffffffffffffffffffffffffff1614612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd90615ceb565b60405180910390fd5b565b612a106130f6565b5f600a5f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612a526130ef565b604051612a5f91906134d6565b60405180910390a1565b600260095403612aae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa590615d53565b60405180910390fd5b6002600981905550565b612ac06114b4565b15612b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612af790615dbb565b60405180910390fd5b565b5f805490505f8203612b40576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b4c5f84838561292d565b600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282540192505081905550612bbe83612baf5f865f612933565b612bb88561313f565b1761295a565b60045f8381526020019081526020015f20819055505f80838301905073ffffffffffffffffffffffffffffffffffffffff8516915082825f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600183015b818114612c585780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600181019050612c1f565b505f8203612c92576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f819055505050612ca65f848385612984565b505050565b6001600981905550565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612d80612ab8565b6001600a5f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dc36130ef565b604051612dd091906134d6565b60405180910390a1565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612dff6127f9565b8786866040518563ffffffff1660e01b8152600401612e219493929190615e2b565b6020604051808303815f875af1925050508015612e5c57506040513d601f19601f82011682018060405250810190612e599190615e89565b60015b612ed2573d805f8114612e8a576040519150601f19603f3d011682016040523d82523d5f602084013e612e8f565b606091505b505f815103612eca576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b606060a060405101806040526020810391505f825281835b600115612f5f57600184039350600a81066030018453600a8104905080612f3d575b50828103602084039350808452505050919050565b60605f825103612f945760405180602001604052805f81525090506130e2565b5f604051806060016040528060408152602001615f1d6040913990505f600360028551612fc19190614af5565b612fcb9190614590565b6004612fd79190614522565b90505f602082612fe79190614af5565b67ffffffffffffffff81111561300057612fff61369c565b5b6040519080825280601f01601f1916602001820160405280156130325781602001600182028036833780820191505090505b509050818152600183018586518101602084015b818310156130a1576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825360018201915050613046565b6003895106600181146130bb57600281146130cb576130d6565b613d3d60f01b60028303526130d6565b603d60f81b60018303525b50505050508093505050505b919050565b5f9392505050565b5f33905090565b6130fe6114b4565b61313d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161313490615efe565b60405180910390fd5b565b5f6001821460e11b9050919050565b604051806080016040528060608152602001606081526020015f8152602001613175613239565b81525090565b6040518060a00160405280600590602082028036833780820191505090505090565b826005600f01601090048101928215613228579160200282015f5b838211156131f857835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026131b8565b80156132265782816101000a81549061ffff02191690556002016020816001010492830192600103026131f8565b505b5090506132359190613266565b5090565b60405180606001604052806003905b613250613281565b8152602001906001900390816132485790505090565b5b8082111561327d575f815f905550600101613267565b5090565b60405180608001604052805f600281111561329f5761329e613b26565b5b81526020015f60028111156132b7576132b6613b26565b5b815260200160608152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613310816132dc565b811461331a575f80fd5b50565b5f8135905061332b81613307565b92915050565b5f60208284031215613346576133456132d4565b5b5f6133538482850161331d565b91505092915050565b5f8115159050919050565b6133708161335c565b82525050565b5f6020820190506133895f830184613367565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156133c65780820151818401526020810190506133ab565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6133eb8261338f565b6133f58185613399565b93506134058185602086016133a9565b61340e816133d1565b840191505092915050565b5f6020820190508181035f83015261343181846133e1565b905092915050565b5f819050919050565b61344b81613439565b8114613455575f80fd5b50565b5f8135905061346681613442565b92915050565b5f60208284031215613481576134806132d4565b5b5f61348e84828501613458565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6134c082613497565b9050919050565b6134d0816134b6565b82525050565b5f6020820190506134e95f8301846134c7565b92915050565b6134f8816134b6565b8114613502575f80fd5b50565b5f81359050613513816134ef565b92915050565b5f806040838503121561352f5761352e6132d4565b5b5f61353c85828601613505565b925050602061354d85828601613458565b9150509250929050565b61356081613439565b82525050565b5f6020820190506135795f830184613557565b92915050565b5f61358982613497565b9050919050565b6135998161357f565b82525050565b5f6020820190506135b25f830184613590565b92915050565b5f805f606084860312156135cf576135ce6132d4565b5b5f6135dc86828701613505565b93505060206135ed86828701613505565b92505060406135fe86828701613458565b9150509250925092565b5f6020828403121561361d5761361c6132d4565b5b5f61362a84828501613505565b91505092915050565b5f8060408385031215613649576136486132d4565b5b5f61365685828601613458565b925050602061366785828601613458565b9150509250929050565b5f6040820190506136845f8301856134c7565b6136916020830184613557565b9392505050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6136d2826133d1565b810181811067ffffffffffffffff821117156136f1576136f061369c565b5b80604052505050565b5f6137036132cb565b905061370f82826136c9565b919050565b5f80fd5b5f80fd5b5f80fd5b5f67ffffffffffffffff82111561373a5761373961369c565b5b613743826133d1565b9050602081019050919050565b828183375f83830152505050565b5f61377061376b84613720565b6136fa565b90508281526020810184848401111561378c5761378b61371c565b5b613797848285613750565b509392505050565b5f82601f8301126137b3576137b2613718565b5b81356137c384826020860161375e565b91505092915050565b5f67ffffffffffffffff8211156137e6576137e561369c565b5b602082029050919050565b5f80fd5b60038110613801575f80fd5b50565b5f81359050613812816137f5565b92915050565b60038110613824575f80fd5b50565b5f8135905061383581613818565b92915050565b5f608082840312156138505761384f613698565b5b61385a60806136fa565b90505f61386984828501613804565b5f83015250602061387c84828501613827565b602083015250604082013567ffffffffffffffff8111156138a05761389f613714565b5b6138ac8482850161379f565b604083015250606082013567ffffffffffffffff8111156138d0576138cf613714565b5b6138dc8482850161379f565b60608301525092915050565b5f6138fa6138f5846137cc565b6136fa565b90508060208402830185811115613914576139136137f1565b5b835b8181101561395b57803567ffffffffffffffff81111561393957613938613718565b5b808601613946898261383b565b85526020850194505050602081019050613916565b5050509392505050565b5f82601f83011261397957613978613718565b5b60036139868482856138e8565b91505092915050565b5f608082840312156139a4576139a3613698565b5b6139ae60806136fa565b90505f82013567ffffffffffffffff8111156139cd576139cc613714565b5b6139d98482850161379f565b5f83015250602082013567ffffffffffffffff8111156139fc576139fb613714565b5b613a088482850161379f565b6020830152506040613a1c84828501613458565b604083015250606082013567ffffffffffffffff811115613a4057613a3f613714565b5b613a4c84828501613965565b60608301525092915050565b5f8060408385031215613a6e57613a6d6132d4565b5b5f83013567ffffffffffffffff811115613a8b57613a8a6132d8565b5b613a978582860161398f565b9250506020613aa885828601613458565b9150509250929050565b5f82825260208201905092915050565b5f613acc8261338f565b613ad68185613ab2565b9350613ae68185602086016133a9565b613aef816133d1565b840191505092915050565b613b0381613439565b82525050565b5f60039050919050565b5f81905092915050565b5f819050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60038110613b6457613b63613b26565b5b50565b5f819050613b7482613b53565b919050565b5f613b8382613b67565b9050919050565b613b9381613b79565b82525050565b60038110613baa57613ba9613b26565b5b50565b5f819050613bba82613b99565b919050565b5f613bc982613bad565b9050919050565b613bd981613bbf565b82525050565b5f608083015f830151613bf45f860182613b8a565b506020830151613c076020860182613bd0565b5060408301518482036040860152613c1f8282613ac2565b91505060608301518482036060860152613c398282613ac2565b9150508091505092915050565b5f613c518383613bdf565b905092915050565b5f602082019050919050565b5f613c6f82613b09565b613c798185613b13565b935083602082028501613c8b85613b1d565b805f5b85811015613cc65784840389528151613ca78582613c46565b9450613cb283613c59565b925060208a01995050600181019050613c8e565b50829750879550505050505092915050565b5f608083015f8301518482035f860152613cf28282613ac2565b91505060208301518482036020860152613d0c8282613ac2565b9150506040830151613d216040860182613afa565b5060608301518482036060860152613d398282613c65565b9150508091505092915050565b5f6020820190508181035f830152613d5e8184613cd8565b905092915050565b5f819050919050565b5f613d89613d84613d7f84613497565b613d66565b613497565b9050919050565b5f613d9a82613d6f565b9050919050565b5f613dab82613d90565b9050919050565b613dbb81613da1565b82525050565b5f602082019050613dd45f830184613db2565b92915050565b5f61ffff82169050919050565b613df081613dda565b8114613dfa575f80fd5b50565b5f81359050613e0b81613de7565b92915050565b5f805f60608486031215613e2857613e276132d4565b5b5f613e3586828701613dfd565b9350506020613e4686828701613458565b9250506040613e5786828701613505565b9150509250925092565b5f8060408385031215613e7757613e766132d4565b5b5f613e8485828601613dfd565b9250506020613e9585828601613458565b9150509250929050565b613ea881613dda565b82525050565b5f602082019050613ec15f830184613e9f565b92915050565b5f60ff82169050919050565b613edc81613ec7565b8114613ee6575f80fd5b50565b5f81359050613ef781613ed3565b92915050565b5f60208284031215613f1257613f116132d4565b5b5f613f1f84828501613ee9565b91505092915050565b5f67ffffffffffffffff821115613f4257613f4161369c565b5b602082029050602081019050919050565b5f613f65613f6084613f28565b6136fa565b90508083825260208201905060208402830185811115613f8857613f876137f1565b5b835b81811015613fb15780613f9d8882613505565b845260208401935050602081019050613f8a565b5050509392505050565b5f82601f830112613fcf57613fce613718565b5b8135613fdf848260208601613f53565b91505092915050565b5f60208284031215613ffd57613ffc6132d4565b5b5f82013567ffffffffffffffff81111561401a576140196132d8565b5b61402684828501613fbb565b91505092915050565b5f67ffffffffffffffff8211156140495761404861369c565b5b602082029050602081019050919050565b5f61406c6140678461402f565b6136fa565b9050808382526020820190506020840283018581111561408f5761408e6137f1565b5b835b818110156140b857806140a48882613ee9565b845260208401935050602081019050614091565b5050509392505050565b5f82601f8301126140d6576140d5613718565b5b81356140e684826020860161405a565b91505092915050565b5f8060408385031215614105576141046132d4565b5b5f83013567ffffffffffffffff811115614122576141216132d8565b5b61412e85828601613fbb565b925050602083013567ffffffffffffffff81111561414f5761414e6132d8565b5b61415b858286016140c2565b9150509250929050565b5f67ffffffffffffffff82111561417f5761417e61369c565b5b602082029050602081019050919050565b5f6141a261419d84614165565b6136fa565b905080838252602082019050602084028301858111156141c5576141c46137f1565b5b835b818110156141ee57806141da8882613dfd565b8452602084019350506020810190506141c7565b5050509392505050565b5f82601f83011261420c5761420b613718565b5b813561421c848260208601614190565b91505092915050565b5f806040838503121561423b5761423a6132d4565b5b5f83013567ffffffffffffffff811115614258576142576132d8565b5b614264858286016141f8565b925050602083013567ffffffffffffffff811115614285576142846132d8565b5b614291858286016141f8565b9150509250929050565b6142a48161335c565b81146142ae575f80fd5b50565b5f813590506142bf8161429b565b92915050565b5f80604083850312156142db576142da6132d4565b5b5f6142e885828601613505565b92505060206142f9858286016142b1565b9150509250929050565b5f67ffffffffffffffff82111561431d5761431c61369c565b5b614326826133d1565b9050602081019050919050565b5f61434561434084614303565b6136fa565b9050828152602081018484840111156143615761436061371c565b5b61436c848285613750565b509392505050565b5f82601f83011261438857614387613718565b5b8135614398848260208601614333565b91505092915050565b5f805f80608085870312156143b9576143b86132d4565b5b5f6143c687828801613505565b94505060206143d787828801613505565b93505060406143e887828801613458565b925050606085013567ffffffffffffffff811115614409576144086132d8565b5b61441587828801614374565b91505092959194509250565b5f61442b82613d90565b9050919050565b61443b81614421565b82525050565b5f6020820190506144545f830184614432565b92915050565b5f80604083850312156144705761446f6132d4565b5b5f61447d85828601613505565b925050602061448e85828601613505565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806144dc57607f821691505b6020821081036144ef576144ee614498565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61452c82613439565b915061453783613439565b925082820261454581613439565b9150828204841483151761455c5761455b6144f5565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61459a82613439565b91506145a583613439565b9250826145b5576145b4614563565b5b828204905092915050565b5f6145d26145cd84613720565b6136fa565b9050828152602081018484840111156145ee576145ed61371c565b5b6145f98482856133a9565b509392505050565b5f82601f83011261461557614614613718565b5b81516146258482602086016145c0565b91505092915050565b5f8151905061463c81613442565b92915050565b5f610180828403121561465857614657613698565b5b6146636101806136fa565b90505f82015167ffffffffffffffff81111561468257614681613714565b5b61468e84828501614601565b5f83015250602082015167ffffffffffffffff8111156146b1576146b0613714565b5b6146bd84828501614601565b602083015250604082015167ffffffffffffffff8111156146e1576146e0613714565b5b6146ed84828501614601565b604083015250606082015167ffffffffffffffff81111561471157614710613714565b5b61471d84828501614601565b606083015250608082015167ffffffffffffffff81111561474157614740613714565b5b61474d84828501614601565b60808301525060a082015167ffffffffffffffff81111561477157614770613714565b5b61477d84828501614601565b60a08301525060c082015167ffffffffffffffff8111156147a1576147a0613714565b5b6147ad84828501614601565b60c08301525060e082015167ffffffffffffffff8111156147d1576147d0613714565b5b6147dd84828501614601565b60e08301525061010082015167ffffffffffffffff81111561480257614801613714565b5b61480e84828501614601565b6101008301525061012082015167ffffffffffffffff81111561483457614833613714565b5b61484084828501614601565b6101208301525061014082015167ffffffffffffffff81111561486657614865613714565b5b61487284828501614601565b610140830152506101606148888482850161462e565b6101608301525092915050565b5f602082840312156148aa576148a96132d4565b5b5f82015167ffffffffffffffff8111156148c7576148c66132d8565b5b6148d384828501614642565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4f6e6c79204576656e744e46542063616e2063616c6c20746869732066756e635f8201527f74696f6e00000000000000000000000000000000000000000000000000000000602082015250565b5f614963602483613399565b915061496e82614909565b604082019050919050565b5f6020820190508181035f83015261499081614957565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e65785f8201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b5f6149f1602c83613399565b91506149fc82614997565b604082019050919050565b5f6020820190508181035f830152614a1e816149e5565b9050919050565b7f43616c6c6572206d757374206f776e20746865204149424f4c540000000000005f82015250565b5f614a59601a83613399565b9150614a6482614a25565b602082019050919050565b5f6020820190508181035f830152614a8681614a4d565b9050919050565b7f4e6f7420617574686f72697a6564204576656e7420636f6e74726163740000005f82015250565b5f614ac1601d83613399565b9150614acc82614a8d565b602082019050919050565b5f6020820190508181035f830152614aee81614ab5565b9050919050565b5f614aff82613439565b9150614b0a83613439565b9250828201905080821115614b2257614b216144f5565b5b92915050565b7f4d6178696d756d20737570706c79206f6620322c3030302072656163686564005f82015250565b5f614b5c601f83613399565b9150614b6782614b28565b602082019050919050565b5f6020820190508181035f830152614b8981614b50565b9050919050565b7f43616e6e6f7420657863656564206d696e74206c696d6974206f6620352070655f8201527f722077616c6c6574000000000000000000000000000000000000000000000000602082015250565b5f614bea602883613399565b9150614bf582614b90565b604082019050919050565b5f6020820190508181035f830152614c1781614bde565b9050919050565b7f4e6f74206f6e2074686520616c6c6f77206c69737400000000000000000000005f82015250565b5f614c52601583613399565b9150614c5d82614c1e565b602082019050919050565b5f6020820190508181035f830152614c7f81614c46565b9050919050565b7f496e636f7272656374207061796d656e742076616c75650000000000000000005f82015250565b5f614cba601783613399565b9150614cc582614c86565b602082019050919050565b5f6020820190508181035f830152614ce781614cae565b9050919050565b5f614cf882613439565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d2a57614d296144f5565b5b600182019050919050565b5f614d3f82613439565b9150614d4a83613439565b925082614d5a57614d59614563565b5b828206905092915050565b7f496e636f7272656374206e756d626572206f662041494f5242495420494473205f8201527f70726f7669646564000000000000000000000000000000000000000000000000602082015250565b5f614dbf602883613399565b9150614dca82614d65565b604082019050919050565b5f6020820190508181035f830152614dec81614db3565b9050919050565b7f4d69736d61746368206265747765656e206e756d626572206f6620746f6b656e5f8201527f7320616e642061696f7262697473000000000000000000000000000000000000602082015250565b5f614e4d602e83613399565b9150614e5882614df3565b604082019050919050565b5f6020820190508181035f830152614e7a81614e41565b9050919050565b5f614e8b82613dda565b9150614e9683613dda565b9250828201905061ffff811115614eb057614eaf6144f5565b5b92915050565b5f614ed0614ecb614ec684613dda565b613d66565b613439565b9050919050565b614ee081614eb6565b82525050565b5f602082019050614ef95f830184614ed7565b92915050565b5f81519050614f0d816134ef565b92915050565b5f60208284031215614f2857614f276132d4565b5b5f614f3584828501614eff565b91505092915050565b7f43616c6c6572206d757374206f776e207468652041494f5242495473000000005f82015250565b5f614f72601c83613399565b9150614f7d82614f3e565b602082019050919050565b5f6020820190508181035f830152614f9f81614f66565b9050919050565b5f606082019050614fb95f8301866134c7565b614fc660208301856134c7565b614fd36040830184614ed7565b949350505050565b5f614fe582613dda565b915061ffff8203614ff957614ff86144f5565b5b600182019050919050565b5f81519050919050565b5f81905092915050565b5f819050602082019050919050565b61503081613dda565b82525050565b5f6150418383615027565b60208301905092915050565b5f602082019050919050565b5f61506382615004565b61506d818561500e565b935061507883615018565b805f5b838110156150a857815161508f8882615036565b975061509a8361504d565b92505060018101905061507b565b5085935050505092915050565b5f6150c08284615059565b915081905092915050565b7f546f6b656e20646f6573206e6f742065786973740000000000000000000000005f82015250565b5f6150ff601483613399565b915061510a826150cb565b602082019050919050565b5f6020820190508181035f83015261512c816150f3565b9050919050565b5f60059050919050565b5f81905092915050565b5f819050919050565b61515981613dda565b82525050565b5f61516a8383615150565b60208301905092915050565b5f602082019050919050565b61518b81615133565b615195818461513d565b92506151a082615147565b805f5b838110156151d05781516151b7878261515f565b96506151c283615176565b9250506001810190506151a3565b505050505050565b5f60a0820190506151eb5f830184615182565b92915050565b5f815190506151ff816137f5565b92915050565b5f8151905061521381613818565b92915050565b5f6080828403121561522e5761522d613698565b5b61523860806136fa565b90505f615247848285016151f1565b5f83015250602061525a84828501615205565b602083015250604082015167ffffffffffffffff81111561527e5761527d613714565b5b61528a84828501614601565b604083015250606082015167ffffffffffffffff8111156152ae576152ad613714565b5b6152ba84828501614601565b60608301525092915050565b5f6152d86152d3846137cc565b6136fa565b905080602084028301858111156152f2576152f16137f1565b5b835b8181101561533957805167ffffffffffffffff81111561531757615316613718565b5b8086016153248982615219565b855260208501945050506020810190506152f4565b5050509392505050565b5f82601f83011261535757615356613718565b5b60036153648482856152c6565b91505092915050565b5f6080828403121561538257615381613698565b5b61538c60806136fa565b90505f82015167ffffffffffffffff8111156153ab576153aa613714565b5b6153b784828501614601565b5f83015250602082015167ffffffffffffffff8111156153da576153d9613714565b5b6153e684828501614601565b60208301525060406153fa8482850161462e565b604083015250606082015167ffffffffffffffff81111561541e5761541d613714565b5b61542a84828501615343565b60608301525092915050565b5f6020828403121561544b5761544a6132d4565b5b5f82015167ffffffffffffffff811115615468576154676132d8565b5b6154748482850161536d565b91505092915050565b5f61548782613439565b915061549283613439565b92508282039050818111156154aa576154a96144f5565b5b92915050565b5f82825260208201905092915050565b5f6154ca8261338f565b6154d481856154b0565b93506154e48185602086016133a9565b6154ed816133d1565b840191505092915050565b61550181613439565b82525050565b5f81905092915050565b61551a81613b79565b82525050565b61552981613bbf565b82525050565b5f608083015f8301516155445f860182615511565b5060208301516155576020860182615520565b506040830151848203604086015261556f82826154c0565b9150506060830151848203606086015261558982826154c0565b9150508091505092915050565b5f6155a1838361552f565b905092915050565b5f6155b382613b09565b6155bd8185615507565b9350836020820285016155cf85613b1d565b805f5b8581101561560a57848403895281516155eb8582615596565b94506155f683613c59565b925060208a019950506001810190506155d2565b50829750879550505050505092915050565b5f608083015f8301518482035f86015261563682826154c0565b9150506020830151848203602086015261565082826154c0565b915050604083015161566560408601826154f8565b506060830151848203606086015261567d82826155a9565b9150508091505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f6156be83836154f8565b60208301905092915050565b5f602082019050919050565b5f6156e08261568a565b6156ea8185615694565b93506156f5836156a4565b805f5b8381101561572557815161570c88826156b3565b9750615717836156ca565b9250506001810190506156f8565b5085935050505092915050565b5f61573c82613d90565b9050919050565b61574c81615732565b82525050565b5f6060820190508181035f83015261576a818661561c565b9050818103602083015261577e81856156d6565b905061578d6040830184615743565b949350505050565b5f602082840312156157aa576157a96132d4565b5b5f82015167ffffffffffffffff8111156157c7576157c66132d8565b5b6157d384828501614601565b91505092915050565b5f81905092915050565b7f7b226e616d65223a20224149424f4c54202300000000000000000000000000005f82015250565b5f61581a6012836157dc565b9150615825826157e6565b601282019050919050565b5f61583a8261338f565b61584481856157dc565b93506158548185602086016133a9565b80840191505092915050565b7f222c20226465736372697074696f6e223a2022546865206669727374206576655f8201527f722064796e616d6963206f6e2d636861696e2073746f727974656c6c696e672060208201527f4e4654732e204576657279204149424f4c542069732066756c6c79206f6e2d6360408201527f6861696e2c20616e6420746865697220747261697473202876697375616c6c7960608201527f20616e64207261726974792920617265207570677261646561626c652062792060808201527f63617573696e67204576656e74732e204576656e747320617265207472616e7360a08201527f616374696f6e73207265636f72646564206f6e2d636861696e2e205768656e2060c08201527f636861696e206f66204576656e74732061726520737461636b65642c2061206c60e08201527f6f7265206973207772697474656e20627920414920746861742063616e2062656101008201527f206164617074656420746f206f74686572206d656469756d732e222c2022696d6101208201527f616765223a2022646174613a696d6167652f7376672b786d6c3b6261736536346101408201527f2c0000000000000000000000000000000000000000000000000000000000000061016082015250565b5f615a3b610161836157dc565b9150615a4682615860565b61016182019050919050565b7f222c202261747472696275746573223a200000000000000000000000000000005f82015250565b5f615a866011836157dc565b9150615a9182615a52565b601182019050919050565b7f7d000000000000000000000000000000000000000000000000000000000000005f82015250565b5f615ad06001836157dc565b9150615adb82615a9c565b600182019050919050565b5f615af08261580e565b9150615afc8286615830565b9150615b0782615a2e565b9150615b138285615830565b9150615b1e82615a7a565b9150615b2a8284615830565b9150615b3582615ac4565b9150819050949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000005f82015250565b5f615b76601d836157dc565b9150615b8182615b42565b601d82019050919050565b5f615b9682615b6a565b9150615ba28284615830565b915081905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f615c07602683613399565b9150615c1282615bad565b604082019050919050565b5f6020820190508181035f830152615c3481615bfb565b9050919050565b5f604082019050615c4e5f8301856134c7565b615c5b60208301846134c7565b9392505050565b5f81519050615c708161429b565b92915050565b5f60208284031215615c8b57615c8a6132d4565b5b5f615c9884828501615c62565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f615cd5602083613399565b9150615ce082615ca1565b602082019050919050565b5f6020820190508181035f830152615d0281615cc9565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f615d3d601f83613399565b9150615d4882615d09565b602082019050919050565b5f6020820190508181035f830152615d6a81615d31565b9050919050565b7f5061757361626c653a20706175736564000000000000000000000000000000005f82015250565b5f615da5601083613399565b9150615db082615d71565b602082019050919050565b5f6020820190508181035f830152615dd281615d99565b9050919050565b5f81519050919050565b5f82825260208201905092915050565b5f615dfd82615dd9565b615e078185615de3565b9350615e178185602086016133a9565b615e20816133d1565b840191505092915050565b5f608082019050615e3e5f8301876134c7565b615e4b60208301866134c7565b615e586040830185613557565b8181036060830152615e6a8184615df3565b905095945050505050565b5f81519050615e8381613307565b92915050565b5f60208284031215615e9e57615e9d6132d4565b5b5f615eab84828501615e75565b91505092915050565b7f5061757361626c653a206e6f74207061757365640000000000000000000000005f82015250565b5f615ee8601483613399565b9150615ef382615eb4565b602082019050919050565b5f6020820190508181035f830152615f1581615edc565b905091905056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122016beaade78e77a7c383502293922dc15f1ba2a8dd5a529eae85ff869276f0c1064736f6c6343000814003300000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000b143e80e8bc1f493b6de979ba01d8c026d94c028000000000000000000000000f49c23e8ac6fbc8cc376c61b738503c6e96fb4ed000000000000000000000000ba66a7c5e1f89a542e3108e3df155a9bf41ac824000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000064149424f4c5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004424f4c5400000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061023a575f3560e01c806370a082311161012d578063a22cb465116100aa578063d86a1f651161006e578063d86a1f651461080d578063dae3553f14610837578063e985e9c514610861578063f2fde38b1461089d578063f49153a0146108c55761023a565b8063a22cb4651461073b578063a51312c814610763578063b88d4fde1461078b578063c4d1510d146107a7578063c87b56dd146107d15761023a565b80638da5cb5b116100f15780638da5cb5b1461066f5780639202134a1461069957806395d89b41146106c1578063a061a03a146106eb578063a21f5598146107135761023a565b806370a08231146105b5578063715018a6146105f15780637263cfe2146106075780637ff9b5961461062f5780638456cb59146106595761023a565b806333f416ac116101bb5780635c975abb1161017f5780635c975abb146104cf5780635e8c420e146104f95780636352211e146105355780636a61e5fc146105715780636ecd2306146105995761023a565b806333f416ac1461040f5780633f4ba83a1461044b57806341f434341461046157806342842e0e1461048b5780635becc9e7146104a75761023a565b806318160ddd1161020257806318160ddd146103265780631d96a0821461035057806323b872dd1461037a5780632848aeaf146103965780632a55205a146103d25761023a565b806301ffc9a71461023e57806306fdde031461027a578063081812fc146102a4578063095ea7b3146102e05780630a67319a146102fc575b5f80fd5b348015610249575f80fd5b50610264600480360381019061025f9190613331565b610901565b6040516102719190613376565b60405180910390f35b348015610285575f80fd5b5061028e610912565b60405161029b9190613419565b60405180910390f35b3480156102af575f80fd5b506102ca60048036038101906102c5919061346c565b6109a2565b6040516102d791906134d6565b60405180910390f35b6102fa60048036038101906102f59190613519565b610a1c565b005b348015610307575f80fd5b50610310610b9a565b60405161031d91906134d6565b60405180910390f35b348015610331575f80fd5b5061033a610bc0565b6040516103479190613566565b60405180910390f35b34801561035b575f80fd5b50610364610bd5565b604051610371919061359f565b60405180910390f35b610394600480360381019061038f91906135b8565b610bfa565b005b3480156103a1575f80fd5b506103bc60048036038101906103b79190613608565b610f47565b6040516103c99190613376565b60405180910390f35b3480156103dd575f80fd5b506103f860048036038101906103f39190613633565b610f64565b604051610406929190613671565b60405180910390f35b34801561041a575f80fd5b5061043560048036038101906104309190613a58565b610fae565b6040516104429190613d46565b60405180910390f35b348015610456575f80fd5b5061045f6111c1565b005b34801561046c575f80fd5b506104756111d3565b6040516104829190613dc1565b60405180910390f35b6104a560048036038101906104a091906135b8565b6111e5565b005b3480156104b2575f80fd5b506104cd60048036038101906104c89190613e11565b611243565b005b3480156104da575f80fd5b506104e36114b4565b6040516104f09190613376565b60405180910390f35b348015610504575f80fd5b5061051f600480360381019061051a9190613e61565b6114c9565b60405161052c9190613eae565b60405180910390f35b348015610540575f80fd5b5061055b6004803603810190610556919061346c565b611503565b60405161056891906134d6565b60405180910390f35b34801561057c575f80fd5b506105976004803603810190610592919061346c565b611514565b005b6105b360048036038101906105ae9190613efd565b611526565b005b3480156105c0575f80fd5b506105db60048036038101906105d69190613608565b611728565b6040516105e89190613566565b60405180910390f35b3480156105fc575f80fd5b506106056117dd565b005b348015610612575f80fd5b5061062d60048036038101906106289190613fe8565b6117f0565b005b34801561063a575f80fd5b50610643611889565b6040516106509190613566565b60405180910390f35b348015610664575f80fd5b5061066d61188f565b005b34801561067a575f80fd5b506106836118a1565b60405161069091906134d6565b60405180910390f35b3480156106a4575f80fd5b506106bf60048036038101906106ba9190613608565b6118c9565b005b3480156106cc575f80fd5b506106d5611915565b6040516106e29190613419565b60405180910390f35b3480156106f6575f80fd5b50610711600480360381019061070c91906140ef565b6119a5565b005b34801561071e575f80fd5b5061073960048036038101906107349190614225565b611a17565b005b348015610746575f80fd5b50610761600480360381019061075c91906142c5565b611e6e565b005b34801561076e575f80fd5b5061078960048036038101906107849190613fe8565b611f7f565b005b6107a560048036038101906107a091906143a1565b612017565b005b3480156107b2575f80fd5b506107bb6120c8565b6040516107c89190613566565b60405180910390f35b3480156107dc575f80fd5b506107f760048036038101906107f2919061346c565b6120ce565b6040516108049190613419565b60405180910390f35b348015610818575f80fd5b506108216124af565b60405161082e9190614441565b60405180910390f35b348015610842575f80fd5b5061084b6124d4565b6040516108589190613eae565b60405180910390f35b34801561086c575f80fd5b506108876004803603810190610882919061445a565b6124d9565b6040516108949190613376565b60405180910390f35b3480156108a8575f80fd5b506108c360048036038101906108be9190613608565b612567565b005b3480156108d0575f80fd5b506108eb60048036038101906108e69190613e61565b6125e9565b6040516108f89190613566565b60405180910390f35b5f61090b82612614565b9050919050565b606060028054610921906144c5565b80601f016020809104026020016040519081016040528092919081815260200182805461094d906144c5565b80156109985780601f1061096f57610100808354040283529160200191610998565b820191905f5260205f20905b81548152906001019060200180831161097b57829003601f168201915b5050505050905090565b5f6109ac826126a5565b6109e2576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b813373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a5a57610a59336126ff565b5b5f610a6483611503565b90508073ffffffffffffffffffffffffffffffffffffffff16610a856127f9565b73ffffffffffffffffffffffffffffffffffffffff1614610ae857610ab181610aac6127f9565b6124d9565b610ae7576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610bc9612800565b6001545f540303905090565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610c3857610c37336126ff565b5b5f610c4283612804565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ca9576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80610cb4856128c7565b91509150610cca8188610cc56127f9565b6128ea565b610d1657610cdf87610cda6127f9565b6124d9565b610d15576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5f73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1603610d7b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d88878787600161292d565b8015610d92575f82555b60055f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815460010191905081905550610e5a86610e36898987612933565b7c02000000000000000000000000000000000000000000000000000000001761295a565b60045f8781526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610ed6575f6001860190505f60045f8381526020019081526020015f205403610ed4575f548114610ed3578360045f8381526020019081526020015f20819055505b5b505b848673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610f3e8787876001612984565b50505050505050565b6011602052805f5260405f205f915054906101000a900460ff1681565b5f80600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166103e8600c5485610f999190614522565b610fa39190614590565b915091509250929050565b610fb661314e565b5f600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636d1884e0846040518263ffffffff1660e01b81526004016110129190613566565b5f60405180830381865afa15801561102c573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906110549190614895565b90505f816101200151511461107f57806101200151845f018190525080610140015184602001819052505b5f816060015151146110dc57806060015184606001515f600381106110a7576110a66148dc565b5b602002015160400181905250806080015184606001515f600381106110cf576110ce6148dc565b5b6020020151606001819052505b5f8160a00151511461113b578060a001518460600151600160038110611105576111046148dc565b5b6020020151604001819052508060c00151846060015160016003811061112e5761112d6148dc565b5b6020020151606001819052505b5f8160e00151511461119b578060e001518460600151600260038110611164576111636148dc565b5b602002015160400181905250806101000151846060015160026003811061118e5761118d6148dc565b5b6020020151606001819052505b5f816101600151146111b7578061016001518460400181815250505b8391505092915050565b6111c961298a565b6111d1612a08565b565b6daaeb6d7670e522a718067333cd4e81565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461122357611222336126ff565b5b61123d84848460405180602001604052805f815250612017565b50505050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ca90614979565b60405180910390fd5b6112e08361ffff166126a5565b61131f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131690614a07565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166113438461ffff16611503565b73ffffffffffffffffffffffffffffffffffffffff1614611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090614a6f565b60405180910390fd5b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142090614ad7565b60405180910390fd5b600e5f8461ffff1661ffff1681526020019081526020015f2082908060018154018082558091505060019003905f5260205f20015f90919091909150558073ffffffffffffffffffffffffffffffffffffffff16828461ffff167f9d69bef09b58f2a8c5773662b27e90d9a424d9e37bb20720454e3b757bdaccc260405160405180910390a4505050565b5f600a5f9054906101000a900460ff16905090565b600f602052815f5260405f2081600581106114e2575f80fd5b60109182820401919006600202915091509054906101000a900461ffff1681565b5f61150d82612804565b9050919050565b61151c61298a565b8060108190555050565b61152e612a69565b611536612ab8565b6107d08160ff16611545610bc0565b61154f9190614af5565b1115611590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158790614b72565b60405180910390fd5b60058160ff1661159f33611728565b6115a99190614af5565b11156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e190614c00565b60405180910390fd5b60115f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90614c68565b60405180910390fd5b8060ff166010546116849190614522565b34146116c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bc90614cd0565b60405180910390fd5b6116d2338260ff16612b02565b6116da6118a1565b73ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f1935050505015801561171c573d5f803e3d5ffd5b50611725612cab565b50565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361178e576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b6117e561298a565b6117ee5f612cb5565b565b6117f861298a565b5f5b815181101561188557600160115f84848151811061181b5761181a6148dc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808061187d90614cee565b9150506117fa565b5050565b60105481565b61189761298a565b61189f612d78565b565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6118d161298a565b80600a60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060038054611924906144c5565b80601f0160208091040260200160405190810160405280929190818152602001828054611950906144c5565b801561199b5780601f106119725761010080835404028352916020019161199b565b820191905f5260205f20905b81548152906001019060200180831161197e57829003601f168201915b5050505050905090565b6119ad61298a565b5f5b82518161ffff161015611a1257611a05838261ffff16815181106119d6576119d56148dc565b5b6020026020010151838361ffff16815181106119f5576119f46148dc565b5b602002602001015160ff16612b02565b80806001019150506119af565b505050565b5f600561ffff168251611a2a9190614d35565b14611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6190614dd5565b60405180910390fd5b8051600561ffff168351611a7e9190614522565b14611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab590614e63565b60405180910390fd5b5f805b83518161ffff161015611e10575f848261ffff1681518110611ae657611ae56148dc565b5b602002602001015190503373ffffffffffffffffffffffffffffffffffffffff16611b148261ffff16611503565b73ffffffffffffffffffffffffffffffffffffffff1614611b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6190614a6f565b60405180910390fd5b611b7261317b565b5f5b600561ffff168161ffff161015611d84575f868287611b939190614e81565b61ffff1681518110611ba857611ba76148dc565b5b602002602001015190503373ffffffffffffffffffffffffffffffffffffffff16600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401611c239190614ee6565b602060405180830381865afa158015611c3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c629190614f13565b73ffffffffffffffffffffffffffffffffffffffff1614611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90614f88565b60405180910390fd5b80838361ffff1660058110611cd057611ccf6148dc565b5b602002019061ffff16908161ffff1681525050600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead846040518463ffffffff1660e01b8152600401611d4393929190614fa6565b5f604051808303815f87803b158015611d5a575f80fd5b505af1158015611d6c573d5f803e3d5ffd5b50505050508080611d7c90614fdb565b915050611b74565b5080600f5f8461ffff1661ffff1681526020019081526020015f20906005611dad92919061319d565b50600e5f8361ffff1661ffff1681526020019081526020015f206001908060018154018082558091505060019003905f5260205f20015f9091909190915055600584611df99190614e81565b935050508080611e0890614fdb565b915050611ac1565b5081604051611e1f91906150b5565b604051809103902083604051611e3591906150b5565b60405180910390207fb13fe97217c908f077e6853d10ad07cf88c5263e74cffbbc9c9aa3059a17cc7b60405160405180910390a3505050565b81611e78816126ff565b8160075f611e846127f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff16611f2d6127f9565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051611f729190613376565b60405180910390a3505050565b611f8761298a565b5f5b8151811015612013575f60115f848481518110611fa957611fa86148dc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808061200b90614cee565b915050611f89565b5050565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461205557612054336126ff565b5b612060858585610bfa565b5f8473ffffffffffffffffffffffffffffffffffffffff163b146120c15761208a85858585612dda565b6120c0576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5050505050565b600c5481565b60606120d9826126a5565b612118576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210f90615115565b60405180910390fd5b5f600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f600e5f8561ffff1661ffff1681526020019081526020015f208054806020026020016040519081016040528092919081815260200182805480156121a057602002820191905f5260205f20905b81548152602001906001019080831161218c575b505050505090505f815190505f6040518060a00160405280600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff168152602001600161ffff1661ffff1681525090505f821461228957600f5f8761ffff1661ffff1681526020019081526020015f20600580602002604051908101604052809291908260058015612281576020028201915f905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116122485790505b505050505090505b5f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a6763630eeb36836040518263ffffffff1660e01b81526004016122c191906151d8565b5f60405180830381865af41580156122db573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906123039190615436565b90505f845111156123415761233e8185600186612320919061547d565b81518110612331576123306148dc565b5b6020026020010151610fae565b90505b5f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a6763fcc8b9e08387896040518463ffffffff1660e01b815260040161237d93929190615752565b5f60405180830381865af4158015612397573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906123bf9190615795565b90505f73aef27971fda85dd8b7e2fb90ccc22a43b3b59a67632850efa684888a6040518463ffffffff1660e01b81526004016123fd93929190615752565b5f60405180830381865af4158015612417573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f8201168201806040525081019061243f9190615795565b90505f61247e61244e8b612f25565b61245785612f74565b8460405160200161246a93929190615ae6565b604051602081830303815290604052612f74565b9050806040516020016124919190615b8c565b60405160208183030381529060405298505050505050505050919050565b600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600581565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b61256f61298a565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036125dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125d490615c1d565b60405180910390fd5b6125e681612cb5565b50565b600e602052815f5260405f208181548110612602575f80fd5b905f5260205f20015f91509150505481565b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061266e57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061269e5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b5f816126af612800565b111580156126bd57505f5482105b80156126f857505f7c010000000000000000000000000000000000000000000000000000000060045f8581526020019081526020015f205416145b9050919050565b5f6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b11156127f6576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b8152600401612775929190615c3b565b602060405180830381865afa158015612790573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127b49190615c76565b6127f557806040517fede71dcc0000000000000000000000000000000000000000000000000000000081526004016127ec91906134d6565b60405180910390fd5b5b50565b5f33905090565b5f90565b5f8082905080612812612800565b11612890575f5481101561288f575f60045f8381526020019081526020015f205490505f7c010000000000000000000000000000000000000000000000000000000082160361288d575b5f81036128835760045f836001900393508381526020019081526020015f2054905061285c565b80925050506128c2565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e86129498686846130e7565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6129926130ef565b73ffffffffffffffffffffffffffffffffffffffff166129b06118a1565b73ffffffffffffffffffffffffffffffffffffffff1614612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd90615ceb565b60405180910390fd5b565b612a106130f6565b5f600a5f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612a526130ef565b604051612a5f91906134d6565b60405180910390a1565b600260095403612aae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa590615d53565b60405180910390fd5b6002600981905550565b612ac06114b4565b15612b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612af790615dbb565b60405180910390fd5b565b5f805490505f8203612b40576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b4c5f84838561292d565b600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282540192505081905550612bbe83612baf5f865f612933565b612bb88561313f565b1761295a565b60045f8381526020019081526020015f20819055505f80838301905073ffffffffffffffffffffffffffffffffffffffff8516915082825f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600183015b818114612c585780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600181019050612c1f565b505f8203612c92576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f819055505050612ca65f848385612984565b505050565b6001600981905550565b5f60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612d80612ab8565b6001600a5f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dc36130ef565b604051612dd091906134d6565b60405180910390a1565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612dff6127f9565b8786866040518563ffffffff1660e01b8152600401612e219493929190615e2b565b6020604051808303815f875af1925050508015612e5c57506040513d601f19601f82011682018060405250810190612e599190615e89565b60015b612ed2573d805f8114612e8a576040519150601f19603f3d011682016040523d82523d5f602084013e612e8f565b606091505b505f815103612eca576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b606060a060405101806040526020810391505f825281835b600115612f5f57600184039350600a81066030018453600a8104905080612f3d575b50828103602084039350808452505050919050565b60605f825103612f945760405180602001604052805f81525090506130e2565b5f604051806060016040528060408152602001615f1d6040913990505f600360028551612fc19190614af5565b612fcb9190614590565b6004612fd79190614522565b90505f602082612fe79190614af5565b67ffffffffffffffff81111561300057612fff61369c565b5b6040519080825280601f01601f1916602001820160405280156130325781602001600182028036833780820191505090505b509050818152600183018586518101602084015b818310156130a1576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825360018201915050613046565b6003895106600181146130bb57600281146130cb576130d6565b613d3d60f01b60028303526130d6565b603d60f81b60018303525b50505050508093505050505b919050565b5f9392505050565b5f33905090565b6130fe6114b4565b61313d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161313490615efe565b60405180910390fd5b565b5f6001821460e11b9050919050565b604051806080016040528060608152602001606081526020015f8152602001613175613239565b81525090565b6040518060a00160405280600590602082028036833780820191505090505090565b826005600f01601090048101928215613228579160200282015f5b838211156131f857835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026131b8565b80156132265782816101000a81549061ffff02191690556002016020816001010492830192600103026131f8565b505b5090506132359190613266565b5090565b60405180606001604052806003905b613250613281565b8152602001906001900390816132485790505090565b5b8082111561327d575f815f905550600101613267565b5090565b60405180608001604052805f600281111561329f5761329e613b26565b5b81526020015f60028111156132b7576132b6613b26565b5b815260200160608152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613310816132dc565b811461331a575f80fd5b50565b5f8135905061332b81613307565b92915050565b5f60208284031215613346576133456132d4565b5b5f6133538482850161331d565b91505092915050565b5f8115159050919050565b6133708161335c565b82525050565b5f6020820190506133895f830184613367565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156133c65780820151818401526020810190506133ab565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6133eb8261338f565b6133f58185613399565b93506134058185602086016133a9565b61340e816133d1565b840191505092915050565b5f6020820190508181035f83015261343181846133e1565b905092915050565b5f819050919050565b61344b81613439565b8114613455575f80fd5b50565b5f8135905061346681613442565b92915050565b5f60208284031215613481576134806132d4565b5b5f61348e84828501613458565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6134c082613497565b9050919050565b6134d0816134b6565b82525050565b5f6020820190506134e95f8301846134c7565b92915050565b6134f8816134b6565b8114613502575f80fd5b50565b5f81359050613513816134ef565b92915050565b5f806040838503121561352f5761352e6132d4565b5b5f61353c85828601613505565b925050602061354d85828601613458565b9150509250929050565b61356081613439565b82525050565b5f6020820190506135795f830184613557565b92915050565b5f61358982613497565b9050919050565b6135998161357f565b82525050565b5f6020820190506135b25f830184613590565b92915050565b5f805f606084860312156135cf576135ce6132d4565b5b5f6135dc86828701613505565b93505060206135ed86828701613505565b92505060406135fe86828701613458565b9150509250925092565b5f6020828403121561361d5761361c6132d4565b5b5f61362a84828501613505565b91505092915050565b5f8060408385031215613649576136486132d4565b5b5f61365685828601613458565b925050602061366785828601613458565b9150509250929050565b5f6040820190506136845f8301856134c7565b6136916020830184613557565b9392505050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6136d2826133d1565b810181811067ffffffffffffffff821117156136f1576136f061369c565b5b80604052505050565b5f6137036132cb565b905061370f82826136c9565b919050565b5f80fd5b5f80fd5b5f80fd5b5f67ffffffffffffffff82111561373a5761373961369c565b5b613743826133d1565b9050602081019050919050565b828183375f83830152505050565b5f61377061376b84613720565b6136fa565b90508281526020810184848401111561378c5761378b61371c565b5b613797848285613750565b509392505050565b5f82601f8301126137b3576137b2613718565b5b81356137c384826020860161375e565b91505092915050565b5f67ffffffffffffffff8211156137e6576137e561369c565b5b602082029050919050565b5f80fd5b60038110613801575f80fd5b50565b5f81359050613812816137f5565b92915050565b60038110613824575f80fd5b50565b5f8135905061383581613818565b92915050565b5f608082840312156138505761384f613698565b5b61385a60806136fa565b90505f61386984828501613804565b5f83015250602061387c84828501613827565b602083015250604082013567ffffffffffffffff8111156138a05761389f613714565b5b6138ac8482850161379f565b604083015250606082013567ffffffffffffffff8111156138d0576138cf613714565b5b6138dc8482850161379f565b60608301525092915050565b5f6138fa6138f5846137cc565b6136fa565b90508060208402830185811115613914576139136137f1565b5b835b8181101561395b57803567ffffffffffffffff81111561393957613938613718565b5b808601613946898261383b565b85526020850194505050602081019050613916565b5050509392505050565b5f82601f83011261397957613978613718565b5b60036139868482856138e8565b91505092915050565b5f608082840312156139a4576139a3613698565b5b6139ae60806136fa565b90505f82013567ffffffffffffffff8111156139cd576139cc613714565b5b6139d98482850161379f565b5f83015250602082013567ffffffffffffffff8111156139fc576139fb613714565b5b613a088482850161379f565b6020830152506040613a1c84828501613458565b604083015250606082013567ffffffffffffffff811115613a4057613a3f613714565b5b613a4c84828501613965565b60608301525092915050565b5f8060408385031215613a6e57613a6d6132d4565b5b5f83013567ffffffffffffffff811115613a8b57613a8a6132d8565b5b613a978582860161398f565b9250506020613aa885828601613458565b9150509250929050565b5f82825260208201905092915050565b5f613acc8261338f565b613ad68185613ab2565b9350613ae68185602086016133a9565b613aef816133d1565b840191505092915050565b613b0381613439565b82525050565b5f60039050919050565b5f81905092915050565b5f819050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60038110613b6457613b63613b26565b5b50565b5f819050613b7482613b53565b919050565b5f613b8382613b67565b9050919050565b613b9381613b79565b82525050565b60038110613baa57613ba9613b26565b5b50565b5f819050613bba82613b99565b919050565b5f613bc982613bad565b9050919050565b613bd981613bbf565b82525050565b5f608083015f830151613bf45f860182613b8a565b506020830151613c076020860182613bd0565b5060408301518482036040860152613c1f8282613ac2565b91505060608301518482036060860152613c398282613ac2565b9150508091505092915050565b5f613c518383613bdf565b905092915050565b5f602082019050919050565b5f613c6f82613b09565b613c798185613b13565b935083602082028501613c8b85613b1d565b805f5b85811015613cc65784840389528151613ca78582613c46565b9450613cb283613c59565b925060208a01995050600181019050613c8e565b50829750879550505050505092915050565b5f608083015f8301518482035f860152613cf28282613ac2565b91505060208301518482036020860152613d0c8282613ac2565b9150506040830151613d216040860182613afa565b5060608301518482036060860152613d398282613c65565b9150508091505092915050565b5f6020820190508181035f830152613d5e8184613cd8565b905092915050565b5f819050919050565b5f613d89613d84613d7f84613497565b613d66565b613497565b9050919050565b5f613d9a82613d6f565b9050919050565b5f613dab82613d90565b9050919050565b613dbb81613da1565b82525050565b5f602082019050613dd45f830184613db2565b92915050565b5f61ffff82169050919050565b613df081613dda565b8114613dfa575f80fd5b50565b5f81359050613e0b81613de7565b92915050565b5f805f60608486031215613e2857613e276132d4565b5b5f613e3586828701613dfd565b9350506020613e4686828701613458565b9250506040613e5786828701613505565b9150509250925092565b5f8060408385031215613e7757613e766132d4565b5b5f613e8485828601613dfd565b9250506020613e9585828601613458565b9150509250929050565b613ea881613dda565b82525050565b5f602082019050613ec15f830184613e9f565b92915050565b5f60ff82169050919050565b613edc81613ec7565b8114613ee6575f80fd5b50565b5f81359050613ef781613ed3565b92915050565b5f60208284031215613f1257613f116132d4565b5b5f613f1f84828501613ee9565b91505092915050565b5f67ffffffffffffffff821115613f4257613f4161369c565b5b602082029050602081019050919050565b5f613f65613f6084613f28565b6136fa565b90508083825260208201905060208402830185811115613f8857613f876137f1565b5b835b81811015613fb15780613f9d8882613505565b845260208401935050602081019050613f8a565b5050509392505050565b5f82601f830112613fcf57613fce613718565b5b8135613fdf848260208601613f53565b91505092915050565b5f60208284031215613ffd57613ffc6132d4565b5b5f82013567ffffffffffffffff81111561401a576140196132d8565b5b61402684828501613fbb565b91505092915050565b5f67ffffffffffffffff8211156140495761404861369c565b5b602082029050602081019050919050565b5f61406c6140678461402f565b6136fa565b9050808382526020820190506020840283018581111561408f5761408e6137f1565b5b835b818110156140b857806140a48882613ee9565b845260208401935050602081019050614091565b5050509392505050565b5f82601f8301126140d6576140d5613718565b5b81356140e684826020860161405a565b91505092915050565b5f8060408385031215614105576141046132d4565b5b5f83013567ffffffffffffffff811115614122576141216132d8565b5b61412e85828601613fbb565b925050602083013567ffffffffffffffff81111561414f5761414e6132d8565b5b61415b858286016140c2565b9150509250929050565b5f67ffffffffffffffff82111561417f5761417e61369c565b5b602082029050602081019050919050565b5f6141a261419d84614165565b6136fa565b905080838252602082019050602084028301858111156141c5576141c46137f1565b5b835b818110156141ee57806141da8882613dfd565b8452602084019350506020810190506141c7565b5050509392505050565b5f82601f83011261420c5761420b613718565b5b813561421c848260208601614190565b91505092915050565b5f806040838503121561423b5761423a6132d4565b5b5f83013567ffffffffffffffff811115614258576142576132d8565b5b614264858286016141f8565b925050602083013567ffffffffffffffff811115614285576142846132d8565b5b614291858286016141f8565b9150509250929050565b6142a48161335c565b81146142ae575f80fd5b50565b5f813590506142bf8161429b565b92915050565b5f80604083850312156142db576142da6132d4565b5b5f6142e885828601613505565b92505060206142f9858286016142b1565b9150509250929050565b5f67ffffffffffffffff82111561431d5761431c61369c565b5b614326826133d1565b9050602081019050919050565b5f61434561434084614303565b6136fa565b9050828152602081018484840111156143615761436061371c565b5b61436c848285613750565b509392505050565b5f82601f83011261438857614387613718565b5b8135614398848260208601614333565b91505092915050565b5f805f80608085870312156143b9576143b86132d4565b5b5f6143c687828801613505565b94505060206143d787828801613505565b93505060406143e887828801613458565b925050606085013567ffffffffffffffff811115614409576144086132d8565b5b61441587828801614374565b91505092959194509250565b5f61442b82613d90565b9050919050565b61443b81614421565b82525050565b5f6020820190506144545f830184614432565b92915050565b5f80604083850312156144705761446f6132d4565b5b5f61447d85828601613505565b925050602061448e85828601613505565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806144dc57607f821691505b6020821081036144ef576144ee614498565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61452c82613439565b915061453783613439565b925082820261454581613439565b9150828204841483151761455c5761455b6144f5565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61459a82613439565b91506145a583613439565b9250826145b5576145b4614563565b5b828204905092915050565b5f6145d26145cd84613720565b6136fa565b9050828152602081018484840111156145ee576145ed61371c565b5b6145f98482856133a9565b509392505050565b5f82601f83011261461557614614613718565b5b81516146258482602086016145c0565b91505092915050565b5f8151905061463c81613442565b92915050565b5f610180828403121561465857614657613698565b5b6146636101806136fa565b90505f82015167ffffffffffffffff81111561468257614681613714565b5b61468e84828501614601565b5f83015250602082015167ffffffffffffffff8111156146b1576146b0613714565b5b6146bd84828501614601565b602083015250604082015167ffffffffffffffff8111156146e1576146e0613714565b5b6146ed84828501614601565b604083015250606082015167ffffffffffffffff81111561471157614710613714565b5b61471d84828501614601565b606083015250608082015167ffffffffffffffff81111561474157614740613714565b5b61474d84828501614601565b60808301525060a082015167ffffffffffffffff81111561477157614770613714565b5b61477d84828501614601565b60a08301525060c082015167ffffffffffffffff8111156147a1576147a0613714565b5b6147ad84828501614601565b60c08301525060e082015167ffffffffffffffff8111156147d1576147d0613714565b5b6147dd84828501614601565b60e08301525061010082015167ffffffffffffffff81111561480257614801613714565b5b61480e84828501614601565b6101008301525061012082015167ffffffffffffffff81111561483457614833613714565b5b61484084828501614601565b6101208301525061014082015167ffffffffffffffff81111561486657614865613714565b5b61487284828501614601565b610140830152506101606148888482850161462e565b6101608301525092915050565b5f602082840312156148aa576148a96132d4565b5b5f82015167ffffffffffffffff8111156148c7576148c66132d8565b5b6148d384828501614642565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4f6e6c79204576656e744e46542063616e2063616c6c20746869732066756e635f8201527f74696f6e00000000000000000000000000000000000000000000000000000000602082015250565b5f614963602483613399565b915061496e82614909565b604082019050919050565b5f6020820190508181035f83015261499081614957565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e65785f8201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b5f6149f1602c83613399565b91506149fc82614997565b604082019050919050565b5f6020820190508181035f830152614a1e816149e5565b9050919050565b7f43616c6c6572206d757374206f776e20746865204149424f4c540000000000005f82015250565b5f614a59601a83613399565b9150614a6482614a25565b602082019050919050565b5f6020820190508181035f830152614a8681614a4d565b9050919050565b7f4e6f7420617574686f72697a6564204576656e7420636f6e74726163740000005f82015250565b5f614ac1601d83613399565b9150614acc82614a8d565b602082019050919050565b5f6020820190508181035f830152614aee81614ab5565b9050919050565b5f614aff82613439565b9150614b0a83613439565b9250828201905080821115614b2257614b216144f5565b5b92915050565b7f4d6178696d756d20737570706c79206f6620322c3030302072656163686564005f82015250565b5f614b5c601f83613399565b9150614b6782614b28565b602082019050919050565b5f6020820190508181035f830152614b8981614b50565b9050919050565b7f43616e6e6f7420657863656564206d696e74206c696d6974206f6620352070655f8201527f722077616c6c6574000000000000000000000000000000000000000000000000602082015250565b5f614bea602883613399565b9150614bf582614b90565b604082019050919050565b5f6020820190508181035f830152614c1781614bde565b9050919050565b7f4e6f74206f6e2074686520616c6c6f77206c69737400000000000000000000005f82015250565b5f614c52601583613399565b9150614c5d82614c1e565b602082019050919050565b5f6020820190508181035f830152614c7f81614c46565b9050919050565b7f496e636f7272656374207061796d656e742076616c75650000000000000000005f82015250565b5f614cba601783613399565b9150614cc582614c86565b602082019050919050565b5f6020820190508181035f830152614ce781614cae565b9050919050565b5f614cf882613439565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d2a57614d296144f5565b5b600182019050919050565b5f614d3f82613439565b9150614d4a83613439565b925082614d5a57614d59614563565b5b828206905092915050565b7f496e636f7272656374206e756d626572206f662041494f5242495420494473205f8201527f70726f7669646564000000000000000000000000000000000000000000000000602082015250565b5f614dbf602883613399565b9150614dca82614d65565b604082019050919050565b5f6020820190508181035f830152614dec81614db3565b9050919050565b7f4d69736d61746368206265747765656e206e756d626572206f6620746f6b656e5f8201527f7320616e642061696f7262697473000000000000000000000000000000000000602082015250565b5f614e4d602e83613399565b9150614e5882614df3565b604082019050919050565b5f6020820190508181035f830152614e7a81614e41565b9050919050565b5f614e8b82613dda565b9150614e9683613dda565b9250828201905061ffff811115614eb057614eaf6144f5565b5b92915050565b5f614ed0614ecb614ec684613dda565b613d66565b613439565b9050919050565b614ee081614eb6565b82525050565b5f602082019050614ef95f830184614ed7565b92915050565b5f81519050614f0d816134ef565b92915050565b5f60208284031215614f2857614f276132d4565b5b5f614f3584828501614eff565b91505092915050565b7f43616c6c6572206d757374206f776e207468652041494f5242495473000000005f82015250565b5f614f72601c83613399565b9150614f7d82614f3e565b602082019050919050565b5f6020820190508181035f830152614f9f81614f66565b9050919050565b5f606082019050614fb95f8301866134c7565b614fc660208301856134c7565b614fd36040830184614ed7565b949350505050565b5f614fe582613dda565b915061ffff8203614ff957614ff86144f5565b5b600182019050919050565b5f81519050919050565b5f81905092915050565b5f819050602082019050919050565b61503081613dda565b82525050565b5f6150418383615027565b60208301905092915050565b5f602082019050919050565b5f61506382615004565b61506d818561500e565b935061507883615018565b805f5b838110156150a857815161508f8882615036565b975061509a8361504d565b92505060018101905061507b565b5085935050505092915050565b5f6150c08284615059565b915081905092915050565b7f546f6b656e20646f6573206e6f742065786973740000000000000000000000005f82015250565b5f6150ff601483613399565b915061510a826150cb565b602082019050919050565b5f6020820190508181035f83015261512c816150f3565b9050919050565b5f60059050919050565b5f81905092915050565b5f819050919050565b61515981613dda565b82525050565b5f61516a8383615150565b60208301905092915050565b5f602082019050919050565b61518b81615133565b615195818461513d565b92506151a082615147565b805f5b838110156151d05781516151b7878261515f565b96506151c283615176565b9250506001810190506151a3565b505050505050565b5f60a0820190506151eb5f830184615182565b92915050565b5f815190506151ff816137f5565b92915050565b5f8151905061521381613818565b92915050565b5f6080828403121561522e5761522d613698565b5b61523860806136fa565b90505f615247848285016151f1565b5f83015250602061525a84828501615205565b602083015250604082015167ffffffffffffffff81111561527e5761527d613714565b5b61528a84828501614601565b604083015250606082015167ffffffffffffffff8111156152ae576152ad613714565b5b6152ba84828501614601565b60608301525092915050565b5f6152d86152d3846137cc565b6136fa565b905080602084028301858111156152f2576152f16137f1565b5b835b8181101561533957805167ffffffffffffffff81111561531757615316613718565b5b8086016153248982615219565b855260208501945050506020810190506152f4565b5050509392505050565b5f82601f83011261535757615356613718565b5b60036153648482856152c6565b91505092915050565b5f6080828403121561538257615381613698565b5b61538c60806136fa565b90505f82015167ffffffffffffffff8111156153ab576153aa613714565b5b6153b784828501614601565b5f83015250602082015167ffffffffffffffff8111156153da576153d9613714565b5b6153e684828501614601565b60208301525060406153fa8482850161462e565b604083015250606082015167ffffffffffffffff81111561541e5761541d613714565b5b61542a84828501615343565b60608301525092915050565b5f6020828403121561544b5761544a6132d4565b5b5f82015167ffffffffffffffff811115615468576154676132d8565b5b6154748482850161536d565b91505092915050565b5f61548782613439565b915061549283613439565b92508282039050818111156154aa576154a96144f5565b5b92915050565b5f82825260208201905092915050565b5f6154ca8261338f565b6154d481856154b0565b93506154e48185602086016133a9565b6154ed816133d1565b840191505092915050565b61550181613439565b82525050565b5f81905092915050565b61551a81613b79565b82525050565b61552981613bbf565b82525050565b5f608083015f8301516155445f860182615511565b5060208301516155576020860182615520565b506040830151848203604086015261556f82826154c0565b9150506060830151848203606086015261558982826154c0565b9150508091505092915050565b5f6155a1838361552f565b905092915050565b5f6155b382613b09565b6155bd8185615507565b9350836020820285016155cf85613b1d565b805f5b8581101561560a57848403895281516155eb8582615596565b94506155f683613c59565b925060208a019950506001810190506155d2565b50829750879550505050505092915050565b5f608083015f8301518482035f86015261563682826154c0565b9150506020830151848203602086015261565082826154c0565b915050604083015161566560408601826154f8565b506060830151848203606086015261567d82826155a9565b9150508091505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f6156be83836154f8565b60208301905092915050565b5f602082019050919050565b5f6156e08261568a565b6156ea8185615694565b93506156f5836156a4565b805f5b8381101561572557815161570c88826156b3565b9750615717836156ca565b9250506001810190506156f8565b5085935050505092915050565b5f61573c82613d90565b9050919050565b61574c81615732565b82525050565b5f6060820190508181035f83015261576a818661561c565b9050818103602083015261577e81856156d6565b905061578d6040830184615743565b949350505050565b5f602082840312156157aa576157a96132d4565b5b5f82015167ffffffffffffffff8111156157c7576157c66132d8565b5b6157d384828501614601565b91505092915050565b5f81905092915050565b7f7b226e616d65223a20224149424f4c54202300000000000000000000000000005f82015250565b5f61581a6012836157dc565b9150615825826157e6565b601282019050919050565b5f61583a8261338f565b61584481856157dc565b93506158548185602086016133a9565b80840191505092915050565b7f222c20226465736372697074696f6e223a2022546865206669727374206576655f8201527f722064796e616d6963206f6e2d636861696e2073746f727974656c6c696e672060208201527f4e4654732e204576657279204149424f4c542069732066756c6c79206f6e2d6360408201527f6861696e2c20616e6420746865697220747261697473202876697375616c6c7960608201527f20616e64207261726974792920617265207570677261646561626c652062792060808201527f63617573696e67204576656e74732e204576656e747320617265207472616e7360a08201527f616374696f6e73207265636f72646564206f6e2d636861696e2e205768656e2060c08201527f636861696e206f66204576656e74732061726520737461636b65642c2061206c60e08201527f6f7265206973207772697474656e20627920414920746861742063616e2062656101008201527f206164617074656420746f206f74686572206d656469756d732e222c2022696d6101208201527f616765223a2022646174613a696d6167652f7376672b786d6c3b6261736536346101408201527f2c0000000000000000000000000000000000000000000000000000000000000061016082015250565b5f615a3b610161836157dc565b9150615a4682615860565b61016182019050919050565b7f222c202261747472696275746573223a200000000000000000000000000000005f82015250565b5f615a866011836157dc565b9150615a9182615a52565b601182019050919050565b7f7d000000000000000000000000000000000000000000000000000000000000005f82015250565b5f615ad06001836157dc565b9150615adb82615a9c565b600182019050919050565b5f615af08261580e565b9150615afc8286615830565b9150615b0782615a2e565b9150615b138285615830565b9150615b1e82615a7a565b9150615b2a8284615830565b9150615b3582615ac4565b9150819050949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000005f82015250565b5f615b76601d836157dc565b9150615b8182615b42565b601d82019050919050565b5f615b9682615b6a565b9150615ba28284615830565b915081905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f615c07602683613399565b9150615c1282615bad565b604082019050919050565b5f6020820190508181035f830152615c3481615bfb565b9050919050565b5f604082019050615c4e5f8301856134c7565b615c5b60208301846134c7565b9392505050565b5f81519050615c708161429b565b92915050565b5f60208284031215615c8b57615c8a6132d4565b5b5f615c9884828501615c62565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f615cd5602083613399565b9150615ce082615ca1565b602082019050919050565b5f6020820190508181035f830152615d0281615cc9565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f615d3d601f83613399565b9150615d4882615d09565b602082019050919050565b5f6020820190508181035f830152615d6a81615d31565b9050919050565b7f5061757361626c653a20706175736564000000000000000000000000000000005f82015250565b5f615da5601083613399565b9150615db082615d71565b602082019050919050565b5f6020820190508181035f830152615dd281615d99565b9050919050565b5f81519050919050565b5f82825260208201905092915050565b5f615dfd82615dd9565b615e078185615de3565b9350615e178185602086016133a9565b615e20816133d1565b840191505092915050565b5f608082019050615e3e5f8301876134c7565b615e4b60208301866134c7565b615e586040830185613557565b8181036060830152615e6a8184615df3565b905095945050505050565b5f81519050615e8381613307565b92915050565b5f60208284031215615e9e57615e9d6132d4565b5b5f615eab84828501615e75565b91505092915050565b7f5061757361626c653a206e6f74207061757365640000000000000000000000005f82015250565b5f615ee8601483613399565b9150615ef382615eb4565b602082019050919050565b5f6020820190508181035f830152615f1581615edc565b905091905056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122016beaade78e77a7c383502293922dc15f1ba2a8dd5a529eae85ff869276f0c1064736f6c63430008140033

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

00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000b143e80e8bc1f493b6de979ba01d8c026d94c028000000000000000000000000f49c23e8ac6fbc8cc376c61b738503c6e96fb4ed000000000000000000000000ba66a7c5e1f89a542e3108e3df155a9bf41ac824000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000064149424f4c5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004424f4c5400000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): AIBOLT
Arg [1] : symbol (string): BOLT
Arg [2] : _royaltiesRecipient (address): 0xB143e80e8bc1f493b6DE979ba01D8C026D94C028
Arg [3] : _eventsNFT (address): 0xf49C23E8ac6Fbc8CC376C61B738503C6e96Fb4ED
Arg [4] : _aiorbit (address): 0xbA66A7c5e1f89a542E3108E3Df155A9BF41ac824
Arg [5] : _tokenPrice (uint256): 100000000000000000

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 000000000000000000000000b143e80e8bc1f493b6de979ba01d8c026d94c028
Arg [3] : 000000000000000000000000f49c23e8ac6fbc8cc376c61b738503c6e96fb4ed
Arg [4] : 000000000000000000000000ba66a7c5e1f89a542e3108e3df155a9bf41ac824
Arg [5] : 000000000000000000000000000000000000000000000000016345785d8a0000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 4149424f4c540000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 424f4c5400000000000000000000000000000000000000000000000000000000


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

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