ETH Price: $3,102.46 (-5.99%)
 

Overview

Max Total Supply

100 PTRD

Holders

66

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
admiral.savedsouls.eth
0x261F436676cFA456a8F086a850160E97550AEA9C
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
Portrade

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 18 : Portrade.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";
import "openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol";
import "openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-contracts/contracts/utils/Strings.sol";
import "openzeppelin-contracts/contracts/utils/Arrays.sol";

contract Portrade is ERC1155, Ownable, ReentrancyGuard {
    using ECDSA for bytes32;
    using MessageHashUtils for bytes32;
    using Strings for uint256;
    using Arrays for uint256[];

    uint256 public ethPrice;

    uint256 private _collectionSupply;
    mapping(uint256 id => uint256 quantity) public tokenSupply;
    mapping(address owner => uint256 count) public totalBalances;

    uint256 public constant MAX_SUPPLY = 100;
    uint256 public constant MAX_INVENTORY = 367;
    uint256 public constant MINT_LIMIT = 3;

    uint256 private constant TOKEN_STOCK_4_ID = 33;
    uint256 private constant TOKEN_STOCK_5_ID = 49;

    address private _signerAddress;

    string public name;
    string public symbol;
    bool public isPaused;
    bool public isPublicMint;
    bool public isGuaranteedMint;

    constructor(
        address signerAddress
    )
        ERC1155(
            "https://storage.googleapis.com/portrade/portrade-1_0/metadata/"
        )
        Ownable(msg.sender)
    {
        _signerAddress = signerAddress;
        name = "Portrade 1.0";
        symbol = "PTRD";
        ethPrice = 0.3 ether;
        isPaused = true;
        isPublicMint = false;
        isGuaranteedMint = true;
    }

    modifier checkIsPaused() {
        require(!isPaused, "Portrade is currently locked.");
        _;
    }

    modifier checkIsPublicMint() {
        require(isPublicMint, "Public mint is not enabled.");
        _;
    }

    //decode signature to get the id of the token
    function _verify(
        bytes memory signature,
        uint256 id
    ) internal view returns (bool) {
        bytes32 message = keccak256(abi.encodePacked(msg.sender, id));
        return
            message.toEthSignedMessageHash().recover(signature) ==
            _signerAddress;
    }

    function uri(uint256 id) public view override returns (string memory) {
        require(id >= 0 && id < MAX_SUPPLY, "Invalid Id");
        string memory baseUri = super.uri(id);
        return
            bytes(baseUri).length > 0
                ? string(abi.encodePacked(baseUri, id.toString(), ".json"))
                : "";
    }

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

    function setEthPrice(uint256 newPrice) external onlyOwner {
        ethPrice = newPrice;
    }

    function flipPause() external onlyOwner {
        isPaused = !isPaused;
    }

    function flipPublicMint() external onlyOwner {
        isPublicMint = !isPublicMint;
    }

    function flipGuaranteeMint() external onlyOwner {
        isGuaranteedMint = !isGuaranteedMint;
    }

    function setSignerAddress(address signerAddress) external onlyOwner {
        _signerAddress = signerAddress;
    }

    function collectionSupply() external view returns (uint256) {
        return _collectionSupply;
    }

    function isAvailable(uint256 id) external view returns (bool) {
        require(id >= 0 && id < MAX_SUPPLY, "Invalid ID");
        if (id <= TOKEN_STOCK_4_ID) {
            return tokenSupply[id] < 4;
        } else if (id <= TOKEN_STOCK_5_ID) {
            return tokenSupply[id] < 5;
        } else {
            return tokenSupply[id] < 3;
        }
    }

    function isSoldOut() external view returns (bool) {
        return _collectionSupply >= MAX_SUPPLY;
    }

    function mint(
        bytes memory signature,
        uint256 id
    ) external payable checkIsPaused nonReentrant {
        require(id >= 0 && id < MAX_SUPPLY, "Invalid ID");
        require(_verify(signature, id), "Invalid Signature");
        require(totalBalances[msg.sender] < MINT_LIMIT, "Max 3 per owner");
        require(_collectionSupply < MAX_SUPPLY, "Sold Out");
        if (id <= TOKEN_STOCK_4_ID) {
            require(tokenSupply[id] < 4, "Sold Out");
        } else if (id <= TOKEN_STOCK_5_ID) {
            require(tokenSupply[id] < 5, "Sold Out");
        } else {
            require(tokenSupply[id] < 3, "Sold Out");
        }
        require(msg.value >= ethPrice, "Not enough ETH");

        uint256 amount = 1;
        tokenSupply[id] += amount;
        _collectionSupply += amount;
        _mint(msg.sender, id, amount, "");
    }

    function mintPublic(
        uint256 id
    ) external payable checkIsPaused checkIsPublicMint nonReentrant {
        require(id >= 0 && id < MAX_SUPPLY, "Invalid ID");
        require(totalBalances[msg.sender] < MINT_LIMIT, "Max 3 per owner");
        require(_collectionSupply < MAX_SUPPLY, "Sold Out");
        if (id <= TOKEN_STOCK_4_ID) {
            require(tokenSupply[id] < 4, "Sold Out");
        } else if (id <= TOKEN_STOCK_5_ID) {
            require(tokenSupply[id] < 5, "Sold Out");
        } else {
            require(tokenSupply[id] < 3, "Sold Out");
        }
        require(msg.value >= ethPrice, "Not enough ETH");

        uint256 amount = 1;
        tokenSupply[id] += amount;
        // totalBalances[msg.sender] += amount;
        _collectionSupply += amount;
        _mint(msg.sender, id, amount, "");
    }

    function _update(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values
    ) internal virtual override {
        super._update(from, to, ids, values);
        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 value = values.unsafeMemoryAccess(i);

            if (from != address(0)) {
                totalBalances[from] -= value;
            }

            if (to != address(0)) {
                totalBalances[to] += value;
            }
        }
    }

    function withdrawFunding() external onlyOwner {
        uint256 currentBalance = address(this).balance;
        (bool sent, ) = address(msg.sender).call{value: currentBalance}("");
        require(sent, "Error while transferring balance");
    }
}

File 2 of 18 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.20;

import {IERC1155} from "./IERC1155.sol";
import {IERC1155Receiver} from "./IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol";
import {Context} from "../../utils/Context.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {Arrays} from "../../utils/Arrays.sol";
import {IERC1155Errors} from "../../interfaces/draft-IERC6093.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
 */
abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors {
    using Arrays for uint256[];
    using Arrays for address[];

    mapping(uint256 id => mapping(address account => uint256)) private _balances;

    mapping(address account => mapping(address operator => 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 /* id */) public view virtual returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     */
    function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
        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 returns (uint256[] memory) {
        if (accounts.length != ids.length) {
            revert ERC1155InvalidArrayLength(ids.length, accounts.length);
        }

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

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

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
        address sender = _msgSender();
        if (from != sender && !isApprovedForAll(from, sender)) {
            revert ERC1155MissingApprovalForAll(sender, from);
        }
        _safeTransferFrom(from, to, id, value, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) public virtual {
        address sender = _msgSender();
        if (from != sender && !isApprovedForAll(from, sender)) {
            revert ERC1155MissingApprovalForAll(sender, from);
        }
        _safeBatchTransferFrom(from, to, ids, values, data);
    }

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
     * (or `to`) is the zero address.
     *
     * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
     *   or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
     * - `ids` and `values` must have the same length.
     *
     * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
     */
    function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
        if (ids.length != values.length) {
            revert ERC1155InvalidArrayLength(ids.length, values.length);
        }

        address operator = _msgSender();

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids.unsafeMemoryAccess(i);
            uint256 value = values.unsafeMemoryAccess(i);

            if (from != address(0)) {
                uint256 fromBalance = _balances[id][from];
                if (fromBalance < value) {
                    revert ERC1155InsufficientBalance(from, fromBalance, value, id);
                }
                unchecked {
                    // Overflow not possible: value <= fromBalance
                    _balances[id][from] = fromBalance - value;
                }
            }

            if (to != address(0)) {
                _balances[id][to] += value;
            }
        }

        if (ids.length == 1) {
            uint256 id = ids.unsafeMemoryAccess(0);
            uint256 value = values.unsafeMemoryAccess(0);
            emit TransferSingle(operator, from, to, id, value);
        } else {
            emit TransferBatch(operator, from, to, ids, values);
        }
    }

    /**
     * @dev Version of {_update} that performs the token acceptance check by calling
     * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
     * contains code (eg. is a smart contract at the moment of execution).
     *
     * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
     * update to the contract state after this function would break the check-effect-interaction pattern. Consider
     * overriding {_update} instead.
     */
    function _updateWithAcceptanceCheck(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) internal virtual {
        _update(from, to, ids, values);
        if (to != address(0)) {
            address operator = _msgSender();
            if (ids.length == 1) {
                uint256 id = ids.unsafeMemoryAccess(0);
                uint256 value = values.unsafeMemoryAccess(0);
                _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
            } else {
                _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
            }
        }
    }

    /**
     * @dev Transfers a `value` 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 `value` 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 value, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(from, to, ids, values, 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.
     * - `ids` and `values` must have the same length.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        _updateWithAcceptanceCheck(from, to, ids, values, 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 values 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 a `value` amount of tokens of 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 value, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(address(0), to, ids, values, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - `to` cannot be the zero address.
     * - 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 values, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        _updateWithAcceptanceCheck(address(0), to, ids, values, data);
    }

    /**
     * @dev Destroys a `value` amount of tokens of type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `value` amount of tokens of type `id`.
     */
    function _burn(address from, uint256 id, uint256 value) internal {
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(from, address(0), ids, values, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `value` amount of tokens of type `id`.
     * - `ids` and `values` must have the same length.
     */
    function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        _updateWithAcceptanceCheck(from, address(0), ids, values, "");
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the zero address.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC1155InvalidOperator(address(0));
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
     * if it contains code at the moment of execution.
     */
    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 value,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    // Tokens rejected
                    revert ERC1155InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    // non-ERC1155Receiver implementer
                    revert ERC1155InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }

    /**
     * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
     * if it contains code at the moment of execution.
     */
    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    // Tokens rejected
                    revert ERC1155InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    // non-ERC1155Receiver implementer
                    revert ERC1155InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }

    /**
     * @dev Creates an array in memory with only one value for each of the elements provided.
     */
    function _asSingletonArrays(
        uint256 element1,
        uint256 element2
    ) private pure returns (uint256[] memory array1, uint256[] memory array2) {
        /// @solidity memory-safe-assembly
        assembly {
            // Load the free memory pointer
            array1 := mload(0x40)
            // Set array length to 1
            mstore(array1, 1)
            // Store the single element at the next word after the length (where content starts)
            mstore(add(array1, 0x20), element1)

            // Repeat for next array locating it right after the first array
            array2 := add(array1, 0x40)
            mstore(array2, 1)
            mstore(add(array2, 0x20), element2)

            // Update the free memory pointer by pointing after the second array
            mstore(0x40, add(array2, 0x40))
        }
    }
}

File 3 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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 4 of 18 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
        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, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        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]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            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.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError, bytes32) {
        // 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, s);
        }

        // 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, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

File 5 of 18 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 6 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

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

File 7 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @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), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

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

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        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] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

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

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

File 8 of 18 : Arrays.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol)

pragma solidity ^0.8.20;

import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";

/**
 * @dev Collection of functions related to array types.
 */
library Arrays {
    using StorageSlot for bytes32;

    /**
     * @dev Searches a sorted `array` and returns the first index that contains
     * a value greater or equal to `element`. If no such index exists (i.e. all
     * values in the array are strictly less than `element`), the array length is
     * returned. Time complexity O(log n).
     *
     * `array` is expected to be sorted in ascending order, and to contain no
     * repeated elements.
     */
    function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
        uint256 low = 0;
        uint256 high = array.length;

        if (high == 0) {
            return 0;
        }

        while (low < high) {
            uint256 mid = Math.average(low, high);

            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)
            // because Math.average rounds towards zero (it does integer division with truncation).
            if (unsafeAccess(array, mid).value > element) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }

        // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
        if (low > 0 && unsafeAccess(array, low - 1).value == element) {
            return low - 1;
        } else {
            return low;
        }
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getAddressSlot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getBytes32Slot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getUint256Slot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
        assembly {
            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
        }
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
        assembly {
            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
        }
    }
}

File 9 of 18 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * 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 `value` 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 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` 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 values,
        bytes calldata data
    ) external;
}

File 10 of 18 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Interface that must be implemented by smart contracts in order to receive
 * ERC-1155 token transfers.
 */
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 11 of 18 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 */
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 12 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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 13 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 14 of 18 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 15 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

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

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 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.

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

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

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

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 16 of 18 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

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

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

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

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

File 17 of 18 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 18 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"signerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"MAX_INVENTORY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipGuaranteeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGuaranteedMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSoldOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setEthPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signerAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenSupply","outputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"totalBalances","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFunding","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620029603803806200296083398101604081905262000034916200019c565b336040518060600160405280603e815260200162002922603e91396200005a8162000138565b506001600160a01b0381166200008a57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b62000095816200014a565b506001600455600980546001600160a01b0319166001600160a01b03831617905560408051808201909152600c81526b0506f72747261646520312e360a41b6020820152600a90620000e8908262000275565b506040805180820190915260048152631415149160e21b6020820152600b9062000113908262000275565b5050670429d069189e0000600555600c805462ffffff19166201000117905562000341565b600262000146828262000275565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208284031215620001af57600080fd5b81516001600160a01b0381168114620001c757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001f957607f821691505b6020821081036200021a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000270576000816000526020600020601f850160051c810160208610156200024b5750805b601f850160051c820191505b818110156200026c5782815560010162000257565b5050505b505050565b81516001600160401b03811115620002915762000291620001ce565b620002a981620002a28454620001e4565b8462000220565b602080601f831160018114620002e15760008415620002c85750858301515b600019600386901b1c1916600185901b1785556200026c565b600085815260208120601f198616915b828110156200031257888601518255948401946001909101908401620002f1565b5085821015620003315787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6125d180620003516000396000f3fe6080604052600436106101f65760003560e01c80633a178d991161010d578063aee9c872116100a0578063e985e9c51161006f578063e985e9c514610569578063efd0cbf914610589578063f242432a1461059c578063f2fde38b146105bc578063ff186b2e146105dc57600080fd5b8063aee9c872146104ec578063b187bd2614610519578063b416d46e14610533578063e92dd0761461054957600080fd5b80638da5cb5b116100dc5780638da5cb5b1461047a57806395d89b41146104a2578063a22cb465146104b7578063a88af1d3146104d757600080fd5b80633a178d99146104035780634e1273f4146104235780636ab9208614610450578063715018a61461046557600080fd5b806306fdde03116101905780632eb2c2d61161015f5780632eb2c2d6146103855780633057931f146103a557806330b9af98146103c457806332cb6b0c146103d9578063385df649146103ee57600080fd5b806306fdde03146102fd5780630e89341c1461031f5780632693ebf21461033f5780632da5ea171461036c57600080fd5b806302775240116101cc578063027752401461029357806302fe5305146102a8578063046dc166146102c8578063049da9e8146102e857600080fd5b8062257612146101fb5780629f926214610210578062fdd58e1461023057806301ffc9a714610263575b600080fd5b61020e610209366004611db8565b6105f2565b005b34801561021c57600080fd5b5061020e61022b366004611dfd565b61087c565b34801561023c57600080fd5b5061025061024b366004611e2d565b610889565b6040519081526020015b60405180910390f35b34801561026f57600080fd5b5061028361027e366004611e6d565b6108b1565b604051901515815260200161025a565b34801561029f57600080fd5b50610250600381565b3480156102b457600080fd5b5061020e6102c3366004611e8a565b610901565b3480156102d457600080fd5b5061020e6102e3366004611edb565b610915565b3480156102f457600080fd5b5061020e61093f565b34801561030957600080fd5b50610312610966565b60405161025a9190611f46565b34801561032b57600080fd5b5061031261033a366004611dfd565b6109f4565b34801561034b57600080fd5b5061025061035a366004611dfd565b60076020526000908152604090205481565b34801561037857600080fd5b5060065460641115610283565b34801561039157600080fd5b5061020e6103a0366004611fec565b610a90565b3480156103b157600080fd5b50600c5461028390610100900460ff1681565b3480156103d057600080fd5b5061020e610af7565b3480156103e557600080fd5b50610250606481565b3480156103fa57600080fd5b5061020e610b99565b34801561040f57600080fd5b5061028361041e366004611dfd565b610bb5565b34801561042f57600080fd5b5061044361043e366004612096565b610c2e565b60405161025a9190612192565b34801561045c57600080fd5b50600654610250565b34801561047157600080fd5b5061020e610cfb565b34801561048657600080fd5b506003546040516001600160a01b03909116815260200161025a565b3480156104ae57600080fd5b50610312610d0f565b3480156104c357600080fd5b5061020e6104d23660046121a5565b610d1c565b3480156104e357600080fd5b5061020e610d27565b3480156104f857600080fd5b50610250610507366004611edb565b60086020526000908152604090205481565b34801561052557600080fd5b50600c546102839060ff1681565b34801561053f57600080fd5b5061025061016f81565b34801561055557600080fd5b50600c546102839062010000900460ff1681565b34801561057557600080fd5b506102836105843660046121e1565b610d4c565b61020e610597366004611dfd565b610d7a565b3480156105a857600080fd5b5061020e6105b7366004612214565b611008565b3480156105c857600080fd5b5061020e6105d7366004611edb565b611067565b3480156105e857600080fd5b5061025060055481565b600c5460ff161561064a5760405162461bcd60e51b815260206004820152601d60248201527f506f7274726164652069732063757272656e746c79206c6f636b65642e00000060448201526064015b60405180910390fd5b6106526110a2565b606481106106725760405162461bcd60e51b815260040161064190612279565b61067c82826110cc565b6106bc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610641565b3360009081526008602052604090205460031161070d5760405162461bcd60e51b815260206004820152600f60248201526e26b0bc1019903832b91037bbb732b960891b6044820152606401610641565b60646006541061072f5760405162461bcd60e51b81526004016106419061229d565b6021811161076a576000818152600760205260409020546004116107655760405162461bcd60e51b81526004016106419061229d565b6107ce565b603181116107a0576000818152600760205260409020546005116107655760405162461bcd60e51b81526004016106419061229d565b6000818152600760205260409020546003116107ce5760405162461bcd60e51b81526004016106419061229d565b6005543410156108115760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610641565b600081815260076020526040812080546001928392916108329084906122d5565b92505081905550806006600082825461084b91906122d5565b9250508190555061086d33838360405180602001604052806000815250611170565b506108786001600455565b5050565b6108846111cd565b600555565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806108e257506001600160e01b031982166303a24d0760e21b145b806108ab57506301ffc9a760e01b6001600160e01b03198316146108ab565b6109096111cd565b610912816111fa565b50565b61091d6111cd565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6109476111cd565b600c805462ff0000198116620100009182900460ff1615909102179055565b600a8054610973906122e8565b80601f016020809104026020016040519081016040528092919081815260200182805461099f906122e8565b80156109ec5780601f106109c1576101008083540402835291602001916109ec565b820191906000526020600020905b8154815290600101906020018083116109cf57829003601f168201915b505050505081565b606060648210610a335760405162461bcd60e51b815260206004820152600a602482015269125b9d985b1a5908125960b21b6044820152606401610641565b6000610a3e83611206565b90506000815111610a5e5760405180602001604052806000815250610a89565b80610a688461129a565b604051602001610a79929190612322565b6040516020818303038152906040525b9392505050565b336001600160a01b0386168114801590610ab15750610aaf8682610d4c565b155b15610ae25760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610641565b610aef868686868661132d565b505050505050565b610aff6111cd565b6040514790600090339083908381818185875af1925050503d8060008114610b43576040519150601f19603f3d011682016040523d82523d6000602084013e610b48565b606091505b50509050806108785760405162461bcd60e51b815260206004820181905260248201527f4572726f72207768696c65207472616e7366657272696e672062616c616e63656044820152606401610641565b610ba16111cd565b600c805460ff19811660ff90911615179055565b600060648210610bd75760405162461bcd60e51b815260040161064190612279565b60218211610bf5575060009081526007602052604090205460041190565b60318211610c13575060009081526007602052604090205460051190565b5060009081526007602052604090205460031190565b919050565b60608151835114610c5f5781518351604051635b05999160e01b815260048101929092526024820152604401610641565b6000835167ffffffffffffffff811115610c7b57610c7b611cf9565b604051908082528060200260200182016040528015610ca4578160200160208202803683370190505b50905060005b8451811015610cf357602080820286010151610cce90602080840287010151610889565b828281518110610ce057610ce0612361565b6020908102919091010152600101610caa565b509392505050565b610d036111cd565b610d0d6000611394565b565b600b8054610973906122e8565b6108783383836113e6565b610d2f6111cd565b600c805461ff001981166101009182900460ff1615909102179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b600c5460ff1615610dcd5760405162461bcd60e51b815260206004820152601d60248201527f506f7274726164652069732063757272656e746c79206c6f636b65642e0000006044820152606401610641565b600c54610100900460ff16610e245760405162461bcd60e51b815260206004820152601b60248201527f5075626c6963206d696e74206973206e6f7420656e61626c65642e00000000006044820152606401610641565b610e2c6110a2565b60648110610e4c5760405162461bcd60e51b815260040161064190612279565b33600090815260086020526040902054600311610e9d5760405162461bcd60e51b815260206004820152600f60248201526e26b0bc1019903832b91037bbb732b960891b6044820152606401610641565b606460065410610ebf5760405162461bcd60e51b81526004016106419061229d565b60218111610efa57600081815260076020526040902054600411610ef55760405162461bcd60e51b81526004016106419061229d565b610f5e565b60318111610f3057600081815260076020526040902054600511610ef55760405162461bcd60e51b81526004016106419061229d565b600081815260076020526040902054600311610f5e5760405162461bcd60e51b81526004016106419061229d565b600554341015610fa15760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610641565b60008181526007602052604081208054600192839291610fc29084906122d5565b925050819055508060066000828254610fdb91906122d5565b92505081905550610ffd33838360405180602001604052806000815250611170565b506109126001600455565b336001600160a01b038616811480159061102957506110278682610d4c565b155b1561105a5760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610641565b610aef868686868661147c565b61106f6111cd565b6001600160a01b03811661109957604051631e4fbdf760e01b815260006004820152602401610641565b61091281611394565b6002600454036110c557604051633ee5aeb560e01b815260040160405180910390fd5b6002600455565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052600090819060540160408051601f1981840301815291905280516020909101206009549091506001600160a01b031661115e85611158847f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b9061150a565b6001600160a01b031614949350505050565b6001600160a01b03841661119a57604051632bfa23e760e11b815260006004820152602401610641565b60408051600180825260208201869052818301908152606082018590526080820190925290610aef600087848487611534565b6003546001600160a01b03163314610d0d5760405163118cdaa760e01b8152336004820152602401610641565b600261087882826123c4565b606060028054611215906122e8565b80601f0160208091040260200160405190810160405280929190818152602001828054611241906122e8565b801561128e5780601f106112635761010080835404028352916020019161128e565b820191906000526020600020905b81548152906001019060200180831161127157829003601f168201915b50505050509050919050565b606060006112a783611587565b600101905060008167ffffffffffffffff8111156112c7576112c7611cf9565b6040519080825280601f01601f1916602001820160405280156112f1576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846112fb57509392505050565b6001600160a01b03841661135757604051632bfa23e760e11b815260006004820152602401610641565b6001600160a01b03851661138057604051626a0d4560e21b815260006004820152602401610641565b61138d8585858585611534565b5050505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661140f5760405162ced3e160e81b815260006004820152602401610641565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114a657604051632bfa23e760e11b815260006004820152602401610641565b6001600160a01b0385166114cf57604051626a0d4560e21b815260006004820152602401610641565b604080516001808252602082018690528183019081526060820185905260808201909252906115018787848487611534565b50505050505050565b60008060008061151a868661165f565b92509250925061152a82826116ac565b5090949350505050565b61154085858585611765565b6001600160a01b0384161561138d57825133906001036115795760208481015190840151611572838989858589611809565b5050610aef565b610aef81878787878761192d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106115c65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106115f2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061161057662386f26fc10000830492506010015b6305f5e1008310611628576305f5e100830492506008015b612710831061163c57612710830492506004015b6064831061164e576064830492506002015b600a83106108ab5760010192915050565b600080600083516041036116995760208401516040850151606086015160001a61168b88828585611a16565b9550955095505050506116a5565b50508151600091506002905b9250925092565b60008260038111156116c0576116c0612484565b036116c9575050565b60018260038111156116dd576116dd612484565b036116fb5760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561170f5761170f612484565b036117305760405163fce698f760e01b815260048101829052602401610641565b600382600381111561174457611744612484565b03610878576040516335e2f38360e21b815260048101829052602401610641565b61177184848484611ae5565b60005b825181101561138d576020808202830101516001600160a01b038616156117c3576001600160a01b038616600090815260086020526040812080548392906117bd90849061249a565b90915550505b6001600160a01b03851615611800576001600160a01b038516600090815260086020526040812080548392906117fa9084906122d5565b90915550505b50600101611774565b6001600160a01b0384163b15610aef5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061184d90899089908890889088906004016124ad565b6020604051808303816000875af1925050508015611888575060408051601f3d908101601f19168201909252611885918101906124f2565b60015b6118f1573d8080156118b6576040519150601f19603f3d011682016040523d82523d6000602084013e6118bb565b606091505b5080516000036118e957604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b1461150157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b6001600160a01b0384163b15610aef5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611971908990899088908890889060040161250f565b6020604051808303816000875af19250505080156119ac575060408051601f3d908101601f191682019092526119a9918101906124f2565b60015b6119da573d8080156118b6576040519150601f19603f3d011682016040523d82523d6000602084013e6118bb565b6001600160e01b0319811663bc197c8160e01b1461150157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611a515750600091506003905082611adb565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611aa5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611ad157506000925060019150829050611adb565b9250600091508190505b9450945094915050565b8051825114611b145781518151604051635b05999160e01b815260048101929092526024820152604401610641565b3360005b8351811015611c1a576020818102858101820151908501909101516001600160a01b03881615611bcb576000828152602081815260408083206001600160a01b038c16845290915290205481811015611ba4576040516303dee4c560e01b81526001600160a01b038a166004820152602481018290526044810183905260648101849052608401610641565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b03871615611c10576000828152602081815260408083206001600160a01b038b16845290915281208054839290611c0a9084906122d5565b90915550505b5050600101611b18565b508251600103611c9b5760208301516000906020840151909150856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611c8c929190918252602082015260400190565b60405180910390a4505061138d565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611cea92919061256d565b60405180910390a45050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d3857611d38611cf9565b604052919050565b600067ffffffffffffffff831115611d5a57611d5a611cf9565b611d6d601f8401601f1916602001611d0f565b9050828152838383011115611d8157600080fd5b828260208301376000602084830101529392505050565b600082601f830112611da957600080fd5b610a8983833560208501611d40565b60008060408385031215611dcb57600080fd5b823567ffffffffffffffff811115611de257600080fd5b611dee85828601611d98565b95602094909401359450505050565b600060208284031215611e0f57600080fd5b5035919050565b80356001600160a01b0381168114610c2957600080fd5b60008060408385031215611e4057600080fd5b611e4983611e16565b946020939093013593505050565b6001600160e01b03198116811461091257600080fd5b600060208284031215611e7f57600080fd5b8135610a8981611e57565b600060208284031215611e9c57600080fd5b813567ffffffffffffffff811115611eb357600080fd5b8201601f81018413611ec457600080fd5b611ed384823560208401611d40565b949350505050565b600060208284031215611eed57600080fd5b610a8982611e16565b60005b83811015611f11578181015183820152602001611ef9565b50506000910152565b60008151808452611f32816020860160208601611ef6565b601f01601f19169290920160200192915050565b602081526000610a896020830184611f1a565b600067ffffffffffffffff821115611f7357611f73611cf9565b5060051b60200190565b600082601f830112611f8e57600080fd5b81356020611fa3611f9e83611f59565b611d0f565b8083825260208201915060208460051b870101935086841115611fc557600080fd5b602086015b84811015611fe15780358352918301918301611fca565b509695505050505050565b600080600080600060a0868803121561200457600080fd5b61200d86611e16565b945061201b60208701611e16565b9350604086013567ffffffffffffffff8082111561203857600080fd5b61204489838a01611f7d565b9450606088013591508082111561205a57600080fd5b61206689838a01611f7d565b9350608088013591508082111561207c57600080fd5b5061208988828901611d98565b9150509295509295909350565b600080604083850312156120a957600080fd5b823567ffffffffffffffff808211156120c157600080fd5b818501915085601f8301126120d557600080fd5b813560206120e5611f9e83611f59565b82815260059290921b8401810191818101908984111561210457600080fd5b948201945b838610156121295761211a86611e16565b82529482019490820190612109565b9650508601359250508082111561213f57600080fd5b5061214c85828601611f7d565b9150509250929050565b60008151808452602080850194506020840160005b838110156121875781518752958201959082019060010161216b565b509495945050505050565b602081526000610a896020830184612156565b600080604083850312156121b857600080fd5b6121c183611e16565b9150602083013580151581146121d657600080fd5b809150509250929050565b600080604083850312156121f457600080fd5b6121fd83611e16565b915061220b60208401611e16565b90509250929050565b600080600080600060a0868803121561222c57600080fd5b61223586611e16565b945061224360208701611e16565b93506040860135925060608601359150608086013567ffffffffffffffff81111561226d57600080fd5b61208988828901611d98565b6020808252600a9082015269125b9d985b1a5908125160b21b604082015260600190565b60208082526008908201526714dbdb190813dd5d60c21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156108ab576108ab6122bf565b600181811c908216806122fc57607f821691505b60208210810361231c57634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612334818460208801611ef6565b835190830190612348818360208801611ef6565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052603260045260246000fd5b601f8211156123bf576000816000526020600020601f850160051c810160208610156123a05750805b601f850160051c820191505b81811015610aef578281556001016123ac565b505050565b815167ffffffffffffffff8111156123de576123de611cf9565b6123f2816123ec84546122e8565b84612377565b602080601f831160018114612427576000841561240f5750858301515b600019600386901b1c1916600185901b178555610aef565b600085815260208120601f198616915b8281101561245657888601518255948401946001909101908401612437565b50858210156124745787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052602160045260246000fd5b818103818111156108ab576108ab6122bf565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906124e790830184611f1a565b979650505050505050565b60006020828403121561250457600080fd5b8151610a8981611e57565b6001600160a01b0386811682528516602082015260a06040820181905260009061253b90830186612156565b828103606084015261254d8186612156565b905082810360808401526125618185611f1a565b98975050505050505050565b6040815260006125806040830185612156565b82810360208401526125928185612156565b9594505050505056fea2646970667358221220f7d78987c808538a06adee441e4f8fb68e36aec49b93584cd4fc02e5de47c6ad64736f6c6343000816003368747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f706f7274726164652f706f7274726164652d315f302f6d657461646174612f00000000000000000000000079a91e41c9de7c9f26aa904e23169703513c8ef3

Deployed Bytecode

0x6080604052600436106101f65760003560e01c80633a178d991161010d578063aee9c872116100a0578063e985e9c51161006f578063e985e9c514610569578063efd0cbf914610589578063f242432a1461059c578063f2fde38b146105bc578063ff186b2e146105dc57600080fd5b8063aee9c872146104ec578063b187bd2614610519578063b416d46e14610533578063e92dd0761461054957600080fd5b80638da5cb5b116100dc5780638da5cb5b1461047a57806395d89b41146104a2578063a22cb465146104b7578063a88af1d3146104d757600080fd5b80633a178d99146104035780634e1273f4146104235780636ab9208614610450578063715018a61461046557600080fd5b806306fdde03116101905780632eb2c2d61161015f5780632eb2c2d6146103855780633057931f146103a557806330b9af98146103c457806332cb6b0c146103d9578063385df649146103ee57600080fd5b806306fdde03146102fd5780630e89341c1461031f5780632693ebf21461033f5780632da5ea171461036c57600080fd5b806302775240116101cc578063027752401461029357806302fe5305146102a8578063046dc166146102c8578063049da9e8146102e857600080fd5b8062257612146101fb5780629f926214610210578062fdd58e1461023057806301ffc9a714610263575b600080fd5b61020e610209366004611db8565b6105f2565b005b34801561021c57600080fd5b5061020e61022b366004611dfd565b61087c565b34801561023c57600080fd5b5061025061024b366004611e2d565b610889565b6040519081526020015b60405180910390f35b34801561026f57600080fd5b5061028361027e366004611e6d565b6108b1565b604051901515815260200161025a565b34801561029f57600080fd5b50610250600381565b3480156102b457600080fd5b5061020e6102c3366004611e8a565b610901565b3480156102d457600080fd5b5061020e6102e3366004611edb565b610915565b3480156102f457600080fd5b5061020e61093f565b34801561030957600080fd5b50610312610966565b60405161025a9190611f46565b34801561032b57600080fd5b5061031261033a366004611dfd565b6109f4565b34801561034b57600080fd5b5061025061035a366004611dfd565b60076020526000908152604090205481565b34801561037857600080fd5b5060065460641115610283565b34801561039157600080fd5b5061020e6103a0366004611fec565b610a90565b3480156103b157600080fd5b50600c5461028390610100900460ff1681565b3480156103d057600080fd5b5061020e610af7565b3480156103e557600080fd5b50610250606481565b3480156103fa57600080fd5b5061020e610b99565b34801561040f57600080fd5b5061028361041e366004611dfd565b610bb5565b34801561042f57600080fd5b5061044361043e366004612096565b610c2e565b60405161025a9190612192565b34801561045c57600080fd5b50600654610250565b34801561047157600080fd5b5061020e610cfb565b34801561048657600080fd5b506003546040516001600160a01b03909116815260200161025a565b3480156104ae57600080fd5b50610312610d0f565b3480156104c357600080fd5b5061020e6104d23660046121a5565b610d1c565b3480156104e357600080fd5b5061020e610d27565b3480156104f857600080fd5b50610250610507366004611edb565b60086020526000908152604090205481565b34801561052557600080fd5b50600c546102839060ff1681565b34801561053f57600080fd5b5061025061016f81565b34801561055557600080fd5b50600c546102839062010000900460ff1681565b34801561057557600080fd5b506102836105843660046121e1565b610d4c565b61020e610597366004611dfd565b610d7a565b3480156105a857600080fd5b5061020e6105b7366004612214565b611008565b3480156105c857600080fd5b5061020e6105d7366004611edb565b611067565b3480156105e857600080fd5b5061025060055481565b600c5460ff161561064a5760405162461bcd60e51b815260206004820152601d60248201527f506f7274726164652069732063757272656e746c79206c6f636b65642e00000060448201526064015b60405180910390fd5b6106526110a2565b606481106106725760405162461bcd60e51b815260040161064190612279565b61067c82826110cc565b6106bc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610641565b3360009081526008602052604090205460031161070d5760405162461bcd60e51b815260206004820152600f60248201526e26b0bc1019903832b91037bbb732b960891b6044820152606401610641565b60646006541061072f5760405162461bcd60e51b81526004016106419061229d565b6021811161076a576000818152600760205260409020546004116107655760405162461bcd60e51b81526004016106419061229d565b6107ce565b603181116107a0576000818152600760205260409020546005116107655760405162461bcd60e51b81526004016106419061229d565b6000818152600760205260409020546003116107ce5760405162461bcd60e51b81526004016106419061229d565b6005543410156108115760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610641565b600081815260076020526040812080546001928392916108329084906122d5565b92505081905550806006600082825461084b91906122d5565b9250508190555061086d33838360405180602001604052806000815250611170565b506108786001600455565b5050565b6108846111cd565b600555565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806108e257506001600160e01b031982166303a24d0760e21b145b806108ab57506301ffc9a760e01b6001600160e01b03198316146108ab565b6109096111cd565b610912816111fa565b50565b61091d6111cd565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6109476111cd565b600c805462ff0000198116620100009182900460ff1615909102179055565b600a8054610973906122e8565b80601f016020809104026020016040519081016040528092919081815260200182805461099f906122e8565b80156109ec5780601f106109c1576101008083540402835291602001916109ec565b820191906000526020600020905b8154815290600101906020018083116109cf57829003601f168201915b505050505081565b606060648210610a335760405162461bcd60e51b815260206004820152600a602482015269125b9d985b1a5908125960b21b6044820152606401610641565b6000610a3e83611206565b90506000815111610a5e5760405180602001604052806000815250610a89565b80610a688461129a565b604051602001610a79929190612322565b6040516020818303038152906040525b9392505050565b336001600160a01b0386168114801590610ab15750610aaf8682610d4c565b155b15610ae25760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610641565b610aef868686868661132d565b505050505050565b610aff6111cd565b6040514790600090339083908381818185875af1925050503d8060008114610b43576040519150601f19603f3d011682016040523d82523d6000602084013e610b48565b606091505b50509050806108785760405162461bcd60e51b815260206004820181905260248201527f4572726f72207768696c65207472616e7366657272696e672062616c616e63656044820152606401610641565b610ba16111cd565b600c805460ff19811660ff90911615179055565b600060648210610bd75760405162461bcd60e51b815260040161064190612279565b60218211610bf5575060009081526007602052604090205460041190565b60318211610c13575060009081526007602052604090205460051190565b5060009081526007602052604090205460031190565b919050565b60608151835114610c5f5781518351604051635b05999160e01b815260048101929092526024820152604401610641565b6000835167ffffffffffffffff811115610c7b57610c7b611cf9565b604051908082528060200260200182016040528015610ca4578160200160208202803683370190505b50905060005b8451811015610cf357602080820286010151610cce90602080840287010151610889565b828281518110610ce057610ce0612361565b6020908102919091010152600101610caa565b509392505050565b610d036111cd565b610d0d6000611394565b565b600b8054610973906122e8565b6108783383836113e6565b610d2f6111cd565b600c805461ff001981166101009182900460ff1615909102179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b600c5460ff1615610dcd5760405162461bcd60e51b815260206004820152601d60248201527f506f7274726164652069732063757272656e746c79206c6f636b65642e0000006044820152606401610641565b600c54610100900460ff16610e245760405162461bcd60e51b815260206004820152601b60248201527f5075626c6963206d696e74206973206e6f7420656e61626c65642e00000000006044820152606401610641565b610e2c6110a2565b60648110610e4c5760405162461bcd60e51b815260040161064190612279565b33600090815260086020526040902054600311610e9d5760405162461bcd60e51b815260206004820152600f60248201526e26b0bc1019903832b91037bbb732b960891b6044820152606401610641565b606460065410610ebf5760405162461bcd60e51b81526004016106419061229d565b60218111610efa57600081815260076020526040902054600411610ef55760405162461bcd60e51b81526004016106419061229d565b610f5e565b60318111610f3057600081815260076020526040902054600511610ef55760405162461bcd60e51b81526004016106419061229d565b600081815260076020526040902054600311610f5e5760405162461bcd60e51b81526004016106419061229d565b600554341015610fa15760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610641565b60008181526007602052604081208054600192839291610fc29084906122d5565b925050819055508060066000828254610fdb91906122d5565b92505081905550610ffd33838360405180602001604052806000815250611170565b506109126001600455565b336001600160a01b038616811480159061102957506110278682610d4c565b155b1561105a5760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610641565b610aef868686868661147c565b61106f6111cd565b6001600160a01b03811661109957604051631e4fbdf760e01b815260006004820152602401610641565b61091281611394565b6002600454036110c557604051633ee5aeb560e01b815260040160405180910390fd5b6002600455565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052600090819060540160408051601f1981840301815291905280516020909101206009549091506001600160a01b031661115e85611158847f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b9061150a565b6001600160a01b031614949350505050565b6001600160a01b03841661119a57604051632bfa23e760e11b815260006004820152602401610641565b60408051600180825260208201869052818301908152606082018590526080820190925290610aef600087848487611534565b6003546001600160a01b03163314610d0d5760405163118cdaa760e01b8152336004820152602401610641565b600261087882826123c4565b606060028054611215906122e8565b80601f0160208091040260200160405190810160405280929190818152602001828054611241906122e8565b801561128e5780601f106112635761010080835404028352916020019161128e565b820191906000526020600020905b81548152906001019060200180831161127157829003601f168201915b50505050509050919050565b606060006112a783611587565b600101905060008167ffffffffffffffff8111156112c7576112c7611cf9565b6040519080825280601f01601f1916602001820160405280156112f1576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846112fb57509392505050565b6001600160a01b03841661135757604051632bfa23e760e11b815260006004820152602401610641565b6001600160a01b03851661138057604051626a0d4560e21b815260006004820152602401610641565b61138d8585858585611534565b5050505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661140f5760405162ced3e160e81b815260006004820152602401610641565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114a657604051632bfa23e760e11b815260006004820152602401610641565b6001600160a01b0385166114cf57604051626a0d4560e21b815260006004820152602401610641565b604080516001808252602082018690528183019081526060820185905260808201909252906115018787848487611534565b50505050505050565b60008060008061151a868661165f565b92509250925061152a82826116ac565b5090949350505050565b61154085858585611765565b6001600160a01b0384161561138d57825133906001036115795760208481015190840151611572838989858589611809565b5050610aef565b610aef81878787878761192d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106115c65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106115f2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061161057662386f26fc10000830492506010015b6305f5e1008310611628576305f5e100830492506008015b612710831061163c57612710830492506004015b6064831061164e576064830492506002015b600a83106108ab5760010192915050565b600080600083516041036116995760208401516040850151606086015160001a61168b88828585611a16565b9550955095505050506116a5565b50508151600091506002905b9250925092565b60008260038111156116c0576116c0612484565b036116c9575050565b60018260038111156116dd576116dd612484565b036116fb5760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561170f5761170f612484565b036117305760405163fce698f760e01b815260048101829052602401610641565b600382600381111561174457611744612484565b03610878576040516335e2f38360e21b815260048101829052602401610641565b61177184848484611ae5565b60005b825181101561138d576020808202830101516001600160a01b038616156117c3576001600160a01b038616600090815260086020526040812080548392906117bd90849061249a565b90915550505b6001600160a01b03851615611800576001600160a01b038516600090815260086020526040812080548392906117fa9084906122d5565b90915550505b50600101611774565b6001600160a01b0384163b15610aef5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061184d90899089908890889088906004016124ad565b6020604051808303816000875af1925050508015611888575060408051601f3d908101601f19168201909252611885918101906124f2565b60015b6118f1573d8080156118b6576040519150601f19603f3d011682016040523d82523d6000602084013e6118bb565b606091505b5080516000036118e957604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b1461150157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b6001600160a01b0384163b15610aef5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611971908990899088908890889060040161250f565b6020604051808303816000875af19250505080156119ac575060408051601f3d908101601f191682019092526119a9918101906124f2565b60015b6119da573d8080156118b6576040519150601f19603f3d011682016040523d82523d6000602084013e6118bb565b6001600160e01b0319811663bc197c8160e01b1461150157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610641565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611a515750600091506003905082611adb565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611aa5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611ad157506000925060019150829050611adb565b9250600091508190505b9450945094915050565b8051825114611b145781518151604051635b05999160e01b815260048101929092526024820152604401610641565b3360005b8351811015611c1a576020818102858101820151908501909101516001600160a01b03881615611bcb576000828152602081815260408083206001600160a01b038c16845290915290205481811015611ba4576040516303dee4c560e01b81526001600160a01b038a166004820152602481018290526044810183905260648101849052608401610641565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b03871615611c10576000828152602081815260408083206001600160a01b038b16845290915281208054839290611c0a9084906122d5565b90915550505b5050600101611b18565b508251600103611c9b5760208301516000906020840151909150856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611c8c929190918252602082015260400190565b60405180910390a4505061138d565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611cea92919061256d565b60405180910390a45050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d3857611d38611cf9565b604052919050565b600067ffffffffffffffff831115611d5a57611d5a611cf9565b611d6d601f8401601f1916602001611d0f565b9050828152838383011115611d8157600080fd5b828260208301376000602084830101529392505050565b600082601f830112611da957600080fd5b610a8983833560208501611d40565b60008060408385031215611dcb57600080fd5b823567ffffffffffffffff811115611de257600080fd5b611dee85828601611d98565b95602094909401359450505050565b600060208284031215611e0f57600080fd5b5035919050565b80356001600160a01b0381168114610c2957600080fd5b60008060408385031215611e4057600080fd5b611e4983611e16565b946020939093013593505050565b6001600160e01b03198116811461091257600080fd5b600060208284031215611e7f57600080fd5b8135610a8981611e57565b600060208284031215611e9c57600080fd5b813567ffffffffffffffff811115611eb357600080fd5b8201601f81018413611ec457600080fd5b611ed384823560208401611d40565b949350505050565b600060208284031215611eed57600080fd5b610a8982611e16565b60005b83811015611f11578181015183820152602001611ef9565b50506000910152565b60008151808452611f32816020860160208601611ef6565b601f01601f19169290920160200192915050565b602081526000610a896020830184611f1a565b600067ffffffffffffffff821115611f7357611f73611cf9565b5060051b60200190565b600082601f830112611f8e57600080fd5b81356020611fa3611f9e83611f59565b611d0f565b8083825260208201915060208460051b870101935086841115611fc557600080fd5b602086015b84811015611fe15780358352918301918301611fca565b509695505050505050565b600080600080600060a0868803121561200457600080fd5b61200d86611e16565b945061201b60208701611e16565b9350604086013567ffffffffffffffff8082111561203857600080fd5b61204489838a01611f7d565b9450606088013591508082111561205a57600080fd5b61206689838a01611f7d565b9350608088013591508082111561207c57600080fd5b5061208988828901611d98565b9150509295509295909350565b600080604083850312156120a957600080fd5b823567ffffffffffffffff808211156120c157600080fd5b818501915085601f8301126120d557600080fd5b813560206120e5611f9e83611f59565b82815260059290921b8401810191818101908984111561210457600080fd5b948201945b838610156121295761211a86611e16565b82529482019490820190612109565b9650508601359250508082111561213f57600080fd5b5061214c85828601611f7d565b9150509250929050565b60008151808452602080850194506020840160005b838110156121875781518752958201959082019060010161216b565b509495945050505050565b602081526000610a896020830184612156565b600080604083850312156121b857600080fd5b6121c183611e16565b9150602083013580151581146121d657600080fd5b809150509250929050565b600080604083850312156121f457600080fd5b6121fd83611e16565b915061220b60208401611e16565b90509250929050565b600080600080600060a0868803121561222c57600080fd5b61223586611e16565b945061224360208701611e16565b93506040860135925060608601359150608086013567ffffffffffffffff81111561226d57600080fd5b61208988828901611d98565b6020808252600a9082015269125b9d985b1a5908125160b21b604082015260600190565b60208082526008908201526714dbdb190813dd5d60c21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156108ab576108ab6122bf565b600181811c908216806122fc57607f821691505b60208210810361231c57634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612334818460208801611ef6565b835190830190612348818360208801611ef6565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052603260045260246000fd5b601f8211156123bf576000816000526020600020601f850160051c810160208610156123a05750805b601f850160051c820191505b81811015610aef578281556001016123ac565b505050565b815167ffffffffffffffff8111156123de576123de611cf9565b6123f2816123ec84546122e8565b84612377565b602080601f831160018114612427576000841561240f5750858301515b600019600386901b1c1916600185901b178555610aef565b600085815260208120601f198616915b8281101561245657888601518255948401946001909101908401612437565b50858210156124745787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052602160045260246000fd5b818103818111156108ab576108ab6122bf565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906124e790830184611f1a565b979650505050505050565b60006020828403121561250457600080fd5b8151610a8981611e57565b6001600160a01b0386811682528516602082015260a06040820181905260009061253b90830186612156565b828103606084015261254d8186612156565b905082810360808401526125618185611f1a565b98975050505050505050565b6040815260006125806040830185612156565b82810360208401526125928185612156565b9594505050505056fea2646970667358221220f7d78987c808538a06adee441e4f8fb68e36aec49b93584cd4fc02e5de47c6ad64736f6c63430008160033

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

00000000000000000000000079a91e41c9de7c9f26aa904e23169703513c8ef3

-----Decoded View---------------
Arg [0] : signerAddress (address): 0x79A91E41C9DE7c9F26aA904E23169703513c8ef3

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000079a91e41c9de7c9f26aa904e23169703513c8ef3


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

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