ETH Price: $3,346.60 (-1.40%)

Token

ClickCreate Marketplace (CLICKSART)
 

Overview

Max Total Supply

17,883 CLICKSART

Holders

1,019

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
cpf.eth
0xe0d209b7324d982bacb757f724ebe00a9792ac28
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
ClickToken

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 30 : ClickToken.sol
//SPDX-License-Identifier: NONE
pragma solidity ^0.8.18;

import "./manifold-creator-core/ERC1155Creator.sol";

error ClickIsSoulbound();
error MarketplaceCanOnlyMoveClick();

contract ClickToken is ERC1155Creator {

    uint256 public constant CLICK_TOKEN_ID = 1;
    address public immutable MARKETPLACE;

    mapping(address => uint256) public allowedOperators;

    constructor(address owner, address _marketplace) ERC1155Creator ("ClickCreate Marketplace", "CLICKSART") {
        _transferOwnership(owner);
        MARKETPLACE = _marketplace;
    }

    // Adds an immutable pre-approval for CLICK marketplace contract.
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        if (msg.sender != MARKETPLACE) {
            require(
                from == msg.sender || isApprovedForAll(from, msg.sender),
                "ERC1155: caller is not token owner or approved"
            );
        } else if (id != CLICK_TOKEN_ID) {
            revert MarketplaceCanOnlyMoveClick();
        }

        _safeTransferFrom(from, to, id, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        if (msg.sender != MARKETPLACE) {
            require(
                from == msg.sender || isApprovedForAll(from, msg.sender),
                "ERC1155: caller is not token owner or approved"
            );
        } else if (!(ids.length == 1 && ids[0] == CLICK_TOKEN_ID)) {
            revert MarketplaceCanOnlyMoveClick();
        }
        
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    // Ensures CLICK is soulbound, except for approved operators.
    function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override {
        if (
            from != address(0) &&
            operator != MARKETPLACE &&
            _arrayHasClickToken(ids) &&
            allowedOperators[operator] != 1
        ) {
            revert ClickIsSoulbound();
        }

        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    function _arrayHasClickToken(uint256[] memory ids) internal pure returns (bool) {
        uint256 length = ids.length;
        for (uint256 i; i < length; ++i) {
            if (ids[i] == CLICK_TOKEN_ID) {
                return true;
            }
        }
        return false;
    }

    function setAllowedOperator(address operator, uint256 status) external onlyOwner {
        allowedOperators[operator] = status;
    }

    function airdropClicks(address[] calldata recipients, uint256[] calldata amounts) external onlyOwner {
        require(recipients.length == amounts.length, "ClickToken: recipients and amounts length mismatch");
        uint256 length = recipients.length;
        uint256 toAddToTotalSupply;
        for (uint256 i; i < length; ++i) {
            address to = recipients[i];
            uint256 amount = amounts[i];
            _balances[CLICK_TOKEN_ID][to] += amount;
            emit TransferSingle(address(this), address(0), to, CLICK_TOKEN_ID, amount); 
            // Do not do safe transfer acceptance, saves lots of gas and if it gets locked, no biggie.
        }
        _totalSupply[CLICK_TOKEN_ID] += toAddToTotalSupply;
    }

}

File 2 of 30 : AdminControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAdminControl.sol";

abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
    using EnumerableSet for EnumerableSet.AddressSet;

    // Track registered admins
    EnumerableSet.AddressSet private _admins;

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

    /**
     * @dev Only allows approved admins to call the specified function
     */
    modifier adminRequired() {
        require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin");
        _;
    }   

    /**
     * @dev See {IAdminControl-getAdmins}.
     */
    function getAdmins() external view override returns (address[] memory admins) {
        admins = new address[](_admins.length());
        for (uint i = 0; i < _admins.length(); i++) {
            admins[i] = _admins.at(i);
        }
        return admins;
    }

    /**
     * @dev See {IAdminControl-approveAdmin}.
     */
    function approveAdmin(address admin) external override onlyOwner {
        if (!_admins.contains(admin)) {
            emit AdminApproved(admin, msg.sender);
            _admins.add(admin);
        }
    }

    /**
     * @dev See {IAdminControl-revokeAdmin}.
     */
    function revokeAdmin(address admin) external override onlyOwner {
        if (_admins.contains(admin)) {
            emit AdminRevoked(admin, msg.sender);
            _admins.remove(admin);
        }
    }

    /**
     * @dev See {IAdminControl-isAdmin}.
     */
    function isAdmin(address admin) public override view returns (bool) {
        return (owner() == admin || _admins.contains(admin));
    }

}

File 3 of 30 : IAdminControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Interface for admin control
 */
interface IAdminControl is IERC165 {

    event AdminApproved(address indexed account, address indexed sender);
    event AdminRevoked(address indexed account, address indexed sender);

    /**
     * @dev gets address of all admins
     */
    function getAdmins() external view returns (address[] memory);

    /**
     * @dev add an admin.  Can only be called by contract owner.
     */
    function approveAdmin(address admin) external;

    /**
     * @dev remove an admin.  Can only be called by contract owner.
     */
    function revokeAdmin(address admin) external;

    /**
     * @dev checks whether or not given address is an admin
     * Returns True if they are
     */
    function isAdmin(address admin) external view returns (bool);

}

File 4 of 30 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @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 5 of 30 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 6 of 30 : 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 7 of 30 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 8 of 30 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 9 of 30 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 10 of 30 : 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 11 of 30 : 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 12 of 30 : 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 13 of 30 : ERC165Checker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface.
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return
            supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
            !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     *
     * _Available since v3.4._
     */
    function getSupportedInterfaces(
        address account,
        bytes4[] memory interfaceIds
    ) internal view returns (bool[] memory) {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     *
     * Some precompiled contracts will falsely indicate support for a given interface, so caution
     * should be exercised when using this function.
     *
     * Interface identification is specified in ERC-165.
     */
    function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
        // prepare call
        bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);

        // perform static call
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly {
            success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0x00)
        }

        return success && returnSize >= 0x20 && returnValue > 0;
    }
}

File 14 of 30 : 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 15 of 30 : 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 16 of 30 : 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 17 of 30 : 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 30 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

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

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

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

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

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

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 19 of 30 : CreatorCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

import "../extensions/ICreatorExtensionTokenURI.sol";
import "../extensions/ICreatorExtensionRoyalties.sol";

import "./ICreatorCore.sol";

/**
 * @dev Core creator implementation
 */
abstract contract CreatorCore is ReentrancyGuard, ICreatorCore, ERC165 {
    using Strings for uint256;
    using EnumerableSet for EnumerableSet.AddressSet;
    using AddressUpgradeable for address;

    uint256 internal _tokenCount = 0;

    // Base approve transfers address location
    address internal _approveTransferBase;

    // Track registered extensions data
    EnumerableSet.AddressSet internal _extensions;
    EnumerableSet.AddressSet internal _blacklistedExtensions;

    // The baseURI for a given extension
    mapping (address => string) private _extensionBaseURI;
    mapping (address => bool) private _extensionBaseURIIdentical;

    // The prefix for any tokens with a uri configured
    mapping (address => string) private _extensionURIPrefix;

    // Mapping for individual token URIs
    mapping (uint256 => string) internal _tokenURIs;

    // Royalty configurations
    struct RoyaltyConfig {
        address payable receiver;
        uint16 bps;
    }
    mapping (address => RoyaltyConfig[]) internal _extensionRoyalty;
    mapping (uint256 => RoyaltyConfig[]) internal _tokenRoyalty;

    bytes4 private constant _CREATOR_CORE_V1 = 0x28f10a21;

    /**
     * External interface identifiers for royalties
     */

    /**
     *  @dev CreatorCore
     *
     *  bytes4(keccak256('getRoyalties(uint256)')) == 0xbb3bafd6
     *
     *  => 0xbb3bafd6 = 0xbb3bafd6
     */
    bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;

    /**
     *  @dev Rarible: RoyaltiesV1
     *
     *  bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb
     *  bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f
     *
     *  => 0xb9c4d9fb ^ 0x0ebd4c7f = 0xb7799584
     */
    bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;

    /**
     *  @dev Foundation
     *
     *  bytes4(keccak256('getFees(uint256)')) == 0xd5a06d4c
     *
     *  => 0xd5a06d4c = 0xd5a06d4c
     */
    bytes4 private constant _INTERFACE_ID_ROYALTIES_FOUNDATION = 0xd5a06d4c;

    /**
     *  @dev EIP-2981
     *
     * bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
     *
     * => 0x2a55205a = 0x2a55205a
     */
    bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(ICreatorCore).interfaceId || interfaceId == _CREATOR_CORE_V1 || super.supportsInterface(interfaceId)
            || interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE || interfaceId == _INTERFACE_ID_ROYALTIES_RARIBLE
            || interfaceId == _INTERFACE_ID_ROYALTIES_FOUNDATION || interfaceId == _INTERFACE_ID_ROYALTIES_EIP2981;
    }

    /**
     * @dev Only allows registered extensions to call the specified function
     */
    function requireExtension() internal view {
        require(_extensions.contains(msg.sender), "Must be registered extension");
    }

    /**
     * @dev Only allows non-blacklisted extensions
     */
    function requireNonBlacklist(address extension) internal view {
        require(!_blacklistedExtensions.contains(extension), "Extension blacklisted");
    }   

    /**
     * @dev See {ICreatorCore-getExtensions}.
     */
    function getExtensions() external view override returns (address[] memory extensions) {
        extensions = new address[](_extensions.length());
        for (uint i; i < _extensions.length();) {
            extensions[i] = _extensions.at(i);
            unchecked { ++i; }
        }
        return extensions;
    }

    /**
     * @dev Register an extension
     */
    function _registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) internal virtual {
        require(extension != address(this) && extension.isContract(), "Invalid");
        emit ExtensionRegistered(extension, msg.sender);
        _extensionBaseURI[extension] = baseURI;
        _extensionBaseURIIdentical[extension] = baseURIIdentical;
        _extensions.add(extension);
        _setApproveTransferExtension(extension, true);
    }

    /**
     * @dev See {ICreatorCore-setApproveTransferExtension}.
     */
    function setApproveTransferExtension(bool enabled) external override {
        requireExtension();
        _setApproveTransferExtension(msg.sender, enabled);
    }

    /**
     * @dev Set whether or not tokens minted by the extension defers transfer approvals to the extension
     */
    function _setApproveTransferExtension(address extension, bool enabled) internal virtual;

    /**
     * @dev Unregister an extension
     */
    function _unregisterExtension(address extension) internal {
        emit ExtensionUnregistered(extension, msg.sender);
        _extensions.remove(extension);
    }

    /**
     * @dev Blacklist an extension
     */
    function _blacklistExtension(address extension) internal {
       require(extension != address(0) && extension != address(this), "Cannot blacklist yourself");
       if (_extensions.contains(extension)) {
           emit ExtensionUnregistered(extension, msg.sender);
           _extensions.remove(extension);
       }
       if (!_blacklistedExtensions.contains(extension)) {
           emit ExtensionBlacklisted(extension, msg.sender);
           _blacklistedExtensions.add(extension);
       }
    }

    /**
     * @dev Set base token uri for an extension
     */
    function _setBaseTokenURIExtension(string calldata uri, bool identical) internal {
        _extensionBaseURI[msg.sender] = uri;
        _extensionBaseURIIdentical[msg.sender] = identical;
    }

    /**
     * @dev Set token uri prefix for an extension
     */
    function _setTokenURIPrefixExtension(string calldata prefix) internal {
        _extensionURIPrefix[msg.sender] = prefix;
    }

    /**
     * @dev Set token uri for a token of an extension
     */
    function _setTokenURIExtension(uint256 tokenId, string calldata uri) internal {
        require(_tokenExtension(tokenId) == msg.sender, "Invalid token");
        _tokenURIs[tokenId] = uri;
    }

    /**
     * @dev Set base token uri for tokens with no extension
     */
    function _setBaseTokenURI(string calldata uri) internal {
        _extensionBaseURI[address(0)] = uri;
    }

    /**
     * @dev Set token uri prefix for tokens with no extension
     */
    function _setTokenURIPrefix(string calldata prefix) internal {
        _extensionURIPrefix[address(0)] = prefix;
    }


    /**
     * @dev Set token uri for a token with no extension
     */
    function _setTokenURI(uint256 tokenId, string calldata uri) internal {
        require(tokenId > 0 && tokenId <= _tokenCount && _tokenExtension(tokenId) == address(0), "Invalid token");
        _tokenURIs[tokenId] = uri;
    }

    /**
     * @dev Retrieve a token's URI
     */
    function _tokenURI(uint256 tokenId) internal view returns (string memory) {
        require(tokenId > 0 && tokenId <= _tokenCount, "Invalid token");

        address extension = _tokenExtension(tokenId);
        require(!_blacklistedExtensions.contains(extension), "Extension blacklisted");

        if (bytes(_tokenURIs[tokenId]).length != 0) {
            if (bytes(_extensionURIPrefix[extension]).length != 0) {
                return string(abi.encodePacked(_extensionURIPrefix[extension], _tokenURIs[tokenId]));
            }
            return _tokenURIs[tokenId];
        }

        if (ERC165Checker.supportsInterface(extension, type(ICreatorExtensionTokenURI).interfaceId)) {
            return ICreatorExtensionTokenURI(extension).tokenURI(address(this), tokenId);
        }

        if (!_extensionBaseURIIdentical[extension]) {
            return string(abi.encodePacked(_extensionBaseURI[extension], tokenId.toString()));
        } else {
            return _extensionBaseURI[extension];
        }
    }

    /**
     * Helper to get royalties for a token
     */
    function _getRoyalties(uint256 tokenId) view internal returns (address payable[] memory receivers, uint256[] memory bps) {

        // Get token level royalties
        RoyaltyConfig[] memory royalties = _tokenRoyalty[tokenId];
        if (royalties.length == 0) {
            // Get extension specific royalties
            address extension = _tokenExtension(tokenId);
            if (extension != address(0)) {
                if (ERC165Checker.supportsInterface(extension, type(ICreatorExtensionRoyalties).interfaceId)) {
                    (receivers, bps) = ICreatorExtensionRoyalties(extension).getRoyalties(address(this), tokenId);
                    // Extension override exists, just return that
                    if (receivers.length > 0) return (receivers, bps);
                }
                royalties = _extensionRoyalty[extension];
            }
        }
        if (royalties.length == 0) {
            // Get the default royalty
            royalties = _extensionRoyalty[address(0)];
        }
        
        if (royalties.length > 0) {
            receivers = new address payable[](royalties.length);
            bps = new uint256[](royalties.length);
            for (uint i; i < royalties.length;) {
                receivers[i] = royalties[i].receiver;
                bps[i] = royalties[i].bps;
                unchecked { ++i; }
            }
        }
    }

    /**
     * Helper to get royalty receivers for a token
     */
    function _getRoyaltyReceivers(uint256 tokenId) view internal returns (address payable[] memory recievers) {
        (recievers, ) = _getRoyalties(tokenId);
    }

    /**
     * Helper to get royalty basis points for a token
     */
    function _getRoyaltyBPS(uint256 tokenId) view internal returns (uint256[] memory bps) {
        (, bps) = _getRoyalties(tokenId);
    }

    function _getRoyaltyInfo(uint256 tokenId, uint256 value) view internal returns (address receiver, uint256 amount){
        (address payable[] memory receivers, uint256[] memory bps) = _getRoyalties(tokenId);
        require(receivers.length <= 1, "More than 1 royalty receiver");
        
        if (receivers.length == 0) {
            return (address(this), 0);
        }
        return (receivers[0], bps[0]*value/10000);
    }

    /**
     * Set royalties for a token
     */
    function _setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) internal {
       _checkRoyalties(receivers, basisPoints);
        delete _tokenRoyalty[tokenId];
        _setRoyalties(receivers, basisPoints, _tokenRoyalty[tokenId]);
        emit RoyaltiesUpdated(tokenId, receivers, basisPoints);
    }

    /**
     * Set royalties for all tokens of an extension
     */
    function _setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) internal {
        _checkRoyalties(receivers, basisPoints);
        delete _extensionRoyalty[extension];
        _setRoyalties(receivers, basisPoints, _extensionRoyalty[extension]);
        if (extension == address(0)) {
            emit DefaultRoyaltiesUpdated(receivers, basisPoints);
        } else {
            emit ExtensionRoyaltiesUpdated(extension, receivers, basisPoints);
        }
    }

    /**
     * Helper function to check that royalties provided are valid
     */
    function _checkRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) private pure {
        require(receivers.length == basisPoints.length, "Invalid input");
        uint256 totalBasisPoints;
        for (uint i; i < basisPoints.length;) {
            totalBasisPoints += basisPoints[i];
            unchecked { ++i; }
        }
        require(totalBasisPoints < 10000, "Invalid total royalties");
    }

    /**
     * Helper function to set royalties
     */
    function _setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints, RoyaltyConfig[] storage royalties) private {
        for (uint i; i < basisPoints.length;) {
            royalties.push(
                RoyaltyConfig(
                    {
                        receiver: receivers[i],
                        bps: uint16(basisPoints[i])
                    }
                )
            );
            unchecked { ++i; }
        }
    }

    /**
     * @dev Set the base contract's approve transfer contract location
     */
    function _setApproveTransferBase(address extension) internal {
        _approveTransferBase = extension;
        emit ApproveTransferUpdated(extension);
    }

    /**
     * @dev See {ICreatorCore-getApproveTransfer}.
     */
    function getApproveTransfer() external view override returns (address) {
        return _approveTransferBase;
    }

    /**
     * @dev Get the extension for the given token
     */
    function _tokenExtension(uint256 tokenId) internal virtual view returns(address);
}

File 20 of 30 : ERC1155CreatorCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import "../extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol";
import "../extensions/ERC1155/IERC1155CreatorExtensionBurnable.sol";
import "../permissions/ERC1155/IERC1155CreatorMintPermissions.sol";
import "./IERC1155CreatorCore.sol";
import "./CreatorCore.sol";

/**
 * @dev Core ERC1155 creator implementation
 */
abstract contract ERC1155CreatorCore is CreatorCore, IERC1155CreatorCore {

    uint256 constant public VERSION = 3;

    using EnumerableSet for EnumerableSet.AddressSet;

    // Track registered extensions data
    mapping (address => bool) internal _extensionApproveTransfers;
    mapping (address => address) internal _extensionPermissions;

    // For tracking which extension a token was minted by
    mapping (uint256 => address) internal _tokensExtension;

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

    /**
     * @dev See {CreatorCore-_setApproveTransferExtension}
     */
    function _setApproveTransferExtension(address extension, bool enabled) internal override {
        if (ERC165Checker.supportsInterface(extension, type(IERC1155CreatorExtensionApproveTransfer).interfaceId)) {
            _extensionApproveTransfers[extension] = enabled;
            emit ExtensionApproveTransferUpdated(extension, enabled);
        }
    }

    /**
     * @dev Set mint permissions for an extension
     */
    function _setMintPermissions(address extension, address permissions) internal {
        require(_extensions.contains(extension), "Invalid extension");
        require(permissions == address(0) || ERC165Checker.supportsInterface(permissions, type(IERC1155CreatorMintPermissions).interfaceId), "Invalid address");
        if (_extensionPermissions[extension] != permissions) {
            _extensionPermissions[extension] = permissions;
            emit MintPermissionsUpdated(extension, permissions, msg.sender);
        }
    }

    /**
     * If mint permissions have been set for an extension (extensions can mint by default),
     * check if an extension can mint via the permission contract's approveMint function.
     */
    function _checkMintPermissions(address[] memory to, uint256[] memory tokenIds, uint256[] memory amounts) internal {
        if (_extensionPermissions[msg.sender] != address(0)) {
            IERC1155CreatorMintPermissions(_extensionPermissions[msg.sender]).approveMint(msg.sender, to, tokenIds, amounts);
        }
    }

    /**
     * Post burn actions
     */
    function _postBurn(address owner, uint256[] calldata tokenIds, uint256[] calldata amounts) internal virtual {
        require(tokenIds.length > 0, "Invalid input");
        address extension = _tokensExtension[tokenIds[0]];
        for (uint i; i < tokenIds.length;) {
            require(_tokensExtension[tokenIds[i]] == extension, "Mismatched token originators");
            unchecked { ++i; }
        }
        // Callback to originating extension if needed
        if (extension != address(0)) {
           if (ERC165Checker.supportsInterface(extension, type(IERC1155CreatorExtensionBurnable).interfaceId)) {
               IERC1155CreatorExtensionBurnable(extension).onBurn(owner, tokenIds, amounts);
           }
        }
    }

    /**
     * Approve a transfer
     */
    function _approveTransfer(address from, address to, uint256[] memory tokenIds, uint256[] memory amounts) internal {
        // Do not need to approve mints
        if (from == address(0)) return;

        address extension = _tokensExtension[tokenIds[0]];

        for (uint i; i < tokenIds.length;) {
            require(_tokensExtension[tokenIds[i]] == extension, "Mismatched token originators");
            unchecked { ++i; }
        }
        if (extension != address(0) && _extensionApproveTransfers[extension]) {
            require(IERC1155CreatorExtensionApproveTransfer(extension).approveTransfer(msg.sender, from, to, tokenIds, amounts), "Extension approval failure");
        } else if (_approveTransferBase != address(0)) {
            require(IERC1155CreatorExtensionApproveTransfer(_approveTransferBase).approveTransfer(msg.sender, from, to, tokenIds, amounts), "Extension approval failure");
        }
    }

    function _tokenExtension(uint256 tokenId) internal view override returns(address) {
        return _tokensExtension[tokenId];
    }
}

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

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Core creator interface
 */
interface ICreatorCore is IERC165 {

    event ExtensionRegistered(address indexed extension, address indexed sender);
    event ExtensionUnregistered(address indexed extension, address indexed sender);
    event ExtensionBlacklisted(address indexed extension, address indexed sender);
    event MintPermissionsUpdated(address indexed extension, address indexed permissions, address indexed sender);
    event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints);
    event DefaultRoyaltiesUpdated(address payable[] receivers, uint256[] basisPoints);
    event ApproveTransferUpdated(address extension);
    event ExtensionRoyaltiesUpdated(address indexed extension, address payable[] receivers, uint256[] basisPoints);
    event ExtensionApproveTransferUpdated(address indexed extension, bool enabled);

    /**
     * @dev gets address of all extensions
     */
    function getExtensions() external view returns (address[] memory);

    /**
     * @dev add an extension.  Can only be called by contract owner or admin.
     * extension address must point to a contract implementing ICreatorExtension.
     * Returns True if newly added, False if already added.
     */
    function registerExtension(address extension, string calldata baseURI) external;

    /**
     * @dev add an extension.  Can only be called by contract owner or admin.
     * extension address must point to a contract implementing ICreatorExtension.
     * Returns True if newly added, False if already added.
     */
    function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external;

    /**
     * @dev add an extension.  Can only be called by contract owner or admin.
     * Returns True if removed, False if already removed.
     */
    function unregisterExtension(address extension) external;

    /**
     * @dev blacklist an extension.  Can only be called by contract owner or admin.
     * This function will destroy all ability to reference the metadata of any tokens created
     * by the specified extension. It will also unregister the extension if needed.
     * Returns True if removed, False if already removed.
     */
    function blacklistExtension(address extension) external;

    /**
     * @dev set the baseTokenURI of an extension.  Can only be called by extension.
     */
    function setBaseTokenURIExtension(string calldata uri) external;

    /**
     * @dev set the baseTokenURI of an extension.  Can only be called by extension.
     * For tokens with no uri configured, tokenURI will return "uri+tokenId"
     */
    function setBaseTokenURIExtension(string calldata uri, bool identical) external;

    /**
     * @dev set the common prefix of an extension.  Can only be called by extension.
     * If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
     * Useful if you want to use ipfs/arweave
     */
    function setTokenURIPrefixExtension(string calldata prefix) external;

    /**
     * @dev set the tokenURI of a token extension.  Can only be called by extension that minted token.
     */
    function setTokenURIExtension(uint256 tokenId, string calldata uri) external;

    /**
     * @dev set the tokenURI of a token extension for multiple tokens.  Can only be called by extension that minted token.
     */
    function setTokenURIExtension(uint256[] memory tokenId, string[] calldata uri) external;

    /**
     * @dev set the baseTokenURI for tokens with no extension.  Can only be called by owner/admin.
     * For tokens with no uri configured, tokenURI will return "uri+tokenId"
     */
    function setBaseTokenURI(string calldata uri) external;

    /**
     * @dev set the common prefix for tokens with no extension.  Can only be called by owner/admin.
     * If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
     * Useful if you want to use ipfs/arweave
     */
    function setTokenURIPrefix(string calldata prefix) external;

    /**
     * @dev set the tokenURI of a token with no extension.  Can only be called by owner/admin.
     */
    function setTokenURI(uint256 tokenId, string calldata uri) external;

    /**
     * @dev set the tokenURI of multiple tokens with no extension.  Can only be called by owner/admin.
     */
    function setTokenURI(uint256[] memory tokenIds, string[] calldata uris) external;

    /**
     * @dev set a permissions contract for an extension.  Used to control minting.
     */
    function setMintPermissions(address extension, address permissions) external;

    /**
     * @dev Configure so transfers of tokens created by the caller (must be extension) gets approval
     * from the extension before transferring
     */
    function setApproveTransferExtension(bool enabled) external;

    /**
     * @dev get the extension of a given token
     */
    function tokenExtension(uint256 tokenId) external view returns (address);

    /**
     * @dev Set default royalties
     */
    function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external;

    /**
     * @dev Set royalties of a token
     */
    function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external;

    /**
     * @dev Set royalties of an extension
     */
    function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external;

    /**
     * @dev Get royalites of a token.  Returns list of receivers and basisPoints
     */
    function getRoyalties(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
    
    // Royalty support for various other standards
    function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory);
    function getFeeBps(uint256 tokenId) external view returns (uint[] memory);
    function getFees(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
    function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256);

    /**
     * @dev Set the default approve transfer contract location.
     */
    function setApproveTransfer(address extension) external; 

    /**
     * @dev Get the default approve transfer contract location.
     */
    function getApproveTransfer() external view returns (address);
}

File 22 of 30 : IERC1155CreatorCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "./CreatorCore.sol";

/**
 * @dev Core ERC1155 creator interface
 */
interface IERC1155CreatorCore is ICreatorCore {

    /**
     * @dev mint a token with no extension. Can only be called by an admin.
     *
     * @param to       - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
     * @param amounts  - Can be a single element array (all recipients get the same amount) or a multi-element array
     * @param uris     - If no elements, all tokens use the default uri.
     *                   If any element is an empty string, the corresponding token uses the default uri.
     *
     *
     * Requirements: If to is a multi-element array, then uris must be empty or single element array
     *               If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size
     *               If to is a single element array, uris must be empty or the same length as amounts
     *
     * Examples:
     *    mintBaseNew(['0x....1', '0x....2'], [1], [])
     *        Mints a single new token, and gives 1 each to '0x....1' and '0x....2'.  Token uses default uri.
     *    
     *    mintBaseNew(['0x....1', '0x....2'], [1, 2], [])
     *        Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'.  Token uses default uri.
     *    
     *    mintBaseNew(['0x....1'], [1, 2], ["", "http://token2.com"])
     *        Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second.  1st token uses default uri, second uses "http://token2.com".
     *    
     * @return Returns list of tokenIds minted
     */
    function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);

    /**
     * @dev batch mint existing token with no extension. Can only be called by an admin.
     *
     * @param to        - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
     * @param tokenIds  - Can be a single element array (all recipients get the same token) or a multi-element array
     * @param amounts   - Can be a single element array (all recipients get the same amount) or a multi-element array
     *
     * Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays
     *
     * Examples:
     *    mintBaseExisting(['0x....1', '0x....2'], [1], [10])
     *        Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'.
     *    
     *    mintBaseExisting(['0x....1', '0x....2'], [1, 2], [10, 20])
     *        Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'.
     *    
     *    mintBaseExisting(['0x....1'], [1, 2], [10, 20])
     *        Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'.
     *    
     *    mintBaseExisting(['0x....1', '0x....2'], [1], [10, 20])
     *        Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'.
     *    
     */
    function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;

    /**
     * @dev mint a token from an extension. Can only be called by a registered extension.
     *
     * @param to       - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
     * @param amounts  - Can be a single element array (all recipients get the same amount) or a multi-element array
     * @param uris     - If no elements, all tokens use the default uri.
     *                   If any element is an empty string, the corresponding token uses the default uri.
     *
     *
     * Requirements: If to is a multi-element array, then uris must be empty or single element array
     *               If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size
     *               If to is a single element array, uris must be empty or the same length as amounts
     *
     * Examples:
     *    mintExtensionNew(['0x....1', '0x....2'], [1], [])
     *        Mints a single new token, and gives 1 each to '0x....1' and '0x....2'.  Token uses default uri.
     *    
     *    mintExtensionNew(['0x....1', '0x....2'], [1, 2], [])
     *        Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'.  Token uses default uri.
     *    
     *    mintExtensionNew(['0x....1'], [1, 2], ["", "http://token2.com"])
     *        Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second.  1st token uses default uri, second uses "http://token2.com".
     *    
     * @return Returns list of tokenIds minted
     */
    function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);

    /**
     * @dev batch mint existing token from extension. Can only be called by a registered extension.
     *
     * @param to        - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
     * @param tokenIds  - Can be a single element array (all recipients get the same token) or a multi-element array
     * @param amounts   - Can be a single element array (all recipients get the same amount) or a multi-element array
     *
     * Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays
     *
     * Examples:
     *    mintExtensionExisting(['0x....1', '0x....2'], [1], [10])
     *        Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'.
     *    
     *    mintExtensionExisting(['0x....1', '0x....2'], [1, 2], [10, 20])
     *        Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'.
     *    
     *    mintExtensionExisting(['0x....1'], [1, 2], [10, 20])
     *        Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'.
     *    
     *    mintExtensionExisting(['0x....1', '0x....2'], [1], [10, 20])
     *        Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'.
     *    
     */
    function mintExtensionExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;

    /**
     * @dev burn tokens. Can only be called by token owner or approved address.
     * On burn, calls back to the registered extension's onBurn method
     */
    function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) external;

    /**
     * @dev Total amount of tokens in with a given tokenId.
     */
    function totalSupply(uint256 tokenId) external view returns (uint256);
}

File 23 of 30 : ERC1155Creator.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";

import "./core/ERC1155CreatorCore.sol";
import "./token/ERC1155/ERC1155Base.sol";

/**
 * @dev ERC1155Creator implementation
 */
contract ERC1155Creator is AdminControl, ERC1155Base, ERC1155CreatorCore {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(uint256 => uint256) internal _totalSupply;

    constructor (string memory _name, string memory _symbol) ERC1155Base(_name, _symbol) {}

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Core, ERC1155CreatorCore, AdminControl) returns (bool) {
        return ERC1155CreatorCore.supportsInterface(interfaceId) || ERC1155Core.supportsInterface(interfaceId) || AdminControl.supportsInterface(interfaceId);
    }

    function _beforeTokenTransfer(address, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory) internal virtual override {
        _approveTransfer(from, to, ids, amounts);
    }

    /**
     * @dev See {ICreatorCore-registerExtension}.
     */
    function registerExtension(address extension, string calldata baseURI) external override adminRequired {
        requireNonBlacklist(extension);
        _registerExtension(extension, baseURI, false);
    }

    /**
     * @dev See {ICreatorCore-registerExtension}.
     */
    function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external override adminRequired {
        requireNonBlacklist(extension);
        _registerExtension(extension, baseURI, baseURIIdentical);
    }


    /**
     * @dev See {ICreatorCore-unregisterExtension}.
     */
    function unregisterExtension(address extension) external override adminRequired {
        _unregisterExtension(extension);
    }

    /**
     * @dev See {ICreatorCore-blacklistExtension}.
     */
    function blacklistExtension(address extension) external override adminRequired {
        _blacklistExtension(extension);
    }

    /**
     * @dev See {ICreatorCore-setBaseTokenURIExtension}.
     */
    function setBaseTokenURIExtension(string calldata uri_) external override {
        requireExtension();
        _setBaseTokenURIExtension(uri_, false);
    }

    /**
     * @dev See {ICreatorCore-setBaseTokenURIExtension}.
     */
    function setBaseTokenURIExtension(string calldata uri_, bool identical) external override {
        requireExtension();
        _setBaseTokenURIExtension(uri_, identical);
    }

    /**
     * @dev See {ICreatorCore-setTokenURIPrefixExtension}.
     */
    function setTokenURIPrefixExtension(string calldata prefix) external override {
        requireExtension();
        _setTokenURIPrefixExtension(prefix);
    }

    /**
     * @dev See {ICreatorCore-setTokenURIExtension}.
     */
    function setTokenURIExtension(uint256 tokenId, string calldata uri_) external override {
        requireExtension();
        _setTokenURIExtension(tokenId, uri_);
    }

    /**
     * @dev See {ICreatorCore-setTokenURIExtension}.
     */
    function setTokenURIExtension(uint256[] calldata tokenIds, string[] calldata uris) external override {
        requireExtension();
        require(tokenIds.length == uris.length, "Invalid input");
        for (uint i; i < tokenIds.length;) {
            _setTokenURIExtension(tokenIds[i], uris[i]);
            unchecked { ++i; }
        }
    }

    /**
     * @dev See {ICreatorCore-setBaseTokenURI}.
     */
    function setBaseTokenURI(string calldata uri_) external override adminRequired {
        _setBaseTokenURI(uri_);
    }

    /**
     * @dev See {ICreatorCore-setTokenURIPrefix}.
     */
    function setTokenURIPrefix(string calldata prefix) external override adminRequired {
        _setTokenURIPrefix(prefix);
    }

    /**
     * @dev See {ICreatorCore-setTokenURI}.
     */
    function setTokenURI(uint256 tokenId, string calldata uri_) external override adminRequired {
        _setTokenURI(tokenId, uri_);
    }

    /**
     * @dev See {ICreatorCore-setTokenURI}.
     */
    function setTokenURI(uint256[] calldata tokenIds, string[] calldata uris) external override adminRequired {
        require(tokenIds.length == uris.length, "Invalid input");
        for (uint i; i < tokenIds.length;) {
            _setTokenURI(tokenIds[i], uris[i]);
            unchecked { ++i; }
        }
    }

    /**
     * @dev See {ICreatorCore-setMintPermissions}.
     */
    function setMintPermissions(address extension, address permissions) external override adminRequired {
        _setMintPermissions(extension, permissions);
    }

    /**
     * @dev See {IERC1155CreatorCore-mintBaseNew}.
     */
    function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) public virtual override nonReentrant adminRequired returns(uint256[] memory) {
        return _mintNew(address(0), to, amounts, uris);
    }

    /**
     * @dev See {IERC1155CreatorCore-mintBaseExisting}.
     */
    function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant adminRequired {
        for (uint i; i < tokenIds.length;) {
            uint256 tokenId = tokenIds[i];
            require(tokenId > 0 && tokenId <= _tokenCount);
            require(_tokenExtension(tokenId) == address(0));
            unchecked { ++i; }
        }
        _mintExisting(address(0), to, tokenIds, amounts);
    }

    /**
     * @dev See {IERC1155CreatorCore-mintExtensionNew}.
     */
    function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) public virtual override nonReentrant returns(uint256[] memory tokenIds) {
        requireExtension();
        return _mintNew(msg.sender, to, amounts, uris);
    }

    /**
     * @dev See {IERC1155CreatorCore-mintExtensionExisting}.
     */
    function mintExtensionExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant {
        requireExtension();
        for (uint i; i < tokenIds.length;) {
            require(_tokenExtension(tokenIds[i]) == address(msg.sender));
            unchecked { ++i; }
        }
        _mintExisting(msg.sender, to, tokenIds, amounts);
    }

    /**
     * @dev Mint new tokens
     */
    function _mintNew(address extension, address[] calldata to, uint256[] calldata amounts, string[] calldata uris) internal returns(uint256[] memory tokenIds) {
        if (to.length > 1) {
            // Multiple receiver.  Give every receiver the same new token
            tokenIds = new uint256[](1);
            require(uris.length <= 1 && (amounts.length == 1 || to.length == amounts.length));
        } else {
            // Single receiver.  Generating multiple tokens
            tokenIds = new uint256[](amounts.length);
            require(uris.length == 0 || amounts.length == uris.length);
        }

        // Assign tokenIds
        for (uint i; i < tokenIds.length;) {
            ++_tokenCount;
            tokenIds[i] = _tokenCount;
            // Track the extension that minted the token
            _tokensExtension[_tokenCount] = extension;
            unchecked { ++i; }
        }

        if (extension != address(0)) {
            _checkMintPermissions(to, tokenIds, amounts);
        }

        if (to.length == 1 && tokenIds.length == 1) {
           // Single mint
           _mint(to[0], tokenIds[0], amounts[0], new bytes(0));
        } else if (to.length > 1) {
            // Multiple receivers.  Receiving the same token
            if (amounts.length == 1) {
                // Everyone receiving the same amount
                for (uint i; i < to.length;) {
                    _mint(to[i], tokenIds[0], amounts[0], new bytes(0));
                    unchecked { ++i; }
                }
            } else {
                // Everyone receiving different amounts
                for (uint i; i < to.length;) {
                    _mint(to[i], tokenIds[0], amounts[i], new bytes(0));
                    unchecked { ++i; }
                }
            }
        } else {
            _mintBatch(to[0], tokenIds, amounts, new bytes(0));
        }

        for (uint i; i < tokenIds.length;) {
            if (i < uris.length && bytes(uris[i]).length > 0) {
                _tokenURIs[tokenIds[i]] = uris[i];
            }
            unchecked { ++i; }
        }
    }

    /**
     * @dev Mint existing tokens
     */
    function _mintExisting(address extension, address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) internal {
        if (extension != address(0)) {
            _checkMintPermissions(to, tokenIds, amounts);
        }

        if (to.length == 1 && tokenIds.length == 1 && amounts.length == 1) {
             // Single mint
            _mint(to[0], tokenIds[0], amounts[0], new bytes(0));            
        } else if (to.length == 1 && tokenIds.length == amounts.length) {
            // Batch mint to same receiver
            _mintBatch(to[0], tokenIds, amounts, new bytes(0));
        } else if (tokenIds.length == 1 && amounts.length == 1) {
            // Mint of the same token/token amounts to various receivers
            for (uint i; i < to.length;) {
                _mint(to[i], tokenIds[0], amounts[0], new bytes(0));
                unchecked { ++i; }
            }
        } else if (tokenIds.length == 1 && to.length == amounts.length) {
            // Mint of the same token with different amounts to different receivers
            for (uint i; i < to.length;) {
                _mint(to[i], tokenIds[0], amounts[i], new bytes(0));
                unchecked { ++i; }
            }
        } else if (to.length == tokenIds.length && to.length == amounts.length) {
            // Mint of different tokens and different amounts to different receivers
            for (uint i; i < to.length;) {
                _mint(to[i], tokenIds[i], amounts[i], new bytes(0));
                unchecked { ++i; }
            }
        } else {
            revert("Invalid input");
        }
    }

    /**
     * @dev See {IERC1155CreatorCore-tokenExtension}.
     */
    function tokenExtension(uint256 tokenId) public view virtual override returns (address extension) {
        extension = _tokenExtension(tokenId);
        require(extension != address(0));
        require(!_blacklistedExtensions.contains(extension));
    }

    /**
     * @dev See {IERC1155CreatorCore-burn}.
     */
    function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant {
        require(account == msg.sender || isApprovedForAll(account, msg.sender));
        require(tokenIds.length == amounts.length);
        if (tokenIds.length == 1) {
            _burn(account, tokenIds[0], amounts[0]);
        } else {
            _burnBatch(account, tokenIds, amounts);
        }
        _postBurn(account, tokenIds, amounts);
    }

    /**
     * @dev See {ICreatorCore-setRoyalties}.
     */
    function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired {
        _setRoyaltiesExtension(address(0), receivers, basisPoints);
    }

    /**
     * @dev See {ICreatorCore-setRoyalties}.
     */
    function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired {
        _setRoyalties(tokenId, receivers, basisPoints);
    }

    /**
     * @dev See {ICreatorCore-setRoyaltiesExtension}.
     */
    function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired {
        _setRoyaltiesExtension(extension, receivers, basisPoints);
    }

    /**
     * @dev See {ICreatorCore-getRoyalties}.
     */
    function getRoyalties(uint256 tokenId) external view virtual override returns (address payable[] memory, uint256[] memory) {
        return _getRoyalties(tokenId);
    }

    /**
     * @dev See {ICreatorCore-getFees}.
     */
    function getFees(uint256 tokenId) external view virtual override returns (address payable[] memory, uint256[] memory) {
        return _getRoyalties(tokenId);
    }

    /**
     * @dev See {ICreatorCore-getFeeRecipients}.
     */
    function getFeeRecipients(uint256 tokenId) external view virtual override returns (address payable[] memory) {
        return _getRoyaltyReceivers(tokenId);
    }

    /**
     * @dev See {ICreatorCore-getFeeBps}.
     */
    function getFeeBps(uint256 tokenId) external view virtual override returns (uint[] memory) {
        return _getRoyaltyBPS(tokenId);
    }
    
    /**
     * @dev See {ICreatorCore-royaltyInfo}.
     */
    function royaltyInfo(uint256 tokenId, uint256 value) external view virtual override returns (address, uint256) {
        return _getRoyaltyInfo(tokenId, value);
    } 

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     */
    function uri(uint256 tokenId) public view virtual override returns (string memory) {
        return _tokenURI(tokenId);
    }
    
    /**
     * @dev Total amount of tokens in with a given id.
     */
    function totalSupply(uint256 tokenId) external view virtual override returns (uint256) {
        return _totalSupply[tokenId];
    }

    /**
     * @dev See {ERC1155-_mint}.
     */
    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual override {
        super._mint(account, id, amount, data);
        _totalSupply[id] += amount;
    }

    /**
     * @dev See {ERC1155-_mintBatch}.
     */
    function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override {
        super._mintBatch(to, ids, amounts, data);
        for (uint i; i < ids.length;) {
            _totalSupply[ids[i]] += amounts[i];
            unchecked { ++i; }
        }
    }

    /**
     * @dev See {ERC1155-_burn}.
     */
    function _burn(address account, uint256 id, uint256 amount) internal virtual override {
        super._burn(account, id, amount);
        _totalSupply[id] -= amount;
    }

    /**
     * @dev See {ERC1155-_burnBatch}.
     */
    function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual override {
        super._burnBatch(account, ids, amounts);
        for (uint i; i < ids.length;) {
            _totalSupply[ids[i]] -= amounts[i];
            unchecked { ++i; }
        }
    }

    /**
     * @dev See {ICreatorCore-setApproveTransfer}.
     */
    function setApproveTransfer(address extension) external override adminRequired {
        _setApproveTransferBase(extension);
    }
}

File 24 of 30 : IERC1155CreatorExtensionApproveTransfer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * Implement this if you want your extension to approve a transfer
 */
interface IERC1155CreatorExtensionApproveTransfer is IERC165 {

    /**
     * @dev Set whether or not the creator contract will check the extension for approval of token transfer
     */
    function setApproveTransfer(address creator, bool enabled) external;

    /**
     * @dev Called by creator contract to approve a transfer
     */
    function approveTransfer(address operator, address from, address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external returns (bool);
}

File 25 of 30 : IERC1155CreatorExtensionBurnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Your extension is required to implement this interface if it wishes
 * to receive the onBurn callback whenever a token the extension created is
 * burned
 */
interface IERC1155CreatorExtensionBurnable is IERC165 {
    /**
     * @dev callback handler for burn events
     */
    function onBurn(address owner, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
}

File 26 of 30 : ICreatorExtensionRoyalties.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Implement this if you want your extension to have overloadable royalties
 */
interface ICreatorExtensionRoyalties is IERC165 {

    /**
     * Get the royalties for a given creator/tokenId
     */
    function getRoyalties(address creator, uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
}

File 27 of 30 : ICreatorExtensionTokenURI.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Implement this if you want your extension to have overloadable URI's
 */
interface ICreatorExtensionTokenURI is IERC165 {

    /**
     * Get the uri for a given creator/tokenId
     */
    function tokenURI(address creator, uint256 tokenId) external view returns (string memory);
}

File 28 of 30 : IERC1155CreatorMintPermissions.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

/**
 * @dev Required interface of an ERC1155Creator compliant extension contracts.
 */
interface IERC1155CreatorMintPermissions is IERC165 {

    /**
     * @dev get approval to mint
     */
    function approveMint(address extension, address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
}

File 29 of 30 : ERC1155Base.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC1155Core.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-1155[ERC1155] Non-Fungible Token Standard
 */
abstract contract ERC1155Base is ERC1155Core {
    /**
     * @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_;
    }
}

File 30 of 30 : ERC1155Core.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
abstract contract ERC1155Core is ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Token name
    string internal _name;

    // Token symbol
    string internal _symbol;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) internal _balances;

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

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

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: address zero is not a valid owner");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "ERC1155: caller is not token owner or approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "ERC1155: caller is not token owner or approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = msg.sender;
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = msg.sender;
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = msg.sender;
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @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, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"_marketplace","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ClickIsSoulbound","type":"error"},{"inputs":[],"name":"MarketplaceCanOnlyMoveClick","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"extension","type":"address"}],"name":"ApproveTransferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"DefaultRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ExtensionApproveTransferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"ExtensionRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionUnregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"permissions","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"MintPermissionsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"RoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"CLICK_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MARKETPLACE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"airdropClicks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedOperators","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"blacklistExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getApproveTransfer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExtensions","outputs":[{"internalType":"address[]","name":"extensions","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFees","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintBaseExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintBaseNew","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintExtensionExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintExtensionNew","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"nonpayable","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":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"baseURIIdentical","type":"bool"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"status","type":"uint256"}],"name":"setAllowedOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"setApproveTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setApproveTransferExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"bool","name":"identical","type":"bool"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address","name":"permissions","type":"address"}],"name":"setMintPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyaltiesExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefixExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenExtension","outputs":[{"internalType":"address","name":"extension","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"unregisterExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60a06040525f60085534801562000014575f80fd5b506040516200604e3803806200604e833981016040819052620000379162000164565b6040518060400160405280601781526020017f436c69636b437265617465204d61726b6574706c6163650000000000000000008152506040518060400160405280600981526020016810d31250d2d4d0549560ba1b8152508181620000ab620000a5620000f560201b60201c565b620000f9565b600180556004620000bd83826200023a565b506005620000cc82826200023a565b5050505050620000e282620000f960201b60201c565b6001600160a01b03166080525062000302565b3390565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200015f575f80fd5b919050565b5f806040838503121562000176575f80fd5b620001818362000148565b9150620001916020840162000148565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b600181811c90821680620001c357607f821691505b602082108103620001e257634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111562000235575f81815260208120601f850160051c81016020861015620002105750805b601f850160051c820191505b8181101562000231578281556001016200021c565b5050505b505050565b81516001600160401b038111156200025657620002566200019a565b6200026e81620002678454620001ae565b84620001e8565b602080601f831160018114620002a4575f84156200028c5750858301515b5f19600386901b1c1916600185901b17855562000231565b5f85815260208120601f198616915b82811015620002d457888601518255948401946001909101908401620002b3565b5085821015620002f257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b608051615d1e620003305f395f81816107c401528181610b680152818161182e0152613bb30152615d1e5ff3fe608060405234801561000f575f80fd5b5060043610610366575f3560e01c8063715018a6116101c9578063b9c4d9fb116100fe578063e985e9c51161009e578063f2fde38b11610079578063f2fde38b14610791578063feeb5a9a146107a4578063ffa1ad74146107b7578063ffef3cf0146107bf575f80fd5b8063e985e9c514610758578063f0cdc4991461076b578063f242432a1461077e575f80fd5b8063ce8aee9d116100d9578063ce8aee9d1461071f578063d5a06d4c146106df578063e6c884dc14610732578063e92a89f614610745575f80fd5b8063b9c4d9fb146106cc578063bb3bafd6146106df578063bd85b03914610700575f80fd5b806399e0dd7c11610169578063aafb2d4411610144578063aafb2d441461068b578063ac0c8cfa1461069e578063b0fe87c9146106b1578063b2332963146106c4575f80fd5b806399e0dd7c14610646578063a22cb46514610659578063a6674f881461066c575f80fd5b80638518584f116101a45780638518584f146106085780638c6e84721461061b5780638da5cb5b1461062e57806395d89b411461063e575f80fd5b8063715018a6146105e557806382dcc0c8146105ed57806383b7db6314610600575f80fd5b80632eb2c2d61161029f5780633f0f37f61161023f57806361e5bc6b1161021a57806361e5bc6b1461059957806366d1e9d0146105ac578063695c96e6146105bf5780636d73e669146105d2575f80fd5b80633f0f37f6146105605780634e1273f414610573578063596798ad14610586575f80fd5b806331ae450b1161027a57806331ae450b14610512578063332dd1ae146105275780633db0f8ab1461053a5780633e6134b81461054d575f80fd5b80632eb2c2d6146104d957806330176e13146104ec5780633071a0f9146104ff575f80fd5b8063162094c41161030a578063239be317116102e5578063239be3171461046e57806324d7806c146104815780632a55205a146104945780632d345670146104c6575f80fd5b8063162094c41461042357806320e4afe21461043657806322f374d014610449575f80fd5b806302e7afb71161034557806302e7afb7146103c857806306fdde03146103db5780630e89341c146103f05780630ebd4c7f14610403575f80fd5b8062fdd58e1461036a57806301ffc9a71461039057806302622d72146103b3575b5f80fd5b61037d6103783660046149f1565b6107e6565b6040519081526020015b60405180910390f35b6103a361039e366004614a30565b61087f565b6040519015158152602001610387565b6103c66103c13660046149f1565b6108a7565b005b6103c66103d6366004614a4b565b6108ca565b6103e361091f565b6040516103879190614ab3565b6103e36103fe366004614ac5565b6109af565b610416610411366004614ac5565b6109ba565b6040516103879190614b15565b6103c6610431366004614b64565b6109c5565b6103c6610444366004614beb565b610a1e565b6009546001600160a01b03165b6040516001600160a01b039091168152602001610387565b61045661047c366004614ac5565b610a7b565b6103a361048f366004614a4b565b610ab2565b6104a76104a2366004614c5e565b610ae9565b604080516001600160a01b039093168352602083019190915201610387565b6103c66104d4366004614a4b565b610b01565b6103c66104e7366004614dcc565b610b5d565b6103c66104fa366004614e72565b610c1e565b6103c661050d366004614eb0565b610c71565b61051a610ccf565b6040516103879190614f1e565b6103c6610535366004614f30565b610d7c565b6103c6610548366004614f96565b610dd8565b6103c661055b366004614e72565b610eda565b6103c661056e366004614fdd565b610eed565b610416610581366004615040565b610f4b565b6103c6610594366004614a4b565b611072565b6103c66105a7366004614f30565b6110c4565b6103c66105ba366004614e72565b611142565b6103c66105cd366004615106565b611154565b6103c66105e0366004614a4b565b61122a565b6103c6611281565b6103c66105fb366004615198565b611294565b61051a6112a7565b6103c6610616366004614f30565b611346565b610416610629366004615106565b6114ee565b5f546001600160a01b0316610456565b6103e3611524565b6103c6610654366004614e72565b611533565b6103c66106673660046151ea565b611586565b61037d61067a366004614a4b565b60186020525f908152604090205481565b6103c6610699366004614f30565b611591565b6103c66106ac366004615221565b611650565b6103c66106bf366004614f96565b611662565b61037d600181565b61051a6106da366004614ac5565b6116b8565b6106f26106ed366004614ac5565b6116c3565b60405161038792919061523c565b61037d61070e366004614ac5565b5f9081526017602052604090205490565b6103c661072d366004614a4b565b6116d8565b6103c6610740366004615106565b61172a565b6103c6610753366004614b64565b611790565b6103a3610766366004615269565b6117a3565b6103c6610779366004615269565b6117d0565b6103c661078c366004615295565b611823565b6103c661079f366004614a4b565b6118be565b6104166107b2366004615106565b611934565b61037d600381565b6104567f000000000000000000000000000000000000000000000000000000000000000081565b5f6001600160a01b0383166108555760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b505f8181526006602090815260408083206001600160a01b03861684529091529020545b92915050565b5f61088982611996565b806108985750610898826119ba565b806108795750610879826119f4565b6108af611a28565b6001600160a01b039091165f90815260186020526040902055565b336108dc5f546001600160a01b031690565b6001600160a01b031614806108f757506108f7600233611a81565b6109135760405162461bcd60e51b815260040161084c906152f8565b61091c81611aa5565b50565b60606004805461092e9061533c565b80601f016020809104026020016040519081016040528092919081815260200182805461095a9061533c565b80156109a55780601f1061097c576101008083540402835291602001916109a5565b820191905f5260205f20905b81548152906001019060200180831161098857829003601f168201915b5050505050905090565b606061087982611bb3565b606061087982611e88565b336109d75f546001600160a01b031690565b6001600160a01b031614806109f257506109f2600233611a81565b610a0e5760405162461bcd60e51b815260040161084c906152f8565b610a19838383611e93565b505050565b33610a305f546001600160a01b031690565b6001600160a01b03161480610a4b5750610a4b600233611a81565b610a675760405162461bcd60e51b815260040161084c906152f8565b610a748585858585611f14565b5050505050565b5f610a8582611f98565b90506001600160a01b038116610a99575f80fd5b610aa4600c82611a81565b15610aad575f80fd5b919050565b5f816001600160a01b0316610ace5f546001600160a01b031690565b6001600160a01b031614806108795750610879600283611a81565b5f80610af58484611fb2565b915091505b9250929050565b610b09611a28565b610b14600282611a81565b1561091c5760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d5905f90a3610b59600282612083565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bca576001600160a01b038516331480610ba95750610ba985336117a3565b610bc55760405162461bcd60e51b815260040161084c9061536e565b610c11565b82516001148015610bf457506001835f81518110610bea57610bea6153bc565b6020026020010151145b610c115760405163fa74c2d560e01b815260040160405180910390fd5b610a748585858585612097565b33610c305f546001600160a01b031690565b6001600160a01b03161480610c4b5750610c4b600233611a81565b610c675760405162461bcd60e51b815260040161084c906152f8565b610b598282612237565b33610c835f546001600160a01b031690565b6001600160a01b03161480610c9e5750610c9e600233611a81565b610cba5760405162461bcd60e51b815260040161084c906152f8565b610cc38361226b565b610a198383835f6122bb565b6060610cdb60026123a5565b6001600160401b03811115610cf257610cf2614c7e565b604051908082528060200260200182016040528015610d1b578160200160208202803683370190505b5090505f5b610d2a60026123a5565b811015610d7857610d3c6002826123ae565b828281518110610d4e57610d4e6153bc565b6001600160a01b039092166020928302919091019091015280610d70816153e4565b915050610d20565b5090565b33610d8e5f546001600160a01b031690565b6001600160a01b03161480610da95750610da9600233611a81565b610dc55760405162461bcd60e51b815260040161084c906152f8565b610dd25f858585856123b9565b50505050565b610de06124a3565b6001600160a01b038516331480610dfc5750610dfc85336117a3565b610e04575f80fd5b828114610e0f575f80fd5b6001839003610e5857610e538585855f818110610e2e57610e2e6153bc565b9050602002013584845f818110610e4757610e476153bc565b905060200201356124fc565b610ec4565b610ec4858585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201919091525061252e92505050565b610ed185858585856125a3565b610a7460018055565b610ee261272a565b610b5982825f612781565b33610eff5f546001600160a01b031690565b6001600160a01b03161480610f1a5750610f1a600233611a81565b610f365760405162461bcd60e51b815260040161084c906152f8565b610f3f8461226b565b610dd2848484846122bb565b60608151835114610fb05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161084c565b5f83516001600160401b03811115610fca57610fca614c7e565b604051908082528060200260200182016040528015610ff3578160200160208202803683370190505b5090505f5b845181101561106a5761103d858281518110611016576110166153bc565b6020026020010151858381518110611030576110306153bc565b60200260200101516107e6565b82828151811061104f5761104f6153bc565b6020908102919091010152611063816153e4565b9050610ff8565b509392505050565b336110845f546001600160a01b031690565b6001600160a01b0316148061109f575061109f600233611a81565b6110bb5760405162461bcd60e51b815260040161084c906152f8565b61091c816127bc565b6110cc61272a565b8281146110eb5760405162461bcd60e51b815260040161084c906153fc565b5f5b83811015610a745761113a85858381811061110a5761110a6153bc565b90506020020135848484818110611123576111236153bc565b90506020028101906111359190615423565b612810565b6001016110ed565b61114a61272a565b610b59828261281a565b61115c6124a3565b3361116e5f546001600160a01b031690565b6001600160a01b031614806111895750611189600233611a81565b6111a55760405162461bcd60e51b815260040161084c906152f8565b5f5b83811015611209575f8585838181106111c2576111c26153bc565b9050602002013590505f811180156111dc57506008548111155b6111e4575f80fd5b5f6111ee82611f98565b6001600160a01b031614611200575f80fd5b506001016111a7565b506112195f878787878787612833565b61122260018055565b505050505050565b611232611a28565b61123d600282611a81565b61091c5760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb1905f90a3610b59600282612bcb565b611289611a28565b6112925f612bdf565b565b61129c61272a565b610a19838383612781565b60606112b3600a6123a5565b6001600160401b038111156112ca576112ca614c7e565b6040519080825280602002602001820160405280156112f3578160200160208202803683370190505b5090505f5b611302600a6123a5565b811015610d7857611314600a826123ae565b828281518110611326576113266153bc565b6001600160a01b03909216602092830291909101909101526001016112f8565b61134e611a28565b8281146113b85760405162461bcd60e51b815260206004820152603260248201527f436c69636b546f6b656e3a20726563697069656e747320616e6420616d6f756e6044820152710e8e640d8cadccee8d040dad2e6dac2e8c6d60731b606482015260840161084c565b825f805b828110156114a4575f8787838181106113d7576113d76153bc565b90506020020160208101906113ec9190614a4b565b90505f868684818110611401576114016153bc565b6001600160a01b0385165f9081527f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a31602090815260408220805493909102949094013594508493925090611456908490615465565b90915550506040805160018152602081018390526001600160a01b038416915f9130915f80516020615cc9833981519152910160405180910390a450508061149d906153e4565b90506113bc565b5060015f90815260176020527ff36d6bc9642eb6fb6ee9998b09ce990566df752ab06e11f8de7ab633bbd57b8f80548392906114e1908490615465565b9091555050505050505050565b60606114f86124a3565b61150061272a565b61150f33888888888888612c2e565b905061151a60018055565b9695505050505050565b60606005805461092e9061533c565b336115455f546001600160a01b031690565b6001600160a01b031614806115605750611560600233611a81565b61157c5760405162461bcd60e51b815260040161084c906152f8565b610b59828261303a565b610b5933838361306e565b336115a35f546001600160a01b031690565b6001600160a01b031614806115be57506115be600233611a81565b6115da5760405162461bcd60e51b815260040161084c906152f8565b8281146115f95760405162461bcd60e51b815260040161084c906153fc565b5f5b83811015610a7457611648858583818110611618576116186153bc565b90506020020135848484818110611631576116316153bc565b90506020028101906116439190615423565b611e93565b6001016115fb565b61165861272a565b61091c338261314d565b336116745f546001600160a01b031690565b6001600160a01b0316148061168f575061168f600233611a81565b6116ab5760405162461bcd60e51b815260040161084c906152f8565b610a7485858585856123b9565b6060610879826131c4565b6060806116cf836131d6565b91509150915091565b336116ea5f546001600160a01b031690565b6001600160a01b031614806117055750611705600233611a81565b6117215760405162461bcd60e51b815260040161084c906152f8565b61091c81613572565b6117326124a3565b61173a61272a565b5f5b83811015611780573361176686868481811061175a5761175a6153bc565b90506020020135611f98565b6001600160a01b031614611778575f80fd5b60010161173c565b5061121933878787878787612833565b61179861272a565b610a19838383612810565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b336117e25f546001600160a01b031690565b6001600160a01b031614806117fd57506117fd600233611a81565b6118195760405162461bcd60e51b815260040161084c906152f8565b610b5982826135b2565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611890576001600160a01b03851633148061186f575061186f85336117a3565b61188b5760405162461bcd60e51b815260040161084c9061536e565b6118b1565b600183146118b15760405163fa74c2d560e01b815260040160405180910390fd5b610a7485858585856136d9565b6118c6611a28565b6001600160a01b03811661192b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161084c565b61091c81612bdf565b606061193e6124a3565b336119505f546001600160a01b031690565b6001600160a01b0316148061196b575061196b600233611a81565b6119875760405162461bcd60e51b815260040161084c906152f8565b61150f5f888888888888612c2e565b5f6001600160e01b031982166301f4921160e61b14806108795750610879826137fe565b5f6001600160e01b03198216636cdb3d1360e11b148061089857506001600160e01b031982166303a24d0760e21b14806108795750610879825b5f6001600160e01b03198216632a9f3abf60e11b148061087957506301ffc9a760e01b6001600160e01b0319831614610879565b5f546001600160a01b031633146112925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161084c565b6001600160a01b0381165f90815260018301602052604081205415155b9392505050565b6001600160a01b03811615801590611ac657506001600160a01b0381163014155b611b125760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c6600000000000000604482015260640161084c565b611b1d600a82611a81565b15611b645760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a78901479905f90a3611b62600a82612083565b505b611b6f600c82611a81565b61091c5760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c905f90a3610b59600c82612bcb565b60605f82118015611bc657506008548211155b611c025760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b604482015260640161084c565b5f611c0c83611f98565b9050611c19600c82611a81565b15611c5e5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604482015260640161084c565b5f8381526011602052604090208054611c769061533c565b159050611d8b576001600160a01b0381165f9081526010602052604090208054611c9f9061533c565b159050611cef576001600160a01b0381165f90815260106020908152604080832086845260118352928190209051611cd89392016154e7565b604051602081830303815290604052915050919050565b5f8381526011602052604090208054611d079061533c565b80601f0160208091040260200160405190810160405280929190818152602001828054611d339061533c565b8015611d7e5780601f10611d5557610100808354040283529160200191611d7e565b820191905f5260205f20905b815481529060010190602001808311611d6157829003601f168201915b5050505050915050919050565b611d9c8163e9dc637560e01b6138ae565b15611e105760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc6375906044015f60405180830381865afa158015611de9573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611a9e9190810190615503565b6001600160a01b0381165f908152600f602052604090205460ff16611e60576001600160a01b0381165f908152600e60205260409020611e4f846138c9565b604051602001611cd8929190615575565b6001600160a01b0381165f908152600e602052604090208054611d079061533c565b50919050565b6060611a9e826131d6565b5f83118015611ea457506008548311155b8015611ec057505f611eb584611f98565b6001600160a01b0316145b611efc5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b604482015260640161084c565b5f838152601160205260409020610dd28284836155de565b611f2084848484613958565b5f858152601360205260408120611f36916149a8565b611f538484848460135f8b81526020019081526020015f20613a02565b847fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee85858585604051611f8994939291906156c8565b60405180910390a25050505050565b5f908152601660205260409020546001600160a01b031690565b5f805f80611fbf866131d6565b915091506001825111156120155760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c747920726563656976657200000000604482015260640161084c565b81515f0361202a57305f935093505050610afa565b815f8151811061203c5761203c6153bc565b602002602001015161271086835f8151811061205a5761205a6153bc565b602002602001015161206c919061572a565b6120769190615741565b9350935050509250929050565b5f611a9e836001600160a01b038416613abb565b81518351146120b85760405162461bcd60e51b815260040161084c90615760565b6001600160a01b0384166120de5760405162461bcd60e51b815260040161084c906157a8565b336120ed818787878787613b9e565b5f5b84518110156121d1575f85828151811061210b5761210b6153bc565b602002602001015190505f858381518110612128576121286153bc565b6020908102919091018101515f8481526006835260408082206001600160a01b038e1683529093529190912054909150818110156121785760405162461bcd60e51b815260040161084c906157ed565b5f8381526006602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906121b6908490615465565b92505081905550505050806121ca906153e4565b90506120ef565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612221929190615837565b60405180910390a4611222818787878787613c48565b5f8052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c610a198284836155de565b612276600c82611a81565b1561091c5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604482015260640161084c565b6001600160a01b03841630148015906122dd57506001600160a01b0384163b15155b6123135760405162461bcd60e51b8152602060048201526007602482015266125b9d985b1a5960ca1b604482015260640161084c565b60405133906001600160a01b038616907fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a905f90a36001600160a01b0384165f908152600e6020526040902061236a8385836155de565b506001600160a01b0384165f908152600f60205260409020805460ff1916821515179055612399600a85612bcb565b50610dd284600161314d565b5f610879825490565b5f611a9e8383613da2565b6123c584848484613958565b6001600160a01b0385165f9081526012602052604081206123e5916149a8565b6124148484848460125f8b6001600160a01b03166001600160a01b031681526020019081526020015f20613a02565b6001600160a01b038516612464577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b8484848460405161245794939291906156c8565b60405180910390a1610a74565b846001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f85858585604051611f8994939291906156c8565b6002600154036124f55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161084c565b6002600155565b612507838383613dc8565b5f8281526017602052604081208054839290612524908490615849565b9091555050505050565b612539838383613eca565b5f5b8251811015610dd257818181518110612556576125566153bc565b602002602001015160175f858481518110612573576125736153bc565b602002602001015181526020019081526020015f205f8282546125969190615849565b909155505060010161253b565b826125c05760405162461bcd60e51b815260040161084c906153fc565b5f60165f86865f8181106125d6576125d66153bc565b602090810292909201358352508101919091526040015f908120546001600160a01b031691505b8481101561269b57816001600160a01b031660165f888885818110612624576126246153bc565b602090810292909201358352508101919091526040015f20546001600160a01b0316146126935760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f727300000000604482015260640161084c565b6001016125fd565b506001600160a01b03811615611222576126bc816303dc6f6560e51b6138ae565b15611222576040516303dc6f6560e51b81526001600160a01b03821690637b8deca0906126f5908990899089908990899060040161585c565b5f604051808303815f87803b15801561270c575f80fd5b505af115801561271e573d5f803e3d5ffd5b50505050505050505050565b612735600a33611a81565b6112925760405162461bcd60e51b815260206004820152601c60248201527f4d757374206265207265676973746572656420657874656e73696f6e00000000604482015260640161084c565b335f908152600e6020526040902061279a8385836155de565b50335f908152600f60205260409020805460ff19169115159190911790555050565b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f959c0e47a2fe3cf01e237ba4892e2cc3194d77cbfb33e434e40873225d6b595f9060200160405180910390a150565b33611eb584611f98565b335f908152601060205260409020610a198284836155de565b6001600160a01b038716156128dd576128dd8686808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201919091525061405f92505050565b6001851480156128ed5750600183145b80156128f95750600181145b156129765761297186865f818110612913576129136153bc565b90506020020160208101906129289190614a4b565b85855f81811061293a5761293a6153bc565b9050602002013584845f818110612953576129536153bc565b604080515f81526020808201909252910292909201359190506140e7565b612bc2565b60018514801561298557508281145b15612a4c5761297186865f81811061299f5761299f6153bc565b90506020020160208101906129b49190614a4b565b8585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201829052509250612a1c915050565b6040519080825280601f01601f191660200182016040528015612a46576020820181803683370190505b5061411b565b600183148015612a5c5750600181145b15612ace575f5b85811015612ac857612ac0878783818110612a8057612a806153bc565b9050602002016020810190612a959190614a4b565b86865f818110612aa757612aa76153bc565b9050602002013585855f818110612953576129536153bc565b600101612a63565b50612bc2565b600183148015612add57508481145b15612b49575f5b85811015612ac857612b41878783818110612b0157612b016153bc565b9050602002016020810190612b169190614a4b565b86865f818110612b2857612b286153bc565b90506020020135858585818110612953576129536153bc565b600101612ae4565b8483148015612b5757508481145b15612baa575f5b85811015612ac857612ba2878783818110612b7b57612b7b6153bc565b9050602002016020810190612b909190614a4b565b868684818110612b2857612b286153bc565b600101612b5e565b60405162461bcd60e51b815260040161084c906153fc565b50505050505050565b5f611a9e836001600160a01b038416614191565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606001861115612c8057604080516001808252818301909252906020808301908036833701905050905060018211801590612c7357506001841480612c7357508584145b612c7b575f80fd5b612cd8565b836001600160401b03811115612c9857612c98614c7e565b604051908082528060200260200182016040528015612cc1578160200160208202803683370190505b509050811580612cd057508382145b612cd8575f80fd5b5f5b8151811015612d4c5760085f8154612cf1906153e4565b909155506008548251839083908110612d0c57612d0c6153bc565b6020908102919091018101919091526008545f90815260169091526040902080546001600160a01b0319166001600160a01b038b16179055600101612cda565b506001600160a01b03881615612dca57612dca8787808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050604080516020808b0282810182019093528a82528794509092508a918a918291908501908490808284375f9201919091525061405f92505050565b600186148015612ddb575080516001145b15612e3b57612e3687875f818110612df557612df56153bc565b9050602002016020810190612e0a9190614a4b565b825f81518110612e1c57612e1c6153bc565b602002602001015187875f818110612953576129536153bc565b612f86565b6001861115612f23576001849003612ebb575f5b86811015612eb557612ead888883818110612e6c57612e6c6153bc565b9050602002016020810190612e819190614a4b565b835f81518110612e9357612e936153bc565b602002602001015188885f818110612953576129536153bc565b600101612e4f565b50612f86565b5f5b86811015612eb557612f1b888883818110612eda57612eda6153bc565b9050602002016020810190612eef9190614a4b565b835f81518110612f0157612f016153bc565b6020026020010151888885818110612953576129536153bc565b600101612ebd565b612f8687875f818110612f3857612f386153bc565b9050602002016020810190612f4d9190614a4b565b828787808060200260200160405190810160405280939291908181526020018383602002808284375f9201829052509250612a1c915050565b5f5b815181101561302e578281108015612fc457505f848483818110612fae57612fae6153bc565b9050602002810190612fc09190615423565b9050115b1561302657838382818110612fdb57612fdb6153bc565b9050602002810190612fed9190615423565b60115f858581518110613002576130026153bc565b602002602001015181526020019081526020015f2091826130249291906155de565b505b600101612f88565b50979650505050505050565b5f805260106020527f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb01610a198284836155de565b816001600160a01b0316836001600160a01b0316036130e15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161084c565b6001600160a01b038381165f81815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613161826001620e90cb60e41b03196138ae565b15610b59576001600160a01b0382165f81815260146020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a25050565b60606131cf826131d6565b5092915050565b6060805f60135f8581526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b82821015613253575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff168183015282526001909201910161320a565b50505050905080515f03613398575f61326b85611f98565b90506001600160a01b038116156133965761328d81634e53ee3d60e11b6138ae565b1561331457604051634e53ee3d60e11b8152306004820152602481018690526001600160a01b03821690639ca7dc7a906044015f60405180830381865afa1580156132da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261330191908101906158f6565b8151919550935015613314575050915091565b6001600160a01b0381165f90815260126020908152604080832080548251818502810185019093528083529193909284015b8282101561338f575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff1681830152825260019092019101613346565b5050505091505b505b80515f03613438575f808052601260209081527f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7b8054604080518285028101850190915281815293919290919084015b82821015613431575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016133e8565b5050505090505b80511561356c5780516001600160401b0381111561345857613458614c7e565b604051908082528060200260200182016040528015613481578160200160208202803683370190505b50925080516001600160401b0381111561349d5761349d614c7e565b6040519080825280602002602001820160405280156134c6578160200160208202803683370190505b5091505f5b815181101561356a578181815181106134e6576134e66153bc565b60200260200101515f0151848281518110613503576135036153bc565b60200260200101906001600160a01b031690816001600160a01b031681525050818181518110613535576135356153bc565b60200260200101516020015161ffff16838281518110613557576135576153bc565b60209081029190910101526001016134cb565b505b50915091565b60405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a78901479905f90a3610b59600a82612083565b6135bd600a83611a81565b6135fd5760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b604482015260640161084c565b6001600160a01b038116158061361f575061361f816378ea2a9760e11b6138ae565b61365d5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161084c565b6001600160a01b038281165f90815260156020526040902054811690821614610b59576001600160a01b038281165f8181526015602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166136ff5760405162461bcd60e51b815260040161084c906157a8565b335f61370a856141dd565b90505f613716856141dd565b9050613726838989858589613b9e565b5f8681526006602090815260408083206001600160a01b038c168452909152902054858110156137685760405162461bcd60e51b815260040161084c906157ed565b5f8781526006602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906137a6908490615465565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816915f80516020615cc9833981519152910160405180910390a46137f3848a8a8a8a8a614226565b505050505050505050565b5f6001600160e01b031982166314d9799760e21b148061382e57506001600160e01b031982166328f10a2160e01b145b8061383d575061383d826119ba565b8061385857506001600160e01b03198216635d9dd7eb60e11b145b8061387357506001600160e01b03198216632dde656160e21b145b8061388e57506001600160e01b031982166335681b5360e21b145b8061087957506001600160e01b0319821663152a902d60e11b1492915050565b5f6138b8836142e0565b8015611a9e5750611a9e8383614312565b60605f6138d583614398565b60010190505f816001600160401b038111156138f3576138f3614c7e565b6040519080825280601f01601f19166020018201604052801561391d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461392757509392505050565b8281146139775760405162461bcd60e51b815260040161084c906153fc565b5f805b828110156139b057838382818110613994576139946153bc565b90506020020135826139a69190615465565b915060010161397a565b506127108110610a745760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420746f74616c20726f79616c74696573000000000000000000604482015260640161084c565b5f5b8281101561122257816040518060400160405280888885818110613a2a57613a2a6153bc565b9050602002016020810190613a3f9190614a4b565b6001600160a01b03168152602001868685818110613a5f57613a5f6153bc565b61ffff602091820293909301358316909352508354600181810186555f958652948390208451910180549490930151909116600160a01b026001600160b01b03199093166001600160a01b039091161791909117905501613a04565b5f8181526001830160205260408120548015613b95575f613add600183615849565b85549091505f90613af090600190615849565b9050818114613b4f575f865f018281548110613b0e57613b0e6153bc565b905f5260205f200154905080875f018481548110613b2e57613b2e6153bc565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080613b6057613b606159b5565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610879565b5f915050610879565b6001600160a01b03851615801590613be857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614155b8015613bf85750613bf88361446f565b8015613c1c57506001600160a01b0386165f90815260186020526040902054600114155b15613c3a57604051635ec8378b60e11b815260040160405180910390fd5b6112228686868686866144c1565b6001600160a01b0384163b156112225760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613c8c90899089908890889088906004016159c9565b6020604051808303815f875af1925050508015613cc6575060408051601f3d908101601f19168201909252613cc391810190615a1a565b60015b613d7257613cd2615a35565b806308c379a003613d0b5750613ce6615a4e565b80613cf15750613d0d565b8060405162461bcd60e51b815260040161084c9190614ab3565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161084c565b6001600160e01b0319811663bc197c8160e01b14612bc25760405162461bcd60e51b815260040161084c90615ad6565b5f825f018281548110613db757613db76153bc565b905f5260205f200154905092915050565b6001600160a01b038316613dee5760405162461bcd60e51b815260040161084c90615b1e565b335f613df9846141dd565b90505f613e05846141dd565b9050613e2383875f858560405180602001604052805f815250613b9e565b5f8581526006602090815260408083206001600160a01b038a16845290915290205484811015613e655760405162461bcd60e51b815260040161084c90615b61565b5f8681526006602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816915f80516020615cc9833981519152910160405180910390a460408051602081019091525f9052612bc2565b6001600160a01b038316613ef05760405162461bcd60e51b815260040161084c90615b1e565b8051825114613f115760405162461bcd60e51b815260040161084c90615760565b5f339050613f3181855f868660405180602001604052805f815250613b9e565b5f5b8351811015613ff4575f848281518110613f4f57613f4f6153bc565b602002602001015190505f848381518110613f6c57613f6c6153bc565b6020908102919091018101515f8481526006835260408082206001600160a01b038c168352909352919091205490915081811015613fbc5760405162461bcd60e51b815260040161084c90615b61565b5f9283526006602090815260408085206001600160a01b038b1686529091529092209103905580613fec816153e4565b915050613f33565b505f6001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051614044929190615837565b60405180910390a460408051602081019091525f9052610dd2565b335f908152601560205260409020546001600160a01b031615610a1957335f81815260156020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e916140be9190879087908790600401615ba5565b5f604051808303815f87803b1580156140d5575f80fd5b505af1158015612bc2573d5f803e3d5ffd5b6140f3848484846144cd565b5f8381526017602052604081208054849290614110908490615465565b909155505050505050565b61412784848484614596565b5f5b8351811015610a7457828181518110614144576141446153bc565b602002602001015160175f868481518110614161576141616153bc565b602002602001015181526020019081526020015f205f8282546141849190615465565b9091555050600101614129565b5f8181526001830160205260408120546141d657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610879565b505f610879565b6040805160018082528183019092526060915f91906020808301908036833701905050905082815f81518110614215576142156153bc565b602090810291909101015292915050565b6001600160a01b0384163b156112225760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061426a9089908990889088908890600401615bee565b6020604051808303815f875af19250505080156142a4575060408051601f3d908101601f191682019092526142a191810190615a1a565b60015b6142b057613cd2615a35565b6001600160e01b0319811663f23a6e6160e01b14612bc25760405162461bcd60e51b815260040161084c90615ad6565b5f6142f2826301ffc9a760e01b614312565b8015610879575061430b826001600160e01b0319614312565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b17815282515f9392849283928392918391908a617530fa92503d91505f519050828015614382575060208210155b801561438d57505f81115b979650505050505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106143d65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614402576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061442057662386f26fc10000830492506010015b6305f5e1008310614438576305f5e100830492506008015b612710831061444c57612710830492506004015b6064831061445e576064830492506002015b600a83106108795760010192915050565b80515f90815b818110156144b8576001848281518110614491576144916153bc565b6020026020010151036144a8575060019392505050565b6144b1816153e4565b9050614475565b505f9392505050565b611222858585856146e8565b6001600160a01b0384166144f35760405162461bcd60e51b815260040161084c90615c27565b335f6144fe856141dd565b90505f61450a856141dd565b905061451a835f89858589613b9e565b5f8681526006602090815260408083206001600160a01b038b1684529091528120805487929061454b908490615465565b909155505060408051878152602081018790526001600160a01b03808a16925f92918716915f80516020615cc9833981519152910160405180910390a4612bc2835f89898989614226565b6001600160a01b0384166145bc5760405162461bcd60e51b815260040161084c90615c27565b81518351146145dd5760405162461bcd60e51b815260040161084c90615760565b336145ec815f87878787613b9e565b5f5b845181101561468257838181518110614609576146096153bc565b602002602001015160065f878481518110614626576146266153bc565b602002602001015181526020019081526020015f205f886001600160a01b03166001600160a01b031681526020019081526020015f205f82825461466a9190615465565b9091555081905061467a816153e4565b9150506145ee565b50846001600160a01b03165f6001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516146d2929190615837565b60405180910390a4610a74815f87878787613c48565b6001600160a01b03841615610dd2575f60165f845f8151811061470d5761470d6153bc565b602002602001015181526020019081526020015f205f9054906101000a90046001600160a01b031690505f5b83518110156147d957816001600160a01b031660165f868481518110614761576147616153bc565b60209081029190910181015182528101919091526040015f20546001600160a01b0316146147d15760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f727300000000604482015260640161084c565b600101614739565b506001600160a01b0381161580159061480957506001600160a01b0381165f9081526014602052604090205460ff165b156148d35760405163e483517760e01b81526001600160a01b0382169063e4835177906148429033908990899089908990600401615c68565b6020604051808303815f875af115801561485e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148829190615cad565b6148ce5760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c757265000000000000604482015260640161084c565b610a74565b6009546001600160a01b031615610a745760095460405163e483517760e01b81526001600160a01b039091169063e48351779061491c9033908990899089908990600401615c68565b6020604051808303815f875af1158015614938573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061495c9190615cad565b610a745760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c757265000000000000604482015260640161084c565b5080545f8255905f5260205f209081019061091c91905b80821115610d785780546001600160b01b03191681556001016149bf565b6001600160a01b038116811461091c575f80fd5b5f8060408385031215614a02575f80fd5b8235614a0d816149dd565b946020939093013593505050565b6001600160e01b03198116811461091c575f80fd5b5f60208284031215614a40575f80fd5b8135611a9e81614a1b565b5f60208284031215614a5b575f80fd5b8135611a9e816149dd565b5f5b83811015614a80578181015183820152602001614a68565b50505f910152565b5f8151808452614a9f816020860160208601614a66565b601f01601f19169290920160200192915050565b602081525f611a9e6020830184614a88565b5f60208284031215614ad5575f80fd5b5035919050565b5f8151808452602080850194508084015f5b83811015614b0a57815187529582019590820190600101614aee565b509495945050505050565b602081525f611a9e6020830184614adc565b5f8083601f840112614b37575f80fd5b5081356001600160401b03811115614b4d575f80fd5b602083019150836020828501011115610afa575f80fd5b5f805f60408486031215614b76575f80fd5b8335925060208401356001600160401b03811115614b92575f80fd5b614b9e86828701614b27565b9497909650939450505050565b5f8083601f840112614bbb575f80fd5b5081356001600160401b03811115614bd1575f80fd5b6020830191508360208260051b8501011115610afa575f80fd5b5f805f805f60608688031215614bff575f80fd5b8535945060208601356001600160401b0380821115614c1c575f80fd5b614c2889838a01614bab565b90965094506040880135915080821115614c40575f80fd5b50614c4d88828901614bab565b969995985093965092949392505050565b5f8060408385031215614c6f575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b0381118282101715614cb757614cb7614c7e565b6040525050565b5f6001600160401b03821115614cd657614cd6614c7e565b5060051b60200190565b5f82601f830112614cef575f80fd5b81356020614cfc82614cbe565b604051614d098282614c92565b83815260059390931b8501820192828101915086841115614d28575f80fd5b8286015b84811015614d435780358352918301918301614d2c565b509695505050505050565b5f6001600160401b03821115614d6657614d66614c7e565b50601f01601f191660200190565b5f82601f830112614d83575f80fd5b8135614d8e81614d4e565b604051614d9b8282614c92565b828152856020848701011115614daf575f80fd5b826020860160208301375f92810160200192909252509392505050565b5f805f805f60a08688031215614de0575f80fd5b8535614deb816149dd565b94506020860135614dfb816149dd565b935060408601356001600160401b0380821115614e16575f80fd5b614e2289838a01614ce0565b94506060880135915080821115614e37575f80fd5b614e4389838a01614ce0565b93506080880135915080821115614e58575f80fd5b50614e6588828901614d74565b9150509295509295909350565b5f8060208385031215614e83575f80fd5b82356001600160401b03811115614e98575f80fd5b614ea485828601614b27565b90969095509350505050565b5f805f60408486031215614ec2575f80fd5b8335614ecd816149dd565b925060208401356001600160401b03811115614b92575f80fd5b5f8151808452602080850194508084015f5b83811015614b0a5781516001600160a01b031687529582019590820190600101614ef9565b602081525f611a9e6020830184614ee7565b5f805f8060408587031215614f43575f80fd5b84356001600160401b0380821115614f59575f80fd5b614f6588838901614bab565b90965094506020870135915080821115614f7d575f80fd5b50614f8a87828801614bab565b95989497509550505050565b5f805f805f60608688031215614faa575f80fd5b8535614fb5816149dd565b945060208601356001600160401b0380821115614c1c575f80fd5b801515811461091c575f80fd5b5f805f8060608587031215614ff0575f80fd5b8435614ffb816149dd565b935060208501356001600160401b03811115615015575f80fd5b61502187828801614b27565b909450925050604085013561503581614fd0565b939692955090935050565b5f8060408385031215615051575f80fd5b82356001600160401b0380821115615067575f80fd5b818501915085601f83011261507a575f80fd5b8135602061508782614cbe565b6040516150948282614c92565b83815260059390931b85018201928281019150898411156150b3575f80fd5b948201945b838610156150da5785356150cb816149dd565b825294820194908201906150b8565b965050860135925050808211156150ef575f80fd5b506150fc85828601614ce0565b9150509250929050565b5f805f805f806060878903121561511b575f80fd5b86356001600160401b0380821115615131575f80fd5b61513d8a838b01614bab565b90985096506020890135915080821115615155575f80fd5b6151618a838b01614bab565b90965094506040890135915080821115615179575f80fd5b5061518689828a01614bab565b979a9699509497509295939492505050565b5f805f604084860312156151aa575f80fd5b83356001600160401b038111156151bf575f80fd5b6151cb86828701614b27565b90945092505060208401356151df81614fd0565b809150509250925092565b5f80604083850312156151fb575f80fd5b8235615206816149dd565b9150602083013561521681614fd0565b809150509250929050565b5f60208284031215615231575f80fd5b8135611a9e81614fd0565b604081525f61524e6040830185614ee7565b82810360208401526152608185614adc565b95945050505050565b5f806040838503121561527a575f80fd5b8235615285816149dd565b91506020830135615216816149dd565b5f805f805f60a086880312156152a9575f80fd5b85356152b4816149dd565b945060208601356152c4816149dd565b9350604086013592506060860135915060808601356001600160401b038111156152ec575f80fd5b614e6588828901614d74565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b600181811c9082168061535057607f821691505b602082108103611e8257634e487b7160e01b5f52602260045260245ffd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f600182016153f5576153f56153d0565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b5f808335601e19843603018112615438575f80fd5b8301803591506001600160401b03821115615451575f80fd5b602001915036819003821315610afa575f80fd5b80820180821115610879576108796153d0565b5f81546154848161533c565b6001828116801561549c57600181146154b1576154dd565b60ff19841687528215158302870194506154dd565b855f526020805f205f5b858110156154d45781548a8201529084019082016154bb565b50505082870194505b5050505092915050565b5f6154fb6154f58386615478565b84615478565b949350505050565b5f60208284031215615513575f80fd5b81516001600160401b03811115615528575f80fd5b8201601f81018413615538575f80fd5b805161554381614d4e565b6040516155508282614c92565b828152866020848601011115615564575f80fd5b61151a836020830160208701614a66565b5f6155808285615478565b8351615590818360208801614a66565b01949350505050565b601f821115610a19575f81815260208120601f850160051c810160208610156155bf5750805b601f850160051c820191505b81811015611222578281556001016155cb565b6001600160401b038311156155f5576155f5614c7e565b61560983615603835461533c565b83615599565b5f601f84116001811461563a575f85156156235750838201355b5f19600387901b1c1916600186901b178355610a74565b5f83815260209020601f19861690835b8281101561566a578685013582556020948501946001909201910161564a565b5086821015615686575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8183525f6001600160fb1b038311156156af575f80fd5b8260051b80836020870137939093016020019392505050565b604080825281018490525f8560608301825b8781101561570a5782356156ed816149dd565b6001600160a01b03168252602092830192909101906001016156da565b50838103602085015261571e818688615698565b98975050505050505050565b8082028115828204841417610879576108796153d0565b5f8261575b57634e487b7160e01b5f52601260045260245ffd5b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081525f61524e6040830185614adc565b81810381811115610879576108796153d0565b6001600160a01b03861681526060602082018190525f906158809083018688615698565b828103604084015261571e818587615698565b5f82601f8301126158a2575f80fd5b815160206158af82614cbe565b6040516158bc8282614c92565b83815260059390931b85018201928281019150868411156158db575f80fd5b8286015b84811015614d4357805183529183019183016158df565b5f8060408385031215615907575f80fd5b82516001600160401b038082111561591d575f80fd5b818501915085601f830112615930575f80fd5b8151602061593d82614cbe565b60405161594a8282614c92565b83815260059390931b8501820192828101915089841115615969575f80fd5b948201945b83861015615990578551615981816149dd565b8252948201949082019061596e565b918801519196509093505050808211156159a8575f80fd5b506150fc85828601615893565b634e487b7160e01b5f52603160045260245ffd5b6001600160a01b0386811682528516602082015260a0604082018190525f906159f490830186614adc565b8281036060840152615a068186614adc565b9050828103608084015261571e8185614a88565b5f60208284031215615a2a575f80fd5b8151611a9e81614a1b565b5f60033d1115615a4b5760045f803e505f5160e01c5b90565b5f60443d1015615a5b5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615a8a57505050505090565b8285019150815181811115615aa25750505050505090565b843d8701016020828501011115615abc5750505050505090565b615acb60208286010187614c92565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b03851681526080602082018190525f90615bc890830186614ee7565b8281036040840152615bda8186614adc565b9050828103606084015261438d8185614adc565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f9061438d90830184614a88565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6001600160a01b03868116825285811660208301528416604082015260a0606082018190525f90615c9b90830185614adc565b828103608084015261571e8185614adc565b5f60208284031215615cbd575f80fd5b8151611a9e81614fd056fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220eca097f61556a7884a70aea05875309a3793d76279caefb97c6e833076a1030e64736f6c63430008150033000000000000000000000000fcb4c6770d1da3f2ae8bf5dfc97dabf22cd5577e00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e5

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610366575f3560e01c8063715018a6116101c9578063b9c4d9fb116100fe578063e985e9c51161009e578063f2fde38b11610079578063f2fde38b14610791578063feeb5a9a146107a4578063ffa1ad74146107b7578063ffef3cf0146107bf575f80fd5b8063e985e9c514610758578063f0cdc4991461076b578063f242432a1461077e575f80fd5b8063ce8aee9d116100d9578063ce8aee9d1461071f578063d5a06d4c146106df578063e6c884dc14610732578063e92a89f614610745575f80fd5b8063b9c4d9fb146106cc578063bb3bafd6146106df578063bd85b03914610700575f80fd5b806399e0dd7c11610169578063aafb2d4411610144578063aafb2d441461068b578063ac0c8cfa1461069e578063b0fe87c9146106b1578063b2332963146106c4575f80fd5b806399e0dd7c14610646578063a22cb46514610659578063a6674f881461066c575f80fd5b80638518584f116101a45780638518584f146106085780638c6e84721461061b5780638da5cb5b1461062e57806395d89b411461063e575f80fd5b8063715018a6146105e557806382dcc0c8146105ed57806383b7db6314610600575f80fd5b80632eb2c2d61161029f5780633f0f37f61161023f57806361e5bc6b1161021a57806361e5bc6b1461059957806366d1e9d0146105ac578063695c96e6146105bf5780636d73e669146105d2575f80fd5b80633f0f37f6146105605780634e1273f414610573578063596798ad14610586575f80fd5b806331ae450b1161027a57806331ae450b14610512578063332dd1ae146105275780633db0f8ab1461053a5780633e6134b81461054d575f80fd5b80632eb2c2d6146104d957806330176e13146104ec5780633071a0f9146104ff575f80fd5b8063162094c41161030a578063239be317116102e5578063239be3171461046e57806324d7806c146104815780632a55205a146104945780632d345670146104c6575f80fd5b8063162094c41461042357806320e4afe21461043657806322f374d014610449575f80fd5b806302e7afb71161034557806302e7afb7146103c857806306fdde03146103db5780630e89341c146103f05780630ebd4c7f14610403575f80fd5b8062fdd58e1461036a57806301ffc9a71461039057806302622d72146103b3575b5f80fd5b61037d6103783660046149f1565b6107e6565b6040519081526020015b60405180910390f35b6103a361039e366004614a30565b61087f565b6040519015158152602001610387565b6103c66103c13660046149f1565b6108a7565b005b6103c66103d6366004614a4b565b6108ca565b6103e361091f565b6040516103879190614ab3565b6103e36103fe366004614ac5565b6109af565b610416610411366004614ac5565b6109ba565b6040516103879190614b15565b6103c6610431366004614b64565b6109c5565b6103c6610444366004614beb565b610a1e565b6009546001600160a01b03165b6040516001600160a01b039091168152602001610387565b61045661047c366004614ac5565b610a7b565b6103a361048f366004614a4b565b610ab2565b6104a76104a2366004614c5e565b610ae9565b604080516001600160a01b039093168352602083019190915201610387565b6103c66104d4366004614a4b565b610b01565b6103c66104e7366004614dcc565b610b5d565b6103c66104fa366004614e72565b610c1e565b6103c661050d366004614eb0565b610c71565b61051a610ccf565b6040516103879190614f1e565b6103c6610535366004614f30565b610d7c565b6103c6610548366004614f96565b610dd8565b6103c661055b366004614e72565b610eda565b6103c661056e366004614fdd565b610eed565b610416610581366004615040565b610f4b565b6103c6610594366004614a4b565b611072565b6103c66105a7366004614f30565b6110c4565b6103c66105ba366004614e72565b611142565b6103c66105cd366004615106565b611154565b6103c66105e0366004614a4b565b61122a565b6103c6611281565b6103c66105fb366004615198565b611294565b61051a6112a7565b6103c6610616366004614f30565b611346565b610416610629366004615106565b6114ee565b5f546001600160a01b0316610456565b6103e3611524565b6103c6610654366004614e72565b611533565b6103c66106673660046151ea565b611586565b61037d61067a366004614a4b565b60186020525f908152604090205481565b6103c6610699366004614f30565b611591565b6103c66106ac366004615221565b611650565b6103c66106bf366004614f96565b611662565b61037d600181565b61051a6106da366004614ac5565b6116b8565b6106f26106ed366004614ac5565b6116c3565b60405161038792919061523c565b61037d61070e366004614ac5565b5f9081526017602052604090205490565b6103c661072d366004614a4b565b6116d8565b6103c6610740366004615106565b61172a565b6103c6610753366004614b64565b611790565b6103a3610766366004615269565b6117a3565b6103c6610779366004615269565b6117d0565b6103c661078c366004615295565b611823565b6103c661079f366004614a4b565b6118be565b6104166107b2366004615106565b611934565b61037d600381565b6104567f00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e581565b5f6001600160a01b0383166108555760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b505f8181526006602090815260408083206001600160a01b03861684529091529020545b92915050565b5f61088982611996565b806108985750610898826119ba565b806108795750610879826119f4565b6108af611a28565b6001600160a01b039091165f90815260186020526040902055565b336108dc5f546001600160a01b031690565b6001600160a01b031614806108f757506108f7600233611a81565b6109135760405162461bcd60e51b815260040161084c906152f8565b61091c81611aa5565b50565b60606004805461092e9061533c565b80601f016020809104026020016040519081016040528092919081815260200182805461095a9061533c565b80156109a55780601f1061097c576101008083540402835291602001916109a5565b820191905f5260205f20905b81548152906001019060200180831161098857829003601f168201915b5050505050905090565b606061087982611bb3565b606061087982611e88565b336109d75f546001600160a01b031690565b6001600160a01b031614806109f257506109f2600233611a81565b610a0e5760405162461bcd60e51b815260040161084c906152f8565b610a19838383611e93565b505050565b33610a305f546001600160a01b031690565b6001600160a01b03161480610a4b5750610a4b600233611a81565b610a675760405162461bcd60e51b815260040161084c906152f8565b610a748585858585611f14565b5050505050565b5f610a8582611f98565b90506001600160a01b038116610a99575f80fd5b610aa4600c82611a81565b15610aad575f80fd5b919050565b5f816001600160a01b0316610ace5f546001600160a01b031690565b6001600160a01b031614806108795750610879600283611a81565b5f80610af58484611fb2565b915091505b9250929050565b610b09611a28565b610b14600282611a81565b1561091c5760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d5905f90a3610b59600282612083565b5050565b336001600160a01b037f00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e51614610bca576001600160a01b038516331480610ba95750610ba985336117a3565b610bc55760405162461bcd60e51b815260040161084c9061536e565b610c11565b82516001148015610bf457506001835f81518110610bea57610bea6153bc565b6020026020010151145b610c115760405163fa74c2d560e01b815260040160405180910390fd5b610a748585858585612097565b33610c305f546001600160a01b031690565b6001600160a01b03161480610c4b5750610c4b600233611a81565b610c675760405162461bcd60e51b815260040161084c906152f8565b610b598282612237565b33610c835f546001600160a01b031690565b6001600160a01b03161480610c9e5750610c9e600233611a81565b610cba5760405162461bcd60e51b815260040161084c906152f8565b610cc38361226b565b610a198383835f6122bb565b6060610cdb60026123a5565b6001600160401b03811115610cf257610cf2614c7e565b604051908082528060200260200182016040528015610d1b578160200160208202803683370190505b5090505f5b610d2a60026123a5565b811015610d7857610d3c6002826123ae565b828281518110610d4e57610d4e6153bc565b6001600160a01b039092166020928302919091019091015280610d70816153e4565b915050610d20565b5090565b33610d8e5f546001600160a01b031690565b6001600160a01b03161480610da95750610da9600233611a81565b610dc55760405162461bcd60e51b815260040161084c906152f8565b610dd25f858585856123b9565b50505050565b610de06124a3565b6001600160a01b038516331480610dfc5750610dfc85336117a3565b610e04575f80fd5b828114610e0f575f80fd5b6001839003610e5857610e538585855f818110610e2e57610e2e6153bc565b9050602002013584845f818110610e4757610e476153bc565b905060200201356124fc565b610ec4565b610ec4858585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201919091525061252e92505050565b610ed185858585856125a3565b610a7460018055565b610ee261272a565b610b5982825f612781565b33610eff5f546001600160a01b031690565b6001600160a01b03161480610f1a5750610f1a600233611a81565b610f365760405162461bcd60e51b815260040161084c906152f8565b610f3f8461226b565b610dd2848484846122bb565b60608151835114610fb05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161084c565b5f83516001600160401b03811115610fca57610fca614c7e565b604051908082528060200260200182016040528015610ff3578160200160208202803683370190505b5090505f5b845181101561106a5761103d858281518110611016576110166153bc565b6020026020010151858381518110611030576110306153bc565b60200260200101516107e6565b82828151811061104f5761104f6153bc565b6020908102919091010152611063816153e4565b9050610ff8565b509392505050565b336110845f546001600160a01b031690565b6001600160a01b0316148061109f575061109f600233611a81565b6110bb5760405162461bcd60e51b815260040161084c906152f8565b61091c816127bc565b6110cc61272a565b8281146110eb5760405162461bcd60e51b815260040161084c906153fc565b5f5b83811015610a745761113a85858381811061110a5761110a6153bc565b90506020020135848484818110611123576111236153bc565b90506020028101906111359190615423565b612810565b6001016110ed565b61114a61272a565b610b59828261281a565b61115c6124a3565b3361116e5f546001600160a01b031690565b6001600160a01b031614806111895750611189600233611a81565b6111a55760405162461bcd60e51b815260040161084c906152f8565b5f5b83811015611209575f8585838181106111c2576111c26153bc565b9050602002013590505f811180156111dc57506008548111155b6111e4575f80fd5b5f6111ee82611f98565b6001600160a01b031614611200575f80fd5b506001016111a7565b506112195f878787878787612833565b61122260018055565b505050505050565b611232611a28565b61123d600282611a81565b61091c5760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb1905f90a3610b59600282612bcb565b611289611a28565b6112925f612bdf565b565b61129c61272a565b610a19838383612781565b60606112b3600a6123a5565b6001600160401b038111156112ca576112ca614c7e565b6040519080825280602002602001820160405280156112f3578160200160208202803683370190505b5090505f5b611302600a6123a5565b811015610d7857611314600a826123ae565b828281518110611326576113266153bc565b6001600160a01b03909216602092830291909101909101526001016112f8565b61134e611a28565b8281146113b85760405162461bcd60e51b815260206004820152603260248201527f436c69636b546f6b656e3a20726563697069656e747320616e6420616d6f756e6044820152710e8e640d8cadccee8d040dad2e6dac2e8c6d60731b606482015260840161084c565b825f805b828110156114a4575f8787838181106113d7576113d76153bc565b90506020020160208101906113ec9190614a4b565b90505f868684818110611401576114016153bc565b6001600160a01b0385165f9081527f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a31602090815260408220805493909102949094013594508493925090611456908490615465565b90915550506040805160018152602081018390526001600160a01b038416915f9130915f80516020615cc9833981519152910160405180910390a450508061149d906153e4565b90506113bc565b5060015f90815260176020527ff36d6bc9642eb6fb6ee9998b09ce990566df752ab06e11f8de7ab633bbd57b8f80548392906114e1908490615465565b9091555050505050505050565b60606114f86124a3565b61150061272a565b61150f33888888888888612c2e565b905061151a60018055565b9695505050505050565b60606005805461092e9061533c565b336115455f546001600160a01b031690565b6001600160a01b031614806115605750611560600233611a81565b61157c5760405162461bcd60e51b815260040161084c906152f8565b610b59828261303a565b610b5933838361306e565b336115a35f546001600160a01b031690565b6001600160a01b031614806115be57506115be600233611a81565b6115da5760405162461bcd60e51b815260040161084c906152f8565b8281146115f95760405162461bcd60e51b815260040161084c906153fc565b5f5b83811015610a7457611648858583818110611618576116186153bc565b90506020020135848484818110611631576116316153bc565b90506020028101906116439190615423565b611e93565b6001016115fb565b61165861272a565b61091c338261314d565b336116745f546001600160a01b031690565b6001600160a01b0316148061168f575061168f600233611a81565b6116ab5760405162461bcd60e51b815260040161084c906152f8565b610a7485858585856123b9565b6060610879826131c4565b6060806116cf836131d6565b91509150915091565b336116ea5f546001600160a01b031690565b6001600160a01b031614806117055750611705600233611a81565b6117215760405162461bcd60e51b815260040161084c906152f8565b61091c81613572565b6117326124a3565b61173a61272a565b5f5b83811015611780573361176686868481811061175a5761175a6153bc565b90506020020135611f98565b6001600160a01b031614611778575f80fd5b60010161173c565b5061121933878787878787612833565b61179861272a565b610a19838383612810565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b336117e25f546001600160a01b031690565b6001600160a01b031614806117fd57506117fd600233611a81565b6118195760405162461bcd60e51b815260040161084c906152f8565b610b5982826135b2565b336001600160a01b037f00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e51614611890576001600160a01b03851633148061186f575061186f85336117a3565b61188b5760405162461bcd60e51b815260040161084c9061536e565b6118b1565b600183146118b15760405163fa74c2d560e01b815260040160405180910390fd5b610a7485858585856136d9565b6118c6611a28565b6001600160a01b03811661192b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161084c565b61091c81612bdf565b606061193e6124a3565b336119505f546001600160a01b031690565b6001600160a01b0316148061196b575061196b600233611a81565b6119875760405162461bcd60e51b815260040161084c906152f8565b61150f5f888888888888612c2e565b5f6001600160e01b031982166301f4921160e61b14806108795750610879826137fe565b5f6001600160e01b03198216636cdb3d1360e11b148061089857506001600160e01b031982166303a24d0760e21b14806108795750610879825b5f6001600160e01b03198216632a9f3abf60e11b148061087957506301ffc9a760e01b6001600160e01b0319831614610879565b5f546001600160a01b031633146112925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161084c565b6001600160a01b0381165f90815260018301602052604081205415155b9392505050565b6001600160a01b03811615801590611ac657506001600160a01b0381163014155b611b125760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c6600000000000000604482015260640161084c565b611b1d600a82611a81565b15611b645760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a78901479905f90a3611b62600a82612083565b505b611b6f600c82611a81565b61091c5760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c905f90a3610b59600c82612bcb565b60605f82118015611bc657506008548211155b611c025760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b604482015260640161084c565b5f611c0c83611f98565b9050611c19600c82611a81565b15611c5e5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604482015260640161084c565b5f8381526011602052604090208054611c769061533c565b159050611d8b576001600160a01b0381165f9081526010602052604090208054611c9f9061533c565b159050611cef576001600160a01b0381165f90815260106020908152604080832086845260118352928190209051611cd89392016154e7565b604051602081830303815290604052915050919050565b5f8381526011602052604090208054611d079061533c565b80601f0160208091040260200160405190810160405280929190818152602001828054611d339061533c565b8015611d7e5780601f10611d5557610100808354040283529160200191611d7e565b820191905f5260205f20905b815481529060010190602001808311611d6157829003601f168201915b5050505050915050919050565b611d9c8163e9dc637560e01b6138ae565b15611e105760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc6375906044015f60405180830381865afa158015611de9573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611a9e9190810190615503565b6001600160a01b0381165f908152600f602052604090205460ff16611e60576001600160a01b0381165f908152600e60205260409020611e4f846138c9565b604051602001611cd8929190615575565b6001600160a01b0381165f908152600e602052604090208054611d079061533c565b50919050565b6060611a9e826131d6565b5f83118015611ea457506008548311155b8015611ec057505f611eb584611f98565b6001600160a01b0316145b611efc5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b604482015260640161084c565b5f838152601160205260409020610dd28284836155de565b611f2084848484613958565b5f858152601360205260408120611f36916149a8565b611f538484848460135f8b81526020019081526020015f20613a02565b847fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee85858585604051611f8994939291906156c8565b60405180910390a25050505050565b5f908152601660205260409020546001600160a01b031690565b5f805f80611fbf866131d6565b915091506001825111156120155760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c747920726563656976657200000000604482015260640161084c565b81515f0361202a57305f935093505050610afa565b815f8151811061203c5761203c6153bc565b602002602001015161271086835f8151811061205a5761205a6153bc565b602002602001015161206c919061572a565b6120769190615741565b9350935050509250929050565b5f611a9e836001600160a01b038416613abb565b81518351146120b85760405162461bcd60e51b815260040161084c90615760565b6001600160a01b0384166120de5760405162461bcd60e51b815260040161084c906157a8565b336120ed818787878787613b9e565b5f5b84518110156121d1575f85828151811061210b5761210b6153bc565b602002602001015190505f858381518110612128576121286153bc565b6020908102919091018101515f8481526006835260408082206001600160a01b038e1683529093529190912054909150818110156121785760405162461bcd60e51b815260040161084c906157ed565b5f8381526006602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906121b6908490615465565b92505081905550505050806121ca906153e4565b90506120ef565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612221929190615837565b60405180910390a4611222818787878787613c48565b5f8052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c610a198284836155de565b612276600c82611a81565b1561091c5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604482015260640161084c565b6001600160a01b03841630148015906122dd57506001600160a01b0384163b15155b6123135760405162461bcd60e51b8152602060048201526007602482015266125b9d985b1a5960ca1b604482015260640161084c565b60405133906001600160a01b038616907fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a905f90a36001600160a01b0384165f908152600e6020526040902061236a8385836155de565b506001600160a01b0384165f908152600f60205260409020805460ff1916821515179055612399600a85612bcb565b50610dd284600161314d565b5f610879825490565b5f611a9e8383613da2565b6123c584848484613958565b6001600160a01b0385165f9081526012602052604081206123e5916149a8565b6124148484848460125f8b6001600160a01b03166001600160a01b031681526020019081526020015f20613a02565b6001600160a01b038516612464577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b8484848460405161245794939291906156c8565b60405180910390a1610a74565b846001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f85858585604051611f8994939291906156c8565b6002600154036124f55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161084c565b6002600155565b612507838383613dc8565b5f8281526017602052604081208054839290612524908490615849565b9091555050505050565b612539838383613eca565b5f5b8251811015610dd257818181518110612556576125566153bc565b602002602001015160175f858481518110612573576125736153bc565b602002602001015181526020019081526020015f205f8282546125969190615849565b909155505060010161253b565b826125c05760405162461bcd60e51b815260040161084c906153fc565b5f60165f86865f8181106125d6576125d66153bc565b602090810292909201358352508101919091526040015f908120546001600160a01b031691505b8481101561269b57816001600160a01b031660165f888885818110612624576126246153bc565b602090810292909201358352508101919091526040015f20546001600160a01b0316146126935760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f727300000000604482015260640161084c565b6001016125fd565b506001600160a01b03811615611222576126bc816303dc6f6560e51b6138ae565b15611222576040516303dc6f6560e51b81526001600160a01b03821690637b8deca0906126f5908990899089908990899060040161585c565b5f604051808303815f87803b15801561270c575f80fd5b505af115801561271e573d5f803e3d5ffd5b50505050505050505050565b612735600a33611a81565b6112925760405162461bcd60e51b815260206004820152601c60248201527f4d757374206265207265676973746572656420657874656e73696f6e00000000604482015260640161084c565b335f908152600e6020526040902061279a8385836155de565b50335f908152600f60205260409020805460ff19169115159190911790555050565b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f959c0e47a2fe3cf01e237ba4892e2cc3194d77cbfb33e434e40873225d6b595f9060200160405180910390a150565b33611eb584611f98565b335f908152601060205260409020610a198284836155de565b6001600160a01b038716156128dd576128dd8686808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201919091525061405f92505050565b6001851480156128ed5750600183145b80156128f95750600181145b156129765761297186865f818110612913576129136153bc565b90506020020160208101906129289190614a4b565b85855f81811061293a5761293a6153bc565b9050602002013584845f818110612953576129536153bc565b604080515f81526020808201909252910292909201359190506140e7565b612bc2565b60018514801561298557508281145b15612a4c5761297186865f81811061299f5761299f6153bc565b90506020020160208101906129b49190614a4b565b8585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284375f9201829052509250612a1c915050565b6040519080825280601f01601f191660200182016040528015612a46576020820181803683370190505b5061411b565b600183148015612a5c5750600181145b15612ace575f5b85811015612ac857612ac0878783818110612a8057612a806153bc565b9050602002016020810190612a959190614a4b565b86865f818110612aa757612aa76153bc565b9050602002013585855f818110612953576129536153bc565b600101612a63565b50612bc2565b600183148015612add57508481145b15612b49575f5b85811015612ac857612b41878783818110612b0157612b016153bc565b9050602002016020810190612b169190614a4b565b86865f818110612b2857612b286153bc565b90506020020135858585818110612953576129536153bc565b600101612ae4565b8483148015612b5757508481145b15612baa575f5b85811015612ac857612ba2878783818110612b7b57612b7b6153bc565b9050602002016020810190612b909190614a4b565b868684818110612b2857612b286153bc565b600101612b5e565b60405162461bcd60e51b815260040161084c906153fc565b50505050505050565b5f611a9e836001600160a01b038416614191565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606001861115612c8057604080516001808252818301909252906020808301908036833701905050905060018211801590612c7357506001841480612c7357508584145b612c7b575f80fd5b612cd8565b836001600160401b03811115612c9857612c98614c7e565b604051908082528060200260200182016040528015612cc1578160200160208202803683370190505b509050811580612cd057508382145b612cd8575f80fd5b5f5b8151811015612d4c5760085f8154612cf1906153e4565b909155506008548251839083908110612d0c57612d0c6153bc565b6020908102919091018101919091526008545f90815260169091526040902080546001600160a01b0319166001600160a01b038b16179055600101612cda565b506001600160a01b03881615612dca57612dca8787808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050604080516020808b0282810182019093528a82528794509092508a918a918291908501908490808284375f9201919091525061405f92505050565b600186148015612ddb575080516001145b15612e3b57612e3687875f818110612df557612df56153bc565b9050602002016020810190612e0a9190614a4b565b825f81518110612e1c57612e1c6153bc565b602002602001015187875f818110612953576129536153bc565b612f86565b6001861115612f23576001849003612ebb575f5b86811015612eb557612ead888883818110612e6c57612e6c6153bc565b9050602002016020810190612e819190614a4b565b835f81518110612e9357612e936153bc565b602002602001015188885f818110612953576129536153bc565b600101612e4f565b50612f86565b5f5b86811015612eb557612f1b888883818110612eda57612eda6153bc565b9050602002016020810190612eef9190614a4b565b835f81518110612f0157612f016153bc565b6020026020010151888885818110612953576129536153bc565b600101612ebd565b612f8687875f818110612f3857612f386153bc565b9050602002016020810190612f4d9190614a4b565b828787808060200260200160405190810160405280939291908181526020018383602002808284375f9201829052509250612a1c915050565b5f5b815181101561302e578281108015612fc457505f848483818110612fae57612fae6153bc565b9050602002810190612fc09190615423565b9050115b1561302657838382818110612fdb57612fdb6153bc565b9050602002810190612fed9190615423565b60115f858581518110613002576130026153bc565b602002602001015181526020019081526020015f2091826130249291906155de565b505b600101612f88565b50979650505050505050565b5f805260106020527f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb01610a198284836155de565b816001600160a01b0316836001600160a01b0316036130e15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161084c565b6001600160a01b038381165f81815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613161826001620e90cb60e41b03196138ae565b15610b59576001600160a01b0382165f81815260146020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a25050565b60606131cf826131d6565b5092915050565b6060805f60135f8581526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b82821015613253575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff168183015282526001909201910161320a565b50505050905080515f03613398575f61326b85611f98565b90506001600160a01b038116156133965761328d81634e53ee3d60e11b6138ae565b1561331457604051634e53ee3d60e11b8152306004820152602481018690526001600160a01b03821690639ca7dc7a906044015f60405180830381865afa1580156132da573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261330191908101906158f6565b8151919550935015613314575050915091565b6001600160a01b0381165f90815260126020908152604080832080548251818502810185019093528083529193909284015b8282101561338f575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff1681830152825260019092019101613346565b5050505091505b505b80515f03613438575f808052601260209081527f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7b8054604080518285028101850190915281815293919290919084015b82821015613431575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016133e8565b5050505090505b80511561356c5780516001600160401b0381111561345857613458614c7e565b604051908082528060200260200182016040528015613481578160200160208202803683370190505b50925080516001600160401b0381111561349d5761349d614c7e565b6040519080825280602002602001820160405280156134c6578160200160208202803683370190505b5091505f5b815181101561356a578181815181106134e6576134e66153bc565b60200260200101515f0151848281518110613503576135036153bc565b60200260200101906001600160a01b031690816001600160a01b031681525050818181518110613535576135356153bc565b60200260200101516020015161ffff16838281518110613557576135576153bc565b60209081029190910101526001016134cb565b505b50915091565b60405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a78901479905f90a3610b59600a82612083565b6135bd600a83611a81565b6135fd5760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b604482015260640161084c565b6001600160a01b038116158061361f575061361f816378ea2a9760e11b6138ae565b61365d5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161084c565b6001600160a01b038281165f90815260156020526040902054811690821614610b59576001600160a01b038281165f8181526015602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166136ff5760405162461bcd60e51b815260040161084c906157a8565b335f61370a856141dd565b90505f613716856141dd565b9050613726838989858589613b9e565b5f8681526006602090815260408083206001600160a01b038c168452909152902054858110156137685760405162461bcd60e51b815260040161084c906157ed565b5f8781526006602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906137a6908490615465565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816915f80516020615cc9833981519152910160405180910390a46137f3848a8a8a8a8a614226565b505050505050505050565b5f6001600160e01b031982166314d9799760e21b148061382e57506001600160e01b031982166328f10a2160e01b145b8061383d575061383d826119ba565b8061385857506001600160e01b03198216635d9dd7eb60e11b145b8061387357506001600160e01b03198216632dde656160e21b145b8061388e57506001600160e01b031982166335681b5360e21b145b8061087957506001600160e01b0319821663152a902d60e11b1492915050565b5f6138b8836142e0565b8015611a9e5750611a9e8383614312565b60605f6138d583614398565b60010190505f816001600160401b038111156138f3576138f3614c7e565b6040519080825280601f01601f19166020018201604052801561391d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461392757509392505050565b8281146139775760405162461bcd60e51b815260040161084c906153fc565b5f805b828110156139b057838382818110613994576139946153bc565b90506020020135826139a69190615465565b915060010161397a565b506127108110610a745760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420746f74616c20726f79616c74696573000000000000000000604482015260640161084c565b5f5b8281101561122257816040518060400160405280888885818110613a2a57613a2a6153bc565b9050602002016020810190613a3f9190614a4b565b6001600160a01b03168152602001868685818110613a5f57613a5f6153bc565b61ffff602091820293909301358316909352508354600181810186555f958652948390208451910180549490930151909116600160a01b026001600160b01b03199093166001600160a01b039091161791909117905501613a04565b5f8181526001830160205260408120548015613b95575f613add600183615849565b85549091505f90613af090600190615849565b9050818114613b4f575f865f018281548110613b0e57613b0e6153bc565b905f5260205f200154905080875f018481548110613b2e57613b2e6153bc565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080613b6057613b606159b5565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610879565b5f915050610879565b6001600160a01b03851615801590613be857507f00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e56001600160a01b0316866001600160a01b031614155b8015613bf85750613bf88361446f565b8015613c1c57506001600160a01b0386165f90815260186020526040902054600114155b15613c3a57604051635ec8378b60e11b815260040160405180910390fd5b6112228686868686866144c1565b6001600160a01b0384163b156112225760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613c8c90899089908890889088906004016159c9565b6020604051808303815f875af1925050508015613cc6575060408051601f3d908101601f19168201909252613cc391810190615a1a565b60015b613d7257613cd2615a35565b806308c379a003613d0b5750613ce6615a4e565b80613cf15750613d0d565b8060405162461bcd60e51b815260040161084c9190614ab3565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161084c565b6001600160e01b0319811663bc197c8160e01b14612bc25760405162461bcd60e51b815260040161084c90615ad6565b5f825f018281548110613db757613db76153bc565b905f5260205f200154905092915050565b6001600160a01b038316613dee5760405162461bcd60e51b815260040161084c90615b1e565b335f613df9846141dd565b90505f613e05846141dd565b9050613e2383875f858560405180602001604052805f815250613b9e565b5f8581526006602090815260408083206001600160a01b038a16845290915290205484811015613e655760405162461bcd60e51b815260040161084c90615b61565b5f8681526006602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816915f80516020615cc9833981519152910160405180910390a460408051602081019091525f9052612bc2565b6001600160a01b038316613ef05760405162461bcd60e51b815260040161084c90615b1e565b8051825114613f115760405162461bcd60e51b815260040161084c90615760565b5f339050613f3181855f868660405180602001604052805f815250613b9e565b5f5b8351811015613ff4575f848281518110613f4f57613f4f6153bc565b602002602001015190505f848381518110613f6c57613f6c6153bc565b6020908102919091018101515f8481526006835260408082206001600160a01b038c168352909352919091205490915081811015613fbc5760405162461bcd60e51b815260040161084c90615b61565b5f9283526006602090815260408085206001600160a01b038b1686529091529092209103905580613fec816153e4565b915050613f33565b505f6001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051614044929190615837565b60405180910390a460408051602081019091525f9052610dd2565b335f908152601560205260409020546001600160a01b031615610a1957335f81815260156020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e916140be9190879087908790600401615ba5565b5f604051808303815f87803b1580156140d5575f80fd5b505af1158015612bc2573d5f803e3d5ffd5b6140f3848484846144cd565b5f8381526017602052604081208054849290614110908490615465565b909155505050505050565b61412784848484614596565b5f5b8351811015610a7457828181518110614144576141446153bc565b602002602001015160175f868481518110614161576141616153bc565b602002602001015181526020019081526020015f205f8282546141849190615465565b9091555050600101614129565b5f8181526001830160205260408120546141d657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610879565b505f610879565b6040805160018082528183019092526060915f91906020808301908036833701905050905082815f81518110614215576142156153bc565b602090810291909101015292915050565b6001600160a01b0384163b156112225760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061426a9089908990889088908890600401615bee565b6020604051808303815f875af19250505080156142a4575060408051601f3d908101601f191682019092526142a191810190615a1a565b60015b6142b057613cd2615a35565b6001600160e01b0319811663f23a6e6160e01b14612bc25760405162461bcd60e51b815260040161084c90615ad6565b5f6142f2826301ffc9a760e01b614312565b8015610879575061430b826001600160e01b0319614312565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b17815282515f9392849283928392918391908a617530fa92503d91505f519050828015614382575060208210155b801561438d57505f81115b979650505050505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106143d65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614402576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061442057662386f26fc10000830492506010015b6305f5e1008310614438576305f5e100830492506008015b612710831061444c57612710830492506004015b6064831061445e576064830492506002015b600a83106108795760010192915050565b80515f90815b818110156144b8576001848281518110614491576144916153bc565b6020026020010151036144a8575060019392505050565b6144b1816153e4565b9050614475565b505f9392505050565b611222858585856146e8565b6001600160a01b0384166144f35760405162461bcd60e51b815260040161084c90615c27565b335f6144fe856141dd565b90505f61450a856141dd565b905061451a835f89858589613b9e565b5f8681526006602090815260408083206001600160a01b038b1684529091528120805487929061454b908490615465565b909155505060408051878152602081018790526001600160a01b03808a16925f92918716915f80516020615cc9833981519152910160405180910390a4612bc2835f89898989614226565b6001600160a01b0384166145bc5760405162461bcd60e51b815260040161084c90615c27565b81518351146145dd5760405162461bcd60e51b815260040161084c90615760565b336145ec815f87878787613b9e565b5f5b845181101561468257838181518110614609576146096153bc565b602002602001015160065f878481518110614626576146266153bc565b602002602001015181526020019081526020015f205f886001600160a01b03166001600160a01b031681526020019081526020015f205f82825461466a9190615465565b9091555081905061467a816153e4565b9150506145ee565b50846001600160a01b03165f6001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516146d2929190615837565b60405180910390a4610a74815f87878787613c48565b6001600160a01b03841615610dd2575f60165f845f8151811061470d5761470d6153bc565b602002602001015181526020019081526020015f205f9054906101000a90046001600160a01b031690505f5b83518110156147d957816001600160a01b031660165f868481518110614761576147616153bc565b60209081029190910181015182528101919091526040015f20546001600160a01b0316146147d15760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f727300000000604482015260640161084c565b600101614739565b506001600160a01b0381161580159061480957506001600160a01b0381165f9081526014602052604090205460ff165b156148d35760405163e483517760e01b81526001600160a01b0382169063e4835177906148429033908990899089908990600401615c68565b6020604051808303815f875af115801561485e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148829190615cad565b6148ce5760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c757265000000000000604482015260640161084c565b610a74565b6009546001600160a01b031615610a745760095460405163e483517760e01b81526001600160a01b039091169063e48351779061491c9033908990899089908990600401615c68565b6020604051808303815f875af1158015614938573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061495c9190615cad565b610a745760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c757265000000000000604482015260640161084c565b5080545f8255905f5260205f209081019061091c91905b80821115610d785780546001600160b01b03191681556001016149bf565b6001600160a01b038116811461091c575f80fd5b5f8060408385031215614a02575f80fd5b8235614a0d816149dd565b946020939093013593505050565b6001600160e01b03198116811461091c575f80fd5b5f60208284031215614a40575f80fd5b8135611a9e81614a1b565b5f60208284031215614a5b575f80fd5b8135611a9e816149dd565b5f5b83811015614a80578181015183820152602001614a68565b50505f910152565b5f8151808452614a9f816020860160208601614a66565b601f01601f19169290920160200192915050565b602081525f611a9e6020830184614a88565b5f60208284031215614ad5575f80fd5b5035919050565b5f8151808452602080850194508084015f5b83811015614b0a57815187529582019590820190600101614aee565b509495945050505050565b602081525f611a9e6020830184614adc565b5f8083601f840112614b37575f80fd5b5081356001600160401b03811115614b4d575f80fd5b602083019150836020828501011115610afa575f80fd5b5f805f60408486031215614b76575f80fd5b8335925060208401356001600160401b03811115614b92575f80fd5b614b9e86828701614b27565b9497909650939450505050565b5f8083601f840112614bbb575f80fd5b5081356001600160401b03811115614bd1575f80fd5b6020830191508360208260051b8501011115610afa575f80fd5b5f805f805f60608688031215614bff575f80fd5b8535945060208601356001600160401b0380821115614c1c575f80fd5b614c2889838a01614bab565b90965094506040880135915080821115614c40575f80fd5b50614c4d88828901614bab565b969995985093965092949392505050565b5f8060408385031215614c6f575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b0381118282101715614cb757614cb7614c7e565b6040525050565b5f6001600160401b03821115614cd657614cd6614c7e565b5060051b60200190565b5f82601f830112614cef575f80fd5b81356020614cfc82614cbe565b604051614d098282614c92565b83815260059390931b8501820192828101915086841115614d28575f80fd5b8286015b84811015614d435780358352918301918301614d2c565b509695505050505050565b5f6001600160401b03821115614d6657614d66614c7e565b50601f01601f191660200190565b5f82601f830112614d83575f80fd5b8135614d8e81614d4e565b604051614d9b8282614c92565b828152856020848701011115614daf575f80fd5b826020860160208301375f92810160200192909252509392505050565b5f805f805f60a08688031215614de0575f80fd5b8535614deb816149dd565b94506020860135614dfb816149dd565b935060408601356001600160401b0380821115614e16575f80fd5b614e2289838a01614ce0565b94506060880135915080821115614e37575f80fd5b614e4389838a01614ce0565b93506080880135915080821115614e58575f80fd5b50614e6588828901614d74565b9150509295509295909350565b5f8060208385031215614e83575f80fd5b82356001600160401b03811115614e98575f80fd5b614ea485828601614b27565b90969095509350505050565b5f805f60408486031215614ec2575f80fd5b8335614ecd816149dd565b925060208401356001600160401b03811115614b92575f80fd5b5f8151808452602080850194508084015f5b83811015614b0a5781516001600160a01b031687529582019590820190600101614ef9565b602081525f611a9e6020830184614ee7565b5f805f8060408587031215614f43575f80fd5b84356001600160401b0380821115614f59575f80fd5b614f6588838901614bab565b90965094506020870135915080821115614f7d575f80fd5b50614f8a87828801614bab565b95989497509550505050565b5f805f805f60608688031215614faa575f80fd5b8535614fb5816149dd565b945060208601356001600160401b0380821115614c1c575f80fd5b801515811461091c575f80fd5b5f805f8060608587031215614ff0575f80fd5b8435614ffb816149dd565b935060208501356001600160401b03811115615015575f80fd5b61502187828801614b27565b909450925050604085013561503581614fd0565b939692955090935050565b5f8060408385031215615051575f80fd5b82356001600160401b0380821115615067575f80fd5b818501915085601f83011261507a575f80fd5b8135602061508782614cbe565b6040516150948282614c92565b83815260059390931b85018201928281019150898411156150b3575f80fd5b948201945b838610156150da5785356150cb816149dd565b825294820194908201906150b8565b965050860135925050808211156150ef575f80fd5b506150fc85828601614ce0565b9150509250929050565b5f805f805f806060878903121561511b575f80fd5b86356001600160401b0380821115615131575f80fd5b61513d8a838b01614bab565b90985096506020890135915080821115615155575f80fd5b6151618a838b01614bab565b90965094506040890135915080821115615179575f80fd5b5061518689828a01614bab565b979a9699509497509295939492505050565b5f805f604084860312156151aa575f80fd5b83356001600160401b038111156151bf575f80fd5b6151cb86828701614b27565b90945092505060208401356151df81614fd0565b809150509250925092565b5f80604083850312156151fb575f80fd5b8235615206816149dd565b9150602083013561521681614fd0565b809150509250929050565b5f60208284031215615231575f80fd5b8135611a9e81614fd0565b604081525f61524e6040830185614ee7565b82810360208401526152608185614adc565b95945050505050565b5f806040838503121561527a575f80fd5b8235615285816149dd565b91506020830135615216816149dd565b5f805f805f60a086880312156152a9575f80fd5b85356152b4816149dd565b945060208601356152c4816149dd565b9350604086013592506060860135915060808601356001600160401b038111156152ec575f80fd5b614e6588828901614d74565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b600181811c9082168061535057607f821691505b602082108103611e8257634e487b7160e01b5f52602260045260245ffd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f600182016153f5576153f56153d0565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b5f808335601e19843603018112615438575f80fd5b8301803591506001600160401b03821115615451575f80fd5b602001915036819003821315610afa575f80fd5b80820180821115610879576108796153d0565b5f81546154848161533c565b6001828116801561549c57600181146154b1576154dd565b60ff19841687528215158302870194506154dd565b855f526020805f205f5b858110156154d45781548a8201529084019082016154bb565b50505082870194505b5050505092915050565b5f6154fb6154f58386615478565b84615478565b949350505050565b5f60208284031215615513575f80fd5b81516001600160401b03811115615528575f80fd5b8201601f81018413615538575f80fd5b805161554381614d4e565b6040516155508282614c92565b828152866020848601011115615564575f80fd5b61151a836020830160208701614a66565b5f6155808285615478565b8351615590818360208801614a66565b01949350505050565b601f821115610a19575f81815260208120601f850160051c810160208610156155bf5750805b601f850160051c820191505b81811015611222578281556001016155cb565b6001600160401b038311156155f5576155f5614c7e565b61560983615603835461533c565b83615599565b5f601f84116001811461563a575f85156156235750838201355b5f19600387901b1c1916600186901b178355610a74565b5f83815260209020601f19861690835b8281101561566a578685013582556020948501946001909201910161564a565b5086821015615686575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8183525f6001600160fb1b038311156156af575f80fd5b8260051b80836020870137939093016020019392505050565b604080825281018490525f8560608301825b8781101561570a5782356156ed816149dd565b6001600160a01b03168252602092830192909101906001016156da565b50838103602085015261571e818688615698565b98975050505050505050565b8082028115828204841417610879576108796153d0565b5f8261575b57634e487b7160e01b5f52601260045260245ffd5b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081525f61524e6040830185614adc565b81810381811115610879576108796153d0565b6001600160a01b03861681526060602082018190525f906158809083018688615698565b828103604084015261571e818587615698565b5f82601f8301126158a2575f80fd5b815160206158af82614cbe565b6040516158bc8282614c92565b83815260059390931b85018201928281019150868411156158db575f80fd5b8286015b84811015614d4357805183529183019183016158df565b5f8060408385031215615907575f80fd5b82516001600160401b038082111561591d575f80fd5b818501915085601f830112615930575f80fd5b8151602061593d82614cbe565b60405161594a8282614c92565b83815260059390931b8501820192828101915089841115615969575f80fd5b948201945b83861015615990578551615981816149dd565b8252948201949082019061596e565b918801519196509093505050808211156159a8575f80fd5b506150fc85828601615893565b634e487b7160e01b5f52603160045260245ffd5b6001600160a01b0386811682528516602082015260a0604082018190525f906159f490830186614adc565b8281036060840152615a068186614adc565b9050828103608084015261571e8185614a88565b5f60208284031215615a2a575f80fd5b8151611a9e81614a1b565b5f60033d1115615a4b5760045f803e505f5160e01c5b90565b5f60443d1015615a5b5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615a8a57505050505090565b8285019150815181811115615aa25750505050505090565b843d8701016020828501011115615abc5750505050505090565b615acb60208286010187614c92565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b03851681526080602082018190525f90615bc890830186614ee7565b8281036040840152615bda8186614adc565b9050828103606084015261438d8185614adc565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f9061438d90830184614a88565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6001600160a01b03868116825285811660208301528416604082015260a0606082018190525f90615c9b90830185614adc565b828103608084015261571e8185614adc565b5f60208284031215615cbd575f80fd5b8151611a9e81614fd056fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62a2646970667358221220eca097f61556a7884a70aea05875309a3793d76279caefb97c6e833076a1030e64736f6c63430008150033

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

000000000000000000000000fcb4c6770d1da3f2ae8bf5dfc97dabf22cd5577e00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e5

-----Decoded View---------------
Arg [0] : owner (address): 0xfCB4c6770d1DA3F2Ae8BF5dfc97DAbf22CD5577E
Arg [1] : _marketplace (address): 0x13AeF6aAEa7001168a9Cd76d3e7331110a4c63e5

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000fcb4c6770d1da3f2ae8bf5dfc97dabf22cd5577e
Arg [1] : 00000000000000000000000013aef6aaea7001168a9cd76d3e7331110a4c63e5


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.