ETH Price: $3,260.63 (-0.54%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BlueprintV5

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : BlueprintV5.sol
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.4;

import "./abstract/HasSecondarySaleFees.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

contract BlueprintV5 is
    ERC721Upgradeable,
    HasSecondarySaleFees,
    AccessControlEnumerableUpgradeable
{
    using StringsUpgradeable for uint256;

    uint32 public defaultPlatformPrimaryFeePercentage;    
    uint32 public defaultBlueprintSecondarySalePercentage;
    uint32 public defaultPlatformSecondarySalePercentage;
    uint64 public latestErc721TokenIndex;
    uint256 public blueprintIndex;

    address public asyncSaleFeesRecipient;
    address public platform;
    address public minterAddress;
    
    mapping(uint256 => uint256) tokenToBlueprintID;
    mapping(address => uint256) failedTransferCredits;
    mapping(uint256 => Blueprints) public blueprints;

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

    enum SaleState {
        not_prepared,
        not_started,
        started,
        paused
    }
    struct Blueprints {
        bool tokenUriLocked;
        uint32 mintAmountArtist;
        uint32 mintAmountPlatform;
        uint64 capacity;
        uint64 erc721TokenIndex;
        uint64 maxPurchaseAmount;
        uint128 price;          
        address artist;
        address ERC20Token;
        string baseTokenUri;
        bytes32 merkleroot;
        SaleState saleState;    
        uint32[] primaryFeeBPS;
        uint32[] secondaryFeeBPS;
        address[] primaryFeeRecipients;
        address[] secondaryFeeRecipients;
        mapping(address => bool) claimedWhitelistedPieces;
    }

    event BlueprintSeed(uint256 blueprintID, string randomSeed);

    event BlueprintMinted(
        uint256 blueprintID,
        address artist,
        address purchaser,
        uint128 tokenId,
        uint64 newCapacity,
        bytes32 seedPrefix
    );

    event BlueprintPrepared(
        uint256 blueprintID,
        address artist,
        uint64 capacity,
        string blueprintMetaData,
        string baseTokenUri
    );

    event BlueprintSettingsUpdated(
        uint256 blueprintID,
        uint128 price,
        uint32 newMintAmountArtist,
        uint32 newMintAmountPlatform,
        uint32 newSaleState,
        bytes32 newMerkleRoot
    );

    event SaleStarted(uint256 blueprintID);

    event SalePaused(uint256 blueprintID);

    event SaleUnpaused(uint256 blueprintID);

    event BlueprintTokenUriUpdated(uint256 blueprintID, string newBaseTokenUri);

    modifier isBlueprintPrepared(uint256 _blueprintID) {
        require(
            blueprints[_blueprintID].saleState != SaleState.not_prepared,
            "blueprint not prepared"
        );
        _;
    }

    modifier hasSaleStarted(uint256 _blueprintID) {
        require(_hasSaleStarted(_blueprintID), "Sale not started");
        _;
    }

    modifier BuyerWhitelistedOrSaleStarted(
        uint256 _blueprintID,
        uint32 _quantity,
        bytes32[] calldata proof
    ) {
        require(
            _hasSaleStarted(_blueprintID) ||
                (_isBlueprintPreparedAndNotStarted(_blueprintID) &&
                    userWhitelisted(_blueprintID, uint256(_quantity), proof)),
            "not available to purchase"
        );
        _;
    }

    modifier isQuantityAvailableForPurchase(
        uint256 _blueprintID,
        uint32 _quantity
    ) {
        require(
            blueprints[_blueprintID].capacity >= _quantity,
            "quantity exceeds capacity"
        );
        _;
    }

    ///
    ///Initialize the implementation
    ///
    function initialize(
        string memory name_,
        string memory symbol_,
        address minter
    ) public initializer {
        // Intialize parent contracts
        ERC721Upgradeable.__ERC721_init(name_, symbol_);
        HasSecondarySaleFees._initialize();
        AccessControlUpgradeable.__AccessControl_init();

        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(MINTER_ROLE, minter);

        platform = msg.sender;
        minterAddress = minter;

        defaultPlatformPrimaryFeePercentage = 2000; //20%

        asyncSaleFeesRecipient = msg.sender;
    }

    function _hasSaleStarted(uint256 _blueprintID)
        internal
        view
        returns (bool)
    {
        return blueprints[_blueprintID].saleState == SaleState.started;
    }

    function _isBlueprintPreparedAndNotStarted(uint256 _blueprintID)
        internal
        view
        returns (bool)
    {
        return blueprints[_blueprintID].saleState == SaleState.not_started;
    }

    function _getFeePortion(uint256 _totalSaleAmount, uint256 _percentage)
        internal
        pure
        returns (uint256)
    {
        return (_totalSaleAmount * (_percentage)) / 10000;
    }

    function userWhitelisted(
        uint256 _blueprintID,
        uint256 _quantity,
        bytes32[] calldata proof
    ) internal view returns (bool) {
        require(proof.length != 0, "no proof provided");
        require(
            !blueprints[_blueprintID].claimedWhitelistedPieces[msg.sender],
            "already claimed"
        );
        bytes32 _merkleroot = blueprints[_blueprintID].merkleroot;
        return _verify(_leaf(msg.sender, _quantity), _merkleroot, proof);
    }

    function feesApplicable(
        address[] memory _feeRecipients,
        uint32[] memory _feeBPS
    ) internal pure returns (bool) {
        if (_feeRecipients.length != 0 || _feeBPS.length != 0) {
            require(
                _feeRecipients.length == _feeBPS.length,
                "mismatched recipients & Bps"
            );
            uint32 totalPercent;
            for (uint256 i = 0; i < _feeBPS.length; i++) {
                totalPercent = totalPercent + _feeBPS[i];
            }
            require(totalPercent <= 10000, "Fee Bps exceed maximum");
            return true;
        }
        return false;
    }

    function setBlueprintPrepared(
        uint256 _blueprintID,
        string memory _blueprintMetaData
    ) internal {
        blueprints[_blueprintID].saleState = SaleState.not_started;
        //assign the erc721 token index to the blueprint
        blueprints[_blueprintID].erc721TokenIndex = latestErc721TokenIndex;
        uint64 _capacity = blueprints[_blueprintID].capacity;
        latestErc721TokenIndex += _capacity;
        blueprintIndex++;

        emit BlueprintPrepared(
            _blueprintID,
            blueprints[_blueprintID].artist,
            _capacity,
            _blueprintMetaData,
            blueprints[_blueprintID].baseTokenUri
        );
    }

    function setErc20Token(uint256 _blueprintID, address _erc20Token) internal {
        if (_erc20Token != address(0)) {
            blueprints[_blueprintID].ERC20Token = _erc20Token;
        }
    }

    function _setupBlueprint(
        uint256 _blueprintID,
        address _erc20Token,
        string memory _baseTokenUri,
        bytes32 _merkleroot,
        uint32 _mintAmountArtist,
        uint32 _mintAmountPlatform,
        uint32 _maxPurchaseAmount
    ) internal {
        setErc20Token(_blueprintID, _erc20Token);

        blueprints[_blueprintID].baseTokenUri = _baseTokenUri;

        if (_merkleroot != 0) {
            blueprints[_blueprintID].merkleroot = _merkleroot;
        }

        blueprints[_blueprintID].mintAmountArtist = _mintAmountArtist;
        blueprints[_blueprintID].mintAmountPlatform = _mintAmountPlatform;

        if (_maxPurchaseAmount != 0) {
            blueprints[_blueprintID].maxPurchaseAmount = _maxPurchaseAmount;
        }
    }

    function prepareBlueprint(
        address _artist,
        uint64 _capacity,
        uint128 _price,
        address _erc20Token,
        string memory _blueprintMetaData,
        string memory _baseTokenUri,
        bytes32 _merkleroot,
        uint32 _mintAmountArtist,
        uint32 _mintAmountPlatform,
        uint32 _maxPurchaseAmount
    ) external onlyRole(MINTER_ROLE) {
        uint256 _blueprintID = blueprintIndex;
        blueprints[_blueprintID].artist = _artist;
        blueprints[_blueprintID].capacity = _capacity;
        blueprints[_blueprintID].price = _price;

        _setupBlueprint(
            _blueprintID,
            _erc20Token,
            _baseTokenUri,
            _merkleroot,
            _mintAmountArtist,
            _mintAmountPlatform,
            _maxPurchaseAmount
        );
        setBlueprintPrepared(_blueprintID, _blueprintMetaData);
    }

    function updateBlueprintSettings (
        uint256 _blueprintID,
        uint128 _price,
        uint32 _mintAmountArtist,
        uint32 _mintAmountPlatform,
        uint32 _newSaleState,
        bytes32 _merkleroot
    ) external onlyRole(MINTER_ROLE) {
        blueprints[_blueprintID].price = _price;
        blueprints[_blueprintID].mintAmountArtist = _mintAmountArtist;
        blueprints[_blueprintID].mintAmountPlatform = _mintAmountPlatform;
        blueprints[_blueprintID].saleState = SaleState (_newSaleState);
        blueprints[_blueprintID].merkleroot = _merkleroot; 

        emit BlueprintSettingsUpdated(_blueprintID, _price, _mintAmountArtist, _mintAmountPlatform, _newSaleState, _merkleroot);
    }

    function setFeeRecipients(
        uint256 _blueprintID,
        address[] memory _primaryFeeRecipients,
        uint32[] memory _primaryFeeBPS,
        address[] memory _secondaryFeeRecipients,
        uint32[] memory _secondaryFeeBPS
    ) external onlyRole(MINTER_ROLE) {
        require(
            blueprints[_blueprintID].saleState == SaleState.not_started,
            "sale started or not prepared"
        );
        if (feesApplicable(_primaryFeeRecipients, _primaryFeeBPS)) {
            blueprints[_blueprintID]
                .primaryFeeRecipients = _primaryFeeRecipients;
            blueprints[_blueprintID].primaryFeeBPS = _primaryFeeBPS;
        }

        if (feesApplicable(_secondaryFeeRecipients, _secondaryFeeBPS)) {
            blueprints[_blueprintID]
                .secondaryFeeRecipients = _secondaryFeeRecipients;
            blueprints[_blueprintID].secondaryFeeBPS = _secondaryFeeBPS;
        }
    }

    function beginSale(uint256 blueprintID) external onlyRole(MINTER_ROLE) {
        require(
            blueprints[blueprintID].saleState == SaleState.not_started,
            "sale started or not prepared"
        );
        blueprints[blueprintID].saleState = SaleState.started;
        emit SaleStarted(blueprintID);
    }

    function pauseSale(uint256 blueprintID)
        external
        onlyRole(MINTER_ROLE)
        hasSaleStarted(blueprintID)
    {
        blueprints[blueprintID].saleState = SaleState.paused;
        emit SalePaused(blueprintID);
    }

    function unpauseSale(uint256 blueprintID) external onlyRole(MINTER_ROLE) {
        require(
            blueprints[blueprintID].saleState == SaleState.paused,
            "Sale not paused"
        );
        blueprints[blueprintID].saleState = SaleState.started;
        emit SaleUnpaused(blueprintID);
    }

    function purchaseBlueprintsTo(
        uint256 blueprintID,
        uint32 quantity,
        uint256 tokenAmount,
        bytes32[] calldata proof,
        address nftRecipient
    )
        external
        payable
        BuyerWhitelistedOrSaleStarted(blueprintID, quantity, proof)
        isQuantityAvailableForPurchase(blueprintID, quantity)
    {
        require(
            blueprints[blueprintID].maxPurchaseAmount == 0 ||
                quantity <= blueprints[blueprintID].maxPurchaseAmount,
            "user cannot buy more than maxPurchaseAmount in single tx"
        );

        require (tx.origin == msg.sender, "purchase cannot be called from another contract");

        address _artist = blueprints[blueprintID].artist;
        _confirmPaymentAmountAndSettleSale(
            blueprintID,
            quantity,
            tokenAmount,
            _artist
        );

        if (blueprints[blueprintID].saleState == SaleState.not_started) {
            blueprints[blueprintID].claimedWhitelistedPieces[msg.sender] = true;
        }

        _mintQuantity(blueprintID, quantity, nftRecipient);
    }

    function purchaseBlueprints(
        uint256 blueprintID,
        uint32 quantity,
        uint256 tokenAmount,
        bytes32[] calldata proof
    )
        external
        payable
        BuyerWhitelistedOrSaleStarted(blueprintID, quantity, proof)
        isQuantityAvailableForPurchase(blueprintID, quantity)
    {
        require(
            blueprints[blueprintID].maxPurchaseAmount == 0 ||
                quantity <= blueprints[blueprintID].maxPurchaseAmount,
            "user cannot buy more than maxPurchaseAmount in single tx"
        );

        require (tx.origin == msg.sender, "purchase cannot be called from another contract");

        address _artist = blueprints[blueprintID].artist;
        _confirmPaymentAmountAndSettleSale(
            blueprintID,
            quantity,
            tokenAmount,
            _artist
        );

        if (blueprints[blueprintID].saleState == SaleState.not_started) {
            blueprints[blueprintID].claimedWhitelistedPieces[msg.sender] = true;
        }

        _mintQuantity(blueprintID, quantity, msg.sender);
    }

    function preSaleMint(uint256 blueprintID, uint32 quantity) external {
        require(
            _isBlueprintPreparedAndNotStarted(blueprintID),
            "Must be prepared and not started"
        );
        require(
            minterAddress == msg.sender ||
                blueprints[blueprintID].artist == msg.sender,
            "user cannot mint presale"
        );

        if (minterAddress == msg.sender) {
            require(
                quantity <= blueprints[blueprintID].mintAmountPlatform,
                "cannot mint quantity"
            );
            blueprints[blueprintID].mintAmountPlatform -= quantity;
        } else if (blueprints[blueprintID].artist == msg.sender) {
            require(
                quantity <= blueprints[blueprintID].mintAmountArtist,
                "cannot mint quantity"
            );
            blueprints[blueprintID].mintAmountArtist -= quantity;
        }
        _mintQuantity(blueprintID, quantity, msg.sender);
    }

    /*
     * Iterate and mint each blueprint for user
     */
    function _mintQuantity(uint256 _blueprintID, uint32 _quantity, address _nftRecipient) private {
        uint128 newTokenId = blueprints[_blueprintID].erc721TokenIndex;
        uint64 newCap = blueprints[_blueprintID].capacity;
        for (uint16 i = 0; i < _quantity; i++) {
            require(newCap > 0, "blueprint out of capacity");
            
            _mint(_nftRecipient, newTokenId + i);
            tokenToBlueprintID[newTokenId + i] = _blueprintID;

            bytes32 prefixHash = keccak256(
                abi.encodePacked(
                    block.number,
                    block.timestamp,
                    block.coinbase,
                    newCap
                )
            );
            emit BlueprintMinted(
                _blueprintID,
                blueprints[_blueprintID].artist,
                _nftRecipient,
                newTokenId + i,
                newCap,
                prefixHash
            );
            --newCap;
        }

        blueprints[_blueprintID].erc721TokenIndex += _quantity;
        blueprints[_blueprintID].capacity = newCap;
    }

    function _confirmPaymentAmountAndSettleSale(
        uint256 _blueprintID,
        uint32 _quantity,
        uint256 _tokenAmount,
        address _artist
    ) internal {
        address _erc20Token = blueprints[_blueprintID].ERC20Token;
        uint128 _price = blueprints[_blueprintID].price;
        if (_erc20Token == address(0)) {
            require(_tokenAmount == 0, "cannot specify token amount");
            require(
                msg.value == _quantity * _price,
                "Purchase amount must match price"
            );
            _payFeesAndArtist(_blueprintID, _erc20Token, msg.value, _artist);
        } else {
            require(msg.value == 0, "cannot specify eth amount");
            require(
                _tokenAmount == _quantity * _price,
                "Purchase amount must match price"
            );

            IERC20(_erc20Token).transferFrom(
                msg.sender,
                address(this),
                _tokenAmount
            );
            _payFeesAndArtist(_blueprintID, _erc20Token, _tokenAmount, _artist);
        }
    }

    ////////////////////////////////////
    ////// MERKLEROOT FUNCTIONS ////////
    ////////////////////////////////////

    /**
     * Create a merkle tree with address: quantity pairs as the leaves.
     * The msg.sender will be verified if it has a corresponding quantity value in the merkletree
     */

    function _leaf(address account, uint256 quantity)
        internal
        pure
        returns (bytes32)
    {
        return keccak256(abi.encodePacked(account, quantity));
    }

    function _verify(
        bytes32 leaf,
        bytes32 merkleroot,
        bytes32[] memory proof
    ) internal pure returns (bool) {
        return MerkleProof.verify(proof, merkleroot, leaf);
    }

    ////////////////////////////
    /// ONLY ADMIN functions ///
    ////////////////////////////

    function updateBlueprintTokenUri(
        uint256 blueprintID,
        string memory newBaseTokenUri
    ) external onlyRole(MINTER_ROLE) isBlueprintPrepared(blueprintID) {
        require(
            !blueprints[blueprintID].tokenUriLocked,
            "blueprint URI locked"
        );

        blueprints[blueprintID].baseTokenUri = newBaseTokenUri;

        emit BlueprintTokenUriUpdated(blueprintID, newBaseTokenUri);
    }

    function lockBlueprintTokenUri(uint256 blueprintID)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
        isBlueprintPrepared(blueprintID)
    {
        require(
            !blueprints[blueprintID].tokenUriLocked,
            "blueprint URI locked"
        );

        blueprints[blueprintID].tokenUriLocked = true;
    }

    function _baseURIForBlueprint(uint256 tokenId) internal view returns (string memory) {
        return blueprints[tokenToBlueprintID[tokenId]].baseTokenUri;
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );

        string memory baseURI = _baseURIForBlueprint(tokenId);
        return
            bytes(baseURI).length > 0
                ? string(
                    abi.encodePacked(
                        baseURI,
                        "/",
                        tokenId.toString(),
                        "/",
                        "token.json"
                    )
                )
                : "";
    }

    function revealBlueprintSeed(uint256 blueprintID, string memory randomSeed)
        external
        onlyRole(MINTER_ROLE)
        isBlueprintPrepared(blueprintID)
    {
        emit BlueprintSeed(blueprintID, randomSeed);
    }

    function setAsyncFeeRecipient(address _asyncSaleFeesRecipient)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        asyncSaleFeesRecipient = _asyncSaleFeesRecipient;
    }

    function changeDefaultPlatformPrimaryFeePercentage(uint32 _basisPoints)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(_basisPoints <= 10000);
        defaultPlatformPrimaryFeePercentage = _basisPoints;
    }

    function changeDefaultBlueprintSecondarySalePercentage(uint32 _basisPoints)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(_basisPoints + defaultPlatformSecondarySalePercentage <= 10000);
        defaultBlueprintSecondarySalePercentage = _basisPoints;
    }

    function changeDefaultPlatformSecondarySalePercentage(uint32 _basisPoints)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(
            _basisPoints + defaultBlueprintSecondarySalePercentage <= 10000
        );
        defaultPlatformSecondarySalePercentage = _basisPoints;
    }

    function updatePlatformAddress(address _platform)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        grantRole(DEFAULT_ADMIN_ROLE, _platform);

        revokeRole(DEFAULT_ADMIN_ROLE, platform);
        platform = _platform;
    }

    // Allows the platform to change the minter address
    function updateMinterAddress(address newMinterAddress)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        grantRole(MINTER_ROLE, newMinterAddress);

        revokeRole(MINTER_ROLE, minterAddress);
        minterAddress = newMinterAddress;
    }

    ////////////////////////////////////
    /// Secondary Fees implementation //
    ////////////////////////////////////

    function _payFeesAndArtist(
        uint256 _blueprintID,
        address _erc20Token,
        uint256 _amount,
        address _artist
    ) internal {
        address[] memory _primaryFeeRecipients = getPrimaryFeeRecipients(
            _blueprintID
        );
        uint32[] memory _primaryFeeBPS = getPrimaryFeeBps(_blueprintID);
        uint256 feesPaid;

        for (uint256 i = 0; i < _primaryFeeRecipients.length; i++) {
            uint256 fee = _getFeePortion(_amount, _primaryFeeBPS[i]);
            feesPaid = feesPaid + fee;
            _payout(_primaryFeeRecipients[i], _erc20Token, fee);
        }
        if (_amount - feesPaid > 0) {
            _payout(_artist, _erc20Token, (_amount - feesPaid));
        }
    }

    function _payout(
        address _recipient,
        address _erc20Token,
        uint256 _amount
    ) internal {
        if (_erc20Token != address(0)) {
            IERC20(_erc20Token).transfer(_recipient, _amount);
        } else {
            // attempt to send the funds to the recipient
            (bool success, ) = payable(_recipient).call{
                value: _amount,
                gas: 20000
            }("");
            // if it failed, update their credit balance so they can pull it later
            if (!success) {
                failedTransferCredits[_recipient] =
                    failedTransferCredits[_recipient] +
                    _amount;
            }
        }
    }

    function withdrawAllFailedCredits(address payable recipient) external {
        uint256 amount = failedTransferCredits[msg.sender];

        require(amount != 0, "no credits to withdraw");

        failedTransferCredits[msg.sender] = 0;

        (bool successfulWithdraw, ) = recipient.call{value: amount, gas: 20000}(
            ""
        );
        require(successfulWithdraw, "withdraw failed");
    }

    function getPrimaryFeeRecipients(uint256 id)
        public
        view
        returns (address[] memory)
    {
        if (blueprints[id].primaryFeeRecipients.length == 0) {
            address[] memory primaryFeeRecipients = new address[](1);
            primaryFeeRecipients[0] = (asyncSaleFeesRecipient);
            return primaryFeeRecipients;
        } else {
            return blueprints[id].primaryFeeRecipients;
        }
    }

    function getPrimaryFeeBps(uint256 id)
        public
        view
        returns (uint32[] memory)
    {
        if (blueprints[id].primaryFeeBPS.length == 0) {
            uint32[] memory primaryFeeBPS = new uint32[](1);
            primaryFeeBPS[0] = defaultPlatformPrimaryFeePercentage;

            return primaryFeeBPS;
        } else {
            return blueprints[id].primaryFeeBPS;
        }
    }

    function getFeeRecipients(uint256 id)
        public
        view
        override
        returns (address[] memory)
    {
        if (blueprints[id].secondaryFeeRecipients.length == 0) {
            address[] memory feeRecipients = new address[](2);
            feeRecipients[0] = (asyncSaleFeesRecipient);
            feeRecipients[1] = (blueprints[id].artist);

            return feeRecipients;
        } else {
            return blueprints[id].secondaryFeeRecipients;
        }
    }

    function getFeeBps(uint256 id)
        public
        view
        override
        returns (uint32[] memory)
    {
        if (blueprints[id].secondaryFeeBPS.length == 0) {
            uint32[] memory feeBPS = new uint32[](2);
            feeBPS[0] = defaultPlatformSecondarySalePercentage;
            feeBPS[1] = defaultBlueprintSecondarySalePercentage;

            return feeBPS;
        } else {
            return blueprints[id].secondaryFeeBPS;
        }
    }

    ////////////////////////////////////
    /// Required function overide //////
    ////////////////////////////////////

    function isApprovedForAll(address account, address operator)
        public
        view
        override
        returns (bool)
    {
        return
            super.isApprovedForAll(account, operator) ||
            hasRole(DEFAULT_ADMIN_ROLE, operator);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(
            ERC721Upgradeable,
            ERC165StorageUpgradeable,
            AccessControlEnumerableUpgradeable
        )
        returns (bool)
    {
        return
            ERC721Upgradeable.supportsInterface(interfaceId) ||
            ERC165StorageUpgradeable.supportsInterface(interfaceId) ||
            AccessControlEnumerableUpgradeable.supportsInterface(interfaceId);
    }
}

File 2 of 20 : HasSecondarySaleFees.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165StorageUpgradeable.sol";

abstract contract HasSecondarySaleFees is ERC165StorageUpgradeable {
    event SecondarySaleFees(
        uint256 tokenId,
        address[] recipients,
        uint256[] bps
    );

    /*
     * bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f
     * bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb
     *
     * => 0x0ebd4c7f ^ 0xb9c4d9fb == 0xb7799584
     */
    bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584;

    function _initialize() public initializer {
        _registerInterface(_INTERFACE_ID_FEES);
    }

    function getFeeRecipients(uint256 id)
        public
        view
        virtual
        returns (address[] memory);

    function getFeeBps(uint256 id)
        public
        view
        virtual
        returns (uint32[] memory);
}

File 3 of 20 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
    uint256[44] private __gap;
}

File 4 of 20 : AccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerableUpgradeable.sol";
import "./AccessControlUpgradeable.sol";
import "../utils/structs/EnumerableSetUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {
    function __AccessControlEnumerable_init() internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __AccessControl_init_unchained();
        __AccessControlEnumerable_init_unchained();
    }

    function __AccessControlEnumerable_init_unchained() internal initializer {
    }
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
    uint256[49] private __gap;
}

File 5 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 6 of 20 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

File 7 of 20 : ERC165StorageUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165Storage.sol)

pragma solidity ^0.8.0;

import "./ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165StorageUpgradeable is Initializable, ERC165Upgradeable {
    function __ERC165Storage_init() internal initializer {
        __ERC165_init_unchained();
        __ERC165Storage_init_unchained();
    }

    function __ERC165Storage_init_unchained() internal initializer {
    }
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

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

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
    uint256[49] private __gap;
}

File 8 of 20 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal initializer {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 9 of 20 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 10 of 20 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 11 of 20 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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`, 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 be 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

File 12 of 20 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 13 of 20 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

File 14 of 20 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 20 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 16 of 20 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

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

File 17 of 20 : IAccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 18 of 20 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    function __AccessControl_init_unchained() internal initializer {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 19 of 20 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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.
 */
library EnumerableSetUpgradeable {
    // 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;

        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;

        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"address","name":"purchaser","type":"address"},{"indexed":false,"internalType":"uint128","name":"tokenId","type":"uint128"},{"indexed":false,"internalType":"uint64","name":"newCapacity","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"seedPrefix","type":"bytes32"}],"name":"BlueprintMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"},{"indexed":false,"internalType":"address","name":"artist","type":"address"},{"indexed":false,"internalType":"uint64","name":"capacity","type":"uint64"},{"indexed":false,"internalType":"string","name":"blueprintMetaData","type":"string"},{"indexed":false,"internalType":"string","name":"baseTokenUri","type":"string"}],"name":"BlueprintPrepared","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"},{"indexed":false,"internalType":"string","name":"randomSeed","type":"string"}],"name":"BlueprintSeed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":false,"internalType":"uint32","name":"newMintAmountArtist","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"newMintAmountPlatform","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"newSaleState","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"BlueprintSettingsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"},{"indexed":false,"internalType":"string","name":"newBaseTokenUri","type":"string"}],"name":"BlueprintTokenUriUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"SalePaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"SaleStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"SaleUnpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"name":"SecondarySaleFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asyncSaleFeesRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"beginSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blueprintIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blueprints","outputs":[{"internalType":"bool","name":"tokenUriLocked","type":"bool"},{"internalType":"uint32","name":"mintAmountArtist","type":"uint32"},{"internalType":"uint32","name":"mintAmountPlatform","type":"uint32"},{"internalType":"uint64","name":"capacity","type":"uint64"},{"internalType":"uint64","name":"erc721TokenIndex","type":"uint64"},{"internalType":"uint64","name":"maxPurchaseAmount","type":"uint64"},{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"address","name":"artist","type":"address"},{"internalType":"address","name":"ERC20Token","type":"address"},{"internalType":"string","name":"baseTokenUri","type":"string"},{"internalType":"bytes32","name":"merkleroot","type":"bytes32"},{"internalType":"enum BlueprintV5.SaleState","name":"saleState","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_basisPoints","type":"uint32"}],"name":"changeDefaultBlueprintSecondarySalePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_basisPoints","type":"uint32"}],"name":"changeDefaultPlatformPrimaryFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_basisPoints","type":"uint32"}],"name":"changeDefaultPlatformSecondarySalePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultBlueprintSecondarySalePercentage","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultPlatformPrimaryFeePercentage","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultPlatformSecondarySalePercentage","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPrimaryFeeBps","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPrimaryFeeRecipients","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"minter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestErc721TokenIndex","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"lockBlueprintTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"pauseSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"platform","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"},{"internalType":"uint32","name":"quantity","type":"uint32"}],"name":"preSaleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_artist","type":"address"},{"internalType":"uint64","name":"_capacity","type":"uint64"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"address","name":"_erc20Token","type":"address"},{"internalType":"string","name":"_blueprintMetaData","type":"string"},{"internalType":"string","name":"_baseTokenUri","type":"string"},{"internalType":"bytes32","name":"_merkleroot","type":"bytes32"},{"internalType":"uint32","name":"_mintAmountArtist","type":"uint32"},{"internalType":"uint32","name":"_mintAmountPlatform","type":"uint32"},{"internalType":"uint32","name":"_maxPurchaseAmount","type":"uint32"}],"name":"prepareBlueprint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"},{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"purchaseBlueprints","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"},{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"address","name":"nftRecipient","type":"address"}],"name":"purchaseBlueprintsTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"},{"internalType":"string","name":"randomSeed","type":"string"}],"name":"revealBlueprintSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asyncSaleFeesRecipient","type":"address"}],"name":"setAsyncFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blueprintID","type":"uint256"},{"internalType":"address[]","name":"_primaryFeeRecipients","type":"address[]"},{"internalType":"uint32[]","name":"_primaryFeeBPS","type":"uint32[]"},{"internalType":"address[]","name":"_secondaryFeeRecipients","type":"address[]"},{"internalType":"uint32[]","name":"_secondaryFeeBPS","type":"uint32[]"}],"name":"setFeeRecipients","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"}],"name":"unpauseSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blueprintID","type":"uint256"},{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint32","name":"_mintAmountArtist","type":"uint32"},{"internalType":"uint32","name":"_mintAmountPlatform","type":"uint32"},{"internalType":"uint32","name":"_newSaleState","type":"uint32"},{"internalType":"bytes32","name":"_merkleroot","type":"bytes32"}],"name":"updateBlueprintSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blueprintID","type":"uint256"},{"internalType":"string","name":"newBaseTokenUri","type":"string"}],"name":"updateBlueprintTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinterAddress","type":"address"}],"name":"updateMinterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platform","type":"address"}],"name":"updatePlatformAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"}],"name":"withdrawAllFailedCredits","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506159da80620000216000396000f3fe60806040526004361061036b5760003560e01c806380ae4ebc116101c6578063c87b56dd116100f7578063ced3604311610095578063deb941481161006f578063deb9414814610a69578063e985e9c514610a8a578063eaf2115d14610aaa578063fce212f314610ad057600080fd5b8063ced3604314610a07578063d539139314610a27578063d547741f14610a4957600080fd5b8063c9e63203116100d1578063c9e6320314610982578063c9f2bd93146109a2578063ca15c873146109c2578063cba991bf146109e257600080fd5b8063c87b56dd14610922578063c8950e6014610942578063c90941b11461096257600080fd5b806395d89b4111610164578063aec970b01161013e578063aec970b0146108a2578063b88d4fde146108c2578063b9c4d9fb146108e2578063c2bce59c1461090257600080fd5b806395d89b4114610858578063a217fddf1461086d578063a22cb4651461088257600080fd5b80638f9f193f116101a05780638f9f193f146107e55780639010d07c1461080557806391d148541461082557806394a9c9c31461084557600080fd5b806380ae4ebc1461079d57806382c32b80146107b2578063898a90bc146107c557600080fd5b80632fcfb95a116102a05780634d073a5a1161023e57806366c083d31161021857806366c083d31461072657806368c31e261461074657806370a08231146107665780637b4252c01461078657600080fd5b80634d073a5a1461068e5780636352211e146106ce57806366bf33be146106ee57600080fd5b806338e395cf1161027a57806338e395cf1461060d5780633a66e4b61461062d57806342842e0e1461064d5780634bde38c81461066d57600080fd5b80632fcfb95a146105ac57806334d722c9146105cc57806336568abe146105ed57600080fd5b80630a21a2111161030d57806323b872dd116102e757806323b872dd1461050e578063248a9ca31461052e5780632e2d6bb81461056c5780632f2ff15d1461058c57600080fd5b80630a21a211146104815780630ebd4c7f146104ae57806322235d69146104db57600080fd5b806306fdde031161034957806306fdde03146103e7578063077f224a14610409578063081812fc14610429578063095ea7b31461046157600080fd5b8063018a62a61461037057806301a949501461039257806301ffc9a7146103b2575b600080fd5b34801561037c57600080fd5b5061039061038b366004614f7e565b610af0565b005b34801561039e57600080fd5b506103906103ad36600461512e565b610ba6565b3480156103be57600080fd5b506103d26103cd366004614e21565b610c0c565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b506103fc610c3b565b6040516103de91906153c8565b34801561041557600080fd5b50610390610424366004614e59565b610ccd565b34801561043557600080fd5b50610449610444366004614dc4565b610dc5565b6040516001600160a01b0390911681526020016103de565b34801561046d57600080fd5b5061039061047c366004614c9d565b610e5a565b34801561048d57600080fd5b506104a161049c366004614dc4565b610f70565b6040516103de9190615296565b3480156104ba57600080fd5b506104ce6104c9366004614dc4565b61106c565b6040516103de91906152e3565b3480156104e757600080fd5b5061012d546104f99063ffffffff1681565b60405163ffffffff90911681526020016103de565b34801561051a57600080fd5b50610390610529366004614bb4565b6111cc565b34801561053a57600080fd5b5061055e610549366004614dc4565b600090815260c9602052604090206001015490565b6040519081526020016103de565b34801561057857600080fd5b50610390610587366004614fc2565b6111fd565b34801561059857600080fd5b506103906105a7366004614ddc565b61136b565b3480156105b857600080fd5b506103906105c7366004614b60565b611391565b3480156105d857600080fd5b5061013154610449906001600160a01b031681565b3480156105f957600080fd5b50610390610608366004614ddc565b6113ff565b34801561061957600080fd5b50610390610628366004615027565b61147d565b34801561063957600080fd5b50610390610648366004614dc4565b6116fe565b34801561065957600080fd5b50610390610668366004614bb4565b6117b7565b34801561067957600080fd5b5061013054610449906001600160a01b031681565b34801561069a57600080fd5b5061012d546106b690600160601b90046001600160401b031681565b6040516001600160401b0390911681526020016103de565b3480156106da57600080fd5b506104496106e9366004614dc4565b6117d2565b3480156106fa57600080fd5b5061070e610709366004614dc4565b611849565b6040516103de9c9b9a99989796959493929190615321565b34801561073257600080fd5b5061039061074136600461512e565b611970565b34801561075257600080fd5b50610390610761366004614dc4565b6119da565b34801561077257600080fd5b5061055e610781366004614b60565b611abf565b34801561079257600080fd5b5061055e61012e5481565b3480156107a957600080fd5b50610390611b46565b6103906107c03660046150b7565b611bc2565b3480156107d157600080fd5b506103906107e0366004614cc8565b611de1565b3480156107f157600080fd5b50610390610800366004614b60565b611e99565b34801561081157600080fd5b50610449610820366004614e00565b611eed565b34801561083157600080fd5b506103d2610840366004614ddc565b611f0c565b610390610853366004615052565b611f37565b34801561086457600080fd5b506103fc612147565b34801561087957600080fd5b5061055e600081565b34801561088e57600080fd5b5061039061089d366004614c70565b612156565b3480156108ae57600080fd5b506103906108bd366004614b60565b612161565b3480156108ce57600080fd5b506103906108dd366004614bf4565b612191565b3480156108ee57600080fd5b506104a16108fd366004614dc4565b6121c3565b34801561090e57600080fd5b5061039061091d366004614dc4565b6122ec565b34801561092e57600080fd5b506103fc61093d366004614dc4565b6123c2565b34801561094e57600080fd5b5061039061095d366004614f7e565b61249d565b34801561096e57600080fd5b5061039061097d366004614b60565b6125ba565b34801561098e57600080fd5b5061039061099d366004614ecd565b6126b8565b3480156109ae57600080fd5b506103906109bd366004614dc4565b612819565b3480156109ce57600080fd5b5061055e6109dd366004614dc4565b612904565b3480156109ee57600080fd5b5061012d546104f990600160401b900463ffffffff1681565b348015610a1357600080fd5b506104ce610a22366004614dc4565b61291b565b348015610a3357600080fd5b5061055e60008051602061598583398151915281565b348015610a5557600080fd5b50610390610a64366004614ddc565b6129eb565b348015610a7557600080fd5b5061012f54610449906001600160a01b031681565b348015610a9657600080fd5b506103d2610aa5366004614b7c565b612a11565b348015610ab657600080fd5b5061012d546104f990640100000000900463ffffffff1681565b348015610adc57600080fd5b50610390610aeb36600461512e565b612a4d565b600080516020615985833981519152610b098133612a8c565b82600080828152610134602052604090206006015460ff166003811115610b4057634e487b7160e01b600052602160045260246000fd5b1415610b675760405162461bcd60e51b8152600401610b5e9061547b565b60405180910390fd5b7f703604f30bacc0494165473e817b003a6db41ed8c598a9ff96093768d701f0958484604051610b98929190615689565b60405180910390a150505050565b6000610bb28133612a8c565b61012d5461271090610bd190600160401b900463ffffffff1684615738565b63ffffffff161115610be257600080fd5b5061012d805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b6000610c1782612af0565b80610c265750610c2682612b40565b80610c355750610c3582612b71565b92915050565b606060658054610c4a9061587d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c769061587d565b8015610cc35780601f10610c9857610100808354040283529160200191610cc3565b820191906000526020600020905b815481529060010190602001808311610ca657829003601f168201915b5050505050905090565b600054610100900460ff1680610ce6575060005460ff16155b610d025760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015610d24576000805461ffff19166101011790555b610d2e8484612b96565b610d36611b46565b610d3e612c1d565b610d49600033612c8c565b610d6160008051602061598583398151915283612c8c565b61013080546001600160a01b03199081163390811790925561013180546001600160a01b03861690831617905561012d805463ffffffff19166107d017905561012f805490911690911790558015610dbf576000805461ff00191690555b50505050565b6000818152606760205260408120546001600160a01b0316610e3e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5e565b506000908152606960205260409020546001600160a01b031690565b6000610e65826117d2565b9050806001600160a01b0316836001600160a01b03161415610ed35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b5e565b336001600160a01b0382161480610eef5750610eef8133612a11565b610f615760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b5e565b610f6b8383612c96565b505050565b60008181526101346020526040902060090154606090610ff95760408051600180825281830190925260009160208083019080368337505061012f5482519293506001600160a01b031691839150600090610fdb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015292915050565b600082815261013460209081526040918290206009018054835181840281018401909452808452909183018282801561105b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161103d575b50505050509050919050565b919050565b6000818152610134602052604090206008015460609061113e5760408051600280825260608201835260009260208301908036833701905050905061012d60089054906101000a900463ffffffff16816000815181106110dc57634e487b7160e01b600052603260045260246000fd5b63ffffffff928316602091820292909201015261012d548251640100000000909104909116908290600190811061112357634e487b7160e01b600052603260045260246000fd5b63ffffffff9092166020928302919091019091015292915050565b600082815261013460209081526040918290206008018054835181840281018401909452808452909183018282801561105b57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411611185575094979650505050505050565b6111d63382612d04565b6111f25760405162461bcd60e51b8152600401610b5e90615508565b610f6b838383612ddb565b6000805160206159858339815191526112168133612a8c565b600087815261013460205260409020600181018054600160401b600160c01b031916600160401b6001600160801b038a1602179055805468ffffffffffffffff00191661010063ffffffff8881169190910268ffffffff0000000000191691909117600160281b8783160217909155831660038111156112a657634e487b7160e01b600052602160045260246000fd5b600088815261013460205260409020600601805460ff191660018360038111156112e057634e487b7160e01b600052602160045260246000fd5b02179055506000878152610134602090815260409182902060050184905581518981526001600160801b0389169181019190915263ffffffff8781168284015286811660608301528516608082015260a0810184905290517fa94140e420fc9bf52910e3e1f62d9d1e07994b684e3d329044dfd35a93dfe6fb9181900360c00190a150505050505050565b600082815260c960205260409020600101546113878133612a8c565b610f6b8383612f7b565b600061139d8133612a8c565b6113b56000805160206159858339815191528361136b565b610131546113db90600080516020615985833981519152906001600160a01b03166129eb565b5061013180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116331461146f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b5e565b6114798282612f9d565b5050565b61148682612fbf565b6114d25760405162461bcd60e51b815260206004820181905260248201527f4d75737420626520707265706172656420616e64206e6f7420737461727465646044820152606401610b5e565b610131546001600160a01b03163314806115065750600082815261013460205260409020600201546001600160a01b031633145b6115525760405162461bcd60e51b815260206004820152601860248201527f757365722063616e6e6f74206d696e742070726573616c6500000000000000006044820152606401610b5e565b610131546001600160a01b031633141561161f576000828152610134602052604090205463ffffffff600160281b909104811690821611156115cd5760405162461bcd60e51b815260206004820152601460248201527363616e6e6f74206d696e74207175616e7469747960601b6044820152606401610b5e565b60008281526101346020526040902080548291906005906115fc908490600160281b900463ffffffff166157f2565b92506101000a81548163ffffffff021916908363ffffffff1602179055506116f3565b600082815261013460205260409020600201546001600160a01b03163314156116f3576000828152610134602052604090205463ffffffff610100909104811690821611156116a75760405162461bcd60e51b815260206004820152601460248201527363616e6e6f74206d696e74207175616e7469747960601b6044820152606401610b5e565b60008281526101346020526040902080548291906001906116d4908490610100900463ffffffff166157f2565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b611479828233613000565b6000805160206159858339815191526117178133612a8c565b816117218161329c565b6117605760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610b5e565b60008381526101346020908152604091829020600601805460ff1916600317905590518481527f4616a0782e5635981b28be1cd36934a60655b462c370d8bd8092c969abc990d091015b60405180910390a1505050565b610f6b83838360405180602001604052806000815250612191565b6000818152606760205260408120546001600160a01b031680610c355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b5e565b610134602052600090815260409020805460018201546002830154600384015460048501805460ff861696610100870463ffffffff90811697600160281b810490911696600160481b82046001600160401b0390811697600160881b90930481169690821695600160401b9092046001600160801b0316946001600160a01b0393841694939091169291906118dd9061587d565b80601f01602080910402602001604051908101604052809291908181526020018280546119099061587d565b80156119565780601f1061192b57610100808354040283529160200191611956565b820191906000526020600020905b81548152906001019060200180831161193957829003601f168201915b50505050600583015460069093015491929160ff1690508c565b600061197c8133612a8c565b61012d546127109061199c90640100000000900463ffffffff1684615738565b63ffffffff1611156119ad57600080fd5b5061012d805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6000805160206159858339815191526119f38133612a8c565b60036000838152610134602052604090206006015460ff166003811115611a2a57634e487b7160e01b600052602160045260246000fd5b14611a695760405162461bcd60e51b815260206004820152600f60248201526e14d85b19481b9bdd081c185d5cd959608a1b6044820152606401610b5e565b60008281526101346020908152604091829020600601805460ff1916600217905590518381527fdcba7a000ef2740d4daa9c60f3235ec53ea38eb4164b31d5470f76e01e52d7bd91015b60405180910390a15050565b60006001600160a01b038216611b2a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b5e565b506001600160a01b031660009081526068602052604090205490565b600054610100900460ff1680611b5f575060005460ff16155b611b7b5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015611b9d576000805461ffff19166101011790555b611bad632dde656160e21b6132a5565b8015611bbf576000805461ff00191690555b50565b85858484611bcf8461329c565b80611bf75750611bde84612fbf565b8015611bf75750611bf7848463ffffffff168484613324565b611c3f5760405162461bcd60e51b81526020600482015260196024820152786e6f7420617661696c61626c6520746f20707572636861736560381b6044820152606401610b5e565b60008a815261013460205260409020548a908a9063ffffffff8216600160481b9091046001600160401b03161015611cb55760405162461bcd60e51b81526020600482015260196024820152787175616e74697479206578636565647320636170616369747960381b6044820152606401610b5e565b60008c815261013460205260409020600101546001600160401b03161580611cfe575060008c815261013460205260409020600101546001600160401b031663ffffffff8c1611155b611d1a5760405162461bcd60e51b8152600401610b5e906154ab565b323314611d395760405162461bcd60e51b8152600401610b5e90615559565b60008c815261013460205260409020600201546001600160a01b0316611d618d8d8d8461346d565b600160008e8152610134602052604090206006015460ff166003811115611d9857634e487b7160e01b600052602160045260246000fd5b1415611dc75760008d815261013460209081526040808320338452600b019091529020805460ff191660011790555b611dd28d8d8a613000565b50505050505050505050505050565b600080516020615985833981519152611dfa8133612a8c565b61012e546000818152610134602052604090206002810180546001600160a01b0319166001600160a01b038f16179055805467ffffffffffffffff60481b1916600160481b6001600160401b038e16021781556001018054600160401b600160c01b031916600160401b6001600160801b038d1602179055611e81818a89898989896136b6565b611e8b8189613785565b505050505050505050505050565b6000611ea58133612a8c565b611eb060008361136b565b61013054611ec9906000906001600160a01b03166129eb565b5061013080546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260fb60205260408120611f059083613895565b9392505050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b84848383611f448461329c565b80611f6c5750611f5384612fbf565b8015611f6c5750611f6c848463ffffffff168484613324565b611fb45760405162461bcd60e51b81526020600482015260196024820152786e6f7420617661696c61626c6520746f20707572636861736560381b6044820152606401610b5e565b600089815261013460205260409020548990899063ffffffff8216600160481b9091046001600160401b0316101561202a5760405162461bcd60e51b81526020600482015260196024820152787175616e74697479206578636565647320636170616369747960381b6044820152606401610b5e565b60008b815261013460205260409020600101546001600160401b03161580612073575060008b815261013460205260409020600101546001600160401b031663ffffffff8b1611155b61208f5760405162461bcd60e51b8152600401610b5e906154ab565b3233146120ae5760405162461bcd60e51b8152600401610b5e90615559565b60008b815261013460205260409020600201546001600160a01b03166120d68c8c8c8461346d565b600160008d8152610134602052604090206006015460ff16600381111561210d57634e487b7160e01b600052602160045260246000fd5b141561213c5760008c815261013460209081526040808320338452600b019091529020805460ff191660011790555b611e8b8c8c33613000565b606060668054610c4a9061587d565b6114793383836138a1565b600061216d8133612a8c565b5061012f80546001600160a01b0319166001600160a01b0392909216919091179055565b61219b3383612d04565b6121b75760405162461bcd60e51b8152600401610b5e90615508565b610dbf84848484613970565b600081815261013460205260409020600a015460609061228057604080516002808252606082018352600092602083019080368337505061012f5482519293506001600160a01b03169183915060009061222d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920181019190915260008581526101349091526040902060020154825191169082906001908110610fdb57634e487b7160e01b600052603260045260246000fd5b60008281526101346020908152604091829020600a018054835181840281018401909452808452909183018282801561105b576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161103d5750505050509050919050565b60006122f88133612a8c565b81600080828152610134602052604090206006015460ff16600381111561232f57634e487b7160e01b600052602160045260246000fd5b141561234d5760405162461bcd60e51b8152600401610b5e9061547b565b6000838152610134602052604090205460ff16156123a45760405162461bcd60e51b8152602060048201526014602482015273189b1d595c1c9a5b9d08155492481b1bd8dad95960621b6044820152606401610b5e565b5050600090815261013460205260409020805460ff19166001179055565b6000818152606760205260409020546060906001600160a01b03166124415760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5e565b600061244c836139a3565b9050600081511161246c5760405180602001604052806000815250611f05565b8061247684613a4d565b604051602001612487929190615196565b6040516020818303038152906040529392505050565b6000805160206159858339815191526124b68133612a8c565b82600080828152610134602052604090206006015460ff1660038111156124ed57634e487b7160e01b600052602160045260246000fd5b141561250b5760405162461bcd60e51b8152600401610b5e9061547b565b6000848152610134602052604090205460ff16156125625760405162461bcd60e51b8152602060048201526014602482015273189b1d595c1c9a5b9d08155492481b1bd8dad95960621b6044820152606401610b5e565b6000848152610134602090815260409091208451612588926004909201918601906147e4565b507f36ab8e0ce3828485b4d98e97c3f5851331257ffe2b61a43e7e0e9875242f96378484604051610b98929190615689565b3360009081526101336020526040902054806126115760405162461bcd60e51b81526020600482015260166024820152756e6f206372656469747320746f20776974686472617760501b6044820152606401610b5e565b3360009081526101336020526040808220829055516001600160a01b03841690614e2090849084818181858888f193505050503d8060008114612670576040519150601f19603f3d011682016040523d82523d6000602084013e612675565b606091505b5050905080610f6b5760405162461bcd60e51b815260206004820152600f60248201526e1dda5d1a191c985dc819985a5b1959608a1b6044820152606401610b5e565b6000805160206159858339815191526126d18133612a8c565b60016000878152610134602052604090206006015460ff16600381111561270857634e487b7160e01b600052602160045260246000fd5b146127555760405162461bcd60e51b815260206004820152601c60248201527f73616c652073746172746564206f72206e6f74207072657061726564000000006044820152606401610b5e565b61275f8585613b66565b156127b357600086815261013460209081526040909120865161278a92600990920191880190614868565b5060008681526101346020908152604090912085516127b1926007909201918701906148bd565b505b6127bd8383613b66565b156128115760008681526101346020908152604090912084516127e892600a90920191860190614868565b50600086815261013460209081526040909120835161280f926008909201918501906148bd565b505b505050505050565b6000805160206159858339815191526128328133612a8c565b60016000838152610134602052604090206006015460ff16600381111561286957634e487b7160e01b600052602160045260246000fd5b146128b65760405162461bcd60e51b815260206004820152601c60248201527f73616c652073746172746564206f72206e6f74207072657061726564000000006044820152606401610b5e565b60008281526101346020908152604091829020600601805460ff1916600217905590518381527fa78c547613f6306e7a70d1bd161c18a496cae1eeb8d4f9e58b60d69ad72ddf589101611ab3565b600081815260fb60205260408120610c3590613c88565b600081815261013460205260409020600701546060906129835760408051600180825281830190925260009160208083019080368337505061012d54825192935063ffffffff169183915060009061112357634e487b7160e01b600052603260045260246000fd5b600082815261013460209081526040918290206007018054835181840281018401909452808452909183018282801561105b576000918252602091829020805463ffffffff168452908202830192909160049101808411611185575094979650505050505050565b600082815260c96020526040902060010154612a078133612a8c565b610f6b8383612f9d565b6001600160a01b038083166000908152606a6020908152604080832093851683529290529081205460ff1680611f055750611f05600083611f0c565b6000612a598133612a8c565b6127108263ffffffff161115612a6e57600080fd5b5061012d805463ffffffff191663ffffffff92909216919091179055565b612a968282611f0c565b61147957612aae816001600160a01b03166014613c92565b612ab9836020613c92565b604051602001612aca9291906151ee565b60408051601f198184030181529082905262461bcd60e51b8252610b5e916004016153c8565b60006001600160e01b031982166380ac58cd60e01b1480612b2157506001600160e01b03198216635b5e139f60e01b145b80610c3557506301ffc9a760e01b6001600160e01b0319831614610c35565b6000612b4b82612af0565b80610c355750506001600160e01b03191660009081526097602052604090205460ff1690565b60006001600160e01b03198216635a05180f60e01b1480610c355750610c3582613e73565b600054610100900460ff1680612baf575060005460ff16155b612bcb5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015612bed576000805461ffff19166101011790555b612bf5613e98565b612bfd613e98565b612c078383613f02565b8015610f6b576000805461ff0019169055505050565b600054610100900460ff1680612c36575060005460ff16155b612c525760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015612c74576000805461ffff19166101011790555b612c7c613e98565b612c84613e98565b611bad613e98565b6114798282612f7b565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ccb826117d2565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b0316612d7d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5e565b6000612d88836117d2565b9050806001600160a01b0316846001600160a01b03161480612dc35750836001600160a01b0316612db884610dc5565b6001600160a01b0316145b80612dd35750612dd38185612a11565b949350505050565b826001600160a01b0316612dee826117d2565b6001600160a01b031614612e565760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b5e565b6001600160a01b038216612eb85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b5e565b612ec3600082612c96565b6001600160a01b0383166000908152606860205260408120805460019290612eec9084906157db565b90915550506001600160a01b0382166000908152606860205260408120805460019290612f1a908490615720565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612f858282613f97565b600082815260fb60205260409020610f6b908261401d565b612fa78282614032565b600082815260fb60205260409020610f6b9082614099565b600060015b6000838152610134602052604090206006015460ff166003811115612ff957634e487b7160e01b600052602160045260246000fd5b1492915050565b600083815261013460205260408120546001600160401b03600160881b8204811692600160481b90920416905b8463ffffffff168161ffff16101561320a576000826001600160401b0316116130985760405162461bcd60e51b815260206004820152601960248201527f626c75657072696e74206f7574206f66206361706163697479000000000000006044820152606401610b5e565b6130b8846130aa61ffff8416866156f5565b6001600160801b03166140ae565b8561013260006130cc61ffff8516876156f5565b6001600160801b03168152602001908152602001600020819055506000434241856040516020016131359493929190938452602084019290925260601b6bffffffffffffffffffffffff1916604083015260c01b6001600160c01b0319166054820152605c0190565b60408051601f19818403018152918152815160209283012060008a81526101349093529120600201549091507fbe53bef0e08aa61aa51091a6fa77b4a68c6da179f64097fa01f92beda583eecc9088906001600160a01b03168761319d61ffff8716896156f5565b604080519485526001600160a01b03938416602086015291909216908301526001600160801b031660608201526001600160401b038516608082015260a0810183905260c00160405180910390a16131f48361585a565b9250508080613202906158b8565b91505061302d565b50600085815261013460205260409020805463ffffffff86169190601190613243908490600160881b90046001600160401b0316615757565b82546101009290920a6001600160401b0381810219909316918316021790915560009687526101346020526040909620805467ffffffffffffffff60481b1916600160481b939097169290920295909517905550505050565b60006002612fc4565b6001600160e01b031980821614156132ff5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401610b5e565b6001600160e01b0319166000908152609760205260409020805460ff19166001179055565b6000816133675760405162461bcd60e51b81526020600482015260116024820152701b9bc81c1c9bdbd9881c1c9bdd9a591959607a1b6044820152606401610b5e565b600085815261013460209081526040808320338452600b0190915290205460ff16156133c75760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610b5e565b6000858152610134602052604090206005015461346361342933876040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b828686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506141f092505050565b9695505050505050565b60008481526101346020526040902060038101546001909101546001600160a01b0390911690600160401b90046001600160801b03168161356e5783156134f65760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f74207370656369667920746f6b656e20616d6f756e7400000000006044820152606401610b5e565b6135068163ffffffff871661578d565b6001600160801b0316341461355d5760405162461bcd60e51b815260206004820181905260248201527f507572636861736520616d6f756e74206d757374206d617463682070726963656044820152606401610b5e565b613569868334866141fd565b612811565b34156135bc5760405162461bcd60e51b815260206004820152601960248201527f63616e6e6f7420737065636966792065746820616d6f756e74000000000000006044820152606401610b5e565b6135cc8163ffffffff871661578d565b6001600160801b031684146136235760405162461bcd60e51b815260206004820181905260248201527f507572636861736520616d6f756e74206d757374206d617463682070726963656044820152606401610b5e565b6040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b038316906323b872dd90606401602060405180830381600087803b15801561367157600080fd5b505af1158015613685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a99190614da8565b50612811868386866141fd565b6136c087876142d7565b60008781526101346020908152604090912086516136e6926004909201918801906147e4565b508315613703576000878152610134602052604090206005018490555b600087815261013460205260409020805468ffffffffffffffff00191661010063ffffffff8681169190910268ffffffff0000000000191691909117600160281b858316021790915581161561280f57600087815261013460205260409020600101805467ffffffffffffffff191663ffffffff831617905550505050505050565b600082815261013460205260409020600681018054600160ff1990911617905561012d8054825467ffffffffffffffff60881b1916600160601b918290046001600160401b03908116600160881b0291909117938490558254600160481b909404811693849392600c926137fd928692900416615757565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555061012e6000815480929190613835906158da565b90915550506000838152610134602052604090819020600281015491517f97660d9bc329402e809d4aabb7261513a7d331d8762d407be7e3316d08d188fd926117aa9287926001600160a01b0390921691869188916004909101906155a8565b6000611f058383614317565b816001600160a01b0316836001600160a01b031614156139035760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b5e565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61397b848484612ddb565b6139878484848461434f565b610dbf5760405162461bcd60e51b8152600401610b5e906153db565b60008181526101326020908152604080832054835261013490915290206004018054606091906139d29061587d565b80601f01602080910402602001604051908101604052809291908181526020018280546139fe9061587d565b801561105b5780601f10613a205761010080835404028352916020019161105b565b820191906000526020600020905b815481529060010190602001808311613a2e5750939695505050505050565b606081613a715750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a9b5780613a85816158da565b9150613a949050600a83615779565b9150613a75565b6000816001600160401b03811115613ac357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613aed576020820181803683370190505b5090505b8415612dd357613b026001836157db565b9150613b0f600a866158f5565b613b1a906030615720565b60f81b818381518110613b3d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613b5f600a86615779565b9450613af1565b600082516000141580613b795750815115155b15613c7f578151835114613bcf5760405162461bcd60e51b815260206004820152601b60248201527f6d69736d61746368656420726563697069656e747320262042707300000000006044820152606401610b5e565b6000805b8351811015613c2357838181518110613bfc57634e487b7160e01b600052603260045260246000fd5b602002602001015182613c0f9190615738565b915080613c1b816158da565b915050613bd3565b506127108163ffffffff161115613c755760405162461bcd60e51b81526020600482015260166024820152754665652042707320657863656564206d6178696d756d60501b6044820152606401610b5e565b6001915050610c35565b50600092915050565b6000610c35825490565b60606000613ca18360026157bc565b613cac906002615720565b6001600160401b03811115613cd157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613cfb576020820181803683370190505b509050600360fc1b81600081518110613d2457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613d6157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613d858460026157bc565b613d90906001615720565b90505b6001811115613e24576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613dd257634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110613df657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93613e1d81615843565b9050613d93565b508315611f055760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b5e565b60006001600160e01b03198216637965db0b60e01b1480610c355750610c3582612b40565b600054610100900460ff1680613eb1575060005460ff16155b613ecd5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015611bad576000805461ffff19166101011790558015611bbf576000805461ff001916905550565b600054610100900460ff1680613f1b575060005460ff16155b613f375760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015613f59576000805461ffff19166101011790555b8251613f6c9060659060208601906147e4565b508151613f809060669060208501906147e4565b508015610f6b576000805461ff0019169055505050565b613fa18282611f0c565b61147957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613fd93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611f05836001600160a01b038416614459565b61403c8282611f0c565b1561147957600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611f05836001600160a01b0384166144a8565b6001600160a01b0382166141045760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b5e565b6000818152606760205260409020546001600160a01b0316156141695760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5e565b6001600160a01b0382166000908152606860205260408120805460019290614192908490615720565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000612dd38284866145c5565b600061420885610f70565b905060006142158661291b565b90506000805b83518110156142b057600061425d8785848151811061424a57634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff166145db565b90506142698184615720565b925061429d85838151811061428e57634e487b7160e01b600052603260045260246000fd5b602002602001015189836145f4565b50806142a8816158da565b91505061421b565b5060006142bd82876157db565b111561280f5761280f84876142d284896157db565b6145f4565b6001600160a01b038116156114795760008281526101346020526040902060030180546001600160a01b0383166001600160a01b03199091161790555050565b600082600001828154811061433c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160a01b0384163b1561445157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614393903390899088908890600401615263565b602060405180830381600087803b1580156143ad57600080fd5b505af19250505080156143dd575060408051601f3d908101601f191682019092526143da91810190614e3d565b60015b614437573d80801561440b576040519150601f19603f3d011682016040523d82523d6000602084013e614410565b606091505b50805161442f5760405162461bcd60e51b8152600401610b5e906153db565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612dd3565b506001612dd3565b60008181526001830160205260408120546144a057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c35565b506000610c35565b600081815260018301602052604081205480156145bb5760006144cc6001836157db565b85549091506000906144e0906001906157db565b905081811461456157600086600001828154811061450e57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061453f57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061458057634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c35565b6000915050610c35565b6000826145d2858461472a565b14949350505050565b60006127106145ea83856157bc565b611f059190615779565b6001600160a01b038216156146855760405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb90604401602060405180830381600087803b15801561464d57600080fd5b505af1158015614661573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbf9190614da8565b6000836001600160a01b031682614e2090604051600060405180830381858888f193505050503d80600081146146d7576040519150601f19603f3d011682016040523d82523d6000602084013e6146dc565b606091505b5050905080610dbf576001600160a01b0384166000908152610133602052604090205461470a908390615720565b6001600160a01b0385166000908152610133602052604090205550505050565b600081815b84518110156147dc57600085828151811061475a57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161479c5760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506147c9565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806147d4816158da565b91505061472f565b509392505050565b8280546147f09061587d565b90600052602060002090601f0160209004810192826148125760008555614858565b82601f1061482b57805160ff1916838001178555614858565b82800160010185558215614858579182015b8281111561485857825182559160200191906001019061483d565b50614864929150614963565b5090565b828054828255906000526020600020908101928215614858579160200282015b8281111561485857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614888565b828054828255906000526020600020906007016008900481019282156148585791602002820160005b8382111561492a57835183826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026148e6565b801561495a5782816101000a81549063ffffffff021916905560040160208160030104928301926001030261492a565b50506148649291505b5b808211156148645760008155600101614964565b60006001600160401b0383111561499157614991615935565b6149a4601f8401601f19166020016156a2565b90508281528383830111156149b857600080fd5b828260208301376000602084830101529392505050565b80356110678161594b565b600082601f8301126149ea578081fd5b813560206149ff6149fa836156d2565b6156a2565b80838252828201915082860187848660051b8901011115614a1e578586fd5b855b85811015614a45578135614a338161594b565b84529284019290840190600101614a20565b5090979650505050505050565b60008083601f840112614a63578182fd5b5081356001600160401b03811115614a79578182fd5b6020830191508360208260051b8501011115614a9457600080fd5b9250929050565b600082601f830112614aab578081fd5b81356020614abb6149fa836156d2565b80838252828201915082860187848660051b8901011115614ada578586fd5b855b85811015614a4557614aed82614b35565b84529284019290840190600101614adc565b600082601f830112614b0f578081fd5b611f0583833560208501614978565b80356001600160801b038116811461106757600080fd5b803563ffffffff8116811461106757600080fd5b80356001600160401b038116811461106757600080fd5b600060208284031215614b71578081fd5b8135611f058161594b565b60008060408385031215614b8e578081fd5b8235614b998161594b565b91506020830135614ba98161594b565b809150509250929050565b600080600060608486031215614bc8578081fd5b8335614bd38161594b565b92506020840135614be38161594b565b929592945050506040919091013590565b60008060008060808587031215614c09578081fd5b8435614c148161594b565b93506020850135614c248161594b565b92506040850135915060608501356001600160401b03811115614c45578182fd5b8501601f81018713614c55578182fd5b614c6487823560208401614978565b91505092959194509250565b60008060408385031215614c82578182fd5b8235614c8d8161594b565b91506020830135614ba981615960565b60008060408385031215614caf578182fd5b8235614cba8161594b565b946020939093013593505050565b6000806000806000806000806000806101408b8d031215614ce7578788fd5b614cf08b6149cf565b9950614cfe60208c01614b49565b9850614d0c60408c01614b1e565b9750614d1a60608c016149cf565b965060808b01356001600160401b0380821115614d35578788fd5b614d418e838f01614aff565b975060a08d0135915080821115614d56578687fd5b50614d638d828e01614aff565b95505060c08b01359350614d7960e08c01614b35565b9250614d886101008c01614b35565b9150614d976101208c01614b35565b90509295989b9194979a5092959850565b600060208284031215614db9578081fd5b8151611f0581615960565b600060208284031215614dd5578081fd5b5035919050565b60008060408385031215614dee578182fd5b823591506020830135614ba98161594b565b60008060408385031215614e12578182fd5b50508035926020909101359150565b600060208284031215614e32578081fd5b8135611f058161596e565b600060208284031215614e4e578081fd5b8151611f058161596e565b600080600060608486031215614e6d578081fd5b83356001600160401b0380821115614e83578283fd5b614e8f87838801614aff565b94506020860135915080821115614ea4578283fd5b50614eb186828701614aff565b9250506040840135614ec28161594b565b809150509250925092565b600080600080600060a08688031215614ee4578283fd5b8535945060208601356001600160401b0380821115614f01578485fd5b614f0d89838a016149da565b95506040880135915080821115614f22578485fd5b614f2e89838a01614a9b565b94506060880135915080821115614f43578283fd5b614f4f89838a016149da565b93506080880135915080821115614f64578283fd5b50614f7188828901614a9b565b9150509295509295909350565b60008060408385031215614f90578182fd5b8235915060208301356001600160401b03811115614fac578182fd5b614fb885828601614aff565b9150509250929050565b60008060008060008060c08789031215614fda578384fd5b86359550614fea60208801614b1e565b9450614ff860408801614b35565b935061500660608801614b35565b925061501460808801614b35565b915060a087013590509295509295509295565b60008060408385031215615039578182fd5b8235915061504960208401614b35565b90509250929050565b600080600080600060808688031215615069578283fd5b8535945061507960208701614b35565b93506040860135925060608601356001600160401b0381111561509a578182fd5b6150a688828901614a52565b969995985093965092949392505050565b60008060008060008060a087890312156150cf578384fd5b863595506150df60208801614b35565b94506040870135935060608701356001600160401b03811115615100578283fd5b61510c89828a01614a52565b90945092505060808701356151208161594b565b809150509295509295509295565b60006020828403121561513f578081fd5b611f0582614b35565b60008151808452615160816020860160208601615817565b601f01601f19169290920160200192915050565b6004811061519257634e487b7160e01b600052602160045260246000fd5b9052565b600083516151a8818460208801615817565b8083019050602f60f81b80825284516151c8816001850160208901615817565b6001920191820152693a37b5b2b7173539b7b760b11b6002820152600c01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615226816017850160208801615817565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615257816028840160208801615817565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061346390830184615148565b6020808252825182820181905260009190848201906040850190845b818110156152d75783516001600160a01b0316835292840192918401916001016152b2565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156152d757835163ffffffff16835292840192918401916001016152ff565b8c1515815263ffffffff8c811660208301528b1660408201526001600160401b038a811660608301528981166080830152881660a08201526001600160801b03871660c082015260006101806001600160a01b03881660e08401526001600160a01b0387166101008401528061012084015261539f81840187615148565b915050836101408301526153b7610160830184615174565b9d9c50505050505050505050505050565b602081526000611f056020830184615148565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260169082015275189b1d595c1c9a5b9d081b9bdd081c1c995c185c995960521b604082015260600190565b60208082526038908201527f757365722063616e6e6f7420627579206d6f7265207468616e206d617850757260408201527f6368617365416d6f756e7420696e2073696e676c652074780000000000000000606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602f908201527f70757263686173652063616e6e6f742062652063616c6c65642066726f6d206160408201526e1b9bdd1a195c8818dbdb9d1c9858dd608a1b606082015260800190565b8581526000602060018060a01b038716818401526001600160401b038616604084015260a060608401526155df60a0840186615148565b838103608085015284548390600181811c908083168061560057607f831692505b86831081141561561e57634e487b7160e01b88526022600452602488fd5b82865260208601955080801561563b576001811461564c57615676565b60ff19851687528787019550615676565b60008b815260209020895b8581101561567057815489820152908401908901615657565b88019650505b50939d9c50505050505050505050505050565b828152604060208201526000612dd36040830184615148565b604051601f8201601f191681016001600160401b03811182821017156156ca576156ca615935565b604052919050565b60006001600160401b038211156156eb576156eb615935565b5060051b60200190565b60006001600160801b0380831681851680830382111561571757615717615909565b01949350505050565b6000821982111561573357615733615909565b500190565b600063ffffffff80831681851680830382111561571757615717615909565b60006001600160401b0380831681851680830382111561571757615717615909565b6000826157885761578861591f565b500490565b60006001600160801b03808316818516818304811182151516156157b3576157b3615909565b02949350505050565b60008160001904831182151516156157d6576157d6615909565b500290565b6000828210156157ed576157ed615909565b500390565b600063ffffffff8381169083168181101561580f5761580f615909565b039392505050565b60005b8381101561583257818101518382015260200161581a565b83811115610dbf5750506000910152565b60008161585257615852615909565b506000190190565b60006001600160401b0382168061587357615873615909565b6000190192915050565b600181811c9082168061589157607f821691505b602082108114156158b257634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156158d0576158d0615909565b6001019392505050565b60006000198214156158ee576158ee615909565b5060010190565b6000826159045761590461591f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611bbf57600080fd5b8015158114611bbf57600080fd5b6001600160e01b031981168114611bbf57600080fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122075e6bc4aaf7491f6af9572210d855e4fe4401171e96cf81e26322239ba9ee63264736f6c63430008040033

Deployed Bytecode

0x60806040526004361061036b5760003560e01c806380ae4ebc116101c6578063c87b56dd116100f7578063ced3604311610095578063deb941481161006f578063deb9414814610a69578063e985e9c514610a8a578063eaf2115d14610aaa578063fce212f314610ad057600080fd5b8063ced3604314610a07578063d539139314610a27578063d547741f14610a4957600080fd5b8063c9e63203116100d1578063c9e6320314610982578063c9f2bd93146109a2578063ca15c873146109c2578063cba991bf146109e257600080fd5b8063c87b56dd14610922578063c8950e6014610942578063c90941b11461096257600080fd5b806395d89b4111610164578063aec970b01161013e578063aec970b0146108a2578063b88d4fde146108c2578063b9c4d9fb146108e2578063c2bce59c1461090257600080fd5b806395d89b4114610858578063a217fddf1461086d578063a22cb4651461088257600080fd5b80638f9f193f116101a05780638f9f193f146107e55780639010d07c1461080557806391d148541461082557806394a9c9c31461084557600080fd5b806380ae4ebc1461079d57806382c32b80146107b2578063898a90bc146107c557600080fd5b80632fcfb95a116102a05780634d073a5a1161023e57806366c083d31161021857806366c083d31461072657806368c31e261461074657806370a08231146107665780637b4252c01461078657600080fd5b80634d073a5a1461068e5780636352211e146106ce57806366bf33be146106ee57600080fd5b806338e395cf1161027a57806338e395cf1461060d5780633a66e4b61461062d57806342842e0e1461064d5780634bde38c81461066d57600080fd5b80632fcfb95a146105ac57806334d722c9146105cc57806336568abe146105ed57600080fd5b80630a21a2111161030d57806323b872dd116102e757806323b872dd1461050e578063248a9ca31461052e5780632e2d6bb81461056c5780632f2ff15d1461058c57600080fd5b80630a21a211146104815780630ebd4c7f146104ae57806322235d69146104db57600080fd5b806306fdde031161034957806306fdde03146103e7578063077f224a14610409578063081812fc14610429578063095ea7b31461046157600080fd5b8063018a62a61461037057806301a949501461039257806301ffc9a7146103b2575b600080fd5b34801561037c57600080fd5b5061039061038b366004614f7e565b610af0565b005b34801561039e57600080fd5b506103906103ad36600461512e565b610ba6565b3480156103be57600080fd5b506103d26103cd366004614e21565b610c0c565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b506103fc610c3b565b6040516103de91906153c8565b34801561041557600080fd5b50610390610424366004614e59565b610ccd565b34801561043557600080fd5b50610449610444366004614dc4565b610dc5565b6040516001600160a01b0390911681526020016103de565b34801561046d57600080fd5b5061039061047c366004614c9d565b610e5a565b34801561048d57600080fd5b506104a161049c366004614dc4565b610f70565b6040516103de9190615296565b3480156104ba57600080fd5b506104ce6104c9366004614dc4565b61106c565b6040516103de91906152e3565b3480156104e757600080fd5b5061012d546104f99063ffffffff1681565b60405163ffffffff90911681526020016103de565b34801561051a57600080fd5b50610390610529366004614bb4565b6111cc565b34801561053a57600080fd5b5061055e610549366004614dc4565b600090815260c9602052604090206001015490565b6040519081526020016103de565b34801561057857600080fd5b50610390610587366004614fc2565b6111fd565b34801561059857600080fd5b506103906105a7366004614ddc565b61136b565b3480156105b857600080fd5b506103906105c7366004614b60565b611391565b3480156105d857600080fd5b5061013154610449906001600160a01b031681565b3480156105f957600080fd5b50610390610608366004614ddc565b6113ff565b34801561061957600080fd5b50610390610628366004615027565b61147d565b34801561063957600080fd5b50610390610648366004614dc4565b6116fe565b34801561065957600080fd5b50610390610668366004614bb4565b6117b7565b34801561067957600080fd5b5061013054610449906001600160a01b031681565b34801561069a57600080fd5b5061012d546106b690600160601b90046001600160401b031681565b6040516001600160401b0390911681526020016103de565b3480156106da57600080fd5b506104496106e9366004614dc4565b6117d2565b3480156106fa57600080fd5b5061070e610709366004614dc4565b611849565b6040516103de9c9b9a99989796959493929190615321565b34801561073257600080fd5b5061039061074136600461512e565b611970565b34801561075257600080fd5b50610390610761366004614dc4565b6119da565b34801561077257600080fd5b5061055e610781366004614b60565b611abf565b34801561079257600080fd5b5061055e61012e5481565b3480156107a957600080fd5b50610390611b46565b6103906107c03660046150b7565b611bc2565b3480156107d157600080fd5b506103906107e0366004614cc8565b611de1565b3480156107f157600080fd5b50610390610800366004614b60565b611e99565b34801561081157600080fd5b50610449610820366004614e00565b611eed565b34801561083157600080fd5b506103d2610840366004614ddc565b611f0c565b610390610853366004615052565b611f37565b34801561086457600080fd5b506103fc612147565b34801561087957600080fd5b5061055e600081565b34801561088e57600080fd5b5061039061089d366004614c70565b612156565b3480156108ae57600080fd5b506103906108bd366004614b60565b612161565b3480156108ce57600080fd5b506103906108dd366004614bf4565b612191565b3480156108ee57600080fd5b506104a16108fd366004614dc4565b6121c3565b34801561090e57600080fd5b5061039061091d366004614dc4565b6122ec565b34801561092e57600080fd5b506103fc61093d366004614dc4565b6123c2565b34801561094e57600080fd5b5061039061095d366004614f7e565b61249d565b34801561096e57600080fd5b5061039061097d366004614b60565b6125ba565b34801561098e57600080fd5b5061039061099d366004614ecd565b6126b8565b3480156109ae57600080fd5b506103906109bd366004614dc4565b612819565b3480156109ce57600080fd5b5061055e6109dd366004614dc4565b612904565b3480156109ee57600080fd5b5061012d546104f990600160401b900463ffffffff1681565b348015610a1357600080fd5b506104ce610a22366004614dc4565b61291b565b348015610a3357600080fd5b5061055e60008051602061598583398151915281565b348015610a5557600080fd5b50610390610a64366004614ddc565b6129eb565b348015610a7557600080fd5b5061012f54610449906001600160a01b031681565b348015610a9657600080fd5b506103d2610aa5366004614b7c565b612a11565b348015610ab657600080fd5b5061012d546104f990640100000000900463ffffffff1681565b348015610adc57600080fd5b50610390610aeb36600461512e565b612a4d565b600080516020615985833981519152610b098133612a8c565b82600080828152610134602052604090206006015460ff166003811115610b4057634e487b7160e01b600052602160045260246000fd5b1415610b675760405162461bcd60e51b8152600401610b5e9061547b565b60405180910390fd5b7f703604f30bacc0494165473e817b003a6db41ed8c598a9ff96093768d701f0958484604051610b98929190615689565b60405180910390a150505050565b6000610bb28133612a8c565b61012d5461271090610bd190600160401b900463ffffffff1684615738565b63ffffffff161115610be257600080fd5b5061012d805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b6000610c1782612af0565b80610c265750610c2682612b40565b80610c355750610c3582612b71565b92915050565b606060658054610c4a9061587d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c769061587d565b8015610cc35780601f10610c9857610100808354040283529160200191610cc3565b820191906000526020600020905b815481529060010190602001808311610ca657829003601f168201915b5050505050905090565b600054610100900460ff1680610ce6575060005460ff16155b610d025760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015610d24576000805461ffff19166101011790555b610d2e8484612b96565b610d36611b46565b610d3e612c1d565b610d49600033612c8c565b610d6160008051602061598583398151915283612c8c565b61013080546001600160a01b03199081163390811790925561013180546001600160a01b03861690831617905561012d805463ffffffff19166107d017905561012f805490911690911790558015610dbf576000805461ff00191690555b50505050565b6000818152606760205260408120546001600160a01b0316610e3e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5e565b506000908152606960205260409020546001600160a01b031690565b6000610e65826117d2565b9050806001600160a01b0316836001600160a01b03161415610ed35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b5e565b336001600160a01b0382161480610eef5750610eef8133612a11565b610f615760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b5e565b610f6b8383612c96565b505050565b60008181526101346020526040902060090154606090610ff95760408051600180825281830190925260009160208083019080368337505061012f5482519293506001600160a01b031691839150600090610fdb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015292915050565b600082815261013460209081526040918290206009018054835181840281018401909452808452909183018282801561105b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161103d575b50505050509050919050565b919050565b6000818152610134602052604090206008015460609061113e5760408051600280825260608201835260009260208301908036833701905050905061012d60089054906101000a900463ffffffff16816000815181106110dc57634e487b7160e01b600052603260045260246000fd5b63ffffffff928316602091820292909201015261012d548251640100000000909104909116908290600190811061112357634e487b7160e01b600052603260045260246000fd5b63ffffffff9092166020928302919091019091015292915050565b600082815261013460209081526040918290206008018054835181840281018401909452808452909183018282801561105b57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411611185575094979650505050505050565b6111d63382612d04565b6111f25760405162461bcd60e51b8152600401610b5e90615508565b610f6b838383612ddb565b6000805160206159858339815191526112168133612a8c565b600087815261013460205260409020600181018054600160401b600160c01b031916600160401b6001600160801b038a1602179055805468ffffffffffffffff00191661010063ffffffff8881169190910268ffffffff0000000000191691909117600160281b8783160217909155831660038111156112a657634e487b7160e01b600052602160045260246000fd5b600088815261013460205260409020600601805460ff191660018360038111156112e057634e487b7160e01b600052602160045260246000fd5b02179055506000878152610134602090815260409182902060050184905581518981526001600160801b0389169181019190915263ffffffff8781168284015286811660608301528516608082015260a0810184905290517fa94140e420fc9bf52910e3e1f62d9d1e07994b684e3d329044dfd35a93dfe6fb9181900360c00190a150505050505050565b600082815260c960205260409020600101546113878133612a8c565b610f6b8383612f7b565b600061139d8133612a8c565b6113b56000805160206159858339815191528361136b565b610131546113db90600080516020615985833981519152906001600160a01b03166129eb565b5061013180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116331461146f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b5e565b6114798282612f9d565b5050565b61148682612fbf565b6114d25760405162461bcd60e51b815260206004820181905260248201527f4d75737420626520707265706172656420616e64206e6f7420737461727465646044820152606401610b5e565b610131546001600160a01b03163314806115065750600082815261013460205260409020600201546001600160a01b031633145b6115525760405162461bcd60e51b815260206004820152601860248201527f757365722063616e6e6f74206d696e742070726573616c6500000000000000006044820152606401610b5e565b610131546001600160a01b031633141561161f576000828152610134602052604090205463ffffffff600160281b909104811690821611156115cd5760405162461bcd60e51b815260206004820152601460248201527363616e6e6f74206d696e74207175616e7469747960601b6044820152606401610b5e565b60008281526101346020526040902080548291906005906115fc908490600160281b900463ffffffff166157f2565b92506101000a81548163ffffffff021916908363ffffffff1602179055506116f3565b600082815261013460205260409020600201546001600160a01b03163314156116f3576000828152610134602052604090205463ffffffff610100909104811690821611156116a75760405162461bcd60e51b815260206004820152601460248201527363616e6e6f74206d696e74207175616e7469747960601b6044820152606401610b5e565b60008281526101346020526040902080548291906001906116d4908490610100900463ffffffff166157f2565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b611479828233613000565b6000805160206159858339815191526117178133612a8c565b816117218161329c565b6117605760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610b5e565b60008381526101346020908152604091829020600601805460ff1916600317905590518481527f4616a0782e5635981b28be1cd36934a60655b462c370d8bd8092c969abc990d091015b60405180910390a1505050565b610f6b83838360405180602001604052806000815250612191565b6000818152606760205260408120546001600160a01b031680610c355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b5e565b610134602052600090815260409020805460018201546002830154600384015460048501805460ff861696610100870463ffffffff90811697600160281b810490911696600160481b82046001600160401b0390811697600160881b90930481169690821695600160401b9092046001600160801b0316946001600160a01b0393841694939091169291906118dd9061587d565b80601f01602080910402602001604051908101604052809291908181526020018280546119099061587d565b80156119565780601f1061192b57610100808354040283529160200191611956565b820191906000526020600020905b81548152906001019060200180831161193957829003601f168201915b50505050600583015460069093015491929160ff1690508c565b600061197c8133612a8c565b61012d546127109061199c90640100000000900463ffffffff1684615738565b63ffffffff1611156119ad57600080fd5b5061012d805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6000805160206159858339815191526119f38133612a8c565b60036000838152610134602052604090206006015460ff166003811115611a2a57634e487b7160e01b600052602160045260246000fd5b14611a695760405162461bcd60e51b815260206004820152600f60248201526e14d85b19481b9bdd081c185d5cd959608a1b6044820152606401610b5e565b60008281526101346020908152604091829020600601805460ff1916600217905590518381527fdcba7a000ef2740d4daa9c60f3235ec53ea38eb4164b31d5470f76e01e52d7bd91015b60405180910390a15050565b60006001600160a01b038216611b2a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b5e565b506001600160a01b031660009081526068602052604090205490565b600054610100900460ff1680611b5f575060005460ff16155b611b7b5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015611b9d576000805461ffff19166101011790555b611bad632dde656160e21b6132a5565b8015611bbf576000805461ff00191690555b50565b85858484611bcf8461329c565b80611bf75750611bde84612fbf565b8015611bf75750611bf7848463ffffffff168484613324565b611c3f5760405162461bcd60e51b81526020600482015260196024820152786e6f7420617661696c61626c6520746f20707572636861736560381b6044820152606401610b5e565b60008a815261013460205260409020548a908a9063ffffffff8216600160481b9091046001600160401b03161015611cb55760405162461bcd60e51b81526020600482015260196024820152787175616e74697479206578636565647320636170616369747960381b6044820152606401610b5e565b60008c815261013460205260409020600101546001600160401b03161580611cfe575060008c815261013460205260409020600101546001600160401b031663ffffffff8c1611155b611d1a5760405162461bcd60e51b8152600401610b5e906154ab565b323314611d395760405162461bcd60e51b8152600401610b5e90615559565b60008c815261013460205260409020600201546001600160a01b0316611d618d8d8d8461346d565b600160008e8152610134602052604090206006015460ff166003811115611d9857634e487b7160e01b600052602160045260246000fd5b1415611dc75760008d815261013460209081526040808320338452600b019091529020805460ff191660011790555b611dd28d8d8a613000565b50505050505050505050505050565b600080516020615985833981519152611dfa8133612a8c565b61012e546000818152610134602052604090206002810180546001600160a01b0319166001600160a01b038f16179055805467ffffffffffffffff60481b1916600160481b6001600160401b038e16021781556001018054600160401b600160c01b031916600160401b6001600160801b038d1602179055611e81818a89898989896136b6565b611e8b8189613785565b505050505050505050505050565b6000611ea58133612a8c565b611eb060008361136b565b61013054611ec9906000906001600160a01b03166129eb565b5061013080546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260fb60205260408120611f059083613895565b9392505050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b84848383611f448461329c565b80611f6c5750611f5384612fbf565b8015611f6c5750611f6c848463ffffffff168484613324565b611fb45760405162461bcd60e51b81526020600482015260196024820152786e6f7420617661696c61626c6520746f20707572636861736560381b6044820152606401610b5e565b600089815261013460205260409020548990899063ffffffff8216600160481b9091046001600160401b0316101561202a5760405162461bcd60e51b81526020600482015260196024820152787175616e74697479206578636565647320636170616369747960381b6044820152606401610b5e565b60008b815261013460205260409020600101546001600160401b03161580612073575060008b815261013460205260409020600101546001600160401b031663ffffffff8b1611155b61208f5760405162461bcd60e51b8152600401610b5e906154ab565b3233146120ae5760405162461bcd60e51b8152600401610b5e90615559565b60008b815261013460205260409020600201546001600160a01b03166120d68c8c8c8461346d565b600160008d8152610134602052604090206006015460ff16600381111561210d57634e487b7160e01b600052602160045260246000fd5b141561213c5760008c815261013460209081526040808320338452600b019091529020805460ff191660011790555b611e8b8c8c33613000565b606060668054610c4a9061587d565b6114793383836138a1565b600061216d8133612a8c565b5061012f80546001600160a01b0319166001600160a01b0392909216919091179055565b61219b3383612d04565b6121b75760405162461bcd60e51b8152600401610b5e90615508565b610dbf84848484613970565b600081815261013460205260409020600a015460609061228057604080516002808252606082018352600092602083019080368337505061012f5482519293506001600160a01b03169183915060009061222d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920181019190915260008581526101349091526040902060020154825191169082906001908110610fdb57634e487b7160e01b600052603260045260246000fd5b60008281526101346020908152604091829020600a018054835181840281018401909452808452909183018282801561105b576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161103d5750505050509050919050565b60006122f88133612a8c565b81600080828152610134602052604090206006015460ff16600381111561232f57634e487b7160e01b600052602160045260246000fd5b141561234d5760405162461bcd60e51b8152600401610b5e9061547b565b6000838152610134602052604090205460ff16156123a45760405162461bcd60e51b8152602060048201526014602482015273189b1d595c1c9a5b9d08155492481b1bd8dad95960621b6044820152606401610b5e565b5050600090815261013460205260409020805460ff19166001179055565b6000818152606760205260409020546060906001600160a01b03166124415760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5e565b600061244c836139a3565b9050600081511161246c5760405180602001604052806000815250611f05565b8061247684613a4d565b604051602001612487929190615196565b6040516020818303038152906040529392505050565b6000805160206159858339815191526124b68133612a8c565b82600080828152610134602052604090206006015460ff1660038111156124ed57634e487b7160e01b600052602160045260246000fd5b141561250b5760405162461bcd60e51b8152600401610b5e9061547b565b6000848152610134602052604090205460ff16156125625760405162461bcd60e51b8152602060048201526014602482015273189b1d595c1c9a5b9d08155492481b1bd8dad95960621b6044820152606401610b5e565b6000848152610134602090815260409091208451612588926004909201918601906147e4565b507f36ab8e0ce3828485b4d98e97c3f5851331257ffe2b61a43e7e0e9875242f96378484604051610b98929190615689565b3360009081526101336020526040902054806126115760405162461bcd60e51b81526020600482015260166024820152756e6f206372656469747320746f20776974686472617760501b6044820152606401610b5e565b3360009081526101336020526040808220829055516001600160a01b03841690614e2090849084818181858888f193505050503d8060008114612670576040519150601f19603f3d011682016040523d82523d6000602084013e612675565b606091505b5050905080610f6b5760405162461bcd60e51b815260206004820152600f60248201526e1dda5d1a191c985dc819985a5b1959608a1b6044820152606401610b5e565b6000805160206159858339815191526126d18133612a8c565b60016000878152610134602052604090206006015460ff16600381111561270857634e487b7160e01b600052602160045260246000fd5b146127555760405162461bcd60e51b815260206004820152601c60248201527f73616c652073746172746564206f72206e6f74207072657061726564000000006044820152606401610b5e565b61275f8585613b66565b156127b357600086815261013460209081526040909120865161278a92600990920191880190614868565b5060008681526101346020908152604090912085516127b1926007909201918701906148bd565b505b6127bd8383613b66565b156128115760008681526101346020908152604090912084516127e892600a90920191860190614868565b50600086815261013460209081526040909120835161280f926008909201918501906148bd565b505b505050505050565b6000805160206159858339815191526128328133612a8c565b60016000838152610134602052604090206006015460ff16600381111561286957634e487b7160e01b600052602160045260246000fd5b146128b65760405162461bcd60e51b815260206004820152601c60248201527f73616c652073746172746564206f72206e6f74207072657061726564000000006044820152606401610b5e565b60008281526101346020908152604091829020600601805460ff1916600217905590518381527fa78c547613f6306e7a70d1bd161c18a496cae1eeb8d4f9e58b60d69ad72ddf589101611ab3565b600081815260fb60205260408120610c3590613c88565b600081815261013460205260409020600701546060906129835760408051600180825281830190925260009160208083019080368337505061012d54825192935063ffffffff169183915060009061112357634e487b7160e01b600052603260045260246000fd5b600082815261013460209081526040918290206007018054835181840281018401909452808452909183018282801561105b576000918252602091829020805463ffffffff168452908202830192909160049101808411611185575094979650505050505050565b600082815260c96020526040902060010154612a078133612a8c565b610f6b8383612f9d565b6001600160a01b038083166000908152606a6020908152604080832093851683529290529081205460ff1680611f055750611f05600083611f0c565b6000612a598133612a8c565b6127108263ffffffff161115612a6e57600080fd5b5061012d805463ffffffff191663ffffffff92909216919091179055565b612a968282611f0c565b61147957612aae816001600160a01b03166014613c92565b612ab9836020613c92565b604051602001612aca9291906151ee565b60408051601f198184030181529082905262461bcd60e51b8252610b5e916004016153c8565b60006001600160e01b031982166380ac58cd60e01b1480612b2157506001600160e01b03198216635b5e139f60e01b145b80610c3557506301ffc9a760e01b6001600160e01b0319831614610c35565b6000612b4b82612af0565b80610c355750506001600160e01b03191660009081526097602052604090205460ff1690565b60006001600160e01b03198216635a05180f60e01b1480610c355750610c3582613e73565b600054610100900460ff1680612baf575060005460ff16155b612bcb5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015612bed576000805461ffff19166101011790555b612bf5613e98565b612bfd613e98565b612c078383613f02565b8015610f6b576000805461ff0019169055505050565b600054610100900460ff1680612c36575060005460ff16155b612c525760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015612c74576000805461ffff19166101011790555b612c7c613e98565b612c84613e98565b611bad613e98565b6114798282612f7b565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ccb826117d2565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b0316612d7d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5e565b6000612d88836117d2565b9050806001600160a01b0316846001600160a01b03161480612dc35750836001600160a01b0316612db884610dc5565b6001600160a01b0316145b80612dd35750612dd38185612a11565b949350505050565b826001600160a01b0316612dee826117d2565b6001600160a01b031614612e565760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b5e565b6001600160a01b038216612eb85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b5e565b612ec3600082612c96565b6001600160a01b0383166000908152606860205260408120805460019290612eec9084906157db565b90915550506001600160a01b0382166000908152606860205260408120805460019290612f1a908490615720565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612f858282613f97565b600082815260fb60205260409020610f6b908261401d565b612fa78282614032565b600082815260fb60205260409020610f6b9082614099565b600060015b6000838152610134602052604090206006015460ff166003811115612ff957634e487b7160e01b600052602160045260246000fd5b1492915050565b600083815261013460205260408120546001600160401b03600160881b8204811692600160481b90920416905b8463ffffffff168161ffff16101561320a576000826001600160401b0316116130985760405162461bcd60e51b815260206004820152601960248201527f626c75657072696e74206f7574206f66206361706163697479000000000000006044820152606401610b5e565b6130b8846130aa61ffff8416866156f5565b6001600160801b03166140ae565b8561013260006130cc61ffff8516876156f5565b6001600160801b03168152602001908152602001600020819055506000434241856040516020016131359493929190938452602084019290925260601b6bffffffffffffffffffffffff1916604083015260c01b6001600160c01b0319166054820152605c0190565b60408051601f19818403018152918152815160209283012060008a81526101349093529120600201549091507fbe53bef0e08aa61aa51091a6fa77b4a68c6da179f64097fa01f92beda583eecc9088906001600160a01b03168761319d61ffff8716896156f5565b604080519485526001600160a01b03938416602086015291909216908301526001600160801b031660608201526001600160401b038516608082015260a0810183905260c00160405180910390a16131f48361585a565b9250508080613202906158b8565b91505061302d565b50600085815261013460205260409020805463ffffffff86169190601190613243908490600160881b90046001600160401b0316615757565b82546101009290920a6001600160401b0381810219909316918316021790915560009687526101346020526040909620805467ffffffffffffffff60481b1916600160481b939097169290920295909517905550505050565b60006002612fc4565b6001600160e01b031980821614156132ff5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401610b5e565b6001600160e01b0319166000908152609760205260409020805460ff19166001179055565b6000816133675760405162461bcd60e51b81526020600482015260116024820152701b9bc81c1c9bdbd9881c1c9bdd9a591959607a1b6044820152606401610b5e565b600085815261013460209081526040808320338452600b0190915290205460ff16156133c75760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610b5e565b6000858152610134602052604090206005015461346361342933876040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b828686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506141f092505050565b9695505050505050565b60008481526101346020526040902060038101546001909101546001600160a01b0390911690600160401b90046001600160801b03168161356e5783156134f65760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f74207370656369667920746f6b656e20616d6f756e7400000000006044820152606401610b5e565b6135068163ffffffff871661578d565b6001600160801b0316341461355d5760405162461bcd60e51b815260206004820181905260248201527f507572636861736520616d6f756e74206d757374206d617463682070726963656044820152606401610b5e565b613569868334866141fd565b612811565b34156135bc5760405162461bcd60e51b815260206004820152601960248201527f63616e6e6f7420737065636966792065746820616d6f756e74000000000000006044820152606401610b5e565b6135cc8163ffffffff871661578d565b6001600160801b031684146136235760405162461bcd60e51b815260206004820181905260248201527f507572636861736520616d6f756e74206d757374206d617463682070726963656044820152606401610b5e565b6040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b038316906323b872dd90606401602060405180830381600087803b15801561367157600080fd5b505af1158015613685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a99190614da8565b50612811868386866141fd565b6136c087876142d7565b60008781526101346020908152604090912086516136e6926004909201918801906147e4565b508315613703576000878152610134602052604090206005018490555b600087815261013460205260409020805468ffffffffffffffff00191661010063ffffffff8681169190910268ffffffff0000000000191691909117600160281b858316021790915581161561280f57600087815261013460205260409020600101805467ffffffffffffffff191663ffffffff831617905550505050505050565b600082815261013460205260409020600681018054600160ff1990911617905561012d8054825467ffffffffffffffff60881b1916600160601b918290046001600160401b03908116600160881b0291909117938490558254600160481b909404811693849392600c926137fd928692900416615757565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555061012e6000815480929190613835906158da565b90915550506000838152610134602052604090819020600281015491517f97660d9bc329402e809d4aabb7261513a7d331d8762d407be7e3316d08d188fd926117aa9287926001600160a01b0390921691869188916004909101906155a8565b6000611f058383614317565b816001600160a01b0316836001600160a01b031614156139035760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b5e565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61397b848484612ddb565b6139878484848461434f565b610dbf5760405162461bcd60e51b8152600401610b5e906153db565b60008181526101326020908152604080832054835261013490915290206004018054606091906139d29061587d565b80601f01602080910402602001604051908101604052809291908181526020018280546139fe9061587d565b801561105b5780601f10613a205761010080835404028352916020019161105b565b820191906000526020600020905b815481529060010190602001808311613a2e5750939695505050505050565b606081613a715750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a9b5780613a85816158da565b9150613a949050600a83615779565b9150613a75565b6000816001600160401b03811115613ac357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613aed576020820181803683370190505b5090505b8415612dd357613b026001836157db565b9150613b0f600a866158f5565b613b1a906030615720565b60f81b818381518110613b3d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613b5f600a86615779565b9450613af1565b600082516000141580613b795750815115155b15613c7f578151835114613bcf5760405162461bcd60e51b815260206004820152601b60248201527f6d69736d61746368656420726563697069656e747320262042707300000000006044820152606401610b5e565b6000805b8351811015613c2357838181518110613bfc57634e487b7160e01b600052603260045260246000fd5b602002602001015182613c0f9190615738565b915080613c1b816158da565b915050613bd3565b506127108163ffffffff161115613c755760405162461bcd60e51b81526020600482015260166024820152754665652042707320657863656564206d6178696d756d60501b6044820152606401610b5e565b6001915050610c35565b50600092915050565b6000610c35825490565b60606000613ca18360026157bc565b613cac906002615720565b6001600160401b03811115613cd157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613cfb576020820181803683370190505b509050600360fc1b81600081518110613d2457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613d6157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613d858460026157bc565b613d90906001615720565b90505b6001811115613e24576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613dd257634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110613df657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93613e1d81615843565b9050613d93565b508315611f055760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b5e565b60006001600160e01b03198216637965db0b60e01b1480610c355750610c3582612b40565b600054610100900460ff1680613eb1575060005460ff16155b613ecd5760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015611bad576000805461ffff19166101011790558015611bbf576000805461ff001916905550565b600054610100900460ff1680613f1b575060005460ff16155b613f375760405162461bcd60e51b8152600401610b5e9061542d565b600054610100900460ff16158015613f59576000805461ffff19166101011790555b8251613f6c9060659060208601906147e4565b508151613f809060669060208501906147e4565b508015610f6b576000805461ff0019169055505050565b613fa18282611f0c565b61147957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613fd93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611f05836001600160a01b038416614459565b61403c8282611f0c565b1561147957600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611f05836001600160a01b0384166144a8565b6001600160a01b0382166141045760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b5e565b6000818152606760205260409020546001600160a01b0316156141695760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5e565b6001600160a01b0382166000908152606860205260408120805460019290614192908490615720565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000612dd38284866145c5565b600061420885610f70565b905060006142158661291b565b90506000805b83518110156142b057600061425d8785848151811061424a57634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff166145db565b90506142698184615720565b925061429d85838151811061428e57634e487b7160e01b600052603260045260246000fd5b602002602001015189836145f4565b50806142a8816158da565b91505061421b565b5060006142bd82876157db565b111561280f5761280f84876142d284896157db565b6145f4565b6001600160a01b038116156114795760008281526101346020526040902060030180546001600160a01b0383166001600160a01b03199091161790555050565b600082600001828154811061433c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160a01b0384163b1561445157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614393903390899088908890600401615263565b602060405180830381600087803b1580156143ad57600080fd5b505af19250505080156143dd575060408051601f3d908101601f191682019092526143da91810190614e3d565b60015b614437573d80801561440b576040519150601f19603f3d011682016040523d82523d6000602084013e614410565b606091505b50805161442f5760405162461bcd60e51b8152600401610b5e906153db565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612dd3565b506001612dd3565b60008181526001830160205260408120546144a057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c35565b506000610c35565b600081815260018301602052604081205480156145bb5760006144cc6001836157db565b85549091506000906144e0906001906157db565b905081811461456157600086600001828154811061450e57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061453f57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061458057634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c35565b6000915050610c35565b6000826145d2858461472a565b14949350505050565b60006127106145ea83856157bc565b611f059190615779565b6001600160a01b038216156146855760405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb90604401602060405180830381600087803b15801561464d57600080fd5b505af1158015614661573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbf9190614da8565b6000836001600160a01b031682614e2090604051600060405180830381858888f193505050503d80600081146146d7576040519150601f19603f3d011682016040523d82523d6000602084013e6146dc565b606091505b5050905080610dbf576001600160a01b0384166000908152610133602052604090205461470a908390615720565b6001600160a01b0385166000908152610133602052604090205550505050565b600081815b84518110156147dc57600085828151811061475a57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161479c5760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506147c9565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806147d4816158da565b91505061472f565b509392505050565b8280546147f09061587d565b90600052602060002090601f0160209004810192826148125760008555614858565b82601f1061482b57805160ff1916838001178555614858565b82800160010185558215614858579182015b8281111561485857825182559160200191906001019061483d565b50614864929150614963565b5090565b828054828255906000526020600020908101928215614858579160200282015b8281111561485857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614888565b828054828255906000526020600020906007016008900481019282156148585791602002820160005b8382111561492a57835183826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026148e6565b801561495a5782816101000a81549063ffffffff021916905560040160208160030104928301926001030261492a565b50506148649291505b5b808211156148645760008155600101614964565b60006001600160401b0383111561499157614991615935565b6149a4601f8401601f19166020016156a2565b90508281528383830111156149b857600080fd5b828260208301376000602084830101529392505050565b80356110678161594b565b600082601f8301126149ea578081fd5b813560206149ff6149fa836156d2565b6156a2565b80838252828201915082860187848660051b8901011115614a1e578586fd5b855b85811015614a45578135614a338161594b565b84529284019290840190600101614a20565b5090979650505050505050565b60008083601f840112614a63578182fd5b5081356001600160401b03811115614a79578182fd5b6020830191508360208260051b8501011115614a9457600080fd5b9250929050565b600082601f830112614aab578081fd5b81356020614abb6149fa836156d2565b80838252828201915082860187848660051b8901011115614ada578586fd5b855b85811015614a4557614aed82614b35565b84529284019290840190600101614adc565b600082601f830112614b0f578081fd5b611f0583833560208501614978565b80356001600160801b038116811461106757600080fd5b803563ffffffff8116811461106757600080fd5b80356001600160401b038116811461106757600080fd5b600060208284031215614b71578081fd5b8135611f058161594b565b60008060408385031215614b8e578081fd5b8235614b998161594b565b91506020830135614ba98161594b565b809150509250929050565b600080600060608486031215614bc8578081fd5b8335614bd38161594b565b92506020840135614be38161594b565b929592945050506040919091013590565b60008060008060808587031215614c09578081fd5b8435614c148161594b565b93506020850135614c248161594b565b92506040850135915060608501356001600160401b03811115614c45578182fd5b8501601f81018713614c55578182fd5b614c6487823560208401614978565b91505092959194509250565b60008060408385031215614c82578182fd5b8235614c8d8161594b565b91506020830135614ba981615960565b60008060408385031215614caf578182fd5b8235614cba8161594b565b946020939093013593505050565b6000806000806000806000806000806101408b8d031215614ce7578788fd5b614cf08b6149cf565b9950614cfe60208c01614b49565b9850614d0c60408c01614b1e565b9750614d1a60608c016149cf565b965060808b01356001600160401b0380821115614d35578788fd5b614d418e838f01614aff565b975060a08d0135915080821115614d56578687fd5b50614d638d828e01614aff565b95505060c08b01359350614d7960e08c01614b35565b9250614d886101008c01614b35565b9150614d976101208c01614b35565b90509295989b9194979a5092959850565b600060208284031215614db9578081fd5b8151611f0581615960565b600060208284031215614dd5578081fd5b5035919050565b60008060408385031215614dee578182fd5b823591506020830135614ba98161594b565b60008060408385031215614e12578182fd5b50508035926020909101359150565b600060208284031215614e32578081fd5b8135611f058161596e565b600060208284031215614e4e578081fd5b8151611f058161596e565b600080600060608486031215614e6d578081fd5b83356001600160401b0380821115614e83578283fd5b614e8f87838801614aff565b94506020860135915080821115614ea4578283fd5b50614eb186828701614aff565b9250506040840135614ec28161594b565b809150509250925092565b600080600080600060a08688031215614ee4578283fd5b8535945060208601356001600160401b0380821115614f01578485fd5b614f0d89838a016149da565b95506040880135915080821115614f22578485fd5b614f2e89838a01614a9b565b94506060880135915080821115614f43578283fd5b614f4f89838a016149da565b93506080880135915080821115614f64578283fd5b50614f7188828901614a9b565b9150509295509295909350565b60008060408385031215614f90578182fd5b8235915060208301356001600160401b03811115614fac578182fd5b614fb885828601614aff565b9150509250929050565b60008060008060008060c08789031215614fda578384fd5b86359550614fea60208801614b1e565b9450614ff860408801614b35565b935061500660608801614b35565b925061501460808801614b35565b915060a087013590509295509295509295565b60008060408385031215615039578182fd5b8235915061504960208401614b35565b90509250929050565b600080600080600060808688031215615069578283fd5b8535945061507960208701614b35565b93506040860135925060608601356001600160401b0381111561509a578182fd5b6150a688828901614a52565b969995985093965092949392505050565b60008060008060008060a087890312156150cf578384fd5b863595506150df60208801614b35565b94506040870135935060608701356001600160401b03811115615100578283fd5b61510c89828a01614a52565b90945092505060808701356151208161594b565b809150509295509295509295565b60006020828403121561513f578081fd5b611f0582614b35565b60008151808452615160816020860160208601615817565b601f01601f19169290920160200192915050565b6004811061519257634e487b7160e01b600052602160045260246000fd5b9052565b600083516151a8818460208801615817565b8083019050602f60f81b80825284516151c8816001850160208901615817565b6001920191820152693a37b5b2b7173539b7b760b11b6002820152600c01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615226816017850160208801615817565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615257816028840160208801615817565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061346390830184615148565b6020808252825182820181905260009190848201906040850190845b818110156152d75783516001600160a01b0316835292840192918401916001016152b2565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156152d757835163ffffffff16835292840192918401916001016152ff565b8c1515815263ffffffff8c811660208301528b1660408201526001600160401b038a811660608301528981166080830152881660a08201526001600160801b03871660c082015260006101806001600160a01b03881660e08401526001600160a01b0387166101008401528061012084015261539f81840187615148565b915050836101408301526153b7610160830184615174565b9d9c50505050505050505050505050565b602081526000611f056020830184615148565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260169082015275189b1d595c1c9a5b9d081b9bdd081c1c995c185c995960521b604082015260600190565b60208082526038908201527f757365722063616e6e6f7420627579206d6f7265207468616e206d617850757260408201527f6368617365416d6f756e7420696e2073696e676c652074780000000000000000606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602f908201527f70757263686173652063616e6e6f742062652063616c6c65642066726f6d206160408201526e1b9bdd1a195c8818dbdb9d1c9858dd608a1b606082015260800190565b8581526000602060018060a01b038716818401526001600160401b038616604084015260a060608401526155df60a0840186615148565b838103608085015284548390600181811c908083168061560057607f831692505b86831081141561561e57634e487b7160e01b88526022600452602488fd5b82865260208601955080801561563b576001811461564c57615676565b60ff19851687528787019550615676565b60008b815260209020895b8581101561567057815489820152908401908901615657565b88019650505b50939d9c50505050505050505050505050565b828152604060208201526000612dd36040830184615148565b604051601f8201601f191681016001600160401b03811182821017156156ca576156ca615935565b604052919050565b60006001600160401b038211156156eb576156eb615935565b5060051b60200190565b60006001600160801b0380831681851680830382111561571757615717615909565b01949350505050565b6000821982111561573357615733615909565b500190565b600063ffffffff80831681851680830382111561571757615717615909565b60006001600160401b0380831681851680830382111561571757615717615909565b6000826157885761578861591f565b500490565b60006001600160801b03808316818516818304811182151516156157b3576157b3615909565b02949350505050565b60008160001904831182151516156157d6576157d6615909565b500290565b6000828210156157ed576157ed615909565b500390565b600063ffffffff8381169083168181101561580f5761580f615909565b039392505050565b60005b8381101561583257818101518382015260200161581a565b83811115610dbf5750506000910152565b60008161585257615852615909565b506000190190565b60006001600160401b0382168061587357615873615909565b6000190192915050565b600181811c9082168061589157607f821691505b602082108114156158b257634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156158d0576158d0615909565b6001019392505050565b60006000198214156158ee576158ee615909565b5060010190565b6000826159045761590461591f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611bbf57600080fd5b8015158114611bbf57600080fd5b6001600160e01b031981168114611bbf57600080fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122075e6bc4aaf7491f6af9572210d855e4fe4401171e96cf81e26322239ba9ee63264736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.