ETH Price: $1,974.98 (-5.38%)

Contract

0x2AeA2f0183632b4EaA909EFed58A6E0B8E48Ef25
 

Overview

ETH Balance

0.043433709379039228 ETH

Eth Value

$85.78 (@ $1,974.98/ETH)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint Creation165896322023-02-09 7:13:111121 days ago1675926791IN
0x2AeA2f01...B8E48Ef25
0.00618118 ETH0.0037920920.55033602
Mint Creation165727212023-02-06 22:25:591123 days ago1675722359IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0033220128.53917098
Mint Creation165725202023-02-06 21:45:471123 days ago1675719947IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0040168631.06119024
Withdraw Creator...165275542023-01-31 14:58:471130 days ago1675177127IN
0x2AeA2f01...B8E48Ef25
0 ETH0.000817426.5659226
Mint Creation165218732023-01-30 19:56:591130 days ago1675108619IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0028255621.84920357
Mint Creation165196412023-01-30 12:28:231131 days ago1675081703IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0018987316.31189824
Mint Creation165196332023-01-30 12:26:471131 days ago1675081607IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0025051318.16182515
Mint Creation165086932023-01-28 23:46:591132 days ago1674949619IN
0x2AeA2f01...B8E48Ef25
0.00643973 ETH0.0025509213.8241244
Mint Creation165004402023-01-27 20:09:111133 days ago1674850151IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0031921825.15890975
Mint Creation165003822023-01-27 19:57:351133 days ago1674849455IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0024558817.80476946
Withdraw Creator...164898542023-01-26 8:40:351135 days ago1674722435IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0004765315.48748472
Make New Creatio...164652692023-01-22 22:17:111138 days ago1674425831IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0174717630
Make New Creatio...164578182023-01-21 21:18:351139 days ago1674335915IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0201918330
Mint Creation164451962023-01-20 3:01:591141 days ago1674183719IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0023847517.28910118
Mint Creation164451912023-01-20 3:00:591141 days ago1674183659IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0020238216.76617288
Mint Creation164214962023-01-16 19:39:111144 days ago1673897951IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0036318831.20126015
Mint Creation164214942023-01-16 19:38:351144 days ago1673897915IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0035382930.39716108
Mint Creation164214922023-01-16 19:38:111144 days ago1673897891IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0034993130.06234981
Mint Creation164214902023-01-16 19:37:471144 days ago1673897867IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0032365927.300402
Mint Creation164214882023-01-16 19:37:231144 days ago1673897843IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0036099631.01291559
Mint Creation164214862023-01-16 19:36:591144 days ago1673897819IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0036899830.56924825
Mint Creation164214832023-01-16 19:36:231144 days ago1673897783IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0036977929.14379863
Mint Creation164214812023-01-16 19:35:591144 days ago1673897759IN
0x2AeA2f01...B8E48Ef25
0.00636803 ETH0.0047424928.64514564
Mint Creation164214782023-01-16 19:35:231144 days ago1673897723IN
0x2AeA2f01...B8E48Ef25
0.00636803 ETH0.004793230.54009711
Mint Creation164214762023-01-16 19:34:591144 days ago1673897699IN
0x2AeA2f01...B8E48Ef25
0 ETH0.0033865228.05528573
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer165896322023-02-09 7:13:111121 days ago1675926791
0x2AeA2f01...B8E48Ef25
0.00006119 ETH
Transfer165275542023-01-31 14:58:471130 days ago1675177127
0x2AeA2f01...B8E48Ef25
0.00637597 ETH
Transfer165086932023-01-28 23:46:591132 days ago1674949619
0x2AeA2f01...B8E48Ef25
0.00006375 ETH
Transfer164898542023-01-26 8:40:351135 days ago1674722435
0x2AeA2f01...B8E48Ef25
0.01260997 ETH
Transfer164214812023-01-16 19:35:591144 days ago1673897759
0x2AeA2f01...B8E48Ef25
0.00006304 ETH
Transfer164214782023-01-16 19:35:231144 days ago1673897723
0x2AeA2f01...B8E48Ef25
0.00006304 ETH
Transfer164214742023-01-16 19:34:351144 days ago1673897675
0x2AeA2f01...B8E48Ef25
0.00006304 ETH
Transfer164199012023-01-16 14:18:591145 days ago1673878739
0x2AeA2f01...B8E48Ef25
0.00655821 ETH
Transfer164087232023-01-15 0:47:111146 days ago1673743631
0x2AeA2f01...B8E48Ef25
0.00006558 ETH
Transfer163841902023-01-11 14:32:591150 days ago1673447579
0x2AeA2f01...B8E48Ef25
0.00750403 ETH
Transfer163809652023-01-11 3:45:111150 days ago1673408711
0x2AeA2f01...B8E48Ef25
0.00007504 ETH
Transfer163809422023-01-11 3:40:351150 days ago1673408435
0x2AeA2f01...B8E48Ef25
0.00007504 ETH
Transfer163774152023-01-10 15:50:471150 days ago1673365847
0x2AeA2f01...B8E48Ef25
0.00753307 ETH
Transfer163746112023-01-10 6:27:471151 days ago1673332067
0x2AeA2f01...B8E48Ef25
0.00007533 ETH
Transfer163746092023-01-10 6:27:231151 days ago1673332043
0x2AeA2f01...B8E48Ef25
0.00007533 ETH
Transfer163705032023-01-09 16:41:111151 days ago1673282471
0x2AeA2f01...B8E48Ef25
0.00758224 ETH
Transfer163695182023-01-09 13:22:591152 days ago1673270579
0x2AeA2f01...B8E48Ef25
0.00007582 ETH
Transfer163480072023-01-06 13:21:111155 days ago1673011271
0x2AeA2f01...B8E48Ef25
0.02394224 ETH
Transfer163454072023-01-06 4:38:111155 days ago1672979891
0x2AeA2f01...B8E48Ef25
0.00007985 ETH
Transfer163454032023-01-06 4:37:231155 days ago1672979843
0x2AeA2f01...B8E48Ef25
0.00007985 ETH
Transfer163453042023-01-06 4:17:351155 days ago1672978655
0x2AeA2f01...B8E48Ef25
0.00007985 ETH
Transfer163452742023-01-06 4:11:351155 days ago1672978295
0x2AeA2f01...B8E48Ef25
0.00007985 ETH
Transfer163443672023-01-06 1:08:471155 days ago1672967327
0x2AeA2f01...B8E48Ef25
0.0000797 ETH
Transfer163416262023-01-05 15:56:471155 days ago1672934207
0x2AeA2f01...B8E48Ef25
0.00799213 ETH
Transfer163404262023-01-05 11:55:111156 days ago1672919711
0x2AeA2f01...B8E48Ef25
0.00007992 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CommunityCreations

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 125 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

/// @title: Community Creations
/// @author: x0r (Michael Blau) & Henry Borska

import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";
import {AdminControl} from "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC1155CreatorCore} from "@manifoldxyz/creator-core-solidity/contracts/core/IERC1155CreatorCore.sol";
import {ICreatorExtensionTokenURI} from "@manifoldxyz/creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol";
import {IPriceOracle} from "./IPriceOracle.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

contract CommunityCreations is
    AdminControl,
    ICreatorExtensionTokenURI,
    ReentrancyGuard
{
    // =================== CUSTOM ERRORS =================== //
    error NotCreator();
    error NonExistentToken();
    error InsufficientPayment();
    error NotMEVArmyCollector();
    error AlreadyMintedToken();

    // =================== CUSTOM STRUCTS =================== //
    struct Creation {
        address creatorAddress;
        bool isFree;
        bool isPublicMint;
        string tokenURI;
        string name;
        uint256 dateCreated;
    }

    // manifold creator contract address
    address public immutable creatorContract;

    // MEV Army contract address
    address public immutable mevArmyAddress;

    // number of "Community Creations" created so far
    uint256 public numCreations;

    // address of the price oracle
    address public priceOracle;

    // mapping between a tokenId and a Creation
    mapping(uint256 => Creation) public tokenIdToCreation;

    // mapping that keeps track of all payments a Creator receives when someone mints their Creation.
    mapping(address => uint256) public creatorBalance;

    constructor(
        address _creatorContract,
        address _priceOracle,
        address _mevArmyAddress
    ) {
        creatorContract = _creatorContract;
        priceOracle = _priceOracle;
        mevArmyAddress = _mevArmyAddress;
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view override(IERC165, AdminControl) returns (bool) {
        return
            interfaceId == type(ICreatorExtensionTokenURI).interfaceId ||
            interfaceId == type(AdminControl).interfaceId ||
            interfaceId == type(IERC165).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @notice Accept mint fee and mint a Creation. If not a public mint, only MEV Army collectors can mint.
     * @param _tokenId of the Creation you want to mint
     */
    function mintCreation(uint256 _tokenId) public payable {
        // check that _tokenId exists.
        if (_tokenId > numCreations) revert NonExistentToken();

        // check if msg.sender has minted this tokenId
        if (IERC1155(creatorContract).balanceOf(msg.sender, _tokenId) > 0)
            revert AlreadyMintedToken();

        Creation memory creation = tokenIdToCreation[_tokenId];

        if (!creation.isPublicMint) {
            if (IERC721(mevArmyAddress).balanceOf(msg.sender) == 0)
                revert NotMEVArmyCollector();
        }

        if (!creation.isFree) {
            uint256 currentPriceInEth = IPriceOracle(priceOracle)
                .getPriceInEth();
            if (msg.value < currentPriceInEth) revert InsufficientPayment();

            // allocate mint fee to the Creator of this tokenId
            creatorBalance[creation.creatorAddress] += currentPriceInEth;

            // refund any excess funds to the minter
            payable(msg.sender).transfer(msg.value - currentPriceInEth);
        }

        _mint(_tokenId);
    }

    /**
     * @dev mint an 1155 token on the manifold creator contract
     * @param _tokenId to mint
     */
    function _mint(uint256 _tokenId) internal {
        address[] memory to = new address[](1);
        to[0] = msg.sender;

        uint256[] memory token = new uint256[](1);
        token[0] = _tokenId;

        uint256[] memory amount = new uint256[](1);
        amount[0] = 1;

        IERC1155CreatorCore(creatorContract).mintExtensionExisting(
            to,
            token,
            amount
        );
    }

    /**
     * @notice return the metadata for a given tokenId
     * @param _creatorContract to check the correct manifold creator contract
     * @param _tokenId of the NFT
     */
    function tokenURI(
        address _creatorContract,
        uint256 _tokenId
    ) public view override returns (string memory) {
        require(_creatorContract == creatorContract);
        return tokenIdToCreation[_tokenId].tokenURI;
    }

    /**
     * @notice make a new Creation and mint the first token to the Creator.
     * @param _creator who made the new Creation
     * @param _isFree is the Creation free to mint
     * @param _tokenURI of the new Creation
     */
    function makeNewCreation(
        address _creator,
        bool _isFree,
        bool _isPublicMint,
        string memory _tokenURI,
        string memory _name
    ) external adminRequired {
        // register a new Creation
        ++numCreations;
        tokenIdToCreation[numCreations] = Creation(
            _creator,
            _isFree,
            _isPublicMint,
            _tokenURI,
            _name,
            block.timestamp
        );

        // mint the first token of the Creation to the Creator
        address[] memory to = new address[](1);
        to[0] = _creator;

        uint256[] memory amounts = new uint256[](1);
        amounts[0] = 1;

        string[] memory uris = new string[](1);
        uris[0] = "";

        IERC1155CreatorCore(creatorContract).mintExtensionNew(
            to,
            amounts,
            uris
        );
    }

    // ====================== Creator Admin Functions ====================== //

    /**
     * @notice withdraw Creator balance.
     */
    function withdrawCreatorBalance() external nonReentrant {
        uint256 balanceToWithdraw = creatorBalance[msg.sender];
        creatorBalance[msg.sender] = 0;

        (bool success, ) = payable(msg.sender).call{value: balanceToWithdraw}(
            ""
        );
        require(success);
    }

    /**
     * @notice update the tokenURI of a Creation. Only the Creator of a Creation can update its tokenURI.
     * @param _tokenId of the Creation you want to update
     * @param _newTokenURI of the Creation
     */
    function updateCreationTokenURI(
        uint256 _tokenId,
        string memory _newTokenURI
    ) external {
        Creation storage creation = tokenIdToCreation[_tokenId];
        if (msg.sender != creation.creatorAddress) revert NotCreator();
        creation.tokenURI = _newTokenURI;
    }

    /**
     * @notice update the creatorAddress for a given Creation. Only the Creator of a Creation can update its creator address.
     * @param _tokenId of the Creation you want to update
     * @param _newCreatorAddress of the Creation
     */
    function updateCreationCreatorAddress(
        uint256 _tokenId,
        address _newCreatorAddress
    ) external {
        Creation storage creation = tokenIdToCreation[_tokenId];
        if (msg.sender != creation.creatorAddress) revert NotCreator();
        creation.creatorAddress = _newCreatorAddress;
    }

    /**
     * @notice update the isFree parameter for a given Creation. Only the Creator of a Creation can update whether a Creation is free or not.
     * @param _tokenId of the Creation you want to update
     * @param _isFree parameter of the Creation
     */
    function updateCreationIsFree(uint256 _tokenId, bool _isFree) external {
        Creation storage creation = tokenIdToCreation[_tokenId];
        if (msg.sender != creation.creatorAddress) revert NotCreator();
        creation.isFree = _isFree;
    }

    /**
     * @notice update the isPublicMint parameter for a given Creation. Only the Creator of a Creation can update whether a Creation is a public mint or not.
     * @param _tokenId of the Creation you want to update
     * @param _isPublicMint parameter of the Creation
     */
    function updateCreationIsPublicMint(
        uint256 _tokenId,
        bool _isPublicMint
    ) external {
        Creation storage creation = tokenIdToCreation[_tokenId];
        if (msg.sender != creation.creatorAddress) revert NotCreator();
        creation.isPublicMint = _isPublicMint;
    }

    // ====================== View Functions ====================== //
    /**
     * @notice get a list of all Creations created by the given Creator.
     * @param _creator whose Creations you want
     */
    function getCreations(
        address _creator
    ) public view returns (Creation[] memory) {
        Creation[] memory creations = new Creation[](numCreations);

        for (uint256 i = 0; i < numCreations; i++) {
            Creation memory creation = tokenIdToCreation[i + 1];
            if (_creator == creation.creatorAddress) {
                creations[i] = creation;
            }
        }

        return creations;
    }

    /**
     * @notice get a list of all Creations.
     */
    function getAllCreations() public view returns (Creation[] memory) {
        Creation[] memory creations = new Creation[](numCreations);

        for (uint256 i = 0; i < numCreations; i++) {
            Creation memory creation = tokenIdToCreation[i + 1];
            creations[i] = creation;
        }

        return creations;
    }

    /**
     * @notice get the number of Creations.
     */
    function getNumCreations() public view returns (uint256) {
        return numCreations;
    }

    // ====================== Admin Functions ====================== //

    function setPriceOracle(address _priceOracle) external adminRequired {
        priceOracle = _priceOracle;
    }
}

File 2 of 21 : IPriceOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;


interface IPriceOracle {
    function getPriceInEth() external view returns (uint256);
}

File 3 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 4 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

    // Track registered admins
    EnumerableSet.AddressSet private _admins;

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

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

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

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

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

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

}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "./CreatorCore.sol";

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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);
}

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

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

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

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

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

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

}

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

import "./ICreatorCore.sol";

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

    uint256 internal _tokenCount = 0;

    // Base approve transfers address location
    address internal _approveTransferBase;

    // Track registered extensions data
    EnumerableSet.AddressSet internal _extensions;
    EnumerableSet.AddressSet internal _blacklistedExtensions;
    mapping (address => address) internal _extensionPermissions;
    mapping (address => bool) internal _extensionApproveTransfers;
    
    // For tracking which extension a token was minted by
    mapping (uint256 => address) internal _tokensExtension;

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

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

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

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

    bytes4 private constant _CREATOR_CORE_V1 = 0x28f10a21;

    /**
     * External interface identifiers for royalties
     */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

    /**
     * Get token extension
     */
    function _tokenExtension(uint256 tokenId) internal view returns (address extension) {
        extension = _tokensExtension[tokenId];

        require(extension != address(0), "No extension for token");
        require(!_blacklistedExtensions.contains(extension), "Extension blacklisted");

        return extension;
    }

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

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

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

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

        return interfaceIdsSupported;
    }

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

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

        // all interfaces supported
        return true;
    }

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_creatorContract","type":"address"},{"internalType":"address","name":"_priceOracle","type":"address"},{"internalType":"address","name":"_mevArmyAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyMintedToken","type":"error"},{"inputs":[],"name":"InsufficientPayment","type":"error"},{"inputs":[],"name":"NonExistentToken","type":"error"},{"inputs":[],"name":"NotCreator","type":"error"},{"inputs":[],"name":"NotMEVArmyCollector","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"creatorBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creatorContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllCreations","outputs":[{"components":[{"internalType":"address","name":"creatorAddress","type":"address"},{"internalType":"bool","name":"isFree","type":"bool"},{"internalType":"bool","name":"isPublicMint","type":"bool"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"dateCreated","type":"uint256"}],"internalType":"struct CommunityCreations.Creation[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"}],"name":"getCreations","outputs":[{"components":[{"internalType":"address","name":"creatorAddress","type":"address"},{"internalType":"bool","name":"isFree","type":"bool"},{"internalType":"bool","name":"isPublicMint","type":"bool"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"dateCreated","type":"uint256"}],"internalType":"struct CommunityCreations.Creation[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumCreations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"bool","name":"_isFree","type":"bool"},{"internalType":"bool","name":"_isPublicMint","type":"bool"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"string","name":"_name","type":"string"}],"name":"makeNewCreation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mevArmyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintCreation","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"numCreations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceOracle","type":"address"}],"name":"setPriceOracle","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToCreation","outputs":[{"internalType":"address","name":"creatorAddress","type":"address"},{"internalType":"bool","name":"isFree","type":"bool"},{"internalType":"bool","name":"isPublicMint","type":"bool"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"dateCreated","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creatorContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_newCreatorAddress","type":"address"}],"name":"updateCreationCreatorAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_isFree","type":"bool"}],"name":"updateCreationIsFree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_isPublicMint","type":"bool"}],"name":"updateCreationIsPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newTokenURI","type":"string"}],"name":"updateCreationTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawCreatorBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b5060405162002545380380620025458339810160408190526200003491620000e1565b6200003f3362000074565b60016003556001600160a01b03928316608052600580546001600160a01b031916928416929092179091551660a0526200012b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000dc57600080fd5b919050565b600080600060608486031215620000f757600080fd5b6200010284620000c4565b92506200011260208501620000c4565b91506200012260408501620000c4565b90509250925092565b60805160a0516123d16200017460003960008181610430015261082e0152600081816102d5015281816105fc01528181610d040152818161165001526118c601526123d16000f3fe6080604052600436106101615760003560e01c80635f6088db116100c1578063ce97d4281161007a578063ce97d428146103fe578063d199f6ef1461041e578063de3ba08414610452578063e6cd7ab614610472578063e9dc63751461049f578063f2fde38b146104cc578063feddf0cd146104ec57600080fd5b80635f6088db146103495780636d73e66914610369578063715018a614610389578063772cf33f1461039e5780638da5cb5b146103c05780639f7986d2146103de57600080fd5b806327935f981161011e57806327935f981461024c5780632c8250ba146102615780632d3456701461028157806331ae450b146102a15780633dae35ce146102c3578063530e784f146102f7578063593320371461031757600080fd5b806301ffc9a7146101665780631860ef281461019b5780631aa97572146101bf5780632438f53f146101e157806324d7806c146101f45780632630c12f14610214575b600080fd5b34801561017257600080fd5b50610186610181366004611c7b565b610501565b60405190151581526020015b60405180910390f35b3480156101a757600080fd5b506101b160045481565b604051908152602001610192565b3480156101cb57600080fd5b506101df6101da366004611cc1565b610562565b005b6101df6101ef366004611ced565b6105bb565b34801561020057600080fd5b5061018661020f366004611d06565b6109d0565b34801561022057600080fd5b50600554610234906001600160a01b031681565b6040516001600160a01b039091168152602001610192565b34801561025857600080fd5b506101df610a09565b34801561026d57600080fd5b506101df61027c366004611de6565b610ad6565b34801561028d57600080fd5b506101df61029c366004611d06565b610d8f565b3480156102ad57600080fd5b506102b6610deb565b6040516101929190611ebf565b3480156102cf57600080fd5b506102347f000000000000000000000000000000000000000000000000000000000000000081565b34801561030357600080fd5b506101df610312366004611d06565b610e99565b34801561032357600080fd5b50610337610332366004611ced565b610f05565b60405161019296959493929190611f1f565b34801561035557600080fd5b506101df610364366004611f79565b61105d565b34801561037557600080fd5b506101df610384366004611d06565b6110b0565b34801561039557600080fd5b506101df611108565b3480156103aa57600080fd5b506103b361111c565b6040516101929190611fbf565b3480156103cc57600080fd5b506000546001600160a01b0316610234565b3480156103ea57600080fd5b506101df6103f9366004612081565b611350565b34801561040a57600080fd5b506101df610419366004612081565b6113a5565b34801561042a57600080fd5b506102347f000000000000000000000000000000000000000000000000000000000000000081565b34801561045e57600080fd5b506103b361046d366004611d06565b6113fa565b34801561047e57600080fd5b506101b161048d366004611d06565b60076020526000908152604090205481565b3480156104ab57600080fd5b506104bf6104ba3660046120a4565b61164c565b60405161019291906120ce565b3480156104d857600080fd5b506101df6104e7366004611d06565b61172e565b3480156104f857600080fd5b506004546101b1565b60006001600160e01b0319821663e9dc637560e01b148061053257506001600160e01b031982166354c1bcd960e01b145b8061054d57506001600160e01b031982166301ffc9a760e01b145b8061055c575061055c826117a4565b92915050565b600082815260066020526040902080546001600160a01b0316331461059a576040516393687c0b60e01b815260040160405180910390fd5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6004548111156105de57604051634a1850bf60e11b815260040160405180910390fd5b604051627eeac760e11b8152336004820152602481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062fdd58e90604401602060405180830381865afa15801561064a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066e91906120e1565b111561068d576040516375ec758f60e11b815260040160405180910390fd5b6000818152600660209081526040808320815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906106f0906120fa565b80601f016020809104026020016040519081016040528092919081815260200182805461071c906120fa565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b50505050508152602001600282018054610782906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546107ae906120fa565b80156107fb5780601f106107d0576101008083540402835291602001916107fb565b820191906000526020600020905b8154815290600101906020018083116107de57829003601f168201915b50505050508152602001600382015481525050905080604001516108c1576040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a191906120e1565b6000036108c15760405163f879b72d60e01b815260040160405180910390fd5b80602001516109c357600554604080516372d8948560e01b815290516000926001600160a01b0316916372d894859160048083019260209291908290030181865afa158015610914573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093891906120e1565b90508034101561095b5760405163cd1c886760e01b815260040160405180910390fd5b81516001600160a01b031660009081526007602052604081208054839290610984908490612144565b909155503390506108fc610998833461215c565b6040518115909202916000818181858888f193505050501580156109c0573d6000803e3d6000fd5b50505b6109cc826117d9565b5050565b6000816001600160a01b03166109ee6000546001600160a01b031690565b6001600160a01b0316148061055c575061055c600183611937565b600260035403610a605760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260035533600081815260076020526040808220805490839055905190929083908381818185875af1925050503d8060008114610aba576040519150601f19603f3d011682016040523d82523d6000602084013e610abf565b606091505b5050905080610acd57600080fd5b50506001600355565b33610ae96000546001600160a01b031690565b6001600160a01b03161480610b045750610b04600133611937565b610b205760405162461bcd60e51b8152600401610a5790612173565b600460008154610b2f906121b7565b909155506040805160c0810182526001600160a01b038088168252861515602080840191825287151584860190815260608501888152608086018890524260a08701526004546000908152600684529690962085518154945192511515600160a81b0260ff60a81b19931515600160a01b026001600160a81b03199096169190961617939093171692909217815592518051929392610bd49260018501920190611bb2565b5060808201518051610bf0916002840191602090910190611bb2565b5060a09190910151600390910155604080516001808252818301909252600091602080830190803683370190505090508581600081518110610c3457610c346121d0565b6001600160a01b039290921660209283029190910190910152604080516001808252818301909252600091816020016020820280368337019050509050600181600081518110610c8657610c866121d0565b6020908102919091010152604080516001808252818301909252600091816020015b6060815260200190600190039081610ca85790505090506040518060200160405280600081525081600081518110610ce257610ce26121d0565b6020908102919091010152604051634637423960e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638c6e847290610d3d90869086908690600401612216565b6000604051808303816000875af1158015610d5c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d84919081019061229d565b505050505050505050565b610d9761195c565b610da2600182611937565b15610de85760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a36109cc6001826119b6565b50565b6060610df760016119cb565b6001600160401b03811115610e0e57610e0e611d31565b604051908082528060200260200182016040528015610e37578160200160208202803683370190505b50905060005b610e4760016119cb565b811015610e9557610e596001826119d5565b828281518110610e6b57610e6b6121d0565b6001600160a01b039092166020928302919091019091015280610e8d816121b7565b915050610e3d565b5090565b33610eac6000546001600160a01b031690565b6001600160a01b03161480610ec75750610ec7600133611937565b610ee35760405162461bcd60e51b8152600401610a5790612173565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600660205260009081526040902080546001820180546001600160a01b0383169360ff600160a01b8504811694600160a81b900416929091610f46906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610f72906120fa565b8015610fbf5780601f10610f9457610100808354040283529160200191610fbf565b820191906000526020600020905b815481529060010190602001808311610fa257829003601f168201915b505050505090806002018054610fd4906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611000906120fa565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050908060030154905086565b600082815260066020526040902080546001600160a01b03163314611095576040516393687c0b60e01b815260040160405180910390fd5b81516110aa9060018301906020850190611bb2565b50505050565b6110b861195c565b6110c3600182611937565b610de85760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a36109cc6001826119e1565b61111061195c565b61111a60006119f6565b565b606060006004546001600160401b0381111561113a5761113a611d31565b60405190808252806020026020018201604052801561117357816020015b611160611c32565b8152602001906001900390816111585790505b50905060005b60045481101561134a576000600681611193846001612144565b81526020808201929092526040908101600020815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906111f8906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611224906120fa565b80156112715780601f1061124657610100808354040283529160200191611271565b820191906000526020600020905b81548152906001019060200180831161125457829003601f168201915b5050505050815260200160028201805461128a906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546112b6906120fa565b80156113035780601f106112d857610100808354040283529160200191611303565b820191906000526020600020905b8154815290600101906020018083116112e657829003601f168201915b5050505050815260200160038201548152505090508083838151811061132b5761132b6121d0565b6020026020010181905250508080611342906121b7565b915050611179565b50919050565b600082815260066020526040902080546001600160a01b03163314611388576040516393687c0b60e01b815260040160405180910390fd5b8054911515600160a01b0260ff60a01b1990921691909117905550565b600082815260066020526040902080546001600160a01b031633146113dd576040516393687c0b60e01b815260040160405180910390fd5b8054911515600160a81b0260ff60a81b1990921691909117905550565b606060006004546001600160401b0381111561141857611418611d31565b60405190808252806020026020018201604052801561145157816020015b61143e611c32565b8152602001906001900390816114365790505b50905060005b600454811015611645576000600681611471846001612144565b81526020808201929092526040908101600020815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906114d6906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611502906120fa565b801561154f5780601f106115245761010080835404028352916020019161154f565b820191906000526020600020905b81548152906001019060200180831161153257829003601f168201915b50505050508152602001600282018054611568906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611594906120fa565b80156115e15780601f106115b6576101008083540402835291602001916115e1565b820191906000526020600020905b8154815290600101906020018083116115c457829003601f168201915b50505050508152602001600382015481525050905080600001516001600160a01b0316856001600160a01b0316036116325780838381518110611626576116266121d0565b60200260200101819052505b508061163d816121b7565b915050611457565b5092915050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03161461168c57600080fd5b600082815260066020526040902060010180546116a8906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546116d4906120fa565b80156117215780601f106116f657610100808354040283529160200191611721565b820191906000526020600020905b81548152906001019060200180831161170457829003601f168201915b5050505050905092915050565b61173661195c565b6001600160a01b03811661179b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a57565b610de8816119f6565b60006001600160e01b03198216632a9f3abf60e11b148061055c57506301ffc9a760e01b6001600160e01b031983161461055c565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061180f5761180f6121d0565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508281600081518110611860576118606121d0565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090506001816000815181106118a4576118a46121d0565b60209081029190910101526040516339b2213760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e6c884dc906118ff90869086908690600401612342565b600060405180830381600087803b15801561191957600080fd5b505af115801561192d573d6000803e3d6000fd5b5050505050505050565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6000546001600160a01b0316331461111a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a57565b6000611955836001600160a01b038416611a46565b600061055c825490565b60006119558383611b39565b6000611955836001600160a01b038416611b63565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120548015611b2f576000611a6a60018361215c565b8554909150600090611a7e9060019061215c565b9050818114611ae3576000866000018281548110611a9e57611a9e6121d0565b9060005260206000200154905080876000018481548110611ac157611ac16121d0565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611af457611af4612385565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061055c565b600091505061055c565b6000826000018281548110611b5057611b506121d0565b9060005260206000200154905092915050565b6000818152600183016020526040812054611baa5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561055c565b50600061055c565b828054611bbe906120fa565b90600052602060002090601f016020900481019282611be05760008555611c26565b82601f10611bf957805160ff1916838001178555611c26565b82800160010185558215611c26579182015b82811115611c26578251825591602001919060010190611c0b565b50610e95929150611c66565b6040805160c0810182526000808252602082018190529181018290526060808201819052608082015260a081019190915290565b5b80821115610e955760008155600101611c67565b600060208284031215611c8d57600080fd5b81356001600160e01b03198116811461195557600080fd5b80356001600160a01b0381168114611cbc57600080fd5b919050565b60008060408385031215611cd457600080fd5b82359150611ce460208401611ca5565b90509250929050565b600060208284031215611cff57600080fd5b5035919050565b600060208284031215611d1857600080fd5b61195582611ca5565b80358015158114611cbc57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611d6f57611d6f611d31565b604052919050565b600082601f830112611d8857600080fd5b81356001600160401b03811115611da157611da1611d31565b611db4601f8201601f1916602001611d47565b818152846020838601011115611dc957600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611dfe57600080fd5b611e0786611ca5565b9450611e1560208701611d21565b9350611e2360408701611d21565b925060608601356001600160401b0380821115611e3f57600080fd5b611e4b89838a01611d77565b93506080880135915080821115611e6157600080fd5b50611e6e88828901611d77565b9150509295509295909350565b600081518084526020808501945080840160005b83811015611eb45781516001600160a01b031687529582019590820190600101611e8f565b509495945050505050565b6020815260006119556020830184611e7b565b6000815180845260005b81811015611ef857602081850181015186830182015201611edc565b81811115611f0a576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b03871681528515156020820152841515604082015260c060608201819052600090611f5390830186611ed2565b8281036080840152611f658186611ed2565b9150508260a0830152979650505050505050565b60008060408385031215611f8c57600080fd5b8235915060208301356001600160401b03811115611fa957600080fd5b611fb585828601611d77565b9150509250929050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561207357888303603f19018552815180516001600160a01b03168452878101511515888501528681015115158785015260608082015160c0828701819052919061203683880182611ed2565b92505050608080830151868303828801526120518382611ed2565b60a0948501519790940196909652505094870194925090860190600101611fe6565b509098975050505050505050565b6000806040838503121561209457600080fd5b82359150611ce460208401611d21565b600080604083850312156120b757600080fd5b6120c083611ca5565b946020939093013593505050565b6020815260006119556020830184611ed2565b6000602082840312156120f357600080fd5b5051919050565b600181811c9082168061210e57607f821691505b60208210810361134a57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156121575761215761212e565b500190565b60008282101561216e5761216e61212e565b500390565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b6000600182016121c9576121c961212e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015611eb4578151875295820195908201906001016121fa565b6060815260006122296060830186611e7b565b60208382038185015261223c82876121e6565b915083820360408501528185518084528284019150828160051b85010183880160005b8381101561228d57601f1987840301855261227b838351611ed2565b9486019492509085019060010161225f565b50909a9950505050505050505050565b600060208083850312156122b057600080fd5b82516001600160401b03808211156122c757600080fd5b818501915085601f8301126122db57600080fd5b8151818111156122ed576122ed611d31565b8060051b91506122fe848301611d47565b818152918301840191848101908884111561231857600080fd5b938501935b838510156123365784518252938501939085019061231d565b98975050505050505050565b6060815260006123556060830186611e7b565b828103602084015261236781866121e6565b9050828103604084015261237b81856121e6565b9695505050505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200a49c5b8f5ae4a7a862e27b32712421a8789dbbe6fe83d066b9a32a0ef55534064736f6c634300080d0033000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f29000000000000000000000000c963117f48cc19b249098eddbb36e8272dc7098d00000000000000000000000099cd66b3d67cd65fbafbd2fd49915002d4a2e0f2

Deployed Bytecode

0x6080604052600436106101615760003560e01c80635f6088db116100c1578063ce97d4281161007a578063ce97d428146103fe578063d199f6ef1461041e578063de3ba08414610452578063e6cd7ab614610472578063e9dc63751461049f578063f2fde38b146104cc578063feddf0cd146104ec57600080fd5b80635f6088db146103495780636d73e66914610369578063715018a614610389578063772cf33f1461039e5780638da5cb5b146103c05780639f7986d2146103de57600080fd5b806327935f981161011e57806327935f981461024c5780632c8250ba146102615780632d3456701461028157806331ae450b146102a15780633dae35ce146102c3578063530e784f146102f7578063593320371461031757600080fd5b806301ffc9a7146101665780631860ef281461019b5780631aa97572146101bf5780632438f53f146101e157806324d7806c146101f45780632630c12f14610214575b600080fd5b34801561017257600080fd5b50610186610181366004611c7b565b610501565b60405190151581526020015b60405180910390f35b3480156101a757600080fd5b506101b160045481565b604051908152602001610192565b3480156101cb57600080fd5b506101df6101da366004611cc1565b610562565b005b6101df6101ef366004611ced565b6105bb565b34801561020057600080fd5b5061018661020f366004611d06565b6109d0565b34801561022057600080fd5b50600554610234906001600160a01b031681565b6040516001600160a01b039091168152602001610192565b34801561025857600080fd5b506101df610a09565b34801561026d57600080fd5b506101df61027c366004611de6565b610ad6565b34801561028d57600080fd5b506101df61029c366004611d06565b610d8f565b3480156102ad57600080fd5b506102b6610deb565b6040516101929190611ebf565b3480156102cf57600080fd5b506102347f000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f2981565b34801561030357600080fd5b506101df610312366004611d06565b610e99565b34801561032357600080fd5b50610337610332366004611ced565b610f05565b60405161019296959493929190611f1f565b34801561035557600080fd5b506101df610364366004611f79565b61105d565b34801561037557600080fd5b506101df610384366004611d06565b6110b0565b34801561039557600080fd5b506101df611108565b3480156103aa57600080fd5b506103b361111c565b6040516101929190611fbf565b3480156103cc57600080fd5b506000546001600160a01b0316610234565b3480156103ea57600080fd5b506101df6103f9366004612081565b611350565b34801561040a57600080fd5b506101df610419366004612081565b6113a5565b34801561042a57600080fd5b506102347f00000000000000000000000099cd66b3d67cd65fbafbd2fd49915002d4a2e0f281565b34801561045e57600080fd5b506103b361046d366004611d06565b6113fa565b34801561047e57600080fd5b506101b161048d366004611d06565b60076020526000908152604090205481565b3480156104ab57600080fd5b506104bf6104ba3660046120a4565b61164c565b60405161019291906120ce565b3480156104d857600080fd5b506101df6104e7366004611d06565b61172e565b3480156104f857600080fd5b506004546101b1565b60006001600160e01b0319821663e9dc637560e01b148061053257506001600160e01b031982166354c1bcd960e01b145b8061054d57506001600160e01b031982166301ffc9a760e01b145b8061055c575061055c826117a4565b92915050565b600082815260066020526040902080546001600160a01b0316331461059a576040516393687c0b60e01b815260040160405180910390fd5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6004548111156105de57604051634a1850bf60e11b815260040160405180910390fd5b604051627eeac760e11b8152336004820152602481018290526000907f000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f296001600160a01b03169062fdd58e90604401602060405180830381865afa15801561064a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066e91906120e1565b111561068d576040516375ec758f60e11b815260040160405180910390fd5b6000818152600660209081526040808320815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906106f0906120fa565b80601f016020809104026020016040519081016040528092919081815260200182805461071c906120fa565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b50505050508152602001600282018054610782906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546107ae906120fa565b80156107fb5780601f106107d0576101008083540402835291602001916107fb565b820191906000526020600020905b8154815290600101906020018083116107de57829003601f168201915b50505050508152602001600382015481525050905080604001516108c1576040516370a0823160e01b81523360048201527f00000000000000000000000099cd66b3d67cd65fbafbd2fd49915002d4a2e0f26001600160a01b0316906370a0823190602401602060405180830381865afa15801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a191906120e1565b6000036108c15760405163f879b72d60e01b815260040160405180910390fd5b80602001516109c357600554604080516372d8948560e01b815290516000926001600160a01b0316916372d894859160048083019260209291908290030181865afa158015610914573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093891906120e1565b90508034101561095b5760405163cd1c886760e01b815260040160405180910390fd5b81516001600160a01b031660009081526007602052604081208054839290610984908490612144565b909155503390506108fc610998833461215c565b6040518115909202916000818181858888f193505050501580156109c0573d6000803e3d6000fd5b50505b6109cc826117d9565b5050565b6000816001600160a01b03166109ee6000546001600160a01b031690565b6001600160a01b0316148061055c575061055c600183611937565b600260035403610a605760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260035533600081815260076020526040808220805490839055905190929083908381818185875af1925050503d8060008114610aba576040519150601f19603f3d011682016040523d82523d6000602084013e610abf565b606091505b5050905080610acd57600080fd5b50506001600355565b33610ae96000546001600160a01b031690565b6001600160a01b03161480610b045750610b04600133611937565b610b205760405162461bcd60e51b8152600401610a5790612173565b600460008154610b2f906121b7565b909155506040805160c0810182526001600160a01b038088168252861515602080840191825287151584860190815260608501888152608086018890524260a08701526004546000908152600684529690962085518154945192511515600160a81b0260ff60a81b19931515600160a01b026001600160a81b03199096169190961617939093171692909217815592518051929392610bd49260018501920190611bb2565b5060808201518051610bf0916002840191602090910190611bb2565b5060a09190910151600390910155604080516001808252818301909252600091602080830190803683370190505090508581600081518110610c3457610c346121d0565b6001600160a01b039290921660209283029190910190910152604080516001808252818301909252600091816020016020820280368337019050509050600181600081518110610c8657610c866121d0565b6020908102919091010152604080516001808252818301909252600091816020015b6060815260200190600190039081610ca85790505090506040518060200160405280600081525081600081518110610ce257610ce26121d0565b6020908102919091010152604051634637423960e11b81526001600160a01b037f000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f291690638c6e847290610d3d90869086908690600401612216565b6000604051808303816000875af1158015610d5c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d84919081019061229d565b505050505050505050565b610d9761195c565b610da2600182611937565b15610de85760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a36109cc6001826119b6565b50565b6060610df760016119cb565b6001600160401b03811115610e0e57610e0e611d31565b604051908082528060200260200182016040528015610e37578160200160208202803683370190505b50905060005b610e4760016119cb565b811015610e9557610e596001826119d5565b828281518110610e6b57610e6b6121d0565b6001600160a01b039092166020928302919091019091015280610e8d816121b7565b915050610e3d565b5090565b33610eac6000546001600160a01b031690565b6001600160a01b03161480610ec75750610ec7600133611937565b610ee35760405162461bcd60e51b8152600401610a5790612173565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600660205260009081526040902080546001820180546001600160a01b0383169360ff600160a01b8504811694600160a81b900416929091610f46906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610f72906120fa565b8015610fbf5780601f10610f9457610100808354040283529160200191610fbf565b820191906000526020600020905b815481529060010190602001808311610fa257829003601f168201915b505050505090806002018054610fd4906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611000906120fa565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050908060030154905086565b600082815260066020526040902080546001600160a01b03163314611095576040516393687c0b60e01b815260040160405180910390fd5b81516110aa9060018301906020850190611bb2565b50505050565b6110b861195c565b6110c3600182611937565b610de85760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a36109cc6001826119e1565b61111061195c565b61111a60006119f6565b565b606060006004546001600160401b0381111561113a5761113a611d31565b60405190808252806020026020018201604052801561117357816020015b611160611c32565b8152602001906001900390816111585790505b50905060005b60045481101561134a576000600681611193846001612144565b81526020808201929092526040908101600020815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906111f8906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611224906120fa565b80156112715780601f1061124657610100808354040283529160200191611271565b820191906000526020600020905b81548152906001019060200180831161125457829003601f168201915b5050505050815260200160028201805461128a906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546112b6906120fa565b80156113035780601f106112d857610100808354040283529160200191611303565b820191906000526020600020905b8154815290600101906020018083116112e657829003601f168201915b5050505050815260200160038201548152505090508083838151811061132b5761132b6121d0565b6020026020010181905250508080611342906121b7565b915050611179565b50919050565b600082815260066020526040902080546001600160a01b03163314611388576040516393687c0b60e01b815260040160405180910390fd5b8054911515600160a01b0260ff60a01b1990921691909117905550565b600082815260066020526040902080546001600160a01b031633146113dd576040516393687c0b60e01b815260040160405180910390fd5b8054911515600160a81b0260ff60a81b1990921691909117905550565b606060006004546001600160401b0381111561141857611418611d31565b60405190808252806020026020018201604052801561145157816020015b61143e611c32565b8152602001906001900390816114365790505b50905060005b600454811015611645576000600681611471846001612144565b81526020808201929092526040908101600020815160c08101835281546001600160a01b038116825260ff600160a01b82048116151595830195909552600160a81b90049093161515918301919091526001810180546060840191906114d6906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611502906120fa565b801561154f5780601f106115245761010080835404028352916020019161154f565b820191906000526020600020905b81548152906001019060200180831161153257829003601f168201915b50505050508152602001600282018054611568906120fa565b80601f0160208091040260200160405190810160405280929190818152602001828054611594906120fa565b80156115e15780601f106115b6576101008083540402835291602001916115e1565b820191906000526020600020905b8154815290600101906020018083116115c457829003601f168201915b50505050508152602001600382015481525050905080600001516001600160a01b0316856001600160a01b0316036116325780838381518110611626576116266121d0565b60200260200101819052505b508061163d816121b7565b915050611457565b5092915050565b60607f000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f296001600160a01b0316836001600160a01b03161461168c57600080fd5b600082815260066020526040902060010180546116a8906120fa565b80601f01602080910402602001604051908101604052809291908181526020018280546116d4906120fa565b80156117215780601f106116f657610100808354040283529160200191611721565b820191906000526020600020905b81548152906001019060200180831161170457829003601f168201915b5050505050905092915050565b61173661195c565b6001600160a01b03811661179b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a57565b610de8816119f6565b60006001600160e01b03198216632a9f3abf60e11b148061055c57506301ffc9a760e01b6001600160e01b031983161461055c565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061180f5761180f6121d0565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508281600081518110611860576118606121d0565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090506001816000815181106118a4576118a46121d0565b60209081029190910101526040516339b2213760e21b81526001600160a01b037f000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f29169063e6c884dc906118ff90869086908690600401612342565b600060405180830381600087803b15801561191957600080fd5b505af115801561192d573d6000803e3d6000fd5b5050505050505050565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6000546001600160a01b0316331461111a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a57565b6000611955836001600160a01b038416611a46565b600061055c825490565b60006119558383611b39565b6000611955836001600160a01b038416611b63565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120548015611b2f576000611a6a60018361215c565b8554909150600090611a7e9060019061215c565b9050818114611ae3576000866000018281548110611a9e57611a9e6121d0565b9060005260206000200154905080876000018481548110611ac157611ac16121d0565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611af457611af4612385565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061055c565b600091505061055c565b6000826000018281548110611b5057611b506121d0565b9060005260206000200154905092915050565b6000818152600183016020526040812054611baa5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561055c565b50600061055c565b828054611bbe906120fa565b90600052602060002090601f016020900481019282611be05760008555611c26565b82601f10611bf957805160ff1916838001178555611c26565b82800160010185558215611c26579182015b82811115611c26578251825591602001919060010190611c0b565b50610e95929150611c66565b6040805160c0810182526000808252602082018190529181018290526060808201819052608082015260a081019190915290565b5b80821115610e955760008155600101611c67565b600060208284031215611c8d57600080fd5b81356001600160e01b03198116811461195557600080fd5b80356001600160a01b0381168114611cbc57600080fd5b919050565b60008060408385031215611cd457600080fd5b82359150611ce460208401611ca5565b90509250929050565b600060208284031215611cff57600080fd5b5035919050565b600060208284031215611d1857600080fd5b61195582611ca5565b80358015158114611cbc57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611d6f57611d6f611d31565b604052919050565b600082601f830112611d8857600080fd5b81356001600160401b03811115611da157611da1611d31565b611db4601f8201601f1916602001611d47565b818152846020838601011115611dc957600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611dfe57600080fd5b611e0786611ca5565b9450611e1560208701611d21565b9350611e2360408701611d21565b925060608601356001600160401b0380821115611e3f57600080fd5b611e4b89838a01611d77565b93506080880135915080821115611e6157600080fd5b50611e6e88828901611d77565b9150509295509295909350565b600081518084526020808501945080840160005b83811015611eb45781516001600160a01b031687529582019590820190600101611e8f565b509495945050505050565b6020815260006119556020830184611e7b565b6000815180845260005b81811015611ef857602081850181015186830182015201611edc565b81811115611f0a576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b03871681528515156020820152841515604082015260c060608201819052600090611f5390830186611ed2565b8281036080840152611f658186611ed2565b9150508260a0830152979650505050505050565b60008060408385031215611f8c57600080fd5b8235915060208301356001600160401b03811115611fa957600080fd5b611fb585828601611d77565b9150509250929050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561207357888303603f19018552815180516001600160a01b03168452878101511515888501528681015115158785015260608082015160c0828701819052919061203683880182611ed2565b92505050608080830151868303828801526120518382611ed2565b60a0948501519790940196909652505094870194925090860190600101611fe6565b509098975050505050505050565b6000806040838503121561209457600080fd5b82359150611ce460208401611d21565b600080604083850312156120b757600080fd5b6120c083611ca5565b946020939093013593505050565b6020815260006119556020830184611ed2565b6000602082840312156120f357600080fd5b5051919050565b600181811c9082168061210e57607f821691505b60208210810361134a57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156121575761215761212e565b500190565b60008282101561216e5761216e61212e565b500390565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b6000600182016121c9576121c961212e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015611eb4578151875295820195908201906001016121fa565b6060815260006122296060830186611e7b565b60208382038185015261223c82876121e6565b915083820360408501528185518084528284019150828160051b85010183880160005b8381101561228d57601f1987840301855261227b838351611ed2565b9486019492509085019060010161225f565b50909a9950505050505050505050565b600060208083850312156122b057600080fd5b82516001600160401b03808211156122c757600080fd5b818501915085601f8301126122db57600080fd5b8151818111156122ed576122ed611d31565b8060051b91506122fe848301611d47565b818152918301840191848101908884111561231857600080fd5b938501935b838510156123365784518252938501939085019061231d565b98975050505050505050565b6060815260006123556060830186611e7b565b828103602084015261236781866121e6565b9050828103604084015261237b81856121e6565b9695505050505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200a49c5b8f5ae4a7a862e27b32712421a8789dbbe6fe83d066b9a32a0ef55534064736f6c634300080d0033

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

000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f29000000000000000000000000c963117f48cc19b249098eddbb36e8272dc7098d00000000000000000000000099cd66b3d67cd65fbafbd2fd49915002d4a2e0f2

-----Decoded View---------------
Arg [0] : _creatorContract (address): 0x319C76e5F63eD84943f26f028cb03F7086795f29
Arg [1] : _priceOracle (address): 0xc963117F48Cc19b249098EddBB36E8272dc7098D
Arg [2] : _mevArmyAddress (address): 0x99cd66b3D67Cd65FbAfbD2fD49915002d4a2E0F2

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000319c76e5f63ed84943f26f028cb03f7086795f29
Arg [1] : 000000000000000000000000c963117f48cc19b249098eddbb36e8272dc7098d
Arg [2] : 00000000000000000000000099cd66b3d67cd65fbafbd2fd49915002d4a2e0f2


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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