ETH Price: $3,338.36 (+1.41%)
 

Overview

Max Total Supply

20

Holders

15

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
Juicebox: Deployer
0x823b92d6a4b2aed4b15675c7917c9f922ea8adad
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:
JuiceboxCards

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 41 : JuiceboxCards.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @title Juicebox Cards v1.2
/// @notice Juicebox Cards gives every Juicebox project it's own Open Edition NFT that renders the Juicebox Project's own NFT metadata to every holder's wallet.
/// @author @nnnnicholas

import {IERC1155, ERC1155, IERC165} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {IJBDirectory} from "@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBDirectory.sol";
import {IJBTiered721Delegate} from "@jbx-protocol/juice-721-delegate/contracts/interfaces/IJBTiered721Delegate.sol";
import {JBTokens} from "@jbx-protocol/juice-contracts-v3/contracts/libraries/JBTokens.sol";
import {IJBPaymentTerminal} from "@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBPaymentTerminal.sol";
import {Config} from "src/Structs/Config.sol";

/*//////////////////////////////////////////////////////////////
                             CONTRACT 
 //////////////////////////////////////////////////////////////*/

contract JuiceboxCards is ERC1155, Ownable, AccessControl, ReentrancyGuard {
    using Strings for uint256;
    /*//////////////////////////////////////////////////////////////
                             ERRORS 
    //////////////////////////////////////////////////////////////*/

    /// @notice Insufficient funds to mint a Card
    error JBCards_TXValueBelowMintPrice();

    /// @notice Cannot pay the project
    /// @param _projectId The ID of the project that cannot be paid
    error JBCards_ProjectRefusedPayment(uint256 _projectId);

    /// @notice Function access is restricted to the dev minter role
    error JBCards_MsgSenderDoesNotHaveDevMinterRole();

    /// @notice Input arrays must be of equal length
    error JBCards_DevMintArgumentArraysMustBeEqualLength();

    /// @notice The project must have a payment terminal configured on the active JBDirectory
    error JBCards_ProjectMustHaveAnETHPaymentTerminalConfiguredOnTheActiveJBDirectory();

    /*//////////////////////////////////////////////////////////////
                             EVENTS 
    //////////////////////////////////////////////////////////////*/

    /// @dev Emitted when the price of the NFT is set
    event JBCards_PriceSet(uint256 _price);

    /// @dev Emitted when the JBProjects contract address is set
    event JBCards_JBProjectsSet(address indexed _JBProjects);

    /// @dev Emitted when the contract metadata URI is set
    event JBCards_ContractUriSet(string _contractUri);

    /// @dev Emitted when a project is paid with `pay` while minting a Card.
    event JBCards_ProjectPaySucceeded(
        uint256 indexed _projectId,
        uint256 _amountPaid
    );

    /// @dev Emitted when a project is paid with `addToBalance` while minting a Card.
    event JBCards_ProjectAddToBalanceSucceeded(
        uint256 indexed _projectId,
        uint256 _amountPaid
    );

    /// @dev Emitted when a `pay` call fails for a given project
    event JBCards_ProjectPayFailed(uint256 indexed _projectId, uint256 _amount);

    /// @dev Emitted when a `addToBalance` call fails for a given project
    event JBCards_ProjectAddToBalanceFailed(
        uint256 indexed _projectId,
        uint256 _amount
    );

    /// @dev Emitted when the tip project is tipped with `pay` while minting a Card.
    event JBCards_TipPaySucceeded(
        uint256 indexed _projectId,
        uint256 _amountPaid
    );

    /// @dev Emitted when the tip project is tipped with `addToBalance` while minting a Card.
    event JBCards_TipAddToBalanceSucceeded(
        uint256 indexed _projectId,
        uint256 _amountPaid
    );

    /// @dev Emitted when a tip `pay` fails
    event JBCards_TipPayFailed(uint256 indexed _projectId, uint256 _amount);

    /// @dev Emitted when a tip `addToBalance` fails
    event JBCards_TipAddToBalanceFailed(
        uint256 indexed _projectId,
        uint256 _amount
    );

    /// @dev Emitted when the directory address is set
    event JBCards_DirectorySet(address indexed _directory);

    /// @dev Emited when the tip recipient project ID is set
    event JBCards_TipProjectSet(uint256 indexed _tipProject);

    /// @dev Emitted when the tip terminal is set
    event JBCards_TipTerminalSet(address indexed newTerminal);

    /*//////////////////////////////////////////////////////////////
                                 ACCESS
    //////////////////////////////////////////////////////////////*/

    bytes32 public constant DEV_MINTER_ROLE = keccak256("DEV_MINTER_ROLE");

    modifier onlyDevMinter() {
        if (!hasRole(DEV_MINTER_ROLE, msg.sender)) {
            revert JBCards_MsgSenderDoesNotHaveDevMinterRole();
        }
        _;
    }

    /*//////////////////////////////////////////////////////////////
                           STORAGE VARIABLES
    //////////////////////////////////////////////////////////////*/

    /// @dev The address of the JBProjects contract
    IERC721Metadata public jbProjects;

    /// @dev The address of the JBDirectory contract
    IJBDirectory public directory;

    /// @dev The project that receives tips
    uint256 public tipProject;

    /// @dev The price to buy a Card in wei
    uint256 public price;

    /// @dev The URI of the contract metadata
    string private contractUri;

    /// @dev The tip project's primary eth terminal of the
    IJBPaymentTerminal public ethTipTerminal;

    /*//////////////////////////////////////////////////////////////
                             CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(Config memory _config) ERC1155("") {
        _setupRole(DEV_MINTER_ROLE, msg.sender);
        setJBProjects(_config.jbProjects); // Set the JBProjects contract that is the metadata source
        setDirectory(_config.directory); // Set the JBDirectory contract
        setPrice(_config.price); // Set the Card price
        setContractUri(_config.contractUri); // Set the contract metadata URI
        setTipProject(_config.tipProject); // Set the project that receives tips and the tip terminal
    }

    /*//////////////////////////////////////////////////////////////
                       EXTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Mints a Card to the beneficiary, pays the project the price, sends any excess msg.value to the tip project, and sends any tip project tokens to the tipBeneficiary.
     * @dev Projects must have a primary ETH terminal on the current JBDirectory, or else mints will revert.
     * @dev Sensible default: pass the msg.sender as both beneficiary and tipBeneficiary.
     * @param projectId The ID of the project to mint a Card for
     * @param beneficiary The address to mint the Card to
     * @param tipBeneficiary The address that receives tokens from the tip project
     */
    function mint(
        uint256 projectId,
        address beneficiary,
        address tipBeneficiary
    ) external payable nonReentrant {
        if (msg.value < price) {
            revert JBCards_TXValueBelowMintPrice();
        }

        // Mint the NFT.
        _mint(beneficiary, projectId, 1, bytes(""));

        // Get the payment terminal the project currently prefers to accept ETH through.
        IJBPaymentTerminal _ethTerminal = directory.primaryTerminalOf(
            projectId,
            JBTokens.ETH
        );

        // If the project doesn't have a payment terminal configured, revert.
        if (_ethTerminal == IJBPaymentTerminal(address(0))) {
            revert JBCards_ProjectMustHaveAnETHPaymentTerminalConfiguredOnTheActiveJBDirectory();
        }

        // Create the metadata for the payment
        bytes memory _payMetadata = abi.encode(
            bytes32(tipProject), // Referral project ID.
            bytes32(0),
            bytes4(0)
        );

        // Pay the project.
        try
            _ethTerminal.pay{value: price}(
                projectId,
                price,
                JBTokens.ETH,
                beneficiary,
                0,
                false,
                "Juicebox Card minted",
                _payMetadata
            )
        {
            emit JBCards_ProjectPaySucceeded(projectId, price); // If pay succeeds, emit success
        } catch {
            // If pay fails, emit failure and try addToBalance
            emit JBCards_ProjectPayFailed(projectId, price);
            try
                _ethTerminal.addToBalanceOf{value: price}(
                    projectId,
                    price,
                    JBTokens.ETH,
                    "Juicebox Card minted",
                    _payMetadata
                )
            {
                emit JBCards_ProjectAddToBalanceSucceeded(projectId, price); // If addToBalance succeeds, emit success
            } catch {
                // If addToBalance fails, emit failure and revert
                emit JBCards_ProjectAddToBalanceFailed(projectId, price);
                revert JBCards_ProjectRefusedPayment(projectId);
            }
        }

        // If the msg.value is greater than the price, pay the tip to the tip project.
        if (msg.value > price) {
            // Pay the tip project.
            uint256 tipAmount = address(this).balance;
            try
                ethTipTerminal.pay{value: tipAmount}(
                    tipProject,
                    tipAmount,
                    JBTokens.ETH,
                    tipBeneficiary,
                    0,
                    false,
                    "Juicebox Card tip",
                    _payMetadata // reuse the same metadata
                )
            {
                // If pay succeeds, emit success
                emit JBCards_TipPaySucceeded(tipProject, tipAmount);
            } catch {
                // If pay fails, emit failure and try addToBalance
                emit JBCards_TipPayFailed(tipProject, tipAmount);
                try
                    ethTipTerminal.addToBalanceOf{value: tipAmount}(
                        tipProject,
                        tipAmount,
                        JBTokens.ETH,
                        "Juicebox Card tip",
                        _payMetadata // reuse the same metadata
                    )
                {
                    // If addToBalance succeeds, emit success
                    emit JBCards_TipAddToBalanceSucceeded(
                        tipProject,
                        tipAmount
                    );
                } catch {
                    // If addToBalanceOf returns an error, leave the ETH in the contract. It will be paid to the tip project with the next successful mint.
                    emit JBCards_TipAddToBalanceFailed(tipProject, tipAmount);
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                            PUBLIC FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Sets the tip project's primary ETH terminal
     * @dev Callable by anyone, but only updates the primary terminal based on the configured directory, which is set by the owner.
     */
    function setTipTerminal() public {
        // Get the payment terminal the project currently prefers to accept ETH through.
        ethTipTerminal = directory.primaryTerminalOf(tipProject, JBTokens.ETH);

        emit JBCards_TipTerminalSet(address(ethTipTerminal));
    }

    /**
     * @notice Returns the URI of the NFT
     * @dev Returns the corresponding URI on the JBProjects contract
     * @param projectId The ID of the project to get the NFT URI for
     * @return string The URI of the NFT
     */
    function uri(
        uint256 projectId
    ) public view virtual override returns (string memory) {
        return jbProjects.tokenURI(projectId);
    }

    /**
     * @notice Returns the contract URI
     * @return string The contract URI
     */
    function contractURI() public view returns (string memory) {
        return contractUri;
    }

    /**
     * @notice Returns whether or not the contract supports an interface
     * @param interfaceId The ID of the interface to check
     * @return bool Whether or not the contract supports the interface
     * @inheritdoc IERC165
     */
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC1155, AccessControl) returns (bool) {
        return
            interfaceId == type(IERC1155).interfaceId ||
            type(AccessControl).interfaceId == interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNER FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Sets the Card price
     * @param _price The Card price in wei
     */
    function setPrice(uint64 _price) public onlyOwner {
        price = uint256(_price);
        emit JBCards_PriceSet(_price);
    }

    /**
     * @notice Sets the project that receives tips and updates the tip terminal
     * @param _tipProject The address that receives mint tips
     */
    function setTipProject(uint16 _tipProject) public onlyOwner {
        tipProject = uint256(_tipProject);
        emit JBCards_TipProjectSet(_tipProject);
        setTipTerminal();
    }

    /**
     * @notice Sets the address of the JBProjects contract from which to get the NFT URI
     * @param _JBProjects The address of the JBProjects contract
     */
    function setJBProjects(address _JBProjects) public onlyOwner {
        jbProjects = IERC721Metadata(_JBProjects);
        emit JBCards_JBProjectsSet(_JBProjects);
    }

    /**
     * @notice Sets the address of the JBDirectory contract from which to get the payment terminal
     * @param _directory The address of the JBDirectory contract
     */
    function setDirectory(address _directory) public onlyOwner {
        directory = IJBDirectory(_directory);
        emit JBCards_DirectorySet(_directory);
    }

    /**
     * @notice Sets the contract URI
     * @param _contractUri The URI of the contract metadata
     */
    function setContractUri(string memory _contractUri) public onlyOwner {
        contractUri = _contractUri;
        emit JBCards_ContractUriSet(_contractUri);
    }

    /**
     * @notice Mints multiple NFTs to any addresses without fee
     * @param to The addresses to mint the NFTs to
     * @param projectIds The IDs of the projects to mint the NFTs for
     * @param amounts The amounts of each NFTs to mint
     */
    function devMint(
        address[] calldata to,
        uint256[] calldata projectIds,
        uint256[] calldata amounts
    ) external onlyDevMinter {
        if (
            to.length != projectIds.length ||
            projectIds.length != amounts.length
        ) {
            revert JBCards_DevMintArgumentArraysMustBeEqualLength();
        }
        for (uint256 i = 0; i < to.length; i++) {
            _mint(to[i], projectIds[i], amounts[i], bytes(""));
        }
    }
}

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

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

        return batchBalances;
    }

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

        return array;
    }
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 4 of 41 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 9 of 41 : IJBDirectory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './IJBFundingCycleStore.sol';
import './IJBPaymentTerminal.sol';
import './IJBProjects.sol';

interface IJBDirectory {
  event SetController(uint256 indexed projectId, address indexed controller, address caller);

  event AddTerminal(uint256 indexed projectId, IJBPaymentTerminal indexed terminal, address caller);

  event SetTerminals(uint256 indexed projectId, IJBPaymentTerminal[] terminals, address caller);

  event SetPrimaryTerminal(
    uint256 indexed projectId,
    address indexed token,
    IJBPaymentTerminal indexed terminal,
    address caller
  );

  event SetIsAllowedToSetFirstController(address indexed addr, bool indexed flag, address caller);

  function projects() external view returns (IJBProjects);

  function fundingCycleStore() external view returns (IJBFundingCycleStore);

  function controllerOf(uint256 _projectId) external view returns (address);

  function isAllowedToSetFirstController(address _address) external view returns (bool);

  function terminalsOf(uint256 _projectId) external view returns (IJBPaymentTerminal[] memory);

  function isTerminalOf(uint256 _projectId, IJBPaymentTerminal _terminal)
    external
    view
    returns (bool);

  function primaryTerminalOf(uint256 _projectId, address _token)
    external
    view
    returns (IJBPaymentTerminal);

  function setControllerOf(uint256 _projectId, address _controller) external;

  function setTerminalsOf(uint256 _projectId, IJBPaymentTerminal[] calldata _terminals) external;

  function setPrimaryTerminalOf(
    uint256 _projectId,
    address _token,
    IJBPaymentTerminal _terminal
  ) external;

  function setIsAllowedToSetFirstController(address _address, bool _flag) external;
}

File 10 of 41 : IJBTiered721Delegate.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBDirectory.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBFundingCycleStore.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBPrices.sol';
import './../structs/JB721PricingParams.sol';
import './../structs/JB721TierParams.sol';
import './../structs/JBTiered721MintReservesForTiersData.sol';
import './../structs/JBTiered721MintForTiersData.sol';
import './IJB721Delegate.sol';
import './IJBTiered721DelegateStore.sol';

interface IJBTiered721Delegate is IJB721Delegate {
  event Mint(
    uint256 indexed tokenId,
    uint256 indexed tierId,
    address indexed beneficiary,
    uint256 totalAmountContributed,
    address caller
  );

  event MintReservedToken(
    uint256 indexed tokenId,
    uint256 indexed tierId,
    address indexed beneficiary,
    address caller
  );

  event AddTier(uint256 indexed tierId, JB721TierParams data, address caller);

  event RemoveTier(uint256 indexed tierId, address caller);

  event SetDefaultReservedTokenBeneficiary(address indexed beneficiary, address caller);

  event SetEncodedIPFSUri(uint256 indexed tierId, bytes32 encodedIPFSUri, address caller);

  event SetBaseUri(string indexed baseUri, address caller);

  event SetContractUri(string indexed contractUri, address caller);

  event SetTokenUriResolver(IJBTokenUriResolver indexed newResolver, address caller);

  event AddCredits(
    uint256 indexed changeAmount,
    uint256 indexed newTotalCredits,
    address indexed account,
    address caller
  );

  event UseCredits(
    uint256 indexed changeAmount,
    uint256 indexed newTotalCredits,
    address indexed account,
    address caller
  );

  function codeOrigin() external view returns (address);

  function store() external view returns (IJBTiered721DelegateStore);

  function fundingCycleStore() external view returns (IJBFundingCycleStore);
  
  function pricingContext() external view returns (uint256, uint256, IJBPrices);

  function creditsOf(address _address) external view returns (uint256);

  function firstOwnerOf(uint256 _tokenId) external view returns (address);

  function baseURI() external view returns (string memory);

  function contractURI() external view returns (string memory);

  function adjustTiers(
    JB721TierParams[] memory _tierDataToAdd,
    uint256[] memory _tierIdsToRemove
  ) external;

  function mintReservesFor(
    JBTiered721MintReservesForTiersData[] memory _mintReservesForTiersData
  ) external;

  function mintReservesFor(uint256 _tierId, uint256 _count) external;

  function mintFor(
    uint16[] calldata _tierIds,
    address _beneficiary
  ) external returns (uint256[] memory tokenIds);

  function setMetadata(
    string memory _baseUri,
    string calldata _contractMetadataUri,
    IJBTokenUriResolver _tokenUriResolver,
    uint256 _encodedIPFSUriTierId,
    bytes32 _encodedIPFSUri
  ) external;

  function initialize(
    uint256 _projectId,
    IJBDirectory _directory,
    string memory _name,
    string memory _symbol,
    IJBFundingCycleStore _fundingCycleStore,
    string memory _baseUri,
    IJBTokenUriResolver _tokenUriResolver,
    string memory _contractUri,
    JB721PricingParams memory _pricing,
    IJBTiered721DelegateStore _store,
    JBTiered721Flags memory _flags
  ) external;
}

File 11 of 41 : JBTokens.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library JBTokens {
  /** 
    @notice 
    The ETH token address in Juicebox is represented by 0x000000000000000000000000000000000000EEEe.
  */
  address public constant ETH = address(0x000000000000000000000000000000000000EEEe);
}

File 12 of 41 : IJBPaymentTerminal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface IJBPaymentTerminal is IERC165 {
  function acceptsToken(address _token, uint256 _projectId) external view returns (bool);

  function currencyForToken(address _token) external view returns (uint256);

  function decimalsForToken(address _token) external view returns (uint256);

  // Return value must be a fixed point number with 18 decimals.
  function currentEthOverflowOf(uint256 _projectId) external view returns (uint256);

  function pay(
    uint256 _projectId,
    uint256 _amount,
    address _token,
    address _beneficiary,
    uint256 _minReturnedTokens,
    bool _preferClaimedTokens,
    string calldata _memo,
    bytes calldata _metadata
  ) external payable returns (uint256 beneficiaryTokenCount);

  function addToBalanceOf(
    uint256 _projectId,
    uint256 _amount,
    address _token,
    string calldata _memo,
    bytes calldata _metadata
  ) external payable;
}

File 13 of 41 : Config.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

struct Config {
    address jbProjects; // 160 bits  // The JBProjects contract
    uint16 tipProject;  // 16 bits   // The project ID of the metadata project
    uint64 price;       // 64 bits   // The price of the NFT in wei
    address directory;  // 160 bits  // The directory contract
    string contractUri; // 256+ bits // The URI of the contract metadata
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

File 16 of 41 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

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

File 17 of 41 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 20 of 41 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

File 23 of 41 : IJBFundingCycleStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../enums/JBBallotState.sol';
import './../structs/JBFundingCycle.sol';
import './../structs/JBFundingCycleData.sol';

interface IJBFundingCycleStore {
  event Configure(
    uint256 indexed configuration,
    uint256 indexed projectId,
    JBFundingCycleData data,
    uint256 metadata,
    uint256 mustStartAtOrAfter,
    address caller
  );

  event Init(uint256 indexed configuration, uint256 indexed projectId, uint256 indexed basedOn);

  function latestConfigurationOf(uint256 _projectId) external view returns (uint256);

  function get(uint256 _projectId, uint256 _configuration)
    external
    view
    returns (JBFundingCycle memory);

  function latestConfiguredOf(uint256 _projectId)
    external
    view
    returns (JBFundingCycle memory fundingCycle, JBBallotState ballotState);

  function queuedOf(uint256 _projectId) external view returns (JBFundingCycle memory fundingCycle);

  function currentOf(uint256 _projectId) external view returns (JBFundingCycle memory fundingCycle);

  function currentBallotStateOf(uint256 _projectId) external view returns (JBBallotState);

  function configureFor(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    uint256 _metadata,
    uint256 _mustStartAtOrAfter
  ) external returns (JBFundingCycle memory fundingCycle);
}

File 24 of 41 : IJBProjects.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import './../structs/JBProjectMetadata.sol';
import './IJBTokenUriResolver.sol';

interface IJBProjects is IERC721 {
  event Create(
    uint256 indexed projectId,
    address indexed owner,
    JBProjectMetadata metadata,
    address caller
  );

  event SetMetadata(uint256 indexed projectId, JBProjectMetadata metadata, address caller);

  event SetTokenUriResolver(IJBTokenUriResolver indexed resolver, address caller);

  function count() external view returns (uint256);

  function metadataContentOf(uint256 _projectId, uint256 _domain)
    external
    view
    returns (string memory);

  function tokenUriResolver() external view returns (IJBTokenUriResolver);

  function createFor(address _owner, JBProjectMetadata calldata _metadata)
    external
    returns (uint256 projectId);

  function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata) external;

  function setTokenUriResolver(IJBTokenUriResolver _newResolver) external;
}

File 25 of 41 : IJBPrices.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './IJBPriceFeed.sol';

interface IJBPrices {
  event AddFeed(uint256 indexed currency, uint256 indexed base, IJBPriceFeed feed);

  function feedFor(uint256 _currency, uint256 _base) external view returns (IJBPriceFeed);

  function priceFor(
    uint256 _currency,
    uint256 _base,
    uint256 _decimals
  ) external view returns (uint256);

  function addFeedFor(
    uint256 _currency,
    uint256 _base,
    IJBPriceFeed _priceFeed
  ) external;
}

File 26 of 41 : JB721PricingParams.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBPrices.sol';
import './JB721TierParams.sol';

/**
  @member tiers The tiers to set.
  @member currency The currency that the tier contribution floors are denoted in.
  @member decimals The number of decimals included in the tier contribution floor fixed point numbers.
  @member prices A contract that exposes price feeds that can be used to resolved the value of a contributions that are sent in different currencies. Set to the zero address if payments must be made in `currency`.
*/
struct JB721PricingParams {
  JB721TierParams[] tiers;
  uint48 currency;
  uint48 decimals;
  IJBPrices prices;
}

File 27 of 41 : JB721TierParams.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
  @member price The minimum contribution to qualify for this tier.
  @member initialQuantity The initial `remainingAllowance` value when the tier was set.
  @member votingUnits The amount of voting significance to give this tier compared to others.
  @member reservedRate The number of minted tokens needed in the tier to allow for minting another reserved token.
  @member reservedRateBeneficiary The beneificary of the reserved tokens for this tier.
  @member encodedIPFSUri The URI to use for each token within the tier.
  @member category A category to group NFT tiers by.
  @member allowManualMint A flag indicating if the contract's owner can mint from this tier on demand.
  @member shouldUseReservedRateBeneficiaryAsDefault A flag indicating if the `reservedTokenBeneficiary` should be stored as the default beneficiary for all tiers.
  @member transfersPausable A flag indicating if transfers from this tier can be pausable. 
  @member useVotingUnits A flag indicating if the voting units override should be used over the price as the tier's voting units.
*/
struct JB721TierParams {
  uint104 price;
  uint32 initialQuantity;
  uint32 votingUnits;
  uint16 reservedRate;
  address reservedTokenBeneficiary;
  bytes32 encodedIPFSUri;
  uint24 category;
  bool allowManualMint;
  bool shouldUseReservedTokenBeneficiaryAsDefault;
  bool transfersPausable;
  bool useVotingUnits;
}

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

/** 
  @member tierId The ID of the tier to mint within.
  @member count The number of reserved tokens to mint. 
*/
struct JBTiered721MintReservesForTiersData {
  uint256 tierId;
  uint256 count;
}

File 29 of 41 : JBTiered721MintForTiersData.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member tierIds The IDs of the tier to mint within.
  @member beneficiary The beneficiary to mint for. 
*/
struct JBTiered721MintForTiersData {
  uint16[] tierIds;
  address beneficiary;
}

File 30 of 41 : IJB721Delegate.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBDirectory.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBTokenUriResolver.sol';

interface IJB721Delegate {
  function projectId() external view returns (uint256);

  function directory() external view returns (IJBDirectory);
}

File 31 of 41 : IJBTiered721DelegateStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBTokenUriResolver.sol';
import './../structs/JB721TierParams.sol';
import './../structs/JB721Tier.sol';
import './../structs/JBTiered721Flags.sol';

interface IJBTiered721DelegateStore {
  event CleanTiers(address indexed nft, address caller);

  function totalSupply(address _nft) external view returns (uint256);

  function balanceOf(address _nft, address _owner) external view returns (uint256);

  function maxTierIdOf(address _nft) external view returns (uint256);

  function tiersOf(
    address _nft,
    uint256[] calldata _categories,
    bool _includeResolvedUri,
    uint256 _startingSortIndex,
    uint256 _size
  ) external view returns (JB721Tier[] memory tiers);

  function tierOf(
    address _nft,
    uint256 _id,
    bool _includeResolvedUri
  ) external view returns (JB721Tier memory tier);

  function tierBalanceOf(
    address _nft,
    address _owner,
    uint256 _tier
  ) external view returns (uint256);

  function tierOfTokenId(
    address _nft,
    uint256 _tokenId,
    bool _includeResolvedUri
  ) external view returns (JB721Tier memory tier);

  function tierIdOfToken(uint256 _tokenId) external pure returns (uint256);

  function encodedIPFSUriOf(address _nft, uint256 _tierId) external view returns (bytes32);

  // function firstOwnerOf(address _nft, uint256 _tokenId) external view returns (address);

  function redemptionWeightOf(
    address _nft,
    uint256[] memory _tokenIds
  ) external view returns (uint256 weight);

  function totalRedemptionWeight(address _nft) external view returns (uint256 weight);

  function numberOfReservedTokensOutstandingFor(
    address _nft,
    uint256 _tierId
  ) external view returns (uint256);

  function numberOfReservesMintedFor(address _nft, uint256 _tierId) external view returns (uint256);

  function numberOfBurnedFor(address _nft, uint256 _tierId) external view returns (uint256);

  function isTierRemoved(address _nft, uint256 _tierId) external view returns (bool);

  function flagsOf(address _nft) external view returns (JBTiered721Flags memory);

  function votingUnitsOf(address _nft, address _account) external view returns (uint256 units);

  function tierVotingUnitsOf(
    address _nft,
    address _account,
    uint256 _tierId
  ) external view returns (uint256 units);

  function defaultReservedTokenBeneficiaryOf(address _nft) external view returns (address);

  function reservedTokenBeneficiaryOf(
    address _nft,
    uint256 _tierId
  ) external view returns (address);

  function tokenUriResolverOf(address _nft) external view returns (IJBTokenUriResolver);

  function encodedTierIPFSUriOf(address _nft, uint256 _tokenId) external view returns (bytes32);

  function recordAddTiers(
    JB721TierParams[] memory _tierData
  ) external returns (uint256[] memory tierIds);

  function recordMintReservesFor(
    uint256 _tierId,
    uint256 _count
  ) external returns (uint256[] memory tokenIds);

  function recordBurn(uint256[] memory _tokenIds) external;

  function recordMint(
    uint256 _amount,
    uint16[] calldata _tierIds,
    bool _isManualMint
  ) external returns (uint256[] memory tokenIds, uint256 leftoverAmount);

  function recordTransferForTier(uint256 _tierId, address _from, address _to) external;

  function recordRemoveTierIds(uint256[] memory _tierIds) external;

  function recordSetTokenUriResolver(IJBTokenUriResolver _resolver) external;

  function recordSetEncodedIPFSUriOf(uint256 _tierId, bytes32 _encodedIPFSUri) external;

  function recordFlags(JBTiered721Flags calldata _flag) external;

  function cleanTiers(address _nft) external;
}

File 32 of 41 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 33 of 41 : JBBallotState.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum JBBallotState {
  Active,
  Approved,
  Failed
}

File 34 of 41 : JBFundingCycle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBFundingCycleBallot.sol';

/** 
  @member number The funding cycle number for the cycle's project. Each funding cycle has a number that is an increment of the cycle that directly preceded it. Each project's first funding cycle has a number of 1.
  @member configuration The timestamp when the parameters for this funding cycle were configured. This value will stay the same for subsequent funding cycles that roll over from an originally configured cycle.
  @member basedOn The `configuration` of the funding cycle that was active when this cycle was created.
  @member start The timestamp marking the moment from which the funding cycle is considered active. It is a unix timestamp measured in seconds.
  @member duration The number of seconds the funding cycle lasts for, after which a new funding cycle will start. A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`.
  @member weight A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. For example, payment terminals can use this to determine how many tokens should be minted when a payment is received.
  @member discountRate A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. If it's 0, each funding cycle will have equal weight. If the number is 90%, the next funding cycle will have a 10% smaller weight. This weight is out of `JBConstants.MAX_DISCOUNT_RATE`.
  @member ballot An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. It can be used to create rules around how a project owner can change funding cycle parameters over time.
  @member metadata Extra data that can be associated with a funding cycle.
*/
struct JBFundingCycle {
  uint256 number;
  uint256 configuration;
  uint256 basedOn;
  uint256 start;
  uint256 duration;
  uint256 weight;
  uint256 discountRate;
  IJBFundingCycleBallot ballot;
  uint256 metadata;
}

File 35 of 41 : JBFundingCycleData.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBFundingCycleBallot.sol';

/** 
  @member duration The number of seconds the funding cycle lasts for, after which a new funding cycle will start. A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`.
  @member weight A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. For example, payment terminals can use this to determine how many tokens should be minted when a payment is received.
  @member discountRate A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. If it's 0, each funding cycle will have equal weight. If the number is 90%, the next funding cycle will have a 10% smaller weight. This weight is out of `JBConstants.MAX_DISCOUNT_RATE`.
  @member ballot An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. It can be used to create rules around how a project owner can change funding cycle parameters over time.
*/
struct JBFundingCycleData {
  uint256 duration;
  uint256 weight;
  uint256 discountRate;
  IJBFundingCycleBallot ballot;
}

File 36 of 41 : JBProjectMetadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member content The metadata content.
  @member domain The domain within which the metadata applies.
*/
struct JBProjectMetadata {
  string content;
  uint256 domain;
}

File 37 of 41 : IJBTokenUriResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IJBTokenUriResolver {
  function getUri(uint256 _projectId) external view returns (string memory tokenUri);
}

File 38 of 41 : IJBPriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IJBPriceFeed {
  function currentPrice(uint256 _targetDecimals) external view returns (uint256);
}

File 39 of 41 : JB721Tier.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

/**
  @member id The tier's ID.
  @member price The price that must be paid to qualify for this tier.
  @member remainingQuantity Remaining number of tokens in this tier. Together with idCeiling this enables for consecutive, increasing token ids to be issued to contributors.
  @member initialQuantity The initial `remainingAllowance` value when the tier was set.
  @member votingUnits The amount of voting significance to give this tier compared to others.
  @member reservedRate The number of minted tokens needed in the tier to allow for minting another reserved token.
  @member reservedRateBeneficiary The beneificary of the reserved tokens for this tier.
  @member encodedIPFSUri The URI to use for each token within the tier.
  @member category A category to group NFT tiers by.
  @member allowManualMint A flag indicating if the contract's owner can mint from this tier on demand.
  @member transfersPausable A flag indicating if transfers from this tier can be pausable. 
  @member resolvedTokenUri A resolved token URI if a resolver is included for the NFT to which this tier belongs.
*/
struct JB721Tier {
  uint256 id;
  uint256 price;
  uint256 remainingQuantity;
  uint256 initialQuantity;
  uint256 votingUnits;
  uint256 reservedRate;
  address reservedTokenBeneficiary;
  bytes32 encodedIPFSUri;
  uint256 category;
  bool allowManualMint;
  bool transfersPausable;
  string resolvedUri;
}

File 40 of 41 : JBTiered721Flags.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member lockReservedTokenChanges A flag indicating if reserved tokens can change over time by adding new tiers with a reserved rate.
  @member lockVotingUnitChanges A flag indicating if voting unit expectations can change over time by adding new tiers with voting units.
  @member lockManualMintingChanges A flag indicating if manual minting expectations can change over time by adding new tiers with manual minting.
  @member preventOverspending A flag indicating if payments sending more than the value the NFTs being minted are worth should be reverted. 
*/
struct JBTiered721Flags {
  bool lockReservedTokenChanges;
  bool lockVotingUnitChanges;
  bool lockManualMintingChanges;
  bool preventOverspending;
}

File 41 of 41 : IJBFundingCycleBallot.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import './../enums/JBBallotState.sol';

interface IJBFundingCycleBallot is IERC165 {
  function duration() external view returns (uint256);

  function stateOf(
    uint256 _projectId,
    uint256 _configuration,
    uint256 _start
  ) external view returns (JBBallotState);
}

Settings
{
  "remappings": [
    "@ensdomains/=node_modules/@ensdomains/",
    "@jbx-protocol/=node_modules/@jbx-protocol/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@paulrberg/=node_modules/@paulrberg/",
    "base64-sol/=node_modules/base64-sol/",
    "ds-test/=lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "juice-token-resolver/=lib/juice-token-resolver/",
    "prb-math/=node_modules/prb-math/",
    "typeface/=lib/juice-token-resolver/lib/typeface/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"jbProjects","type":"address"},{"internalType":"uint16","name":"tipProject","type":"uint16"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"address","name":"directory","type":"address"},{"internalType":"string","name":"contractUri","type":"string"}],"internalType":"struct Config","name":"_config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"JBCards_DevMintArgumentArraysMustBeEqualLength","type":"error"},{"inputs":[],"name":"JBCards_MsgSenderDoesNotHaveDevMinterRole","type":"error"},{"inputs":[],"name":"JBCards_ProjectMustHaveAnETHPaymentTerminalConfiguredOnTheActiveJBDirectory","type":"error"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"JBCards_ProjectRefusedPayment","type":"error"},{"inputs":[],"name":"JBCards_TXValueBelowMintPrice","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":false,"internalType":"string","name":"_contractUri","type":"string"}],"name":"JBCards_ContractUriSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_directory","type":"address"}],"name":"JBCards_DirectorySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_JBProjects","type":"address"}],"name":"JBCards_JBProjectsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"JBCards_PriceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"JBCards_ProjectAddToBalanceFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountPaid","type":"uint256"}],"name":"JBCards_ProjectAddToBalanceSucceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"JBCards_ProjectPayFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountPaid","type":"uint256"}],"name":"JBCards_ProjectPaySucceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"JBCards_TipAddToBalanceFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountPaid","type":"uint256"}],"name":"JBCards_TipAddToBalanceSucceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"JBCards_TipPayFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountPaid","type":"uint256"}],"name":"JBCards_TipPaySucceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tipProject","type":"uint256"}],"name":"JBCards_TipProjectSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newTerminal","type":"address"}],"name":"JBCards_TipTerminalSet","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEV_MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"projectIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"directory","outputs":[{"internalType":"contract IJBDirectory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethTipTerminal","outputs":[{"internalType":"contract IJBPaymentTerminal","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"jbProjects","outputs":[{"internalType":"contract IERC721Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"tipBeneficiary","type":"address"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractUri","type":"string"}],"name":"setContractUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_directory","type":"address"}],"name":"setDirectory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_JBProjects","type":"address"}],"name":"setJBProjects","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_price","type":"uint64"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_tipProject","type":"uint16"}],"name":"setTipProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setTipTerminal","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":"tipProject","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162003648380380620036488339810160408190526200003491620005de565b6040805160208101909152600081526200004e81620000df565b506200005a33620000f1565b60016005556200008b7f20f546240c242d1a9eab9d28b86b580e72eb85d36c7ae9952962eee54e393c563362000143565b805162000098906200014f565b6060810151620000a890620001a3565b6040810151620000b890620001f7565b6080810151620000c89062000247565b6020810151620000d89062000291565b506200085f565b6002620000ed828262000737565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620000ed8282620002db565b620001596200037f565b600680546001600160a01b0319166001600160a01b0383169081179091556040517f14a53320b515e5bd15168e3fb3e5e71851c5102987a77141633103d02df761c090600090a250565b620001ad6200037f565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fa0ddb7770400bb6f56f6cf1509ac80275c68f517b320233eab8b2dd25fb5c29690600090a250565b620002016200037f565b6001600160401b03811660098190556040519081527f8b429835b91a808725b2a7facad351a43bb9bfe2fb4c23c3bcebed45d98fc0c0906020015b60405180910390a150565b620002516200037f565b600a6200025f828262000737565b507f3d19aa64ec42643d9f45a852fd1b15158d4c0789fbbc3f0e18ef4ea681dbcec3816040516200023c919062000803565b6200029b6200037f565b61ffff811660088190556040517f9b989ec2db2a403d4c1b1db2783b5d2b97eaaa1f11a90a50011e0f5e1cc60fbb90600090a2620002d8620003e0565b50565b60008281526004602090815260408083206001600160a01b038516845290915290205460ff16620000ed5760008281526004602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200033b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6003546001600160a01b03163314620003de5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b600754600854604051630862026560e41b8152600481019190915261eeee60248201526001600160a01b0390911690638620265090604401602060405180830381865afa15801562000436573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200045c919062000838565b600b80546001600160a01b0319166001600160a01b039290921691821790556040517fa91b3c45d3528ba4867f171a8103aa4171afb5fe9f7c125b63f458e3b092a1b790600090a2565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715620004e157620004e1620004a6565b60405290565b6001600160a01b0381168114620002d857600080fd5b80516200050a81620004e7565b919050565b80516001600160401b03811681146200050a57600080fd5b60005b83811015620005445781810151838201526020016200052a565b50506000910152565b600082601f8301126200055f57600080fd5b81516001600160401b03808211156200057c576200057c620004a6565b604051601f8301601f19908116603f01168101908282118183101715620005a757620005a7620004a6565b81604052838152866020858801011115620005c157600080fd5b620005d484602083016020890162000527565b9695505050505050565b600060208284031215620005f157600080fd5b81516001600160401b03808211156200060957600080fd5b9083019060a082860312156200061e57600080fd5b62000628620004bc565b82516200063581620004e7565b8152602083015161ffff811681146200064d57600080fd5b602082015262000660604084016200050f565b60408201526200067360608401620004fd565b60608201526080830151828111156200068b57600080fd5b62000699878286016200054d565b60808301525095945050505050565b600181811c90821680620006bd57607f821691505b602082108103620006de57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200073257600081815260208120601f850160051c810160208610156200070d5750805b601f850160051c820191505b818110156200072e5782815560010162000719565b5050505b505050565b81516001600160401b03811115620007535762000753620004a6565b6200076b81620007648454620006a8565b84620006e4565b602080601f831160018114620007a357600084156200078a5750858301515b600019600386901b1c1916600185901b1785556200072e565b600085815260208120601f198616915b82811015620007d457888601518255948401946001909101908401620007b3565b5085821015620007f35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600082518060208401526200082481604085016020870162000527565b601f01601f19169190910160400192915050565b6000602082840312156200084b57600080fd5b81516200085881620004e7565b9392505050565b612dd9806200086f6000396000f3fe6080604052600436106101e15760003560e01c80638da5cb5b11610102578063ccb4807b11610095578063e8a3d48511610064578063e8a3d4851461059d578063e985e9c5146105b2578063f242432a146105fb578063f2fde38b1461061b57600080fd5b8063ccb4807b1461052a578063d547741f1461054a578063da39b3e71461056a578063e0e66e441461057d57600080fd5b8063a217fddf116100d1578063a217fddf146104b5578063a22cb465146104ca578063bccf233c146104ea578063c41c2f241461050a57600080fd5b80638da5cb5b1461044157806391d148541461045f5780639e3789da1461047f578063a035b1fe1461049f57600080fd5b80632eb2c2d61161017a5780634e1273f4116101495780634e1273f4146103bf578063696c2ce3146103ec5780636e91818a1461040c578063715018a61461042c57600080fd5b80632eb2c2d6146103275780632f2ff15d14610347578063319804441461036757806336568abe1461039f57600080fd5b806315160fbb116101b657806315160fbb146102aa5780632114b68b146102c1578063229c2048146102d7578063248a9ca3146102f757600080fd5b8062260046146101e6578062fdd58e1461022d57806301ffc9a71461024d5780630e89341c1461027d575b600080fd5b3480156101f257600080fd5b5061021a7f20f546240c242d1a9eab9d28b86b580e72eb85d36c7ae9952962eee54e393c5681565b6040519081526020015b60405180910390f35b34801561023957600080fd5b5061021a610248366004611f80565b61063b565b34801561025957600080fd5b5061026d610268366004611fc2565b6106d4565b6040519015158152602001610224565b34801561028957600080fd5b5061029d610298366004611fdf565b610714565b6040516102249190612048565b3480156102b657600080fd5b506102bf610786565b005b3480156102cd57600080fd5b5061021a60085481565b3480156102e357600080fd5b506102bf6102f236600461205b565b610849565b34801561030357600080fd5b5061021a610312366004611fdf565b60009081526004602052604090206001015490565b34801561033357600080fd5b506102bf6103423660046121e7565b610897565b34801561035357600080fd5b506102bf610362366004612294565b6108e3565b34801561037357600080fd5b50600654610387906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b3480156103ab57600080fd5b506102bf6103ba366004612294565b61090d565b3480156103cb57600080fd5b506103df6103da3660046122c4565b61098b565b60405161022491906123cb565b3480156103f857600080fd5b506102bf6104073660046123de565b610ab4565b34801561041857600080fd5b506102bf6104273660046123de565b610b06565b34801561043857600080fd5b506102bf610b58565b34801561044d57600080fd5b506003546001600160a01b0316610387565b34801561046b57600080fd5b5061026d61047a366004612294565b610b6c565b34801561048b57600080fd5b50600b54610387906001600160a01b031681565b3480156104ab57600080fd5b5061021a60095481565b3480156104c157600080fd5b5061021a600081565b3480156104d657600080fd5b506102bf6104e53660046123fb565b610b97565b3480156104f657600080fd5b506102bf61050536600461242e565b610ba2565b34801561051657600080fd5b50600754610387906001600160a01b031681565b34801561053657600080fd5b506102bf610545366004612452565b610be8565b34801561055657600080fd5b506102bf610565366004612294565b610c2c565b6102bf6105783660046124a2565b610c51565b34801561058957600080fd5b506102bf61059836600461252f565b611142565b3480156105a957600080fd5b5061029d61124d565b3480156105be57600080fd5b5061026d6105cd3660046125c8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561060757600080fd5b506102bf6106163660046125f6565b6112df565b34801561062757600080fd5b506102bf6106363660046123de565b611324565b60006001600160a01b0383166106ab5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b1480610705575063da8def7360e01b6001600160e01b03198316145b806106ce57506106ce8261139a565b60065460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa15801561075e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106ce919081019061265e565b600754600854604051630862026560e41b8152600481019190915261eeee60248201526001600160a01b0390911690638620265090604401602060405180830381865afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff91906126df565b600b80546001600160a01b0319166001600160a01b039290921691821790556040517fa91b3c45d3528ba4867f171a8103aa4171afb5fe9f7c125b63f458e3b092a1b790600090a2565b6108516113bf565b6001600160401b03811660098190556040519081527f8b429835b91a808725b2a7facad351a43bb9bfe2fb4c23c3bcebed45d98fc0c0906020015b60405180910390a150565b6001600160a01b0385163314806108b357506108b385336105cd565b6108cf5760405162461bcd60e51b81526004016106a2906126fc565b6108dc8585858585611419565b5050505050565b6000828152600460205260409020600101546108fe816115f6565b6109088383611600565b505050565b6001600160a01b038116331461097d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106a2565b6109878282611686565b5050565b606081518351146109f05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106a2565b600083516001600160401b03811115610a0b57610a0b612084565b604051908082528060200260200182016040528015610a34578160200160208202803683370190505b50905060005b8451811015610aac57610a7f858281518110610a5857610a5861274a565b6020026020010151858381518110610a7257610a7261274a565b602002602001015161063b565b828281518110610a9157610a9161274a565b6020908102919091010152610aa581612776565b9050610a3a565b509392505050565b610abc6113bf565b600680546001600160a01b0319166001600160a01b0383169081179091556040517f14a53320b515e5bd15168e3fb3e5e71851c5102987a77141633103d02df761c090600090a250565b610b0e6113bf565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fa0ddb7770400bb6f56f6cf1509ac80275c68f517b320233eab8b2dd25fb5c29690600090a250565b610b606113bf565b610b6a60006116ed565b565b60009182526004602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61098733838361173f565b610baa6113bf565b61ffff811660088190556040517f9b989ec2db2a403d4c1b1db2783b5d2b97eaaa1f11a90a50011e0f5e1cc60fbb90600090a2610be5610786565b50565b610bf06113bf565b600a610bfc828261280f565b507f3d19aa64ec42643d9f45a852fd1b15158d4c0789fbbc3f0e18ef4ea681dbcec38160405161088c9190612048565b600082815260046020526040902060010154610c47816115f6565b6109088383611686565b610c5961181f565b600954341015610c7c57604051639d2c4aa560e01b815260040160405180910390fd5b610c988284600160405180602001604052806000815250611878565b600754604051630862026560e41b81526004810185905261eeee60248201526000916001600160a01b031690638620265090604401602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e91906126df565b90506001600160a01b038116610d375760405163d76a0b1560e01b815260040160405180910390fd5b6008546040805160208101929092526000908201819052606082018190529060800160408051601f1981840301815290829052600954631ebc263f60e01b83529092506001600160a01b03841691631ebc263f9190610da9908990839061eeee908b9060009081908b906004016128ce565b60206040518083038185885af193505050508015610de4575060408051601f3d908101601f19168201909252610de191810190612957565b60015b610f2357847f47c305f21461d61c61a1049a153c0c10298bad3b28963fe3494eca267079030f600954604051610e1c91815260200190565b60405180910390a260095460405163019f1d0b60e31b81526001600160a01b03841691630cf8e85891610e5b908990839061eeee908890600401612970565b6000604051808303818588803b158015610e7457600080fd5b505af193505050508015610e86575060015b610ee257847ffe190b095b35e77d06f50296ae3c34841478bbeb99ba45b4a0f5812edad45f9e600954604051610ebe91815260200190565b60405180910390a2604051634afb559560e11b8152600481018690526024016106a2565b847f687b94ac9c087f94086180faa9dc01ea0f45e33c6766fd98bc456967181d6dd2600954604051610f1691815260200190565b60405180910390a2610f61565b50847f657b582531d907a1bcd2f5e7600df08603648363e0ee1581dcc58a0583cf0cf4600954604051610f5891815260200190565b60405180910390a25b60095434111561113657600b54600854604051631ebc263f60e01b815247926001600160a01b031691631ebc263f918491610fad91839061eeee908b9060009081908c906004016129d9565b60206040518083038185885af193505050508015610fe8575060408051601f3d908101601f19168201909252610fe591810190612957565b60015b6110fc576008546040518281527fd2b50b229255ac34e585a6d015d1a1f429839fce80c8f096b6442fd0d228c6289060200160405180910390a2600b5460085460405163019f1d0b60e31b81526001600160a01b0390921691630cf8e85891849161105e9190839061eeee908990600401612a41565b6000604051808303818588803b15801561107757600080fd5b505af193505050508015611089575060015b6110c9576008546040518281527fdba6302a407096d87f981b64d42f614f95798e6374a24a73bf665853047c41e3906020015b60405180910390a2611134565b6008546040518281527facfda3630f584ca05c8cb34c002f16b7f64c4e9de557965838fca639681193cc906020016110bc565b506008546040518281527fc9e1e262388d52d2223602ceb666f54bfd60804bc3f6aa8b487baacb62d8a4b09060200160405180910390a25b505b50506109086001600555565b61116c7f20f546240c242d1a9eab9d28b86b580e72eb85d36c7ae9952962eee54e393c5633610b6c565b61118957604051630c6a46a960e21b815260040160405180910390fd5b84831415806111985750828114155b156111b657604051637b7b1ac960e11b815260040160405180910390fd5b60005b85811015611244576112328787838181106111d6576111d661274a565b90506020020160208101906111eb91906123de565b8686848181106111fd576111fd61274a565b905060200201358585858181106112165761121661274a565b9050602002013560405180602001604052806000815250611878565b8061123c81612776565b9150506111b9565b50505050505050565b6060600a805461125c9061278f565b80601f01602080910402602001604051908101604052809291908181526020018280546112889061278f565b80156112d55780601f106112aa576101008083540402835291602001916112d5565b820191906000526020600020905b8154815290600101906020018083116112b857829003601f168201915b5050505050905090565b6001600160a01b0385163314806112fb57506112fb85336105cd565b6113175760405162461bcd60e51b81526004016106a2906126fc565b6108dc8585858585611983565b61132c6113bf565b6001600160a01b0381166113915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a2565b610be5816116ed565b60006001600160e01b03198216637965db0b60e01b14806106ce57506106ce82611aad565b6003546001600160a01b03163314610b6a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a2565b815183511461147b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106a2565b6001600160a01b0384166114a15760405162461bcd60e51b81526004016106a290612a8e565b3360005b84518110156115885760008582815181106114c2576114c261274a565b6020026020010151905060008583815181106114e0576114e061274a565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115305760405162461bcd60e51b81526004016106a290612ad3565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061156d908490612b1d565b925050819055505050508061158190612776565b90506114a5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115d8929190612b30565b60405180910390a46115ee818787878787611afd565b505050505050565b610be58133611c58565b61160a8282610b6c565b6109875760008281526004602090815260408083206001600160a01b03851684529091529020805460ff191660011790556116423390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116908282610b6c565b156109875760008281526004602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036117b25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106a2565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6002600554036118715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a2565b6002600555565b6001600160a01b0384166118d85760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106a2565b3360006118e485611cb1565b905060006118f185611cb1565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290611923908490612b1d565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461124483600089898989611cfc565b6001600160a01b0384166119a95760405162461bcd60e51b81526004016106a290612a8e565b3360006119b585611cb1565b905060006119c285611cb1565b90506000868152602081815260408083206001600160a01b038c16845290915290205485811015611a055760405162461bcd60e51b81526004016106a290612ad3565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611a42908490612b1d565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611aa2848a8a8a8a8a611cfc565b505050505050505050565b60006001600160e01b03198216636cdb3d1360e11b1480611ade57506001600160e01b031982166303a24d0760e21b145b806106ce57506301ffc9a760e01b6001600160e01b03198316146106ce565b6001600160a01b0384163b156115ee5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611b419089908990889088908890600401612b5e565b6020604051808303816000875af1925050508015611b7c575060408051601f3d908101601f19168201909252611b7991810190612bbc565b60015b611c2857611b88612bd9565b806308c379a003611bc15750611b9c612bf5565b80611ba75750611bc3565b8060405162461bcd60e51b81526004016106a29190612048565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016106a2565b6001600160e01b0319811663bc197c8160e01b146112445760405162461bcd60e51b81526004016106a290612c7e565b611c628282610b6c565b61098757611c6f81611db7565b611c7a836020611dc9565b604051602001611c8b929190612cc6565b60408051601f198184030181529082905262461bcd60e51b82526106a291600401612048565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611ceb57611ceb61274a565b602090810291909101015292915050565b6001600160a01b0384163b156115ee5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611d409089908990889088908890600401612d3b565b6020604051808303816000875af1925050508015611d7b575060408051601f3d908101601f19168201909252611d7891810190612bbc565b60015b611d8757611b88612bd9565b6001600160e01b0319811663f23a6e6160e01b146112445760405162461bcd60e51b81526004016106a290612c7e565b60606106ce6001600160a01b03831660145b60606000611dd8836002612d75565b611de3906002612b1d565b6001600160401b03811115611dfa57611dfa612084565b6040519080825280601f01601f191660200182016040528015611e24576020820181803683370190505b509050600360fc1b81600081518110611e3f57611e3f61274a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611e6e57611e6e61274a565b60200101906001600160f81b031916908160001a9053506000611e92846002612d75565b611e9d906001612b1d565b90505b6001811115611f15576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ed157611ed161274a565b1a60f81b828281518110611ee757611ee761274a565b60200101906001600160f81b031916908160001a90535060049490941c93611f0e81612d8c565b9050611ea0565b508315611f645760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106a2565b9392505050565b6001600160a01b0381168114610be557600080fd5b60008060408385031215611f9357600080fd5b8235611f9e81611f6b565b946020939093013593505050565b6001600160e01b031981168114610be557600080fd5b600060208284031215611fd457600080fd5b8135611f6481611fac565b600060208284031215611ff157600080fd5b5035919050565b60005b83811015612013578181015183820152602001611ffb565b50506000910152565b60008151808452612034816020860160208601611ff8565b601f01601f19169290920160200192915050565b602081526000611f64602083018461201c565b60006020828403121561206d57600080fd5b81356001600160401b0381168114611f6457600080fd5b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156120bf576120bf612084565b6040525050565b60006001600160401b038211156120df576120df612084565b5060051b60200190565b600082601f8301126120fa57600080fd5b81356020612107826120c6565b604051612114828261209a565b83815260059390931b850182019282810191508684111561213457600080fd5b8286015b8481101561214f5780358352918301918301612138565b509695505050505050565b60006001600160401b0382111561217357612173612084565b50601f01601f191660200190565b600061218c8361215a565b604051612199828261209a565b8092508481528585850111156121ae57600080fd5b8484602083013760006020868301015250509392505050565b600082601f8301126121d857600080fd5b611f6483833560208501612181565b600080600080600060a086880312156121ff57600080fd5b853561220a81611f6b565b9450602086013561221a81611f6b565b935060408601356001600160401b038082111561223657600080fd5b61224289838a016120e9565b9450606088013591508082111561225857600080fd5b61226489838a016120e9565b9350608088013591508082111561227a57600080fd5b50612287888289016121c7565b9150509295509295909350565b600080604083850312156122a757600080fd5b8235915060208301356122b981611f6b565b809150509250929050565b600080604083850312156122d757600080fd5b82356001600160401b03808211156122ee57600080fd5b818501915085601f83011261230257600080fd5b8135602061230f826120c6565b60405161231c828261209a565b83815260059390931b850182019282810191508984111561233c57600080fd5b948201945b8386101561236357853561235481611f6b565b82529482019490820190612341565b9650508601359250508082111561237957600080fd5b50612386858286016120e9565b9150509250929050565b600081518084526020808501945080840160005b838110156123c0578151875295820195908201906001016123a4565b509495945050505050565b602081526000611f646020830184612390565b6000602082840312156123f057600080fd5b8135611f6481611f6b565b6000806040838503121561240e57600080fd5b823561241981611f6b565b9150602083013580151581146122b957600080fd5b60006020828403121561244057600080fd5b813561ffff81168114611f6457600080fd5b60006020828403121561246457600080fd5b81356001600160401b0381111561247a57600080fd5b8201601f8101841361248b57600080fd5b61249a84823560208401612181565b949350505050565b6000806000606084860312156124b757600080fd5b8335925060208401356124c981611f6b565b915060408401356124d981611f6b565b809150509250925092565b60008083601f8401126124f657600080fd5b5081356001600160401b0381111561250d57600080fd5b6020830191508360208260051b850101111561252857600080fd5b9250929050565b6000806000806000806060878903121561254857600080fd5b86356001600160401b038082111561255f57600080fd5b61256b8a838b016124e4565b9098509650602089013591508082111561258457600080fd5b6125908a838b016124e4565b909650945060408901359150808211156125a957600080fd5b506125b689828a016124e4565b979a9699509497509295939492505050565b600080604083850312156125db57600080fd5b82356125e681611f6b565b915060208301356122b981611f6b565b600080600080600060a0868803121561260e57600080fd5b853561261981611f6b565b9450602086013561262981611f6b565b9350604086013592506060860135915060808601356001600160401b0381111561265257600080fd5b612287888289016121c7565b60006020828403121561267057600080fd5b81516001600160401b0381111561268657600080fd5b8201601f8101841361269757600080fd5b80516126a28161215a565b6040516126af828261209a565b8281528660208486010111156126c457600080fd5b6126d5836020830160208701611ff8565b9695505050505050565b6000602082840312156126f157600080fd5b8151611f6481611f6b565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161278857612788612760565b5060010190565b600181811c908216806127a357607f821691505b6020821081036127c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561090857600081815260208120601f850160051c810160208610156127f05750805b601f850160051c820191505b818110156115ee578281556001016127fc565b81516001600160401b0381111561282857612828612084565b61283c81612836845461278f565b846127c9565b602080601f83116001811461287157600084156128595750858301515b600019600386901b1c1916600185901b1785556115ee565b600085815260208120601f198616915b828110156128a057888601518255948401946001909101908401612881565b50858210156128be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b878152602081018790526001600160a01b038681166040830152851660608201526080810184905282151560a082015261010060c0820181905260148183015273129d5a58d9589bde0810d85c99081b5a5b9d195960621b61012083015260009061014083015b905082810360e0840152612949818561201c565b9a9950505050505050505050565b60006020828403121561296957600080fd5b5051919050565b848152602081018490526001600160a01b038316604082015260a06060820181905260149082015273129d5a58d9589bde0810d85c99081b5a5b9d195960621b60c0820152600060e082015b82810360808401526129ce818561201c565b979650505050505050565b878152602081018790526001600160a01b038681166040830152851660608201526080810184905282151560a082015261010060c082018190526011818301527004a75696365626f7820436172642074697607c1b6101208301526000906101408301612935565b848152602081018490526001600160a01b038316604082015260a0606082018190526011908201527004a75696365626f7820436172642074697607c1b60c0820152600060e082016129bc565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156106ce576106ce612760565b604081526000612b436040830185612390565b8281036020840152612b558185612390565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090612b8a90830186612390565b8281036060840152612b9c8186612390565b90508281036080840152612bb0818561201c565b98975050505050505050565b600060208284031215612bce57600080fd5b8151611f6481611fac565b600060033d1115612bf25760046000803e5060005160e01c5b90565b600060443d1015612c035790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612c3257505050505090565b8285019150815181811115612c4a5750505050505090565b843d8701016020828501011115612c645750505050505090565b612c736020828601018761209a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612cfe816017850160208801611ff8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612d2f816028840160208801611ff8565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906129ce9083018461201c565b80820281158282048414176106ce576106ce612760565b600081612d9b57612d9b612760565b50600019019056fea2646970667358221220c6c893172393e48c45712844739440620995b6de15d40c7d10300364cc99b86264736f6c634300081100330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000000000000000000000000000000000000000001d1000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d663733385a3863584a366e34614c737a4a6373334d67425451717270395a564e6b685776565575654d3547790000000000000000000000

Deployed Bytecode

0x6080604052600436106101e15760003560e01c80638da5cb5b11610102578063ccb4807b11610095578063e8a3d48511610064578063e8a3d4851461059d578063e985e9c5146105b2578063f242432a146105fb578063f2fde38b1461061b57600080fd5b8063ccb4807b1461052a578063d547741f1461054a578063da39b3e71461056a578063e0e66e441461057d57600080fd5b8063a217fddf116100d1578063a217fddf146104b5578063a22cb465146104ca578063bccf233c146104ea578063c41c2f241461050a57600080fd5b80638da5cb5b1461044157806391d148541461045f5780639e3789da1461047f578063a035b1fe1461049f57600080fd5b80632eb2c2d61161017a5780634e1273f4116101495780634e1273f4146103bf578063696c2ce3146103ec5780636e91818a1461040c578063715018a61461042c57600080fd5b80632eb2c2d6146103275780632f2ff15d14610347578063319804441461036757806336568abe1461039f57600080fd5b806315160fbb116101b657806315160fbb146102aa5780632114b68b146102c1578063229c2048146102d7578063248a9ca3146102f757600080fd5b8062260046146101e6578062fdd58e1461022d57806301ffc9a71461024d5780630e89341c1461027d575b600080fd5b3480156101f257600080fd5b5061021a7f20f546240c242d1a9eab9d28b86b580e72eb85d36c7ae9952962eee54e393c5681565b6040519081526020015b60405180910390f35b34801561023957600080fd5b5061021a610248366004611f80565b61063b565b34801561025957600080fd5b5061026d610268366004611fc2565b6106d4565b6040519015158152602001610224565b34801561028957600080fd5b5061029d610298366004611fdf565b610714565b6040516102249190612048565b3480156102b657600080fd5b506102bf610786565b005b3480156102cd57600080fd5b5061021a60085481565b3480156102e357600080fd5b506102bf6102f236600461205b565b610849565b34801561030357600080fd5b5061021a610312366004611fdf565b60009081526004602052604090206001015490565b34801561033357600080fd5b506102bf6103423660046121e7565b610897565b34801561035357600080fd5b506102bf610362366004612294565b6108e3565b34801561037357600080fd5b50600654610387906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b3480156103ab57600080fd5b506102bf6103ba366004612294565b61090d565b3480156103cb57600080fd5b506103df6103da3660046122c4565b61098b565b60405161022491906123cb565b3480156103f857600080fd5b506102bf6104073660046123de565b610ab4565b34801561041857600080fd5b506102bf6104273660046123de565b610b06565b34801561043857600080fd5b506102bf610b58565b34801561044d57600080fd5b506003546001600160a01b0316610387565b34801561046b57600080fd5b5061026d61047a366004612294565b610b6c565b34801561048b57600080fd5b50600b54610387906001600160a01b031681565b3480156104ab57600080fd5b5061021a60095481565b3480156104c157600080fd5b5061021a600081565b3480156104d657600080fd5b506102bf6104e53660046123fb565b610b97565b3480156104f657600080fd5b506102bf61050536600461242e565b610ba2565b34801561051657600080fd5b50600754610387906001600160a01b031681565b34801561053657600080fd5b506102bf610545366004612452565b610be8565b34801561055657600080fd5b506102bf610565366004612294565b610c2c565b6102bf6105783660046124a2565b610c51565b34801561058957600080fd5b506102bf61059836600461252f565b611142565b3480156105a957600080fd5b5061029d61124d565b3480156105be57600080fd5b5061026d6105cd3660046125c8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561060757600080fd5b506102bf6106163660046125f6565b6112df565b34801561062757600080fd5b506102bf6106363660046123de565b611324565b60006001600160a01b0383166106ab5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b1480610705575063da8def7360e01b6001600160e01b03198316145b806106ce57506106ce8261139a565b60065460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa15801561075e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106ce919081019061265e565b600754600854604051630862026560e41b8152600481019190915261eeee60248201526001600160a01b0390911690638620265090604401602060405180830381865afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff91906126df565b600b80546001600160a01b0319166001600160a01b039290921691821790556040517fa91b3c45d3528ba4867f171a8103aa4171afb5fe9f7c125b63f458e3b092a1b790600090a2565b6108516113bf565b6001600160401b03811660098190556040519081527f8b429835b91a808725b2a7facad351a43bb9bfe2fb4c23c3bcebed45d98fc0c0906020015b60405180910390a150565b6001600160a01b0385163314806108b357506108b385336105cd565b6108cf5760405162461bcd60e51b81526004016106a2906126fc565b6108dc8585858585611419565b5050505050565b6000828152600460205260409020600101546108fe816115f6565b6109088383611600565b505050565b6001600160a01b038116331461097d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106a2565b6109878282611686565b5050565b606081518351146109f05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106a2565b600083516001600160401b03811115610a0b57610a0b612084565b604051908082528060200260200182016040528015610a34578160200160208202803683370190505b50905060005b8451811015610aac57610a7f858281518110610a5857610a5861274a565b6020026020010151858381518110610a7257610a7261274a565b602002602001015161063b565b828281518110610a9157610a9161274a565b6020908102919091010152610aa581612776565b9050610a3a565b509392505050565b610abc6113bf565b600680546001600160a01b0319166001600160a01b0383169081179091556040517f14a53320b515e5bd15168e3fb3e5e71851c5102987a77141633103d02df761c090600090a250565b610b0e6113bf565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fa0ddb7770400bb6f56f6cf1509ac80275c68f517b320233eab8b2dd25fb5c29690600090a250565b610b606113bf565b610b6a60006116ed565b565b60009182526004602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61098733838361173f565b610baa6113bf565b61ffff811660088190556040517f9b989ec2db2a403d4c1b1db2783b5d2b97eaaa1f11a90a50011e0f5e1cc60fbb90600090a2610be5610786565b50565b610bf06113bf565b600a610bfc828261280f565b507f3d19aa64ec42643d9f45a852fd1b15158d4c0789fbbc3f0e18ef4ea681dbcec38160405161088c9190612048565b600082815260046020526040902060010154610c47816115f6565b6109088383611686565b610c5961181f565b600954341015610c7c57604051639d2c4aa560e01b815260040160405180910390fd5b610c988284600160405180602001604052806000815250611878565b600754604051630862026560e41b81526004810185905261eeee60248201526000916001600160a01b031690638620265090604401602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e91906126df565b90506001600160a01b038116610d375760405163d76a0b1560e01b815260040160405180910390fd5b6008546040805160208101929092526000908201819052606082018190529060800160408051601f1981840301815290829052600954631ebc263f60e01b83529092506001600160a01b03841691631ebc263f9190610da9908990839061eeee908b9060009081908b906004016128ce565b60206040518083038185885af193505050508015610de4575060408051601f3d908101601f19168201909252610de191810190612957565b60015b610f2357847f47c305f21461d61c61a1049a153c0c10298bad3b28963fe3494eca267079030f600954604051610e1c91815260200190565b60405180910390a260095460405163019f1d0b60e31b81526001600160a01b03841691630cf8e85891610e5b908990839061eeee908890600401612970565b6000604051808303818588803b158015610e7457600080fd5b505af193505050508015610e86575060015b610ee257847ffe190b095b35e77d06f50296ae3c34841478bbeb99ba45b4a0f5812edad45f9e600954604051610ebe91815260200190565b60405180910390a2604051634afb559560e11b8152600481018690526024016106a2565b847f687b94ac9c087f94086180faa9dc01ea0f45e33c6766fd98bc456967181d6dd2600954604051610f1691815260200190565b60405180910390a2610f61565b50847f657b582531d907a1bcd2f5e7600df08603648363e0ee1581dcc58a0583cf0cf4600954604051610f5891815260200190565b60405180910390a25b60095434111561113657600b54600854604051631ebc263f60e01b815247926001600160a01b031691631ebc263f918491610fad91839061eeee908b9060009081908c906004016129d9565b60206040518083038185885af193505050508015610fe8575060408051601f3d908101601f19168201909252610fe591810190612957565b60015b6110fc576008546040518281527fd2b50b229255ac34e585a6d015d1a1f429839fce80c8f096b6442fd0d228c6289060200160405180910390a2600b5460085460405163019f1d0b60e31b81526001600160a01b0390921691630cf8e85891849161105e9190839061eeee908990600401612a41565b6000604051808303818588803b15801561107757600080fd5b505af193505050508015611089575060015b6110c9576008546040518281527fdba6302a407096d87f981b64d42f614f95798e6374a24a73bf665853047c41e3906020015b60405180910390a2611134565b6008546040518281527facfda3630f584ca05c8cb34c002f16b7f64c4e9de557965838fca639681193cc906020016110bc565b506008546040518281527fc9e1e262388d52d2223602ceb666f54bfd60804bc3f6aa8b487baacb62d8a4b09060200160405180910390a25b505b50506109086001600555565b61116c7f20f546240c242d1a9eab9d28b86b580e72eb85d36c7ae9952962eee54e393c5633610b6c565b61118957604051630c6a46a960e21b815260040160405180910390fd5b84831415806111985750828114155b156111b657604051637b7b1ac960e11b815260040160405180910390fd5b60005b85811015611244576112328787838181106111d6576111d661274a565b90506020020160208101906111eb91906123de565b8686848181106111fd576111fd61274a565b905060200201358585858181106112165761121661274a565b9050602002013560405180602001604052806000815250611878565b8061123c81612776565b9150506111b9565b50505050505050565b6060600a805461125c9061278f565b80601f01602080910402602001604051908101604052809291908181526020018280546112889061278f565b80156112d55780601f106112aa576101008083540402835291602001916112d5565b820191906000526020600020905b8154815290600101906020018083116112b857829003601f168201915b5050505050905090565b6001600160a01b0385163314806112fb57506112fb85336105cd565b6113175760405162461bcd60e51b81526004016106a2906126fc565b6108dc8585858585611983565b61132c6113bf565b6001600160a01b0381166113915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a2565b610be5816116ed565b60006001600160e01b03198216637965db0b60e01b14806106ce57506106ce82611aad565b6003546001600160a01b03163314610b6a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a2565b815183511461147b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106a2565b6001600160a01b0384166114a15760405162461bcd60e51b81526004016106a290612a8e565b3360005b84518110156115885760008582815181106114c2576114c261274a565b6020026020010151905060008583815181106114e0576114e061274a565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115305760405162461bcd60e51b81526004016106a290612ad3565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061156d908490612b1d565b925050819055505050508061158190612776565b90506114a5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115d8929190612b30565b60405180910390a46115ee818787878787611afd565b505050505050565b610be58133611c58565b61160a8282610b6c565b6109875760008281526004602090815260408083206001600160a01b03851684529091529020805460ff191660011790556116423390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116908282610b6c565b156109875760008281526004602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036117b25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106a2565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6002600554036118715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a2565b6002600555565b6001600160a01b0384166118d85760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106a2565b3360006118e485611cb1565b905060006118f185611cb1565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290611923908490612b1d565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461124483600089898989611cfc565b6001600160a01b0384166119a95760405162461bcd60e51b81526004016106a290612a8e565b3360006119b585611cb1565b905060006119c285611cb1565b90506000868152602081815260408083206001600160a01b038c16845290915290205485811015611a055760405162461bcd60e51b81526004016106a290612ad3565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611a42908490612b1d565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611aa2848a8a8a8a8a611cfc565b505050505050505050565b60006001600160e01b03198216636cdb3d1360e11b1480611ade57506001600160e01b031982166303a24d0760e21b145b806106ce57506301ffc9a760e01b6001600160e01b03198316146106ce565b6001600160a01b0384163b156115ee5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611b419089908990889088908890600401612b5e565b6020604051808303816000875af1925050508015611b7c575060408051601f3d908101601f19168201909252611b7991810190612bbc565b60015b611c2857611b88612bd9565b806308c379a003611bc15750611b9c612bf5565b80611ba75750611bc3565b8060405162461bcd60e51b81526004016106a29190612048565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016106a2565b6001600160e01b0319811663bc197c8160e01b146112445760405162461bcd60e51b81526004016106a290612c7e565b611c628282610b6c565b61098757611c6f81611db7565b611c7a836020611dc9565b604051602001611c8b929190612cc6565b60408051601f198184030181529082905262461bcd60e51b82526106a291600401612048565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611ceb57611ceb61274a565b602090810291909101015292915050565b6001600160a01b0384163b156115ee5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611d409089908990889088908890600401612d3b565b6020604051808303816000875af1925050508015611d7b575060408051601f3d908101601f19168201909252611d7891810190612bbc565b60015b611d8757611b88612bd9565b6001600160e01b0319811663f23a6e6160e01b146112445760405162461bcd60e51b81526004016106a290612c7e565b60606106ce6001600160a01b03831660145b60606000611dd8836002612d75565b611de3906002612b1d565b6001600160401b03811115611dfa57611dfa612084565b6040519080825280601f01601f191660200182016040528015611e24576020820181803683370190505b509050600360fc1b81600081518110611e3f57611e3f61274a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611e6e57611e6e61274a565b60200101906001600160f81b031916908160001a9053506000611e92846002612d75565b611e9d906001612b1d565b90505b6001811115611f15576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ed157611ed161274a565b1a60f81b828281518110611ee757611ee761274a565b60200101906001600160f81b031916908160001a90535060049490941c93611f0e81612d8c565b9050611ea0565b508315611f645760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106a2565b9392505050565b6001600160a01b0381168114610be557600080fd5b60008060408385031215611f9357600080fd5b8235611f9e81611f6b565b946020939093013593505050565b6001600160e01b031981168114610be557600080fd5b600060208284031215611fd457600080fd5b8135611f6481611fac565b600060208284031215611ff157600080fd5b5035919050565b60005b83811015612013578181015183820152602001611ffb565b50506000910152565b60008151808452612034816020860160208601611ff8565b601f01601f19169290920160200192915050565b602081526000611f64602083018461201c565b60006020828403121561206d57600080fd5b81356001600160401b0381168114611f6457600080fd5b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156120bf576120bf612084565b6040525050565b60006001600160401b038211156120df576120df612084565b5060051b60200190565b600082601f8301126120fa57600080fd5b81356020612107826120c6565b604051612114828261209a565b83815260059390931b850182019282810191508684111561213457600080fd5b8286015b8481101561214f5780358352918301918301612138565b509695505050505050565b60006001600160401b0382111561217357612173612084565b50601f01601f191660200190565b600061218c8361215a565b604051612199828261209a565b8092508481528585850111156121ae57600080fd5b8484602083013760006020868301015250509392505050565b600082601f8301126121d857600080fd5b611f6483833560208501612181565b600080600080600060a086880312156121ff57600080fd5b853561220a81611f6b565b9450602086013561221a81611f6b565b935060408601356001600160401b038082111561223657600080fd5b61224289838a016120e9565b9450606088013591508082111561225857600080fd5b61226489838a016120e9565b9350608088013591508082111561227a57600080fd5b50612287888289016121c7565b9150509295509295909350565b600080604083850312156122a757600080fd5b8235915060208301356122b981611f6b565b809150509250929050565b600080604083850312156122d757600080fd5b82356001600160401b03808211156122ee57600080fd5b818501915085601f83011261230257600080fd5b8135602061230f826120c6565b60405161231c828261209a565b83815260059390931b850182019282810191508984111561233c57600080fd5b948201945b8386101561236357853561235481611f6b565b82529482019490820190612341565b9650508601359250508082111561237957600080fd5b50612386858286016120e9565b9150509250929050565b600081518084526020808501945080840160005b838110156123c0578151875295820195908201906001016123a4565b509495945050505050565b602081526000611f646020830184612390565b6000602082840312156123f057600080fd5b8135611f6481611f6b565b6000806040838503121561240e57600080fd5b823561241981611f6b565b9150602083013580151581146122b957600080fd5b60006020828403121561244057600080fd5b813561ffff81168114611f6457600080fd5b60006020828403121561246457600080fd5b81356001600160401b0381111561247a57600080fd5b8201601f8101841361248b57600080fd5b61249a84823560208401612181565b949350505050565b6000806000606084860312156124b757600080fd5b8335925060208401356124c981611f6b565b915060408401356124d981611f6b565b809150509250925092565b60008083601f8401126124f657600080fd5b5081356001600160401b0381111561250d57600080fd5b6020830191508360208260051b850101111561252857600080fd5b9250929050565b6000806000806000806060878903121561254857600080fd5b86356001600160401b038082111561255f57600080fd5b61256b8a838b016124e4565b9098509650602089013591508082111561258457600080fd5b6125908a838b016124e4565b909650945060408901359150808211156125a957600080fd5b506125b689828a016124e4565b979a9699509497509295939492505050565b600080604083850312156125db57600080fd5b82356125e681611f6b565b915060208301356122b981611f6b565b600080600080600060a0868803121561260e57600080fd5b853561261981611f6b565b9450602086013561262981611f6b565b9350604086013592506060860135915060808601356001600160401b0381111561265257600080fd5b612287888289016121c7565b60006020828403121561267057600080fd5b81516001600160401b0381111561268657600080fd5b8201601f8101841361269757600080fd5b80516126a28161215a565b6040516126af828261209a565b8281528660208486010111156126c457600080fd5b6126d5836020830160208701611ff8565b9695505050505050565b6000602082840312156126f157600080fd5b8151611f6481611f6b565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161278857612788612760565b5060010190565b600181811c908216806127a357607f821691505b6020821081036127c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561090857600081815260208120601f850160051c810160208610156127f05750805b601f850160051c820191505b818110156115ee578281556001016127fc565b81516001600160401b0381111561282857612828612084565b61283c81612836845461278f565b846127c9565b602080601f83116001811461287157600084156128595750858301515b600019600386901b1c1916600185901b1785556115ee565b600085815260208120601f198616915b828110156128a057888601518255948401946001909101908401612881565b50858210156128be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b878152602081018790526001600160a01b038681166040830152851660608201526080810184905282151560a082015261010060c0820181905260148183015273129d5a58d9589bde0810d85c99081b5a5b9d195960621b61012083015260009061014083015b905082810360e0840152612949818561201c565b9a9950505050505050505050565b60006020828403121561296957600080fd5b5051919050565b848152602081018490526001600160a01b038316604082015260a06060820181905260149082015273129d5a58d9589bde0810d85c99081b5a5b9d195960621b60c0820152600060e082015b82810360808401526129ce818561201c565b979650505050505050565b878152602081018790526001600160a01b038681166040830152851660608201526080810184905282151560a082015261010060c082018190526011818301527004a75696365626f7820436172642074697607c1b6101208301526000906101408301612935565b848152602081018490526001600160a01b038316604082015260a0606082018190526011908201527004a75696365626f7820436172642074697607c1b60c0820152600060e082016129bc565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156106ce576106ce612760565b604081526000612b436040830185612390565b8281036020840152612b558185612390565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090612b8a90830186612390565b8281036060840152612b9c8186612390565b90508281036080840152612bb0818561201c565b98975050505050505050565b600060208284031215612bce57600080fd5b8151611f6481611fac565b600060033d1115612bf25760046000803e5060005160e01c5b90565b600060443d1015612c035790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612c3257505050505090565b8285019150815181811115612c4a5750505050505090565b843d8701016020828501011115612c645750505050505090565b612c736020828601018761209a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612cfe816017850160208801611ff8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612d2f816028840160208801611ff8565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906129ce9083018461201c565b80820281158282048414176106ce576106ce612760565b600081612d9b57612d9b612760565b50600019019056fea2646970667358221220c6c893172393e48c45712844739440620995b6de15d40c7d10300364cc99b86264736f6c63430008110033

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000000000000000000000000000000000000000001d1000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d663733385a3863584a366e34614c737a4a6373334d67425451717270395a564e6b685776565575654d3547790000000000000000000000

-----Decoded View---------------
Arg [0] : _config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d3
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001d1
Arg [3] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [4] : 00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea
Arg [5] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [7] : 697066733a2f2f516d663733385a3863584a366e34614c737a4a6373334d6742
Arg [8] : 5451717270395a564e6b685776565575654d3547790000000000000000000000


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.