ETH Price: $2,995.42 (-1.97%)
Gas: 2 Gwei

Contract

0x3A6c1bbbF2A329768BCB293f905080a6d449db55
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Approval For...201997322024-06-29 20:28:597 days ago1719692939IN
0x3A6c1bbb...6d449db55
0 ETH0.000077342.05686017
Craft199021142024-05-19 6:11:4749 days ago1716099107IN
0x3A6c1bbb...6d449db55
0 ETH0.000353663.2623656
Craft199021102024-05-19 6:10:5949 days ago1716099059IN
0x3A6c1bbb...6d449db55
0 ETH0.000464193.11952731
Craft199021072024-05-19 6:10:2349 days ago1716099023IN
0x3A6c1bbb...6d449db55
0 ETH0.000381953.07978677
Craft199020982024-05-19 6:08:3549 days ago1716098915IN
0x3A6c1bbb...6d449db55
0 ETH0.000378943.0555012
Craft199020902024-05-19 6:06:5949 days ago1716098819IN
0x3A6c1bbb...6d449db55
0 ETH0.000369733.41100303
Craft199020862024-05-19 6:06:1149 days ago1716098771IN
0x3A6c1bbb...6d449db55
0 ETH0.000500813.36562325
Craft199020822024-05-19 6:05:2349 days ago1716098723IN
0x3A6c1bbb...6d449db55
0 ETH0.00035083.23601005
Craft199020792024-05-19 6:04:4749 days ago1716098687IN
0x3A6c1bbb...6d449db55
0 ETH0.000354513.2705917
Craft199020672024-05-19 6:02:2349 days ago1716098543IN
0x3A6c1bbb...6d449db55
0 ETH0.00052393.13099959
Craft199020642024-05-19 6:01:4749 days ago1716098507IN
0x3A6c1bbb...6d449db55
0 ETH0.000565743.19976353
Craft198149912024-05-07 1:43:2361 days ago1715046203IN
0x3A6c1bbb...6d449db55
0 ETH0.000596994.23040722
Craft193317882024-02-29 7:49:47129 days ago1709192987IN
0x3A6c1bbb...6d449db55
0 ETH0.0061762751.0031112
Set Approval For...193305692024-02-29 3:42:59129 days ago1709178179IN
0x3A6c1bbb...6d449db55
0 ETH0.0027411846.05877464
Craft193305602024-02-29 3:41:11129 days ago1709178071IN
0x3A6c1bbb...6d449db55
0 ETH0.0072750344.83154476
Craft193272742024-02-28 16:39:59130 days ago1709138399IN
0x3A6c1bbb...6d449db55
0 ETH0.0081804378.67010018
Set Approval For...193270492024-02-28 15:54:35130 days ago1709135675IN
0x3A6c1bbb...6d449db55
0 ETH0.0039626566.67659835
Safe Transfer Fr...193241782024-02-28 6:14:47130 days ago1709100887IN
0x3A6c1bbb...6d449db55
0 ETH0.0018784535.93476244
Craft193240642024-02-28 5:51:59130 days ago1709099519IN
0x3A6c1bbb...6d449db55
0 ETH0.0046130234.00935076
Craft193239072024-02-28 5:19:59130 days ago1709097599IN
0x3A6c1bbb...6d449db55
0 ETH0.006545135.42930364
Craft193238972024-02-28 5:17:47130 days ago1709097467IN
0x3A6c1bbb...6d449db55
0 ETH0.0091709939.51806159
Craft193238932024-02-28 5:16:59130 days ago1709097419IN
0x3A6c1bbb...6d449db55
0 ETH0.0089878335.25800836
Craft193238812024-02-28 5:14:23130 days ago1709097263IN
0x3A6c1bbb...6d449db55
0 ETH0.0085047938.13996741
Set Approval For...192995282024-02-24 19:28:11133 days ago1708802891IN
0x3A6c1bbb...6d449db55
0 ETH0.001914532.16848013
Craft192886552024-02-23 6:58:35135 days ago1708671515IN
0x3A6c1bbb...6d449db55
0 ETH0.0084847437.51523989
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
YelloCollectibles

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 23 : YelloCollectibles.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol';
import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/token/common/ERC2981.sol';
import 'operator-filter-registry/src/DefaultOperatorFilterer.sol';

contract YelloCollectibles is
    Ownable,
    ERC1155,
    ERC1155Burnable,
    ERC1155Supply,
    ReentrancyGuard,
    DefaultOperatorFilterer,
    ERC2981
{
    string public name;
    string public symbol;

    /**
     * @dev Related to models
     */
    uint256 public modelCounter;
    mapping(uint256 => Model) public models;
    struct Model {
        uint256 partType;
        uint256 requirePartAmount;
        uint256 mintPrice;
        bool craftable;
    }

    /**
     * @dev Parts Contract
     */
    YelloPartsContract public yelloParts;

    /**
     * @dev Craft open or close
     */
    bool public craftOpen;

    /**
     * @dev Mint open or close
     */
    bool public mintOpen;

    constructor(address yelloPartsAddr) ERC1155('') {
        name = "YELLO Collectibles";
        symbol = "YELLO";
        yelloParts = YelloPartsContract(yelloPartsAddr);

        // Set royalty receiver to the contract creator,
        // at 5% (default denominator is 10000).
        _setDefaultRoyalty(msg.sender, 500);
    }

    /**
     * @dev validates caller is not from contract
     */
    modifier callerIsUser() {
        require(tx.origin == msg.sender, 'Caller is contract');
        _;
    }

    /**
     * @dev add models to collection
     */
    function addModel(
        uint256 _partType,
        uint256 _requirePartAmount,
        uint256 _mintPrice,
        bool _craftable
    ) external onlyOwner {
        Model storage ast = models[modelCounter];
        ast.partType = _partType;
        ast.requirePartAmount = _requirePartAmount;
        ast.mintPrice = _mintPrice;
        ast.craftable = _craftable;
        modelCounter++;
    }

    function editModelPartType(uint256 _id, uint256 _partType) external onlyOwner {
        models[_id].partType = _partType;
    }

    function editModelRequirePartAmount(uint256 _id, uint256 _requirePartAmount) external onlyOwner {
        models[_id].requirePartAmount = _requirePartAmount;
    }

    function editModelMintPrice(uint256 _id, uint256 _mintPrice) external onlyOwner {
        models[_id].mintPrice = _mintPrice;
    }

    function editModelCraftable(uint256 _id, bool _craftable) external onlyOwner {
        models[_id].craftable = _craftable;
    }

    /**
     * @dev set parts contract address
     */
    function setYelloPartsAddress(address yelloPartsAddr) external onlyOwner {
        yelloParts = YelloPartsContract(yelloPartsAddr);
    }

    /**
     * @dev set craft open or close
     */
    function setCraftOpen(bool _craftOpen) external onlyOwner {
        craftOpen = _craftOpen;
    }

    /**
     * @dev set mint open or close
     */
    function setMintOpen(bool _mintOpen) external onlyOwner {
        mintOpen = _mintOpen;
    }

    /**
     * @dev Team dev mint
     */
    function devMint(uint256[] calldata ids, uint256[] calldata amounts) external onlyOwner {
        for (uint256 i = 0; i < ids.length; ) {
            require(ids[i] < modelCounter, 'Model not added');

            unchecked {
                ++i;
            }
        }

        _mintBatch(msg.sender, ids, amounts, '');
    }

    /**
     * @dev Public Mint
     */
    function mint(uint256 modelId, uint256 amount) external payable callerIsUser nonReentrant {
        require(mintOpen, 'Mint not open');
        require(models[modelId].mintPrice > 0, 'Mint price 0');
        require(msg.value >= models[modelId].mintPrice * amount, 'Need more ETH');
        require(modelId < modelCounter, 'No such model');

        _mint(msg.sender, modelId, amount, '');
    }

    /**
     * @dev burns parts and craft model
     */
    function craft(uint256[] calldata partIds, uint256 modelId) external callerIsUser nonReentrant {
        require(isValidCraft(partIds, modelId));
        yelloParts.burnBatch(partIds);
        _mint(msg.sender, modelId, 1, '');
    }

    function isValidCraft(uint256[] calldata partIds, uint256 modelId) private view returns (bool) {
        require(craftOpen, 'Craft not open');
        require(modelId < modelCounter, 'No such model');

        Model memory md = models[modelId];
        require(md.craftable, 'Model is not craftable');
        require(partIds.length == md.requirePartAmount, 'Wrong part amount to craft');

        for (uint256 i = 0; i < partIds.length; ) {
            require(yelloParts.getTokenType(partIds[i]) == md.partType, 'Wrong part to craft');
            require(yelloParts.ownerOf(partIds[i]) == msg.sender, 'Do not own token');

            unchecked {
                ++i;
            }
        }

        return true;
    }

    function setBaseURI(string memory newuri) external onlyOwner {
        _setURI(newuri);
    }

    function uri(uint256 _id) public view override returns (string memory) {
        require(_id < modelCounter && totalSupply(_id) > 0, 'URI: nonexistent token');

        return string.concat(super.uri(_id), Strings.toString(_id));
    }

    /**
     * @dev withdraw money to owner
     */
    function withdrawMoney() external onlyOwner nonReentrant {
        (bool success, ) = msg.sender.call{value: address(this).balance}('');
        require(success, 'Transfer failed');
    }

    // The following functions are overrides required by Solidity.

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal override(ERC1155, ERC1155Supply) {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev For Opensea OperatorFilterer
     */
    function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
        super.setApprovalForAll(operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, id, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override onlyAllowedOperator(from) {
        super.safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev For ERC2981
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC2981) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner {
        _setDefaultRoyalty(receiver, feeNumerator);
    }
}

interface YelloPartsContract {
    function burnBatch(uint256[] calldata tokenIds) external;

    function ownerOf(uint256 tokenId) external view returns (address);

    function getTokenType(uint256 tokenId) external view returns (uint256);
}

File 2 of 23 : 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 3 of 23 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

File 4 of 23 : 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 5 of 23 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

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

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../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._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

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

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

    /**
     * @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 {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

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

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), 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 == _msgSender() || isApprovedForAll(from, _msgSender()),
            "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 == _msgSender() || isApprovedForAll(from, _msgSender()),
            "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 = _msgSender();
        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 = _msgSender();

        _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 Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

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

        _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 = _msgSender();
        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 = _msgSender();

        _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;
    }
}

File 7 of 23 : ERC1155Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC1155.sol";

/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155Burnable is ERC1155 {
    function burn(address account, uint256 id, uint256 value) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );

        _burnBatch(account, ids, values);
    }
}

File 8 of 23 : ERC1155Supply.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol)

pragma solidity ^0.8.0;

import "../ERC1155.sol";

/**
 * @dev Extension of ERC1155 that adds tracking of total supply per id.
 *
 * Useful for scenarios where Fungible and Non-fungible tokens have to be
 * clearly identified. Note: While a totalSupply of 1 might mean the
 * corresponding is an NFT, there is no guarantees that no other token with the
 * same id are not going to be minted.
 */
abstract contract ERC1155Supply is ERC1155 {
    mapping(uint256 => uint256) private _totalSupply;

    /**
     * @dev Total amount of tokens in with a given id.
     */
    function totalSupply(uint256 id) public view virtual returns (uint256) {
        return _totalSupply[id];
    }

    /**
     * @dev Indicates whether any token exist with a given id, or not.
     */
    function exists(uint256 id) public view virtual returns (bool) {
        return ERC1155Supply.totalSupply(id) > 0;
    }

    /**
     * @dev See {ERC1155-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                uint256 id = ids[i];
                uint256 amount = amounts[i];
                uint256 supply = _totalSupply[id];
                require(supply >= amount, "ERC1155: burn amount exceeds totalSupply");
                unchecked {
                    _totalSupply[id] = supply - amount;
                }
            }
        }
    }
}

File 9 of 23 : 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 10 of 23 : 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 11 of 23 : 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 12 of 23 : 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 13 of 23 : 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 14 of 23 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 15 of 23 : 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 16 of 23 : 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 17 of 23 : 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 18 of 23 : 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 19 of 23 : 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 20 of 23 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"yelloPartsAddr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"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":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_partType","type":"uint256"},{"internalType":"uint256","name":"_requirePartAmount","type":"uint256"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"},{"internalType":"bool","name":"_craftable","type":"bool"}],"name":"addModel","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":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"partIds","type":"uint256[]"},{"internalType":"uint256","name":"modelId","type":"uint256"}],"name":"craft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"craftOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_craftable","type":"bool"}],"name":"editModelCraftable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"editModelMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_partType","type":"uint256"}],"name":"editModelPartType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_requirePartAmount","type":"uint256"}],"name":"editModelRequirePartAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","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":"uint256","name":"modelId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"modelCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"models","outputs":[{"internalType":"uint256","name":"partType","type":"uint256"},{"internalType":"uint256","name":"requirePartAmount","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"bool","name":"craftable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"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":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_craftOpen","type":"bool"}],"name":"setCraftOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintOpen","type":"bool"}],"name":"setMintOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"yelloPartsAddr","type":"address"}],"name":"setYelloPartsAddress","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":"id","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":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawMoney","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yelloParts","outputs":[{"internalType":"contract YelloPartsContract","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162003c1338038062003c138339810160408190526200003491620003cd565b733cc6cdda760b79bafa08df41ecfa224f810dceb6600160405180602001604052806000815250620000756200006f6200026260201b60201c565b62000266565b6200008081620002b6565b5060016005556daaeb6d7670e522a718067333cd4e3b15620001cb5780156200011957604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015620000fa57600080fd5b505af11580156200010f573d6000803e3d6000fd5b50505050620001cb565b6001600160a01b038216156200016a5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401620000df565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001b157600080fd5b505af1158015620001c6573d6000803e3d6000fd5b505050505b505060408051808201909152601281527159454c4c4f20436f6c6c65637469626c657360701b6020820152600890620002059082620004a4565b5060408051808201909152600581526459454c4c4f60d81b6020820152600990620002319082620004a4565b50600c80546001600160a01b0319166001600160a01b0383161790556200025b336101f4620002c8565b5062000570565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6003620002c48282620004a4565b5050565b6127106001600160601b03821611156200033c5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003945760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000333565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b600060208284031215620003e057600080fd5b81516001600160a01b0381168114620003f857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200042a57607f821691505b6020821081036200044b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200049f57600081815260208120601f850160051c810160208610156200047a5750805b601f850160051c820191505b818110156200049b5782815560010162000486565b5050505b505050565b81516001600160401b03811115620004c057620004c0620003ff565b620004d881620004d1845462000415565b8462000451565b602080601f831160018114620005105760008415620004f75750858301515b600019600386901b1c1916600185901b1785556200049b565b600085815260208120601f198616915b82811015620005415788860151825594840194600190910190840162000520565b5085821015620005605787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61369380620005806000396000f3fe6080604052600436106102245760003560e01c8063715018a611610123578063aec26b5f116100ab578063e985e9c51161006f578063e985e9c5146106e1578063f242432a1461072a578063f2fde38b1461074a578063f5298aca1461076a578063f8004d311461078a57600080fd5b8063aec26b5f1461063e578063bd85b0391461065e578063cc408b8a1461068b578063da75caa4146106a1578063e80b248d146106c157600080fd5b806395d89b41116100f257806395d89b41146105b4578063a22cb465146105c9578063a68b60e1146105e9578063ac08cf3014610609578063ac4460021461062957600080fd5b8063715018a6146105415780637ddd6c14146105565780638da5cb5b14610576578063913e22401461059457600080fd5b80632eb2c2d6116101b15780634f558e79116101755780634f558e791461044b57806355f804b31461047a5780636a030ca91461049a5780636b20c454146105015780637032637e1461052157600080fd5b80632eb2c2d614610383578063388c6000146103a35780633e668f62146103c357806341f43434146103e45780634e1273f41461041e57600080fd5b80630e89341c116101f85780630e89341c146102d05780631b2ef1ca146102f05780631e34c8361461030357806324bbd049146103235780632a55205a1461034457600080fd5b8062fdd58e1461022957806301ffc9a71461025c57806304634d8d1461028c57806306fdde03146102ae575b600080fd5b34801561023557600080fd5b50610249610244366004612841565b6107aa565b6040519081526020015b60405180910390f35b34801561026857600080fd5b5061027c610277366004612883565b610845565b6040519015158152602001610253565b34801561029857600080fd5b506102ac6102a73660046128a7565b610850565b005b3480156102ba57600080fd5b506102c3610866565b604051610253919061293c565b3480156102dc57600080fd5b506102c36102eb36600461294f565b6108f4565b6102ac6102fe366004612968565b610991565b34801561030f57600080fd5b506102ac61031e3660046129ce565b610b35565b34801561032f57600080fd5b50600c5461027c90600160a81b900460ff1681565b34801561035057600080fd5b5061036461035f366004612968565b610c24565b604080516001600160a01b039093168352602083019190915201610253565b34801561038f57600080fd5b506102ac61039e366004612b6c565b610cd2565b3480156103af57600080fd5b506102ac6103be366004612c27565b610d01565b3480156103cf57600080fd5b50600c5461027c90600160a01b900460ff1681565b3480156103f057600080fd5b506104066daaeb6d7670e522a718067333cd4e81565b6040516001600160a01b039091168152602001610253565b34801561042a57600080fd5b5061043e610439366004612c68565b610d57565b6040516102539190612d6f565b34801561045757600080fd5b5061027c61046636600461294f565b600090815260046020526040902054151590565b34801561048657600080fd5b506102ac610495366004612d82565b610e80565b3480156104a657600080fd5b506104df6104b536600461294f565b600b6020526000908152604090208054600182015460028301546003909301549192909160ff1684565b6040805194855260208501939093529183015215156060820152608001610253565b34801561050d57600080fd5b506102ac61051c366004612dd2565b610e94565b34801561052d57600080fd5b506102ac61053c366004612e47565b610ed7565b34801561054d57600080fd5b506102ac610efd565b34801561056257600080fd5b506102ac610571366004612e64565b610f11565b34801561058257600080fd5b506000546001600160a01b0316610406565b3480156105a057600080fd5b506102ac6105af366004612e89565b610f3c565b3480156105c057600080fd5b506102c3610f66565b3480156105d557600080fd5b506102ac6105e4366004612ea6565b610f73565b3480156105f557600080fd5b50600c54610406906001600160a01b031681565b34801561061557600080fd5b506102ac610624366004612ed4565b610f87565b34801561063557600080fd5b506102ac611080565b34801561064a57600080fd5b506102ac610659366004612968565b611125565b34801561066a57600080fd5b5061024961067936600461294f565b60009081526004602052604090205490565b34801561069757600080fd5b50610249600a5481565b3480156106ad57600080fd5b506102ac6106bc366004612968565b611142565b3480156106cd57600080fd5b506102ac6106dc366004612968565b61115c565b3480156106ed57600080fd5b5061027c6106fc366004612f3f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b34801561073657600080fd5b506102ac610745366004612f6d565b611179565b34801561075657600080fd5b506102ac610765366004612e89565b6111a0565b34801561077657600080fd5b506102ac610785366004612fd5565b611216565b34801561079657600080fd5b506102ac6107a5366004612e47565b611259565b60006001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526001602090815260408083206001600160a01b03861684529091529020545b92915050565b600061083f8261127f565b6108586112a4565b61086282826112fe565b5050565b600880546108739061300a565b80601f016020809104026020016040519081016040528092919081815260200182805461089f9061300a565b80156108ec5780601f106108c1576101008083540402835291602001916108ec565b820191906000526020600020905b8154815290600101906020018083116108cf57829003601f168201915b505050505081565b6060600a54821080156109135750600082815260046020526040812054115b6109585760405162461bcd60e51b81526020600482015260166024820152752aa9249d103737b732bc34b9ba32b73a103a37b5b2b760511b6044820152606401610811565b610961826113fb565b61096a8361148f565b60405160200161097b929190613044565b6040516020818303038152906040529050919050565b3233146109d55760405162461bcd60e51b815260206004820152601260248201527110d85b1b195c881a5cc818dbdb9d1c9858dd60721b6044820152606401610811565b6109dd611521565b600c54600160a81b900460ff16610a265760405162461bcd60e51b815260206004820152600d60248201526c26b4b73a103737ba1037b832b760991b6044820152606401610811565b6000828152600b6020526040902060020154610a735760405162461bcd60e51b815260206004820152600c60248201526b04d696e7420707269636520360a41b6044820152606401610811565b6000828152600b6020526040902060020154610a90908290613089565b341015610acf5760405162461bcd60e51b815260206004820152600d60248201526c09ccacac840dadee4ca408aa89609b1b6044820152606401610811565b600a548210610b105760405162461bcd60e51b815260206004820152600d60248201526c139bc81cdd58da081b5bd9195b609a1b6044820152606401610811565b610b2b3383836040518060200160405280600081525061157a565b6108626001600555565b323314610b795760405162461bcd60e51b815260206004820152601260248201527110d85b1b195c881a5cc818dbdb9d1c9858dd60721b6044820152606401610811565b610b81611521565b610b8c838383611665565b610b9557600080fd5b600c5460405163e4623c1b60e01b81526001600160a01b039091169063e4623c1b90610bc790869086906004016130a0565b600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b50505050610c15338260016040518060200160405280600081525061157a565b610c1f6001600555565b505050565b60008281526007602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610c995750604080518082019091526006546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610cb8906001600160601b031687613089565b610cc291906130d9565b91519350909150505b9250929050565b846001600160a01b0381163314610cec57610cec33611994565b610cf98686868686611a4d565b505050505050565b610d096112a4565b600a80546000908152600b60205260408120868155600181018690556002810185905560038101805460ff1916851515179055825490929091610d4b836130fb565b91905055505050505050565b60608151835114610dbc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610811565b600083516001600160401b03811115610dd757610dd7612a19565b604051908082528060200260200182016040528015610e00578160200160208202803683370190505b50905060005b8451811015610e7857610e4b858281518110610e2457610e24613114565b6020026020010151858381518110610e3e57610e3e613114565b60200260200101516107aa565b828281518110610e5d57610e5d613114565b6020908102919091010152610e71816130fb565b9050610e06565b509392505050565b610e886112a4565b610e9181611a99565b50565b6001600160a01b038316331480610eb05750610eb083336106fc565b610ecc5760405162461bcd60e51b81526004016108119061312a565b610c1f838383611aa5565b610edf6112a4565b600c8054911515600160a01b0260ff60a01b19909216919091179055565b610f056112a4565b610f0f6000611c44565b565b610f196112a4565b6000918252600b6020526040909120600301805460ff1916911515919091179055565b610f446112a4565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600980546108739061300a565b81610f7d81611994565b610c1f8383611c94565b610f8f6112a4565b60005b83811015610ffd57600a54858583818110610faf57610faf613114565b9050602002013510610ff55760405162461bcd60e51b815260206004820152600f60248201526e135bd9195b081b9bdd081859191959608a1b6044820152606401610811565b600101610f92565b5061107a3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092018290525060408051602081019091529081529250611c9f915050565b50505050565b6110886112a4565b611090611521565b604051600090339047908381818185875af1925050503d80600081146110d2576040519150601f19603f3d011682016040523d82523d6000602084013e6110d7565b606091505b505090508061111a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610811565b50610f0f6001600555565b61112d6112a4565b6000918252600b602052604090912060020155565b61114a6112a4565b6000918252600b602052604090912055565b6111646112a4565b6000918252600b602052604090912060010155565b846001600160a01b03811633146111935761119333611994565b610cf98686868686611dfa565b6111a86112a4565b6001600160a01b03811661120d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610811565b610e9181611c44565b6001600160a01b038316331480611232575061123283336106fc565b61124e5760405162461bcd60e51b81526004016108119061312a565b610c1f838383611e3f565b6112616112a4565b600c8054911515600160a81b0260ff60a81b19909216919091179055565b60006001600160e01b0319821663152a902d60e11b148061083f575061083f82611f5b565b6000546001600160a01b03163314610f0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610811565b6127106001600160601b038216111561136c5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610811565b6001600160a01b0382166113c25760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610811565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b60606003805461140a9061300a565b80601f01602080910402602001604051908101604052809291908181526020018280546114369061300a565b80156114835780601f1061145857610100808354040283529160200191611483565b820191906000526020600020905b81548152906001019060200180831161146657829003601f168201915b50505050509050919050565b6060600061149c83611fab565b60010190506000816001600160401b038111156114bb576114bb612a19565b6040519080825280601f01601f1916602001820160405280156114e5576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846114ef57509392505050565b6002600554036115735760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610811565b6002600555565b6001600160a01b0384166115a05760405162461bcd60e51b815260040161081190613178565b3360006115ac85612083565b905060006115b985612083565b90506115ca836000898585896120ce565b60008681526001602090815260408083206001600160a01b038b168452909152812080548792906115fc9084906131b9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461165c836000898989896120dc565b50505050505050565b600c54600090600160a01b900460ff166116b25760405162461bcd60e51b815260206004820152600e60248201526d21b930b33a103737ba1037b832b760911b6044820152606401610811565b600a5482106116f35760405162461bcd60e51b815260206004820152600d60248201526c139bc81cdd58da081b5bd9195b609a1b6044820152606401610811565b6000828152600b602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260039091015460ff161515606082018190526117805760405162461bcd60e51b81526020600482015260166024820152754d6f64656c206973206e6f7420637261667461626c6560501b6044820152606401610811565b602081015184146117d35760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67207061727420616d6f756e7420746f2063726166740000000000006044820152606401610811565b60005b84811015611988578151600c546001600160a01b03166376aed2e188888581811061180357611803613114565b905060200201356040518263ffffffff1660e01b815260040161182891815260200190565b602060405180830381865afa158015611845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186991906131cc565b146118ac5760405162461bcd60e51b815260206004820152601360248201527215dc9bdb99c81c185c9d081d1bc818dc98599d606a1b6044820152606401610811565b600c5433906001600160a01b0316636352211e8888858181106118d1576118d1613114565b905060200201356040518263ffffffff1660e01b81526004016118f691815260200190565b602060405180830381865afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193791906131e5565b6001600160a01b0316146119805760405162461bcd60e51b815260206004820152601060248201526f2237903737ba1037bbb7103a37b5b2b760811b6044820152606401610811565b6001016117d6565b50600195945050505050565b6daaeb6d7670e522a718067333cd4e3b15610e9157604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611a01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a259190613202565b610e9157604051633b79c77360e21b81526001600160a01b0382166004820152602401610811565b6001600160a01b038516331480611a695750611a6985336106fc565b611a855760405162461bcd60e51b81526004016108119061312a565b611a928585858585612237565b5050505050565b60036108628282613265565b6001600160a01b038316611acb5760405162461bcd60e51b815260040161081190613324565b8051825114611aec5760405162461bcd60e51b815260040161081190613367565b6000339050611b0f818560008686604051806020016040528060008152506120ce565b60005b8351811015611bd7576000848281518110611b2f57611b2f613114565b602002602001015190506000848381518110611b4d57611b4d613114565b60209081029190910181015160008481526001835260408082206001600160a01b038c168352909352919091205490915081811015611b9e5760405162461bcd60e51b8152600401610811906133af565b60009283526001602090815260408085206001600160a01b038b1686529091529092209103905580611bcf816130fb565b915050611b12565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611c289291906133f3565b60405180910390a460408051602081019091526000905261107a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6108623383836123dc565b6001600160a01b038416611cc55760405162461bcd60e51b815260040161081190613178565b8151835114611ce65760405162461bcd60e51b815260040161081190613367565b33611cf6816000878787876120ce565b60005b8451811015611d9257838181518110611d1457611d14613114565b602002602001015160016000878481518110611d3257611d32613114565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611d7a91906131b9565b90915550819050611d8a816130fb565b915050611cf9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611de39291906133f3565b60405180910390a4611a92816000878787876124bc565b6001600160a01b038516331480611e165750611e1685336106fc565b611e325760405162461bcd60e51b81526004016108119061312a565b611a928585858585612577565b6001600160a01b038316611e655760405162461bcd60e51b815260040161081190613324565b336000611e7184612083565b90506000611e7e84612083565b9050611e9e838760008585604051806020016040528060008152506120ce565b60008581526001602090815260408083206001600160a01b038a16845290915290205484811015611ee15760405162461bcd60e51b8152600401610811906133af565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a460408051602081019091526000905261165c565b60006001600160e01b03198216636cdb3d1360e11b1480611f8c57506001600160e01b031982166303a24d0760e21b145b8061083f57506301ffc9a760e01b6001600160e01b031983161461083f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611fea5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612016576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061203457662386f26fc10000830492506010015b6305f5e100831061204c576305f5e100830492506008015b612710831061206057612710830492506004015b60648310612072576064830492506002015b600a831061083f5760010192915050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106120bd576120bd613114565b602090810291909101015292915050565b610cf98686868686866126b3565b6001600160a01b0384163b15610cf95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906121209089908990889088908890600401613421565b6020604051808303816000875af192505050801561215b575060408051601f3d908101601f1916820190925261215891810190613466565b60015b61220757612167613483565b806308c379a0036121a0575061217b61349f565b8061218657506121a2565b8060405162461bcd60e51b8152600401610811919061293c565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610811565b6001600160e01b0319811663f23a6e6160e01b1461165c5760405162461bcd60e51b815260040161081190613528565b81518351146122585760405162461bcd60e51b815260040161081190613367565b6001600160a01b03841661227e5760405162461bcd60e51b815260040161081190613570565b3361228d8187878787876120ce565b60005b84518110156123765760008582815181106122ad576122ad613114565b6020026020010151905060008583815181106122cb576122cb613114565b60209081029190910181015160008481526001835260408082206001600160a01b038e16835290935291909120549091508181101561231c5760405162461bcd60e51b8152600401610811906135b5565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061235b9084906131b9565b925050819055505050508061236f906130fb565b9050612290565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516123c69291906133f3565b60405180910390a4610cf98187878787876124bc565b816001600160a01b0316836001600160a01b03160361244f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610811565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384163b15610cf95760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061250090899089908890889088906004016135ff565b6020604051808303816000875af192505050801561253b575060408051601f3d908101601f1916820190925261253891810190613466565b60015b61254757612167613483565b6001600160e01b0319811663bc197c8160e01b1461165c5760405162461bcd60e51b815260040161081190613528565b6001600160a01b03841661259d5760405162461bcd60e51b815260040161081190613570565b3360006125a985612083565b905060006125b685612083565b90506125c68389898585896120ce565b60008681526001602090815260408083206001600160a01b038c168452909152902054858110156126095760405162461bcd60e51b8152600401610811906135b5565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126489084906131b9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46126a8848a8a8a8a8a6120dc565b505050505050505050565b6001600160a01b03851661273a5760005b8351811015612738578281815181106126df576126df613114565b6020026020010151600460008684815181106126fd576126fd613114565b60200260200101518152602001908152602001600020600082825461272291906131b9565b909155506127319050816130fb565b90506126c4565b505b6001600160a01b038416610cf95760005b835181101561165c57600084828151811061276857612768613114565b60200260200101519050600084838151811061278657612786613114565b60200260200101519050600060046000848152602001908152602001600020549050818110156128095760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610811565b60009283526004602052604090922091039055612825816130fb565b905061274b565b6001600160a01b0381168114610e9157600080fd5b6000806040838503121561285457600080fd5b823561285f8161282c565b946020939093013593505050565b6001600160e01b031981168114610e9157600080fd5b60006020828403121561289557600080fd5b81356128a08161286d565b9392505050565b600080604083850312156128ba57600080fd5b82356128c58161282c565b915060208301356001600160601b03811681146128e157600080fd5b809150509250929050565b60005b838110156129075781810151838201526020016128ef565b50506000910152565b600081518084526129288160208601602086016128ec565b601f01601f19169290920160200192915050565b6020815260006128a06020830184612910565b60006020828403121561296157600080fd5b5035919050565b6000806040838503121561297b57600080fd5b50508035926020909101359150565b60008083601f84011261299c57600080fd5b5081356001600160401b038111156129b357600080fd5b6020830191508360208260051b8501011115610ccb57600080fd5b6000806000604084860312156129e357600080fd5b83356001600160401b038111156129f957600080fd5b612a058682870161298a565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612a5457612a54612a19565b6040525050565b60006001600160401b03821115612a7457612a74612a19565b5060051b60200190565b600082601f830112612a8f57600080fd5b81356020612a9c82612a5b565b604051612aa98282612a2f565b83815260059390931b8501820192828101915086841115612ac957600080fd5b8286015b84811015612ae45780358352918301918301612acd565b509695505050505050565b60006001600160401b03831115612b0857612b08612a19565b604051612b1f601f8501601f191660200182612a2f565b809150838152848484011115612b3457600080fd5b83836020830137600060208583010152509392505050565b600082601f830112612b5d57600080fd5b6128a083833560208501612aef565b600080600080600060a08688031215612b8457600080fd5b8535612b8f8161282c565b94506020860135612b9f8161282c565b935060408601356001600160401b0380821115612bbb57600080fd5b612bc789838a01612a7e565b94506060880135915080821115612bdd57600080fd5b612be989838a01612a7e565b93506080880135915080821115612bff57600080fd5b50612c0c88828901612b4c565b9150509295509295909350565b8015158114610e9157600080fd5b60008060008060808587031215612c3d57600080fd5b8435935060208501359250604085013591506060850135612c5d81612c19565b939692955090935050565b60008060408385031215612c7b57600080fd5b82356001600160401b0380821115612c9257600080fd5b818501915085601f830112612ca657600080fd5b81356020612cb382612a5b565b604051612cc08282612a2f565b83815260059390931b8501820192828101915089841115612ce057600080fd5b948201945b83861015612d07578535612cf88161282c565b82529482019490820190612ce5565b96505086013592505080821115612d1d57600080fd5b50612d2a85828601612a7e565b9150509250929050565b600081518084526020808501945080840160005b83811015612d6457815187529582019590820190600101612d48565b509495945050505050565b6020815260006128a06020830184612d34565b600060208284031215612d9457600080fd5b81356001600160401b03811115612daa57600080fd5b8201601f81018413612dbb57600080fd5b612dca84823560208401612aef565b949350505050565b600080600060608486031215612de757600080fd5b8335612df28161282c565b925060208401356001600160401b0380821115612e0e57600080fd5b612e1a87838801612a7e565b93506040860135915080821115612e3057600080fd5b50612e3d86828701612a7e565b9150509250925092565b600060208284031215612e5957600080fd5b81356128a081612c19565b60008060408385031215612e7757600080fd5b8235915060208301356128e181612c19565b600060208284031215612e9b57600080fd5b81356128a08161282c565b60008060408385031215612eb957600080fd5b8235612ec48161282c565b915060208301356128e181612c19565b60008060008060408587031215612eea57600080fd5b84356001600160401b0380821115612f0157600080fd5b612f0d8883890161298a565b90965094506020870135915080821115612f2657600080fd5b50612f338782880161298a565b95989497509550505050565b60008060408385031215612f5257600080fd5b8235612f5d8161282c565b915060208301356128e18161282c565b600080600080600060a08688031215612f8557600080fd5b8535612f908161282c565b94506020860135612fa08161282c565b9350604086013592506060860135915060808601356001600160401b03811115612fc957600080fd5b612c0c88828901612b4c565b600080600060608486031215612fea57600080fd5b8335612ff58161282c565b95602085013595506040909401359392505050565b600181811c9082168061301e57607f821691505b60208210810361303e57634e487b7160e01b600052602260045260246000fd5b50919050565b600083516130568184602088016128ec565b83519083019061306a8183602088016128ec565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761083f5761083f613073565b6020808252810182905260006001600160fb1b038311156130c057600080fd5b8260051b80856040850137919091016040019392505050565b6000826130f657634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161310d5761310d613073565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b8082018082111561083f5761083f613073565b6000602082840312156131de57600080fd5b5051919050565b6000602082840312156131f757600080fd5b81516128a08161282c565b60006020828403121561321457600080fd5b81516128a081612c19565b601f821115610c1f57600081815260208120601f850160051c810160208610156132465750805b601f850160051c820191505b81811015610cf957828155600101613252565b81516001600160401b0381111561327e5761327e612a19565b6132928161328c845461300a565b8461321f565b602080601f8311600181146132c757600084156132af5750858301515b600019600386901b1c1916600185901b178555610cf9565b600085815260208120601f198616915b828110156132f6578886015182559484019460019091019084016132d7565b50858210156133145787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6040815260006134066040830185612d34565b82810360208401526134188185612d34565b95945050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061345b90830184612910565b979650505050505050565b60006020828403121561347857600080fd5b81516128a08161286d565b600060033d111561349c5760046000803e5060005160e01c5b90565b600060443d10156134ad5790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156134dc57505050505090565b82850191508151818111156134f45750505050505090565b843d870101602082850101111561350e5750505050505090565b61351d60208286010187612a2f565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061362b90830186612d34565b828103606084015261363d8186612d34565b905082810360808401526136518185612910565b9897505050505050505056fea26469706673582212208f44d66ec895845de34dabd092be90b2c25c6c768fc55477fd42b32a63b0982c64736f6c634300081200330000000000000000000000007885a11bf17cce86d4f2906c1bfb537dadfdc43d

Deployed Bytecode

0x6080604052600436106102245760003560e01c8063715018a611610123578063aec26b5f116100ab578063e985e9c51161006f578063e985e9c5146106e1578063f242432a1461072a578063f2fde38b1461074a578063f5298aca1461076a578063f8004d311461078a57600080fd5b8063aec26b5f1461063e578063bd85b0391461065e578063cc408b8a1461068b578063da75caa4146106a1578063e80b248d146106c157600080fd5b806395d89b41116100f257806395d89b41146105b4578063a22cb465146105c9578063a68b60e1146105e9578063ac08cf3014610609578063ac4460021461062957600080fd5b8063715018a6146105415780637ddd6c14146105565780638da5cb5b14610576578063913e22401461059457600080fd5b80632eb2c2d6116101b15780634f558e79116101755780634f558e791461044b57806355f804b31461047a5780636a030ca91461049a5780636b20c454146105015780637032637e1461052157600080fd5b80632eb2c2d614610383578063388c6000146103a35780633e668f62146103c357806341f43434146103e45780634e1273f41461041e57600080fd5b80630e89341c116101f85780630e89341c146102d05780631b2ef1ca146102f05780631e34c8361461030357806324bbd049146103235780632a55205a1461034457600080fd5b8062fdd58e1461022957806301ffc9a71461025c57806304634d8d1461028c57806306fdde03146102ae575b600080fd5b34801561023557600080fd5b50610249610244366004612841565b6107aa565b6040519081526020015b60405180910390f35b34801561026857600080fd5b5061027c610277366004612883565b610845565b6040519015158152602001610253565b34801561029857600080fd5b506102ac6102a73660046128a7565b610850565b005b3480156102ba57600080fd5b506102c3610866565b604051610253919061293c565b3480156102dc57600080fd5b506102c36102eb36600461294f565b6108f4565b6102ac6102fe366004612968565b610991565b34801561030f57600080fd5b506102ac61031e3660046129ce565b610b35565b34801561032f57600080fd5b50600c5461027c90600160a81b900460ff1681565b34801561035057600080fd5b5061036461035f366004612968565b610c24565b604080516001600160a01b039093168352602083019190915201610253565b34801561038f57600080fd5b506102ac61039e366004612b6c565b610cd2565b3480156103af57600080fd5b506102ac6103be366004612c27565b610d01565b3480156103cf57600080fd5b50600c5461027c90600160a01b900460ff1681565b3480156103f057600080fd5b506104066daaeb6d7670e522a718067333cd4e81565b6040516001600160a01b039091168152602001610253565b34801561042a57600080fd5b5061043e610439366004612c68565b610d57565b6040516102539190612d6f565b34801561045757600080fd5b5061027c61046636600461294f565b600090815260046020526040902054151590565b34801561048657600080fd5b506102ac610495366004612d82565b610e80565b3480156104a657600080fd5b506104df6104b536600461294f565b600b6020526000908152604090208054600182015460028301546003909301549192909160ff1684565b6040805194855260208501939093529183015215156060820152608001610253565b34801561050d57600080fd5b506102ac61051c366004612dd2565b610e94565b34801561052d57600080fd5b506102ac61053c366004612e47565b610ed7565b34801561054d57600080fd5b506102ac610efd565b34801561056257600080fd5b506102ac610571366004612e64565b610f11565b34801561058257600080fd5b506000546001600160a01b0316610406565b3480156105a057600080fd5b506102ac6105af366004612e89565b610f3c565b3480156105c057600080fd5b506102c3610f66565b3480156105d557600080fd5b506102ac6105e4366004612ea6565b610f73565b3480156105f557600080fd5b50600c54610406906001600160a01b031681565b34801561061557600080fd5b506102ac610624366004612ed4565b610f87565b34801561063557600080fd5b506102ac611080565b34801561064a57600080fd5b506102ac610659366004612968565b611125565b34801561066a57600080fd5b5061024961067936600461294f565b60009081526004602052604090205490565b34801561069757600080fd5b50610249600a5481565b3480156106ad57600080fd5b506102ac6106bc366004612968565b611142565b3480156106cd57600080fd5b506102ac6106dc366004612968565b61115c565b3480156106ed57600080fd5b5061027c6106fc366004612f3f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b34801561073657600080fd5b506102ac610745366004612f6d565b611179565b34801561075657600080fd5b506102ac610765366004612e89565b6111a0565b34801561077657600080fd5b506102ac610785366004612fd5565b611216565b34801561079657600080fd5b506102ac6107a5366004612e47565b611259565b60006001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526001602090815260408083206001600160a01b03861684529091529020545b92915050565b600061083f8261127f565b6108586112a4565b61086282826112fe565b5050565b600880546108739061300a565b80601f016020809104026020016040519081016040528092919081815260200182805461089f9061300a565b80156108ec5780601f106108c1576101008083540402835291602001916108ec565b820191906000526020600020905b8154815290600101906020018083116108cf57829003601f168201915b505050505081565b6060600a54821080156109135750600082815260046020526040812054115b6109585760405162461bcd60e51b81526020600482015260166024820152752aa9249d103737b732bc34b9ba32b73a103a37b5b2b760511b6044820152606401610811565b610961826113fb565b61096a8361148f565b60405160200161097b929190613044565b6040516020818303038152906040529050919050565b3233146109d55760405162461bcd60e51b815260206004820152601260248201527110d85b1b195c881a5cc818dbdb9d1c9858dd60721b6044820152606401610811565b6109dd611521565b600c54600160a81b900460ff16610a265760405162461bcd60e51b815260206004820152600d60248201526c26b4b73a103737ba1037b832b760991b6044820152606401610811565b6000828152600b6020526040902060020154610a735760405162461bcd60e51b815260206004820152600c60248201526b04d696e7420707269636520360a41b6044820152606401610811565b6000828152600b6020526040902060020154610a90908290613089565b341015610acf5760405162461bcd60e51b815260206004820152600d60248201526c09ccacac840dadee4ca408aa89609b1b6044820152606401610811565b600a548210610b105760405162461bcd60e51b815260206004820152600d60248201526c139bc81cdd58da081b5bd9195b609a1b6044820152606401610811565b610b2b3383836040518060200160405280600081525061157a565b6108626001600555565b323314610b795760405162461bcd60e51b815260206004820152601260248201527110d85b1b195c881a5cc818dbdb9d1c9858dd60721b6044820152606401610811565b610b81611521565b610b8c838383611665565b610b9557600080fd5b600c5460405163e4623c1b60e01b81526001600160a01b039091169063e4623c1b90610bc790869086906004016130a0565b600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b50505050610c15338260016040518060200160405280600081525061157a565b610c1f6001600555565b505050565b60008281526007602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610c995750604080518082019091526006546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610cb8906001600160601b031687613089565b610cc291906130d9565b91519350909150505b9250929050565b846001600160a01b0381163314610cec57610cec33611994565b610cf98686868686611a4d565b505050505050565b610d096112a4565b600a80546000908152600b60205260408120868155600181018690556002810185905560038101805460ff1916851515179055825490929091610d4b836130fb565b91905055505050505050565b60608151835114610dbc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610811565b600083516001600160401b03811115610dd757610dd7612a19565b604051908082528060200260200182016040528015610e00578160200160208202803683370190505b50905060005b8451811015610e7857610e4b858281518110610e2457610e24613114565b6020026020010151858381518110610e3e57610e3e613114565b60200260200101516107aa565b828281518110610e5d57610e5d613114565b6020908102919091010152610e71816130fb565b9050610e06565b509392505050565b610e886112a4565b610e9181611a99565b50565b6001600160a01b038316331480610eb05750610eb083336106fc565b610ecc5760405162461bcd60e51b81526004016108119061312a565b610c1f838383611aa5565b610edf6112a4565b600c8054911515600160a01b0260ff60a01b19909216919091179055565b610f056112a4565b610f0f6000611c44565b565b610f196112a4565b6000918252600b6020526040909120600301805460ff1916911515919091179055565b610f446112a4565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600980546108739061300a565b81610f7d81611994565b610c1f8383611c94565b610f8f6112a4565b60005b83811015610ffd57600a54858583818110610faf57610faf613114565b9050602002013510610ff55760405162461bcd60e51b815260206004820152600f60248201526e135bd9195b081b9bdd081859191959608a1b6044820152606401610811565b600101610f92565b5061107a3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092018290525060408051602081019091529081529250611c9f915050565b50505050565b6110886112a4565b611090611521565b604051600090339047908381818185875af1925050503d80600081146110d2576040519150601f19603f3d011682016040523d82523d6000602084013e6110d7565b606091505b505090508061111a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610811565b50610f0f6001600555565b61112d6112a4565b6000918252600b602052604090912060020155565b61114a6112a4565b6000918252600b602052604090912055565b6111646112a4565b6000918252600b602052604090912060010155565b846001600160a01b03811633146111935761119333611994565b610cf98686868686611dfa565b6111a86112a4565b6001600160a01b03811661120d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610811565b610e9181611c44565b6001600160a01b038316331480611232575061123283336106fc565b61124e5760405162461bcd60e51b81526004016108119061312a565b610c1f838383611e3f565b6112616112a4565b600c8054911515600160a81b0260ff60a81b19909216919091179055565b60006001600160e01b0319821663152a902d60e11b148061083f575061083f82611f5b565b6000546001600160a01b03163314610f0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610811565b6127106001600160601b038216111561136c5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610811565b6001600160a01b0382166113c25760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610811565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b60606003805461140a9061300a565b80601f01602080910402602001604051908101604052809291908181526020018280546114369061300a565b80156114835780601f1061145857610100808354040283529160200191611483565b820191906000526020600020905b81548152906001019060200180831161146657829003601f168201915b50505050509050919050565b6060600061149c83611fab565b60010190506000816001600160401b038111156114bb576114bb612a19565b6040519080825280601f01601f1916602001820160405280156114e5576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846114ef57509392505050565b6002600554036115735760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610811565b6002600555565b6001600160a01b0384166115a05760405162461bcd60e51b815260040161081190613178565b3360006115ac85612083565b905060006115b985612083565b90506115ca836000898585896120ce565b60008681526001602090815260408083206001600160a01b038b168452909152812080548792906115fc9084906131b9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461165c836000898989896120dc565b50505050505050565b600c54600090600160a01b900460ff166116b25760405162461bcd60e51b815260206004820152600e60248201526d21b930b33a103737ba1037b832b760911b6044820152606401610811565b600a5482106116f35760405162461bcd60e51b815260206004820152600d60248201526c139bc81cdd58da081b5bd9195b609a1b6044820152606401610811565b6000828152600b602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260039091015460ff161515606082018190526117805760405162461bcd60e51b81526020600482015260166024820152754d6f64656c206973206e6f7420637261667461626c6560501b6044820152606401610811565b602081015184146117d35760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67207061727420616d6f756e7420746f2063726166740000000000006044820152606401610811565b60005b84811015611988578151600c546001600160a01b03166376aed2e188888581811061180357611803613114565b905060200201356040518263ffffffff1660e01b815260040161182891815260200190565b602060405180830381865afa158015611845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186991906131cc565b146118ac5760405162461bcd60e51b815260206004820152601360248201527215dc9bdb99c81c185c9d081d1bc818dc98599d606a1b6044820152606401610811565b600c5433906001600160a01b0316636352211e8888858181106118d1576118d1613114565b905060200201356040518263ffffffff1660e01b81526004016118f691815260200190565b602060405180830381865afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193791906131e5565b6001600160a01b0316146119805760405162461bcd60e51b815260206004820152601060248201526f2237903737ba1037bbb7103a37b5b2b760811b6044820152606401610811565b6001016117d6565b50600195945050505050565b6daaeb6d7670e522a718067333cd4e3b15610e9157604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611a01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a259190613202565b610e9157604051633b79c77360e21b81526001600160a01b0382166004820152602401610811565b6001600160a01b038516331480611a695750611a6985336106fc565b611a855760405162461bcd60e51b81526004016108119061312a565b611a928585858585612237565b5050505050565b60036108628282613265565b6001600160a01b038316611acb5760405162461bcd60e51b815260040161081190613324565b8051825114611aec5760405162461bcd60e51b815260040161081190613367565b6000339050611b0f818560008686604051806020016040528060008152506120ce565b60005b8351811015611bd7576000848281518110611b2f57611b2f613114565b602002602001015190506000848381518110611b4d57611b4d613114565b60209081029190910181015160008481526001835260408082206001600160a01b038c168352909352919091205490915081811015611b9e5760405162461bcd60e51b8152600401610811906133af565b60009283526001602090815260408085206001600160a01b038b1686529091529092209103905580611bcf816130fb565b915050611b12565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611c289291906133f3565b60405180910390a460408051602081019091526000905261107a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6108623383836123dc565b6001600160a01b038416611cc55760405162461bcd60e51b815260040161081190613178565b8151835114611ce65760405162461bcd60e51b815260040161081190613367565b33611cf6816000878787876120ce565b60005b8451811015611d9257838181518110611d1457611d14613114565b602002602001015160016000878481518110611d3257611d32613114565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611d7a91906131b9565b90915550819050611d8a816130fb565b915050611cf9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611de39291906133f3565b60405180910390a4611a92816000878787876124bc565b6001600160a01b038516331480611e165750611e1685336106fc565b611e325760405162461bcd60e51b81526004016108119061312a565b611a928585858585612577565b6001600160a01b038316611e655760405162461bcd60e51b815260040161081190613324565b336000611e7184612083565b90506000611e7e84612083565b9050611e9e838760008585604051806020016040528060008152506120ce565b60008581526001602090815260408083206001600160a01b038a16845290915290205484811015611ee15760405162461bcd60e51b8152600401610811906133af565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a460408051602081019091526000905261165c565b60006001600160e01b03198216636cdb3d1360e11b1480611f8c57506001600160e01b031982166303a24d0760e21b145b8061083f57506301ffc9a760e01b6001600160e01b031983161461083f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611fea5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612016576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061203457662386f26fc10000830492506010015b6305f5e100831061204c576305f5e100830492506008015b612710831061206057612710830492506004015b60648310612072576064830492506002015b600a831061083f5760010192915050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106120bd576120bd613114565b602090810291909101015292915050565b610cf98686868686866126b3565b6001600160a01b0384163b15610cf95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906121209089908990889088908890600401613421565b6020604051808303816000875af192505050801561215b575060408051601f3d908101601f1916820190925261215891810190613466565b60015b61220757612167613483565b806308c379a0036121a0575061217b61349f565b8061218657506121a2565b8060405162461bcd60e51b8152600401610811919061293c565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610811565b6001600160e01b0319811663f23a6e6160e01b1461165c5760405162461bcd60e51b815260040161081190613528565b81518351146122585760405162461bcd60e51b815260040161081190613367565b6001600160a01b03841661227e5760405162461bcd60e51b815260040161081190613570565b3361228d8187878787876120ce565b60005b84518110156123765760008582815181106122ad576122ad613114565b6020026020010151905060008583815181106122cb576122cb613114565b60209081029190910181015160008481526001835260408082206001600160a01b038e16835290935291909120549091508181101561231c5760405162461bcd60e51b8152600401610811906135b5565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061235b9084906131b9565b925050819055505050508061236f906130fb565b9050612290565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516123c69291906133f3565b60405180910390a4610cf98187878787876124bc565b816001600160a01b0316836001600160a01b03160361244f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610811565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384163b15610cf95760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061250090899089908890889088906004016135ff565b6020604051808303816000875af192505050801561253b575060408051601f3d908101601f1916820190925261253891810190613466565b60015b61254757612167613483565b6001600160e01b0319811663bc197c8160e01b1461165c5760405162461bcd60e51b815260040161081190613528565b6001600160a01b03841661259d5760405162461bcd60e51b815260040161081190613570565b3360006125a985612083565b905060006125b685612083565b90506125c68389898585896120ce565b60008681526001602090815260408083206001600160a01b038c168452909152902054858110156126095760405162461bcd60e51b8152600401610811906135b5565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126489084906131b9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46126a8848a8a8a8a8a6120dc565b505050505050505050565b6001600160a01b03851661273a5760005b8351811015612738578281815181106126df576126df613114565b6020026020010151600460008684815181106126fd576126fd613114565b60200260200101518152602001908152602001600020600082825461272291906131b9565b909155506127319050816130fb565b90506126c4565b505b6001600160a01b038416610cf95760005b835181101561165c57600084828151811061276857612768613114565b60200260200101519050600084838151811061278657612786613114565b60200260200101519050600060046000848152602001908152602001600020549050818110156128095760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610811565b60009283526004602052604090922091039055612825816130fb565b905061274b565b6001600160a01b0381168114610e9157600080fd5b6000806040838503121561285457600080fd5b823561285f8161282c565b946020939093013593505050565b6001600160e01b031981168114610e9157600080fd5b60006020828403121561289557600080fd5b81356128a08161286d565b9392505050565b600080604083850312156128ba57600080fd5b82356128c58161282c565b915060208301356001600160601b03811681146128e157600080fd5b809150509250929050565b60005b838110156129075781810151838201526020016128ef565b50506000910152565b600081518084526129288160208601602086016128ec565b601f01601f19169290920160200192915050565b6020815260006128a06020830184612910565b60006020828403121561296157600080fd5b5035919050565b6000806040838503121561297b57600080fd5b50508035926020909101359150565b60008083601f84011261299c57600080fd5b5081356001600160401b038111156129b357600080fd5b6020830191508360208260051b8501011115610ccb57600080fd5b6000806000604084860312156129e357600080fd5b83356001600160401b038111156129f957600080fd5b612a058682870161298a565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612a5457612a54612a19565b6040525050565b60006001600160401b03821115612a7457612a74612a19565b5060051b60200190565b600082601f830112612a8f57600080fd5b81356020612a9c82612a5b565b604051612aa98282612a2f565b83815260059390931b8501820192828101915086841115612ac957600080fd5b8286015b84811015612ae45780358352918301918301612acd565b509695505050505050565b60006001600160401b03831115612b0857612b08612a19565b604051612b1f601f8501601f191660200182612a2f565b809150838152848484011115612b3457600080fd5b83836020830137600060208583010152509392505050565b600082601f830112612b5d57600080fd5b6128a083833560208501612aef565b600080600080600060a08688031215612b8457600080fd5b8535612b8f8161282c565b94506020860135612b9f8161282c565b935060408601356001600160401b0380821115612bbb57600080fd5b612bc789838a01612a7e565b94506060880135915080821115612bdd57600080fd5b612be989838a01612a7e565b93506080880135915080821115612bff57600080fd5b50612c0c88828901612b4c565b9150509295509295909350565b8015158114610e9157600080fd5b60008060008060808587031215612c3d57600080fd5b8435935060208501359250604085013591506060850135612c5d81612c19565b939692955090935050565b60008060408385031215612c7b57600080fd5b82356001600160401b0380821115612c9257600080fd5b818501915085601f830112612ca657600080fd5b81356020612cb382612a5b565b604051612cc08282612a2f565b83815260059390931b8501820192828101915089841115612ce057600080fd5b948201945b83861015612d07578535612cf88161282c565b82529482019490820190612ce5565b96505086013592505080821115612d1d57600080fd5b50612d2a85828601612a7e565b9150509250929050565b600081518084526020808501945080840160005b83811015612d6457815187529582019590820190600101612d48565b509495945050505050565b6020815260006128a06020830184612d34565b600060208284031215612d9457600080fd5b81356001600160401b03811115612daa57600080fd5b8201601f81018413612dbb57600080fd5b612dca84823560208401612aef565b949350505050565b600080600060608486031215612de757600080fd5b8335612df28161282c565b925060208401356001600160401b0380821115612e0e57600080fd5b612e1a87838801612a7e565b93506040860135915080821115612e3057600080fd5b50612e3d86828701612a7e565b9150509250925092565b600060208284031215612e5957600080fd5b81356128a081612c19565b60008060408385031215612e7757600080fd5b8235915060208301356128e181612c19565b600060208284031215612e9b57600080fd5b81356128a08161282c565b60008060408385031215612eb957600080fd5b8235612ec48161282c565b915060208301356128e181612c19565b60008060008060408587031215612eea57600080fd5b84356001600160401b0380821115612f0157600080fd5b612f0d8883890161298a565b90965094506020870135915080821115612f2657600080fd5b50612f338782880161298a565b95989497509550505050565b60008060408385031215612f5257600080fd5b8235612f5d8161282c565b915060208301356128e18161282c565b600080600080600060a08688031215612f8557600080fd5b8535612f908161282c565b94506020860135612fa08161282c565b9350604086013592506060860135915060808601356001600160401b03811115612fc957600080fd5b612c0c88828901612b4c565b600080600060608486031215612fea57600080fd5b8335612ff58161282c565b95602085013595506040909401359392505050565b600181811c9082168061301e57607f821691505b60208210810361303e57634e487b7160e01b600052602260045260246000fd5b50919050565b600083516130568184602088016128ec565b83519083019061306a8183602088016128ec565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761083f5761083f613073565b6020808252810182905260006001600160fb1b038311156130c057600080fd5b8260051b80856040850137919091016040019392505050565b6000826130f657634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161310d5761310d613073565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b8082018082111561083f5761083f613073565b6000602082840312156131de57600080fd5b5051919050565b6000602082840312156131f757600080fd5b81516128a08161282c565b60006020828403121561321457600080fd5b81516128a081612c19565b601f821115610c1f57600081815260208120601f850160051c810160208610156132465750805b601f850160051c820191505b81811015610cf957828155600101613252565b81516001600160401b0381111561327e5761327e612a19565b6132928161328c845461300a565b8461321f565b602080601f8311600181146132c757600084156132af5750858301515b600019600386901b1c1916600185901b178555610cf9565b600085815260208120601f198616915b828110156132f6578886015182559484019460019091019084016132d7565b50858210156133145787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6040815260006134066040830185612d34565b82810360208401526134188185612d34565b95945050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061345b90830184612910565b979650505050505050565b60006020828403121561347857600080fd5b81516128a08161286d565b600060033d111561349c5760046000803e5060005160e01c5b90565b600060443d10156134ad5790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156134dc57505050505090565b82850191508151818111156134f45750505050505090565b843d870101602082850101111561350e5750505050505090565b61351d60208286010187612a2f565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061362b90830186612d34565b828103606084015261363d8186612d34565b905082810360808401526136518185612910565b9897505050505050505056fea26469706673582212208f44d66ec895845de34dabd092be90b2c25c6c768fc55477fd42b32a63b0982c64736f6c63430008120033

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

0000000000000000000000007885a11bf17cce86d4f2906c1bfb537dadfdc43d

-----Decoded View---------------
Arg [0] : yelloPartsAddr (address): 0x7885A11BF17ccE86d4F2906c1BfB537DaDfdC43d

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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