ETH Price: $2,527.48 (+2.72%)

Contract

0xb386f825515414b52d88f2EB39AB63436F28136E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Cart Mint167826072023-03-08 9:19:47539 days ago1678267187IN
0xb386f825...36F28136E
0.2 ETH0.0030916920.33688032
Cart Mint167394122023-03-02 7:30:59545 days ago1677742259IN
0xb386f825...36F28136E
0.2 ETH0.0028869318.99002616
Cart Mint167364632023-03-01 21:33:11546 days ago1677706391IN
0xb386f825...36F28136E
0.6 ETH0.0043254928.91840131
Cart Mint167364622023-03-01 21:32:59546 days ago1677706379IN
0xb386f825...36F28136E
0.2 ETH0.0044290929.61297578
Cart Mint167363802023-03-01 21:16:35546 days ago1677705395IN
0xb386f825...36F28136E
0.2 ETH0.004110127.47837714
Cart Mint167363212023-03-01 21:04:47546 days ago1677704687IN
0xb386f825...36F28136E
0.2 ETH0.0044735929.91532644
Cart Mint167363062023-03-01 21:01:47546 days ago1677704507IN
0xb386f825...36F28136E
0.2 ETH0.0054669636.55804986
Cart Mint167350202023-03-01 16:41:23546 days ago1677688883IN
0xb386f825...36F28136E
0.2 ETH0.0087690557.67369515
Cart Mint167342352023-03-01 14:02:35546 days ago1677679355IN
0xb386f825...36F28136E
0.2 ETH0.0042991728.27736064
Cart Mint167332692023-03-01 10:46:35546 days ago1677667595IN
0xb386f825...36F28136E
0.2 ETH0.0040237726.46593926
Cart Mint167330672023-03-01 10:05:47546 days ago1677665147IN
0xb386f825...36F28136E
0.2 ETH0.004653630.60860425
Cart Mint167287802023-02-28 19:37:11547 days ago1677613031IN
0xb386f825...36F28136E
0.4 ETH0.0084997831.88790162
Cart Mint167283142023-02-28 18:03:11547 days ago1677607391IN
0xb386f825...36F28136E
0.4 ETH0.0102341937.69530317
Cart Mint167282122023-02-28 17:42:47547 days ago1677606167IN
0xb386f825...36F28136E
0.4 ETH0.0078826529.57265802
Cart Mint167280842023-02-28 17:16:35547 days ago1677604595IN
0xb386f825...36F28136E
0.4 ETH0.0092467234.69637955
Cart Mint167279612023-02-28 16:51:35547 days ago1677603095IN
0xb386f825...36F28136E
0.2 ETH0.0042382728.337167
Cart Mint167278102023-02-28 16:20:59547 days ago1677601259IN
0xb386f825...36F28136E
0.2 ETH0.004541329.86991591
Cart Mint167277992023-02-28 16:18:47547 days ago1677601127IN
0xb386f825...36F28136E
1.4 ETH0.0264917830.90163806
Cart Mint167277442023-02-28 16:07:47547 days ago1677600467IN
0xb386f825...36F28136E
0.2 ETH0.0048110432.16668601
Cart Mint167277312023-02-28 16:05:11547 days ago1677600311IN
0xb386f825...36F28136E
0.2 ETH0.0043221628.89612193
Cart Mint167273492023-02-28 14:47:59547 days ago1677595679IN
0xb386f825...36F28136E
0.2 ETH0.0043921526.35304253
Cart Mint167273142023-02-28 14:40:59547 days ago1677595259IN
0xb386f825...36F28136E
0.2 ETH0.0037145624.83560827
Cart Mint167269832023-02-28 13:34:23547 days ago1677591263IN
0xb386f825...36F28136E
0.2 ETH0.0041952728.05002517
Cart Mint167269622023-02-28 13:29:59547 days ago1677590999IN
0xb386f825...36F28136E
0.2 ETH0.0036972824.72010213
Cart Mint167267542023-02-28 12:47:59547 days ago1677588479IN
0xb386f825...36F28136E
0.2 ETH0.003492220.95332269
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
167826072023-03-08 9:19:47539 days ago1678267187
0xb386f825...36F28136E
0.2 ETH
167394122023-03-02 7:30:59545 days ago1677742259
0xb386f825...36F28136E
0.2 ETH
167364632023-03-01 21:33:11546 days ago1677706391
0xb386f825...36F28136E
0.6 ETH
167364622023-03-01 21:32:59546 days ago1677706379
0xb386f825...36F28136E
0.2 ETH
167363802023-03-01 21:16:35546 days ago1677705395
0xb386f825...36F28136E
0.2 ETH
167363212023-03-01 21:04:47546 days ago1677704687
0xb386f825...36F28136E
0.2 ETH
167363062023-03-01 21:01:47546 days ago1677704507
0xb386f825...36F28136E
0.2 ETH
167350202023-03-01 16:41:23546 days ago1677688883
0xb386f825...36F28136E
0.2 ETH
167342352023-03-01 14:02:35546 days ago1677679355
0xb386f825...36F28136E
0.2 ETH
167332692023-03-01 10:46:35546 days ago1677667595
0xb386f825...36F28136E
0.2 ETH
167330672023-03-01 10:05:47546 days ago1677665147
0xb386f825...36F28136E
0.2 ETH
167287802023-02-28 19:37:11547 days ago1677613031
0xb386f825...36F28136E
0.2 ETH
167287802023-02-28 19:37:11547 days ago1677613031
0xb386f825...36F28136E
0.2 ETH
167283142023-02-28 18:03:11547 days ago1677607391
0xb386f825...36F28136E
0.2 ETH
167283142023-02-28 18:03:11547 days ago1677607391
0xb386f825...36F28136E
0.2 ETH
167282122023-02-28 17:42:47547 days ago1677606167
0xb386f825...36F28136E
0.2 ETH
167282122023-02-28 17:42:47547 days ago1677606167
0xb386f825...36F28136E
0.2 ETH
167280842023-02-28 17:16:35547 days ago1677604595
0xb386f825...36F28136E
0.2 ETH
167280842023-02-28 17:16:35547 days ago1677604595
0xb386f825...36F28136E
0.2 ETH
167279612023-02-28 16:51:35547 days ago1677603095
0xb386f825...36F28136E
0.2 ETH
167278102023-02-28 16:20:59547 days ago1677601259
0xb386f825...36F28136E
0.2 ETH
167277992023-02-28 16:18:47547 days ago1677601127
0xb386f825...36F28136E
0.2 ETH
167277992023-02-28 16:18:47547 days ago1677601127
0xb386f825...36F28136E
0.2 ETH
167277992023-02-28 16:18:47547 days ago1677601127
0xb386f825...36F28136E
0.2 ETH
167277992023-02-28 16:18:47547 days ago1677601127
0xb386f825...36F28136E
0.2 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ArtDubaiCart

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : ArtDubaiCart.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/*
     ::::::::      :::     ::::::::: ::::::::::: 
    :+:    :+:   :+: :+:   :+:    :+:    :+:     
    +:+         +:+   +:+  +:+    +:+    +:+     
    +#+        +#++:++#++: +#++:++#:     +#+     
    +#+        +#+     +#+ +#+    +#+    +#+     
    #+#    #+# #+#     #+# #+#    #+#    #+#     
     ########  ###     ### ###    ###    ###     

    UAE NFT - Art Dubai Cart
    All rights reserved 2023
    Developed by DeployLabs.io ([email protected])
*/

import "./ArtDubai.sol";

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/**
 * @title Art Dubai Cart
 * @author DeployLabs.io
 *
 * @dev This contract is used for batch minting of Art Dubai NFTs.
 */
contract ArtDubaiCart is Ownable, ReentrancyGuard {
	enum CollectionName {
		Alexis,
		Jason
	}

	/**
	 * @dev The cart item for batch minting.
	 *
	 * @param signaturePackage The signature package.
	 * @param tokenId The token ID.
	 * @param quantity The quantity to mint.
	 */
	struct CartItem {
		SignaturePackage signaturePackage;
		uint8 tokenId;
		uint16 quantity;
	}

	event TokenMinted(CollectionName indexed collectionName, uint8 indexed tokenId, uint16 quantity);

	mapping(CollectionName => ArtDubai) private s_collections;

	constructor(ArtDubai alexisCollection, ArtDubai jasonCollection) {
		s_collections[CollectionName.Alexis] = alexisCollection;
		s_collections[CollectionName.Jason] = jasonCollection;
	}

	/**
	 * @dev Batch mint NFTs from the cart.
	 *
	 * @param alexisCartItems The cart items for the Alexis collection.
	 * @param jasonCartItems The cart items for the Jason collection.
	 * @param mintTo The address to mint the NFTs to.
	 */
	function cartMint(
		CartItem[] calldata alexisCartItems,
		CartItem[] calldata jasonCartItems,
		address mintTo
	) external payable nonReentrant {
		_mintArtDubaiTokens(CollectionName.Alexis, alexisCartItems, mintTo);
		_mintArtDubaiTokens(CollectionName.Jason, jasonCartItems, mintTo);

		uint256 change = address(this).balance;
		if (change > 0) payable(msg.sender).transfer(change);
	}

	/**
	 * @dev Set the Art Dubai collection address.
	 *
	 * @param collectionName The name of the collection.
	 * @param collection The collection address.
	 */
	function setCollectionContract(
		CollectionName collectionName,
		ArtDubai collection
	) external onlyOwner {
		s_collections[collectionName] = collection;
	}

	/**
	 * @dev Get the addresses of the collections.
	 *
	 * @return alexisCollection The Alexis collection address.
	 * @return jasonCollection The Jason collection address.
	 */
	function getCollectionAddresses()
		external
		view
		returns (address alexisCollection, address jasonCollection)
	{
		alexisCollection = address(s_collections[CollectionName.Alexis]);
		jasonCollection = address(s_collections[CollectionName.Jason]);
	}

	/**
	 * @dev Mint NFTs from the cart.
	 *
	 * @param collectionName The name of the collection.
	 * @param cartItems The cart items.
	 * @param mintTo The address to mint the NFTs to.
	 */
	function _mintArtDubaiTokens(
		CollectionName collectionName,
		CartItem[] calldata cartItems,
		address mintTo
	) internal {
		ArtDubai collection = s_collections[collectionName];

		for (uint8 i = 0; i < cartItems.length; i++) {
			CartItem memory cartItem = cartItems[i];
			SaleConditions memory saleCondition = collection.getSaleConditions(cartItem.tokenId);

			uint16 remainingSupply = saleCondition.supplyLimit -
				uint16(collection.totalSupply(cartItem.tokenId));
			uint16 remainingTokensPerWallet = saleCondition.maxTokensPerWallet -
				collection.getMintedCount(cartItem.tokenId, mintTo);
			uint16 quantityToMint = _min(cartItem.quantity, remainingSupply, remainingTokensPerWallet);

			uint256 cost = saleCondition.weiTokenPrice * quantityToMint;

			collection.mint{ value: cost }(
				cartItem.signaturePackage,
				mintTo,
				cartItem.tokenId,
				quantityToMint
			);

			emit TokenMinted(collectionName, cartItem.tokenId, quantityToMint);
		}
	}

	/**
	 * @dev Returns the minimum of three numbers.
	 *
	 * @param a The first number.
	 * @param b The second number.
	 * @param c The third number.
	 *
	 * @return minimal The minimum of the two numbers.
	 */
	function _min(uint16 a, uint16 b, uint16 c) internal pure returns (uint16 minimal) {
		minimal = a < b ? a : b;
		minimal = minimal < c ? minimal : c;
	}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

File 4 of 19 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 5 of 19 : 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 6 of 19 : 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 7 of 19 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 8 of 19 : 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 9 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 10 of 19 : 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 11 of 19 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 13 of 19 : 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 14 of 19 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 16 of 19 : ArtDubai.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./library/operator_filterer/DefaultOperatorFilterer.sol";

error ArtDubai__TokenNotForSale();
error ArtDubai__WrongEtherAmmount();
error ArtDubai__ExceedingMaxSupply();
error ArtDubai__ExceedingTokensPerWalletLimit();

error ArtDubai__ExceedingSignatureMaxQuantity();
error ArtDubai__HashComparisonFailed();
error ArtDubai__SignatureExpired();
error ArtDubai__UntrustedSigner();
error ArtDubai__SignatureAlreadyUsed();

error ArtDubai__InvalidInput();
error ArtDubai__NothingToWithdraw();

/**
 * @dev A struct, that contains the sale conditions for a token.
 *
 * @param supplyLimit The maximum amount of tokens that can be minted.
 * @param maxTokensPerWallet The maximum amount of tokens that can be minted per wallet.
 * @param weiTokenPrice The price of a token in wei.
 */
struct SaleConditions {
	uint16 supplyLimit;
	uint16 maxTokensPerWallet;
	uint256 weiTokenPrice;
}

/**
 * @dev A signature package, that secures the minting of tokens.
 *
 * @param hash The hash of the minting operation.
 * @param signature The signature for the hash.
 * @param signatureValidUntil The timestamp until which the signature is valid.
 * @param nonce The nonce, that is used to prevent replay attacks.
 * @param maxQuantity The maximum quantity of tokens that can be minted with this signature.
 */
struct SignaturePackage {
	bytes32 hash;
	bytes signature;
	uint32 signatureValidUntil;
	uint64 nonce;
	uint16 maxQuantity;
}

/**
 * @title Art Dubai
 * @author DeployLabs.io
 *
 * @dev This contract is used as a base contract for all Art Dubai collections.
 */
abstract contract ArtDubai is ERC1155, ERC1155Supply, Ownable, DefaultOperatorFilterer {
	bytes8 internal immutable i_hashSalt;
	address internal immutable i_signerAddress;

	mapping(uint64 => bool) internal s_usedNonces;

	mapping(uint8 => SaleConditions) internal s_saleConditions;
	mapping(uint8 => mapping(address => uint16)) internal s_numberMinted;

	string internal s_baseTokenUri;

	constructor(bytes8 hashSalt, address signerAddress) ERC1155("") {
		i_hashSalt = hashSalt;
		i_signerAddress = signerAddress;
	}

	/**
	 * @dev Mint a token to a specified wallet.
	 *
	 * @param signaturePackage The signature package for security.
	 * @param mintTo The address to mint the token to.
	 * @param tokenId The id of the token to mint.
	 * @param quantity The quantity of tokens to mint.
	 */
	function mint(
		SignaturePackage calldata signaturePackage,
		address mintTo,
		uint8 tokenId,
		uint16 quantity
	) external payable {
		SaleConditions memory conditions = s_saleConditions[tokenId];

		if (!isTokenForSale(tokenId)) revert ArtDubai__TokenNotForSale();

		if (msg.value != conditions.weiTokenPrice * quantity) revert ArtDubai__WrongEtherAmmount();
		if (totalSupply(tokenId) + quantity > conditions.supplyLimit)
			revert ArtDubai__ExceedingMaxSupply();
		if (s_numberMinted[tokenId][mintTo] + quantity > conditions.maxTokensPerWallet)
			revert ArtDubai__ExceedingTokensPerWalletLimit();

		if (quantity > signaturePackage.maxQuantity) revert ArtDubai__ExceedingSignatureMaxQuantity();
		if (signaturePackage.signatureValidUntil < block.timestamp) revert ArtDubai__SignatureExpired();
		if (!_isCorrectMintOperationHash(signaturePackage, tokenId, mintTo))
			revert ArtDubai__HashComparisonFailed();
		if (!_isTrustedSigner(signaturePackage.hash, signaturePackage.signature))
			revert ArtDubai__UntrustedSigner();
		if (s_usedNonces[signaturePackage.nonce]) revert ArtDubai__SignatureAlreadyUsed();

		s_numberMinted[tokenId][mintTo] += quantity;
		s_usedNonces[signaturePackage.nonce] = true;

		_mint(mintTo, tokenId, quantity, "");
	}

	/**
	 * @dev Withdraw the balance of the contract.
	 *
	 * @param to The address to send the balance to.
	 */
	function withdraw(address payable to) external onlyOwner {
		uint256 balance = address(this).balance;
		if (balance == 0) revert ArtDubai__NothingToWithdraw();
		if (to == address(0)) revert ArtDubai__InvalidInput();

		to.transfer(balance);
	}

	/**
	 * @dev Set base URI for token metadata.
	 *
	 * @param baseUri The base URI for token metadata.
	 */
	function setBaseUri(string calldata baseUri) external onlyOwner {
		s_baseTokenUri = baseUri;
	}

	/**
	 * @dev Sets sale conditions for a set of tokens.
	 *
	 * @param tokenIds Token IDs
	 * @param saleConditions Sale conditions for each token
	 */
	function setSaleConditions(
		uint8[] calldata tokenIds,
		SaleConditions[] calldata saleConditions
	) external onlyOwner {
		if (tokenIds.length != saleConditions.length) revert ArtDubai__InvalidInput();

		for (uint8 i = 0; i < tokenIds.length; i++) {
			s_saleConditions[tokenIds[i]] = saleConditions[i];
		}
	}

	/**
	 * @dev Gets sale conditions for a token.
	 *
	 * @param tokenId Token ID
	 *
	 * @return conditions Sale conditions.
	 */
	function getSaleConditions(
		uint8 tokenId
	) external view returns (SaleConditions memory conditions) {
		conditions = s_saleConditions[tokenId];
	}

	/**
	 * @dev Get the number of tokens minted by a wallet.
	 *
	 * @param tokenId The id of the token.
	 * @param wallet The wallet to check.
	 *
	 * @return countMinted The number of tokens minted by the wallet.
	 */
	function getMintedCount(
		uint8 tokenId,
		address wallet
	) external view returns (uint16 countMinted) {
		countMinted = s_numberMinted[tokenId][wallet];
	}

	// Overrides for marketplace restrictions.
	function setApprovalForAll(
		address operator,
		bool approved
	) public override onlyAllowedOperatorApproval(operator) {
		super.setApprovalForAll(operator, approved);
	}

	function safeTransferFrom(
		address from,
		address to,
		uint256 tokenId,
		uint256 amount,
		bytes memory data
	) public override onlyAllowedOperator(from) {
		super.safeTransferFrom(from, to, tokenId, 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 Check, if a token is for sale.
	 *
	 * @param tokenId The id of the token.
	 *
	 * @return isForSale Whether the token is for sale.
	 */
	function isTokenForSale(uint8 tokenId) public view virtual returns (bool isForSale) {
		isForSale = s_saleConditions[tokenId].supplyLimit > 0;
	}

	/**
	 * @dev Get data used to generate the signature.
	 *
	 * @return hashSalt The hash salt.
	 * @return signerAddress The signer address.
	 */
	function getSignatureData() public view returns (bytes8 hashSalt, address signerAddress) {
		hashSalt = i_hashSalt;
		signerAddress = i_signerAddress;
	}

	/**
	 * @dev Get the URI for a token.
	 *
	 * @param tokenId The token ID.
	 *
	 * @return uri The URI for the token.
	 */
	function uri(uint256 tokenId) public view virtual override returns (string memory) {
		return string(abi.encodePacked(s_baseTokenUri, Strings.toString(tokenId)));
	}

	// Override for ERC1155Supply.
	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 Check whether a message hash is the one that has been signed.
	 *
	 * @param signaturePackage The signature package.
	 * @param tokenId The id of the token.
	 * @param mintTo The address to mint to.
	 *
	 * @return isCorrectMintOperationHash Whether the message hash matches the one that has been signed.
	 */
	function _isCorrectMintOperationHash(
		SignaturePackage calldata signaturePackage,
		uint8 tokenId,
		address mintTo
	) internal view returns (bool isCorrectMintOperationHash) {
		bytes memory message = abi.encodePacked(
			i_hashSalt,
			mintTo,
			uint64(block.chainid),
			tokenId,
			signaturePackage.maxQuantity,
			signaturePackage.signatureValidUntil,
			signaturePackage.nonce
		);
		bytes32 messageHash = keccak256(message);

		isCorrectMintOperationHash = messageHash == signaturePackage.hash;
	}

	/**
	 * @dev Check whether a message was signed by a trusted address.
	 *
	 * @param hash The hash of the message.
	 * @param signature The signature of the message.
	 *
	 * @return isTrustedSigner Whether the message was signed by a trusted address.
	 */
	function _isTrustedSigner(
		bytes32 hash,
		bytes memory signature
	) internal view returns (bool isTrustedSigner) {
		isTrustedSigner = i_signerAddress == ECDSA.recover(hash, signature);
	}
}

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

import {OperatorFilterer} from "./OperatorFilterer.sol";

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

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

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

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

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.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.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

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

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

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    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) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ArtDubai","name":"alexisCollection","type":"address"},{"internalType":"contract ArtDubai","name":"jasonCollection","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"enum ArtDubaiCart.CollectionName","name":"collectionName","type":"uint8"},{"indexed":true,"internalType":"uint8","name":"tokenId","type":"uint8"},{"indexed":false,"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"TokenMinted","type":"event"},{"inputs":[{"components":[{"components":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint32","name":"signatureValidUntil","type":"uint32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"uint16","name":"maxQuantity","type":"uint16"}],"internalType":"struct SignaturePackage","name":"signaturePackage","type":"tuple"},{"internalType":"uint8","name":"tokenId","type":"uint8"},{"internalType":"uint16","name":"quantity","type":"uint16"}],"internalType":"struct ArtDubaiCart.CartItem[]","name":"alexisCartItems","type":"tuple[]"},{"components":[{"components":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint32","name":"signatureValidUntil","type":"uint32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"uint16","name":"maxQuantity","type":"uint16"}],"internalType":"struct SignaturePackage","name":"signaturePackage","type":"tuple"},{"internalType":"uint8","name":"tokenId","type":"uint8"},{"internalType":"uint16","name":"quantity","type":"uint16"}],"internalType":"struct ArtDubaiCart.CartItem[]","name":"jasonCartItems","type":"tuple[]"},{"internalType":"address","name":"mintTo","type":"address"}],"name":"cartMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getCollectionAddresses","outputs":[{"internalType":"address","name":"alexisCollection","type":"address"},{"internalType":"address","name":"jasonCollection","type":"address"}],"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":"enum ArtDubaiCart.CollectionName","name":"collectionName","type":"uint8"},{"internalType":"contract ArtDubai","name":"collection","type":"address"}],"name":"setCollectionContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620018f2380380620018f28339818101604052810190620000379190620002a8565b620000576200004b6200015e60201b60201c565b6200016660201b60201c565b600180819055508160026000806001811115620000795762000078620002ef565b5b60018111156200008e576200008d620002ef565b5b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060026000600180811115620000f557620000f4620002ef565b5b60018111156200010a5762000109620002ef565b5b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506200031e565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200025c826200022f565b9050919050565b600062000270826200024f565b9050919050565b620002828162000263565b81146200028e57600080fd5b50565b600081519050620002a28162000277565b92915050565b60008060408385031215620002c257620002c16200022a565b5b6000620002d28582860162000291565b9250506020620002e58582860162000291565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6115c4806200032e6000396000f3fe6080604052600436106100555760003560e01c80631fe49ad11461005a5780632fa722e214610076578063328ac9651461009f578063715018a6146100cb5780638da5cb5b146100e2578063f2fde38b1461010d575b600080fd5b610074600480360381019061006f91906109cf565b610136565b005b34801561008257600080fd5b5061009d60048036038101906100989190610ac7565b6101be565b005b3480156100ab57600080fd5b506100b4610240565b6040516100c2929190610b16565b60405180910390f35b3480156100d757600080fd5b506100e06102fb565b005b3480156100ee57600080fd5b506100f761030f565b6040516101049190610b3f565b60405180910390f35b34801561011957600080fd5b50610134600480360381019061012f9190610b5a565b610338565b005b61013e6103bb565b61014b600086868461040a565b610158600184848461040a565b600047905060008111156101ae573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156101ac573d6000803e3d6000fd5b505b506101b761076a565b5050505050565b6101c6610773565b80600260008460018111156101de576101dd610b87565b5b60018111156101f0576101ef610b87565b5b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000806002600080600181111561025a57610259610b87565b5b600181111561026c5761026b610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600260006001808111156102b4576102b3610b87565b5b60018111156102c6576102c5610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690509091565b610303610773565b61030d60006107f1565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610340610773565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036103af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103a690610c39565b60405180910390fd5b6103b8816107f1565b50565b600260015403610400576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f790610ca5565b60405180910390fd5b6002600181905550565b60006002600086600181111561042357610422610b87565b5b600181111561043557610434610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060005b848490508160ff16101561076257600085858360ff1681811061048f5761048e610cc5565b5b90506020028101906104a19190610cf9565b6104aa906110b9565b905060008373ffffffffffffffffffffffffffffffffffffffff166314119bb783602001516040518263ffffffff1660e01b81526004016104eb91906110db565b606060405180830381865afa158015610508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c91906111a5565b905060008473ffffffffffffffffffffffffffffffffffffffff1663bd85b03984602001516040518263ffffffff1660e01b815260040161056d919061120d565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611228565b82600001516105bd9190611284565b905060008573ffffffffffffffffffffffffffffffffffffffff1663235f0e938560200151896040518363ffffffff1660e01b81526004016106009291906112ba565b602060405180830381865afa15801561061d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064191906112e3565b83602001516106509190611284565b90506000610663856040015184846108b5565b905060008161ffff16856040015161067b9190611310565b90508773ffffffffffffffffffffffffffffffffffffffff16634163933a8288600001518c8a60200151876040518663ffffffff1660e01b81526004016106c59493929190611492565b6000604051808303818588803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b5050505050856020015160ff168c600181111561071257610711610b87565b5b7f29ed64764aaf470d2b3accbb956eea3bfe9b8219751b6fafa16013721ef266088460405161074191906114de565b60405180910390a3505050505050808061075a906114f9565b915050610469565b505050505050565b60018081905550565b61077b6108f0565b73ffffffffffffffffffffffffffffffffffffffff1661079961030f565b73ffffffffffffffffffffffffffffffffffffffff16146107ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e69061156e565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008261ffff168461ffff16106108cc57826108ce565b835b90508161ffff168161ffff16106108e557816108e7565b805b90509392505050565b600033905090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126109315761093061090c565b5b8235905067ffffffffffffffff81111561094e5761094d610911565b5b60208301915083602082028301111561096a57610969610916565b5b9250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061099c82610971565b9050919050565b6109ac81610991565b81146109b757600080fd5b50565b6000813590506109c9816109a3565b92915050565b6000806000806000606086880312156109eb576109ea610902565b5b600086013567ffffffffffffffff811115610a0957610a08610907565b5b610a158882890161091b565b9550955050602086013567ffffffffffffffff811115610a3857610a37610907565b5b610a448882890161091b565b93509350506040610a57888289016109ba565b9150509295509295909350565b60028110610a7157600080fd5b50565b600081359050610a8381610a64565b92915050565b6000610a9482610991565b9050919050565b610aa481610a89565b8114610aaf57600080fd5b50565b600081359050610ac181610a9b565b92915050565b60008060408385031215610ade57610add610902565b5b6000610aec85828601610a74565b9250506020610afd85828601610ab2565b9150509250929050565b610b1081610991565b82525050565b6000604082019050610b2b6000830185610b07565b610b386020830184610b07565b9392505050565b6000602082019050610b546000830184610b07565b92915050565b600060208284031215610b7057610b6f610902565b5b6000610b7e848285016109ba565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610c23602683610bb6565b9150610c2e82610bc7565b604082019050919050565b60006020820190508181036000830152610c5281610c16565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000610c8f601f83610bb6565b9150610c9a82610c59565b602082019050919050565b60006020820190508181036000830152610cbe81610c82565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600082356001606003833603038112610d1557610d14610cf4565b5b80830191505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610d26565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da16108f8565b9050610dad8282610d66565b919050565b600080fd5b6000819050919050565b610dca81610db7565b8114610dd557600080fd5b50565b600081359050610de781610dc1565b92915050565b600080fd5b600067ffffffffffffffff821115610e0d57610e0c610d37565b5b610e1682610d26565b9050602081019050919050565b82818337600083830152505050565b6000610e45610e4084610df2565b610d97565b905082815260208101848484011115610e6157610e60610ded565b5b610e6c848285610e23565b509392505050565b600082601f830112610e8957610e8861090c565b5b8135610e99848260208601610e32565b91505092915050565b600063ffffffff82169050919050565b610ebb81610ea2565b8114610ec657600080fd5b50565b600081359050610ed881610eb2565b92915050565b600067ffffffffffffffff82169050919050565b610efb81610ede565b8114610f0657600080fd5b50565b600081359050610f1881610ef2565b92915050565b600061ffff82169050919050565b610f3581610f1e565b8114610f4057600080fd5b50565b600081359050610f5281610f2c565b92915050565b600060a08284031215610f6e57610f6d610d21565b5b610f7860a0610d97565b90506000610f8884828501610dd8565b600083015250602082013567ffffffffffffffff811115610fac57610fab610db2565b5b610fb884828501610e74565b6020830152506040610fcc84828501610ec9565b6040830152506060610fe084828501610f09565b6060830152506080610ff484828501610f43565b60808301525092915050565b600060ff82169050919050565b61101681611000565b811461102157600080fd5b50565b6000813590506110338161100d565b92915050565b60006060828403121561104f5761104e610d21565b5b6110596060610d97565b9050600082013567ffffffffffffffff81111561107957611078610db2565b5b61108584828501610f58565b600083015250602061109984828501611024565b60208301525060406110ad84828501610f43565b60408301525092915050565b60006110c53683611039565b9050919050565b6110d581611000565b82525050565b60006020820190506110f060008301846110cc565b92915050565b60008151905061110581610f2c565b92915050565b6000819050919050565b61111e8161110b565b811461112957600080fd5b50565b60008151905061113b81611115565b92915050565b60006060828403121561115757611156610d21565b5b6111616060610d97565b90506000611171848285016110f6565b6000830152506020611185848285016110f6565b60208301525060406111998482850161112c565b60408301525092915050565b6000606082840312156111bb576111ba610902565b5b60006111c984828501611141565b91505092915050565b6000819050919050565b60006111f76111f26111ed84611000565b6111d2565b61110b565b9050919050565b611207816111dc565b82525050565b600060208201905061122260008301846111fe565b92915050565b60006020828403121561123e5761123d610902565b5b600061124c8482850161112c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061128f82610f1e565b915061129a83610f1e565b9250828203905061ffff8111156112b4576112b3611255565b5b92915050565b60006040820190506112cf60008301856110cc565b6112dc6020830184610b07565b9392505050565b6000602082840312156112f9576112f8610902565b5b6000611307848285016110f6565b91505092915050565b600061131b8261110b565b91506113268361110b565b92508282026113348161110b565b9150828204841483151761134b5761134a611255565b5b5092915050565b61135b81610db7565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561139b578082015181840152602081019050611380565b60008484015250505050565b60006113b282611361565b6113bc818561136c565b93506113cc81856020860161137d565b6113d581610d26565b840191505092915050565b6113e981610ea2565b82525050565b6113f881610ede565b82525050565b61140781610f1e565b82525050565b600060a0830160008301516114256000860182611352565b506020830151848203602086015261143d82826113a7565b915050604083015161145260408601826113e0565b50606083015161146560608601826113ef565b50608083015161147860808601826113fe565b508091505092915050565b61148c81610f1e565b82525050565b600060808201905081810360008301526114ac818761140d565b90506114bb6020830186610b07565b6114c860408301856110cc565b6114d56060830184611483565b95945050505050565b60006020820190506114f36000830184611483565b92915050565b600061150482611000565b915060ff820361151757611516611255565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611558602083610bb6565b915061156382611522565b602082019050919050565b600060208201905081810360008301526115878161154b565b905091905056fea264697066735822122015ec2fb317c3265c0db15395971541ff92125626f75362eb9145196b5dce89e064736f6c634300081100330000000000000000000000004721dfe67fe46381e2e56eb1e0406e0989bd7b8e000000000000000000000000fb01fdc74a1ce44a1e968d2784b935664f2a503f

Deployed Bytecode

0x6080604052600436106100555760003560e01c80631fe49ad11461005a5780632fa722e214610076578063328ac9651461009f578063715018a6146100cb5780638da5cb5b146100e2578063f2fde38b1461010d575b600080fd5b610074600480360381019061006f91906109cf565b610136565b005b34801561008257600080fd5b5061009d60048036038101906100989190610ac7565b6101be565b005b3480156100ab57600080fd5b506100b4610240565b6040516100c2929190610b16565b60405180910390f35b3480156100d757600080fd5b506100e06102fb565b005b3480156100ee57600080fd5b506100f761030f565b6040516101049190610b3f565b60405180910390f35b34801561011957600080fd5b50610134600480360381019061012f9190610b5a565b610338565b005b61013e6103bb565b61014b600086868461040a565b610158600184848461040a565b600047905060008111156101ae573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156101ac573d6000803e3d6000fd5b505b506101b761076a565b5050505050565b6101c6610773565b80600260008460018111156101de576101dd610b87565b5b60018111156101f0576101ef610b87565b5b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000806002600080600181111561025a57610259610b87565b5b600181111561026c5761026b610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600260006001808111156102b4576102b3610b87565b5b60018111156102c6576102c5610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690509091565b610303610773565b61030d60006107f1565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610340610773565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036103af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103a690610c39565b60405180910390fd5b6103b8816107f1565b50565b600260015403610400576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f790610ca5565b60405180910390fd5b6002600181905550565b60006002600086600181111561042357610422610b87565b5b600181111561043557610434610b87565b5b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060005b848490508160ff16101561076257600085858360ff1681811061048f5761048e610cc5565b5b90506020028101906104a19190610cf9565b6104aa906110b9565b905060008373ffffffffffffffffffffffffffffffffffffffff166314119bb783602001516040518263ffffffff1660e01b81526004016104eb91906110db565b606060405180830381865afa158015610508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c91906111a5565b905060008473ffffffffffffffffffffffffffffffffffffffff1663bd85b03984602001516040518263ffffffff1660e01b815260040161056d919061120d565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611228565b82600001516105bd9190611284565b905060008573ffffffffffffffffffffffffffffffffffffffff1663235f0e938560200151896040518363ffffffff1660e01b81526004016106009291906112ba565b602060405180830381865afa15801561061d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064191906112e3565b83602001516106509190611284565b90506000610663856040015184846108b5565b905060008161ffff16856040015161067b9190611310565b90508773ffffffffffffffffffffffffffffffffffffffff16634163933a8288600001518c8a60200151876040518663ffffffff1660e01b81526004016106c59493929190611492565b6000604051808303818588803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b5050505050856020015160ff168c600181111561071257610711610b87565b5b7f29ed64764aaf470d2b3accbb956eea3bfe9b8219751b6fafa16013721ef266088460405161074191906114de565b60405180910390a3505050505050808061075a906114f9565b915050610469565b505050505050565b60018081905550565b61077b6108f0565b73ffffffffffffffffffffffffffffffffffffffff1661079961030f565b73ffffffffffffffffffffffffffffffffffffffff16146107ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e69061156e565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008261ffff168461ffff16106108cc57826108ce565b835b90508161ffff168161ffff16106108e557816108e7565b805b90509392505050565b600033905090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126109315761093061090c565b5b8235905067ffffffffffffffff81111561094e5761094d610911565b5b60208301915083602082028301111561096a57610969610916565b5b9250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061099c82610971565b9050919050565b6109ac81610991565b81146109b757600080fd5b50565b6000813590506109c9816109a3565b92915050565b6000806000806000606086880312156109eb576109ea610902565b5b600086013567ffffffffffffffff811115610a0957610a08610907565b5b610a158882890161091b565b9550955050602086013567ffffffffffffffff811115610a3857610a37610907565b5b610a448882890161091b565b93509350506040610a57888289016109ba565b9150509295509295909350565b60028110610a7157600080fd5b50565b600081359050610a8381610a64565b92915050565b6000610a9482610991565b9050919050565b610aa481610a89565b8114610aaf57600080fd5b50565b600081359050610ac181610a9b565b92915050565b60008060408385031215610ade57610add610902565b5b6000610aec85828601610a74565b9250506020610afd85828601610ab2565b9150509250929050565b610b1081610991565b82525050565b6000604082019050610b2b6000830185610b07565b610b386020830184610b07565b9392505050565b6000602082019050610b546000830184610b07565b92915050565b600060208284031215610b7057610b6f610902565b5b6000610b7e848285016109ba565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610c23602683610bb6565b9150610c2e82610bc7565b604082019050919050565b60006020820190508181036000830152610c5281610c16565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000610c8f601f83610bb6565b9150610c9a82610c59565b602082019050919050565b60006020820190508181036000830152610cbe81610c82565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600082356001606003833603038112610d1557610d14610cf4565b5b80830191505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610d26565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da16108f8565b9050610dad8282610d66565b919050565b600080fd5b6000819050919050565b610dca81610db7565b8114610dd557600080fd5b50565b600081359050610de781610dc1565b92915050565b600080fd5b600067ffffffffffffffff821115610e0d57610e0c610d37565b5b610e1682610d26565b9050602081019050919050565b82818337600083830152505050565b6000610e45610e4084610df2565b610d97565b905082815260208101848484011115610e6157610e60610ded565b5b610e6c848285610e23565b509392505050565b600082601f830112610e8957610e8861090c565b5b8135610e99848260208601610e32565b91505092915050565b600063ffffffff82169050919050565b610ebb81610ea2565b8114610ec657600080fd5b50565b600081359050610ed881610eb2565b92915050565b600067ffffffffffffffff82169050919050565b610efb81610ede565b8114610f0657600080fd5b50565b600081359050610f1881610ef2565b92915050565b600061ffff82169050919050565b610f3581610f1e565b8114610f4057600080fd5b50565b600081359050610f5281610f2c565b92915050565b600060a08284031215610f6e57610f6d610d21565b5b610f7860a0610d97565b90506000610f8884828501610dd8565b600083015250602082013567ffffffffffffffff811115610fac57610fab610db2565b5b610fb884828501610e74565b6020830152506040610fcc84828501610ec9565b6040830152506060610fe084828501610f09565b6060830152506080610ff484828501610f43565b60808301525092915050565b600060ff82169050919050565b61101681611000565b811461102157600080fd5b50565b6000813590506110338161100d565b92915050565b60006060828403121561104f5761104e610d21565b5b6110596060610d97565b9050600082013567ffffffffffffffff81111561107957611078610db2565b5b61108584828501610f58565b600083015250602061109984828501611024565b60208301525060406110ad84828501610f43565b60408301525092915050565b60006110c53683611039565b9050919050565b6110d581611000565b82525050565b60006020820190506110f060008301846110cc565b92915050565b60008151905061110581610f2c565b92915050565b6000819050919050565b61111e8161110b565b811461112957600080fd5b50565b60008151905061113b81611115565b92915050565b60006060828403121561115757611156610d21565b5b6111616060610d97565b90506000611171848285016110f6565b6000830152506020611185848285016110f6565b60208301525060406111998482850161112c565b60408301525092915050565b6000606082840312156111bb576111ba610902565b5b60006111c984828501611141565b91505092915050565b6000819050919050565b60006111f76111f26111ed84611000565b6111d2565b61110b565b9050919050565b611207816111dc565b82525050565b600060208201905061122260008301846111fe565b92915050565b60006020828403121561123e5761123d610902565b5b600061124c8482850161112c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061128f82610f1e565b915061129a83610f1e565b9250828203905061ffff8111156112b4576112b3611255565b5b92915050565b60006040820190506112cf60008301856110cc565b6112dc6020830184610b07565b9392505050565b6000602082840312156112f9576112f8610902565b5b6000611307848285016110f6565b91505092915050565b600061131b8261110b565b91506113268361110b565b92508282026113348161110b565b9150828204841483151761134b5761134a611255565b5b5092915050565b61135b81610db7565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561139b578082015181840152602081019050611380565b60008484015250505050565b60006113b282611361565b6113bc818561136c565b93506113cc81856020860161137d565b6113d581610d26565b840191505092915050565b6113e981610ea2565b82525050565b6113f881610ede565b82525050565b61140781610f1e565b82525050565b600060a0830160008301516114256000860182611352565b506020830151848203602086015261143d82826113a7565b915050604083015161145260408601826113e0565b50606083015161146560608601826113ef565b50608083015161147860808601826113fe565b508091505092915050565b61148c81610f1e565b82525050565b600060808201905081810360008301526114ac818761140d565b90506114bb6020830186610b07565b6114c860408301856110cc565b6114d56060830184611483565b95945050505050565b60006020820190506114f36000830184611483565b92915050565b600061150482611000565b915060ff820361151757611516611255565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611558602083610bb6565b915061156382611522565b602082019050919050565b600060208201905081810360008301526115878161154b565b905091905056fea264697066735822122015ec2fb317c3265c0db15395971541ff92125626f75362eb9145196b5dce89e064736f6c63430008110033

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

0000000000000000000000004721dfe67fe46381e2e56eb1e0406e0989bd7b8e000000000000000000000000fb01fdc74a1ce44a1e968d2784b935664f2a503f

-----Decoded View---------------
Arg [0] : alexisCollection (address): 0x4721dfE67FE46381e2E56eb1e0406e0989BD7b8E
Arg [1] : jasonCollection (address): 0xfb01FDC74A1Ce44a1e968d2784b935664F2A503F

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004721dfe67fe46381e2e56eb1e0406e0989bd7b8e
Arg [1] : 000000000000000000000000fb01fdc74a1ce44a1e968d2784b935664f2a503f


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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