Contract Address Details

0x306eA61F1157A8232D22A31A90C1bA67bDA8B332

Contract Name
ERC1155Rarible
Creator
0x0ca38e–8259bd at 0x5ec3cd–28baec
Balance
0 CHZ ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
8271284
Contract name:
ERC1155Rarible




Optimization enabled
true
Compiler version
v0.7.6+commit.7338295f




Optimization runs
200
EVM Version
istanbul




Verified at
2023-11-23T15:03:10.566535Z

@rarible/tokens/contracts/erc-1155/ERC1155Rarible.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "./ERC1155Base.sol";
import "../IsPrivateCollection.sol";
import "../access/MinterAccessControl.sol";

contract ERC1155Rarible is ERC1155Base, IsPrivateCollection, MinterAccessControl {
    event CreateERC1155Rarible(address owner, string name, string symbol);
    event CreateERC1155RaribleUser(address owner, string name, string symbol);

    function __ERC1155RaribleUser_init(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address[] memory operators, address transferProxy, address lazyTransferProxy) external virtual {
        __ERC1155Rarible_init_unchained(_name, _symbol, baseURI, contractURI, transferProxy, lazyTransferProxy);
        
        isPrivate = true;
        emit CreateERC1155RaribleUser(_msgSender(), _name, _symbol);
    }
    
    function __ERC1155Rarible_init(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address transferProxy, address lazyTransferProxy) external virtual {
        __ERC1155Rarible_init_unchained(_name, _symbol, baseURI, contractURI, transferProxy, lazyTransferProxy);

        isPrivate = false;
        emit CreateERC1155Rarible(_msgSender(), _name, _symbol);
    }

    function __ERC1155Rarible_init_unchained(string memory _name, string memory _symbol, string memory baseURI, string memory contractURI, address transferProxy, address lazyTransferProxy) internal initializer {
        __Ownable_init_unchained();
        __ERC1155Lazy_init_unchained();
        __ERC165_init_unchained();
        __Context_init_unchained();
        __Mint1155Validator_init_unchained();
        __ERC1155_init_unchained("");
        __HasContractURI_init_unchained(contractURI);
        __ERC1155Burnable_init_unchained();
        __RoyaltiesV2Upgradeable_init_unchained();
        __ERC1155Base_init_unchained(_name, _symbol);
        __MinterAccessControl_init_unchained();
        _setBaseURI(baseURI);

        //setting default approver for transferProxies
        _setDefaultApproval(transferProxy, true);
        _setDefaultApproval(lazyTransferProxy, true);
    }

    function mintAndTransfer(LibERC1155LazyMint.Mint1155Data memory data, address to, uint256 _amount) public override {
        if (isPrivate){
          require(owner() == data.creators[0].account || isMinter(data.creators[0].account), "not owner or minter");
        }
        super.mintAndTransfer(data, to, _amount);
    }
}
        

@rarible/tokens/contracts/erc-1155/ERC1155DefaultApproval.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

import "./ERC1155Upgradeable.sol";

abstract contract ERC1155DefaultApproval is ERC1155Upgradeable {
    mapping(address => bool) private defaultApprovals;

    event DefaultApproval(address indexed operator, bool hasApproval);

    function _setDefaultApproval(address operator, bool hasApproval) internal {
        defaultApprovals[operator] = hasApproval;
        emit DefaultApproval(operator, hasApproval);
    }

    function isApprovedForAll(address _owner, address _operator) public virtual override view returns (bool) {
        return defaultApprovals[_operator] || super.isApprovedForAll(_owner, _operator);
    }
    uint256[50] private __gap;
}
          

@rarible/tokens/contracts/HasContractURI.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

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

abstract contract HasContractURI is ERC165Upgradeable {

    string public contractURI;

    /*
     * bytes4(keccak256('contractURI()')) == 0xe8a3d485
     */
    bytes4 private constant _INTERFACE_ID_CONTRACT_URI = 0xe8a3d485;

    function __HasContractURI_init_unchained(string memory _contractURI) internal initializer {
        contractURI = _contractURI;
        _registerInterface(_INTERFACE_ID_CONTRACT_URI);
    }

    /**
     * @dev Internal function to set the contract URI
     * @param _contractURI string URI prefix to assign
     */
    function _setContractURI(string memory _contractURI) internal {
        contractURI = _contractURI;
    }

    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/introspection/IERC165Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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);
}
          

@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155ReceiverUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

/**
 * _Available since v3.1._
 */
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {

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

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

@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155MetadataURIUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "./IERC1155Upgradeable.sol";

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

@rarible/lib-signature/contracts/ERC1271.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

abstract contract ERC1271 {
    bytes4 constant public ERC1271_INTERFACE_ID = 0xfb855dc9; // this.isValidSignature.selector

    bytes4 constant public ERC1271_RETURN_VALID_SIGNATURE =   0x1626ba7e;
    bytes4 constant public ERC1271_RETURN_INVALID_SIGNATURE = 0x00000000;

    /**
    * @dev Function must be implemented by deriving contract
    * @param _hash Arbitrary length data signed on the behalf of address(this)
    * @param _signature Signature byte array associated with _data
    * @return A bytes4 magic value 0x1626ba7e if the signature check passes, 0x00000000 if not
    *
    * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)
    * MUST allow external calls
    */
    function isValidSignature(bytes32 _hash, bytes memory _signature) public virtual view returns (bytes4);

    function returnIsValidSignatureMagicNumber(bool isValid) internal pure returns (bytes4) {
        return isValid ? ERC1271_RETURN_VALID_SIGNATURE : ERC1271_RETURN_INVALID_SIGNATURE;
    }
}
          

@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;
pragma abicoder v2;

import "@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol";
import "@rarible/royalties/contracts/LibRoyaltiesV2.sol";
import "@rarible/royalties/contracts/RoyaltiesV2.sol";

abstract contract RoyaltiesV2Upgradeable is ERC165Upgradeable, RoyaltiesV2 {
    function __RoyaltiesV2Upgradeable_init_unchained() internal initializer {
        _registerInterface(LibRoyaltiesV2._INTERFACE_ID_ROYALTIES);
    }
}
          

@rarible/tokens/contracts/erc-1155/ERC1155Base.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./ERC1155BurnableUpgradeable.sol";
import "./ERC1155DefaultApproval.sol";
import "./ERC1155Lazy.sol";
import "../HasContractURI.sol";

abstract contract ERC1155Base is OwnableUpgradeable, ERC1155DefaultApproval, ERC1155BurnableUpgradeable, ERC1155Lazy, HasContractURI {
    string public name;
    string public symbol;

    event BurnLazy(address indexed operator, address indexed account, uint256 id, uint256 amount);
    event BurnLazyBatch(address indexed operator, address indexed account, uint256[] ids, uint256[] amounts);
    event BaseUriChanged(string newBaseURI);

    function isApprovedForAll(address _owner, address _operator) public override(ERC1155Upgradeable, ERC1155DefaultApproval, IERC1155Upgradeable) view returns (bool) {
        return ERC1155DefaultApproval.isApprovedForAll(_owner, _operator);
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Lazy, ERC165Upgradeable) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) public virtual override {
        require(ids.length == amounts.length, "ids != amounts");
        uint256[] memory leftToBurns = new uint256[](ids.length);
        uint256[] memory lazyToBurns = new uint256[](ids.length);
        for (uint i = 0; i < ids.length; ++i) {
            (leftToBurns[i], lazyToBurns[i]) = _burnLazy(ids[i], amounts[i]);
        }
        ERC1155BurnableUpgradeable.burnBatch(account, ids, leftToBurns);
        emit BurnLazyBatch(_msgSender(), account, ids, lazyToBurns);
    }

    function burn(address account, uint256 id, uint256 amount) public virtual override {
        (uint256 leftToBurn, uint256 lazyToBurn) = _burnLazy(id, amount);
        if (leftToBurn > 0) {
            //token exists, burn Minted
            ERC1155BurnableUpgradeable.burn(account, id, leftToBurn);
        }
        if (lazyToBurn > 0) {
            emit BurnLazy(_msgSender(), account, id, lazyToBurn);
        }

    }

    function _burnLazy(uint256 id, uint256 amount) internal returns (uint256 leftToBurn, uint256 lazyToBurn) {
        leftToBurn = amount;
        lazyToBurn = 0;
        address creator = address(id >> 96);
        if (creator == _msgSender()) {
            lazyToBurn = amount;
            uint supply = ERC1155Lazy._getSupply(id);
            if (supply != 0) {
                //calculate Lazy amount available for burn
                uint256 lazyBalance = supply - ERC1155Lazy._getMinted(id);
                if (amount > lazyBalance) {//need to burn more than available
                    lazyToBurn = lazyBalance;
                }
            }
            ERC1155Lazy._addMinted(id, lazyToBurn);
            leftToBurn = amount - lazyToBurn;
        }
    }

    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual override(ERC1155Upgradeable, ERC1155Lazy) {
        ERC1155Lazy._mint(account, id, amount, data);
    }

    function __ERC1155Base_init_unchained(string memory _name, string memory _symbol) internal {
        name = _name;
        symbol = _symbol;
    }

    function uri(uint id) external view override(ERC1155BaseURI, ERC1155Upgradeable) virtual returns (string memory) {
        return _tokenURI(id);
    }

    function setBaseURI(string memory newBaseURI) external onlyOwner {
        super._setBaseURI(newBaseURI);

        emit BaseUriChanged(newBaseURI);
    }

    uint256[50] private __gap;
}
          

@rarible/tokens/contracts/erc-1155/Mint1155Validator.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

import "../erc-1271/ERC1271Validator.sol";
import "@rarible/lazy-mint/contracts/erc-1155/LibERC1155LazyMint.sol";

contract Mint1155Validator is ERC1271Validator {
    function __Mint1155Validator_init_unchained() internal initializer {
        __EIP712_init_unchained("Mint1155", "1");
    }

    function validate(address account, bytes32 hash, bytes memory signature) internal view {
        validate1271(account, hash, signature);
    }
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC165Upgradeable.sol";
import "../proxy/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

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

    function __ERC165_init() internal initializer {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal initializer {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return _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;
}
          

@openzeppelin/contracts-upgradeable/proxy/Initializable.sol

// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @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 {UpgradeableProxy-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.
 */
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 || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}
          

@rarible/tokens/contracts/IsPrivateCollection.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

contract IsPrivateCollection {
    /// @dev true if collection is private, false if public
    bool isPrivate;

    uint256[49] private __gap;
}
          

@rarible/lib-signature/contracts/LibSignature.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

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

        // If the signature is valid (and not malleable), return the signer address
        // v > 30 is a special case, we need to adjust hash with "\x19Ethereum Signed Message:\n32"
        // and v = v - 4
        address signer;
        if (v > 30) {
            require(
                v - 4 == 27 || v - 4 == 28,
                "ECDSA: invalid signature 'v' value"
            );
            signer = ecrecover(toEthSignedMessageHash(hash), v - 4, r, s);
        } else {
            require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");
            signer = ecrecover(hash, v, r, s);
        }

        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash)
        internal
        pure
        returns (bytes32)
    {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return
            keccak256(
                abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
            );
    }
}
          

@rarible/royalties/contracts/impl/AbstractRoyalties.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "@rarible/lib-part/contracts/LibPart.sol";

abstract contract AbstractRoyalties {
    mapping (uint256 => LibPart.Part[]) internal royalties;

    function _saveRoyalties(uint256 id, LibPart.Part[] memory _royalties) internal {
        uint256 totalValue;
        for (uint i = 0; i < _royalties.length; ++i) {
            require(_royalties[i].account != address(0x0), "Recipient should be present");
            require(_royalties[i].value != 0, "Royalty value should be positive");
            totalValue += _royalties[i].value;
            royalties[id].push(_royalties[i]);
        }
        require(totalValue < 10000, "Royalty total value should be < 10000");
        _onRoyaltiesSet(id, _royalties);
    }

    function _updateAccount(uint256 _id, address _from, address _to) internal {
        uint length = royalties[_id].length;
        for(uint i = 0; i < length; ++i) {
            if (royalties[_id][i].account == _from) {
                royalties[_id][i].account = payable(address(uint160(_to)));
            }
        }
    }

    function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) virtual internal;
}
          

@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    /**
     * @dev Converts a `uint256` to its ASCII `string` 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);
        uint256 index = digits - 1;
        temp = value;
        while (temp != 0) {
            buffer[index--] = bytes1(uint8(48 + temp % 10));
            temp /= 10;
        }
        return string(buffer);
    }
}
          

@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712Upgradeable is Initializable {
    /* solhint-disable var-name-mixedcase */
    bytes32 private _HASHED_NAME;
    bytes32 private _HASHED_VERSION;
    bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    function __EIP712_init(string memory name, string memory version) internal initializer {
        __EIP712_init_unchained(name, version);
    }

    function __EIP712_init_unchained(string memory name, string memory version) internal initializer {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());
    }

    function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) {
        return keccak256(
            abi.encode(
                typeHash,
                name,
                version,
                _getChainId(),
                address(this)
            )
        );
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash));
    }

    function _getChainId() private view returns (uint256 chainId) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        // solhint-disable-next-line no-inline-assembly
        assembly {
            chainId := chainid()
        }
    }

    /**
     * @dev The hash of the name parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712NameHash() internal virtual view returns (bytes32) {
        return _HASHED_NAME;
    }

    /**
     * @dev The hash of the version parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712VersionHash() internal virtual view returns (bytes32) {
        return _HASHED_VERSION;
    }
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}
          

@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;
pragma abicoder v2;

import "./AbstractRoyalties.sol";
import "../RoyaltiesV2.sol";
import "../IERC2981.sol";
import "../LibRoyalties2981.sol";

contract RoyaltiesV2Impl is AbstractRoyalties, RoyaltiesV2, IERC2981 {

    function getRaribleV2Royalties(uint256 id) override external view returns (LibPart.Part[] memory) {
        return royalties[id];
    }

    function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) override internal {
        emit RoyaltiesSet(id, _royalties);
    }

    /*
    *Token (ERC721, ERC721Minimal, ERC721MinimalMeta, ERC1155 ) can have a number of different royalties beneficiaries
    *calculate sum all royalties, but royalties beneficiary will be only one royalties[0].account, according to rules of IERC2981
    */
    function royaltyInfo(uint256 id, uint256 _salePrice) override external view returns (address receiver, uint256 royaltyAmount) {
        if (royalties[id].length == 0) {
            receiver = address(0);
            royaltyAmount = 0;
            return(receiver, royaltyAmount);
        }
        LibPart.Part[] memory _royalties = royalties[id];
        receiver = _royalties[0].account;
        uint percent;
        for (uint i = 0; i < _royalties.length; ++i) {
            percent += _royalties[i].value;
        }
        //don`t need require(percent < 10000, "Token royalty > 100%"); here, because check later in calculateRoyalties
        royaltyAmount = percent * _salePrice / 10000;
    }
}
          

@rarible/royalties/contracts/LibRoyalties2981.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "@rarible/lib-part/contracts/LibPart.sol";

library LibRoyalties2981 {
    /*
     * https://eips.ethereum.org/EIPS/eip-2981: bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
     */
    bytes4 constant _INTERFACE_ID_ROYALTIES = 0x2a55205a;
    uint96 constant _WEIGHT_VALUE = 1000000;

    /*Method for converting amount to percent and forming LibPart*/
    function calculateRoyalties(address to, uint256 amount) internal view returns (LibPart.Part[] memory) {
        LibPart.Part[] memory result;
        if (amount == 0) {
            return result;
        }
        uint256 percent = amount * 10000 / _WEIGHT_VALUE;
        require(percent < 10000, "Royalties 2981 exceeds 100%");
        result = new LibPart.Part[](1);
        result[0].account = payable(to);
        result[0].value = uint96(percent);
        return result;
    }
}
          

@rarible/tokens/contracts/access/MinterAccessControl.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract MinterAccessControl is OwnableUpgradeable {
    mapping(address => bool) private _minters;
    
    event MinterStatusChanged(address indexed minter, bool indexed status);

    function __MinterAccessControl_init() internal initializer {
        __Ownable_init_unchained();
        __MinterAccessControl_init_unchained();
    }

    function __MinterAccessControl_init_unchained() internal initializer {
    }

    /**
     * @dev Add `minter` to the list of allowed minters.
     */
    function addMinter(address minter) external onlyOwner {
        _minters[minter] = true;
        emit MinterStatusChanged(minter, true);
    }

    /**
     * @dev Add `minters` to the list of allowed minters.
     */
    function addMinters(address[] memory minters) external onlyOwner {
        for (uint i = 0; i < minters.length; ++i) {
            address minter = minters[i];
            _minters[minter] = true;
            emit MinterStatusChanged(minter, true);
        }
    }

    /**
     * @dev Revoke `_minter` from the list of allowed minters.
     */
    function removeMinter(address _minter) external onlyOwner {
        _minters[_minter] = false;
        emit MinterStatusChanged(_minter, false);
    }

    /**
     * @dev Returns `true` if `account` has been granted to minters.
     */
    function isMinter(address account) public view returns (bool) {
        return _minters[account];
    }

    uint256[50] private __gap;
}
          

@rarible/tokens/contracts/erc-1155/ERC1155Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155MetadataURIUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155ReceiverUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

/**
 *
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;

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

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

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

    /*
     *     bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e
     *     bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a
     *     bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6
     *
     *     => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
     *        0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
     */
    bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;

    /*
     *     bytes4(keccak256('uri(uint256)')) == 0x0e89341c
     */
    bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;

    /**
     * @dev See {_setURI}.
     */
    function __ERC1155_init(string memory uri_) internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155_init_unchained(uri_);
    }

    function __ERC1155_init_unchained(string memory uri_) internal initializer {
        _setURI(uri_);

        // register the supported interfaces to conform to ERC1155 via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155);

        // register the supported interfaces to conform to ERC1155MetadataURI via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155_METADATA_URI);
    }

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

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

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

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

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

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][from] = _balances[id][from].sub(amount, "ERC1155: insufficient balance for transfer");
        _balances[id][to] = _balances[id][to].add(amount);

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

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

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );

        address operator = _msgSender();

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

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

            _balances[id][from] = _balances[id][from].sub(
                amount,
                "ERC1155: insufficient balance for transfer"
            );
            _balances[id][to] = _balances[id][to].add(amount);
        }

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

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

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

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

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][account] = _balances[id][account].add(amount);
        emit TransferSingle(operator, address(0), account, id, amount);

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        _balances[id][account] = _balances[id][account].sub(
            amount,
            "ERC1155: burn amount exceeds balance"
        );

        emit TransferSingle(operator, account, address(0), id, amount);
    }

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

        address operator = _msgSender();

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

        for (uint i = 0; i < ids.length; ++i) {
            _balances[ids[i]][account] = _balances[ids[i]][account].sub(
                amounts[i],
                "ERC1155: burn amount exceeds balance"
            );
        }

        emit TransferBatch(operator, account, address(0), ids, amounts);
    }

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

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

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

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

        return array;
    }
    uint256[47] private __gap;
}
          

@rarible/lazy-mint/contracts/erc-1155/LibERC1155LazyMint.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "@rarible/lib-part/contracts/LibPart.sol";

library LibERC1155LazyMint {
    bytes4 constant public ERC1155_LAZY_ASSET_CLASS = bytes4(keccak256("ERC1155_LAZY"));
    bytes4 constant _INTERFACE_ID_MINT_AND_TRANSFER = 0x6db15a0f;

    struct Mint1155Data {
        uint tokenId;
        string tokenURI;
        uint supply;
        LibPart.Part[] creators;
        LibPart.Part[] royalties;
        bytes[] signatures;
    }

    bytes32 public constant MINT_AND_TRANSFER_TYPEHASH = keccak256("Mint1155(uint256 tokenId,uint256 supply,string tokenURI,Part[] creators,Part[] royalties)Part(address account,uint96 value)");

    function hash(Mint1155Data memory data) internal pure returns (bytes32) {
        bytes32[] memory royaltiesBytes = new bytes32[](data.royalties.length);
        for (uint i = 0; i < data.royalties.length; ++i) {
            royaltiesBytes[i] = LibPart.hash(data.royalties[i]);
        }
        bytes32[] memory creatorsBytes = new bytes32[](data.creators.length);
        for (uint i = 0; i < data.creators.length; ++i) {
            creatorsBytes[i] = LibPart.hash(data.creators[i]);
        }
        return keccak256(abi.encode(
                MINT_AND_TRANSFER_TYPEHASH,
                data.tokenId,
                data.supply,
                keccak256(bytes(data.tokenURI)),
                keccak256(abi.encodePacked(creatorsBytes)),
                keccak256(abi.encodePacked(royaltiesBytes))
            ));
    }
}
          

@rarible/tokens/contracts/erc-1155/ERC1155Lazy.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "./ERC1155Upgradeable.sol";
import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol";
import "@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol";
import "@rarible/lazy-mint/contracts/erc-1155/IERC1155LazyMint.sol";
import "./Mint1155Validator.sol";
import "./ERC1155BaseURI.sol";

abstract contract ERC1155Lazy is IERC1155LazyMint, ERC1155BaseURI, Mint1155Validator, RoyaltiesV2Upgradeable, RoyaltiesV2Impl {
    using SafeMathUpgradeable for uint;

    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
    bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;
    bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;

    mapping(uint256 => LibPart.Part[]) private creators;
    mapping(uint => uint) private supply;
    mapping(uint => uint) private minted;

    function __ERC1155Lazy_init_unchained() internal {

    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
        return interfaceId == LibERC1155LazyMint._INTERFACE_ID_MINT_AND_TRANSFER
        || interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES
        || interfaceId == LibRoyalties2981._INTERFACE_ID_ROYALTIES
        || interfaceId == _INTERFACE_ID_ERC165
        || interfaceId == _INTERFACE_ID_ERC1155
        || interfaceId == _INTERFACE_ID_ERC1155_METADATA_URI;
    }

    function transferFromOrMint(
        LibERC1155LazyMint.Mint1155Data memory data,
        address from,
        address to,
        uint256 amount
    ) override external {
        uint balance = balanceOf(from, data.tokenId);
        uint left = amount;
        if (balance != 0) {
            uint transfer = amount;
            if (balance < amount) {
                transfer = balance;
            }
            safeTransferFrom(from, to, data.tokenId, transfer, "");
            left = amount - transfer;
        }
        if (left > 0) {
            require(from == data.creators[0].account, "wrong order maker");
            mintAndTransfer(data, to, left);
        }
    }

    function mintAndTransfer(LibERC1155LazyMint.Mint1155Data memory data, address to, uint256 _amount) public override virtual {
        address minter = address(data.tokenId >> 96);
        address sender = _msgSender();

        require(minter == sender || isApprovedForAll(minter, sender), "ERC1155: transfer caller is not approved");
        require(_amount > 0, "amount incorrect");

        if (supply[data.tokenId] == 0) {
            require(minter == data.creators[0].account, "tokenId incorrect");
            require(data.supply > 0, "supply incorrect");
            require(data.creators.length == data.signatures.length);

            bytes32 hash = LibERC1155LazyMint.hash(data);
            for (uint i = 0; i < data.creators.length; ++i) {
                address creator = data.creators[i].account;
                if (creator != sender) {
                    validate(creator, hash, data.signatures[i]);
                }
            }

            _saveSupply(data.tokenId, data.supply);
            _saveRoyalties(data.tokenId, data.royalties);
            _saveCreators(data.tokenId, data.creators);
            _setTokenURI(data.tokenId, data.tokenURI);
        }

        _mint(to, data.tokenId, _amount, "");
        if (minter != to) {
            emit TransferSingle(sender, address(0), minter, data.tokenId, _amount);
            emit TransferSingle(sender, minter, to, data.tokenId, _amount);
        } else {
            emit TransferSingle(sender, address(0), to, data.tokenId, _amount);
        }
    }

    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual override {
        uint newMinted = amount.add(minted[id]);
        require(newMinted <= supply[id], "more than supply");
        minted[id] = newMinted;

        require(account != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][account] = _balances[id][account].add(amount);

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

    function _saveSupply(uint tokenId, uint _supply) internal {
        require(supply[tokenId] == 0);
        supply[tokenId] = _supply;
        emit Supply(tokenId, _supply);
    }

    function _saveCreators(uint tokenId, LibPart.Part[] memory _creators) internal {
        LibPart.Part[] storage creatorsOfToken = creators[tokenId];
        uint total = 0;
        for (uint i = 0; i < _creators.length; ++i) {
            require(_creators[i].account != address(0x0), "Account should be present");
            require(_creators[i].value != 0, "Creator share should be positive");
            creatorsOfToken.push(_creators[i]);
            total = total.add(_creators[i].value);
        }
        require(total == 10000, "total amount of creators share should be 10000");
        emit Creators(tokenId, _creators);
    }

    function updateAccount(uint256 _id, address _from, address _to) external {
        require(_msgSender() == _from, "not allowed");
        super._updateAccount(_id, _from, _to);
    }

    function getCreators(uint256 _id) external view returns (LibPart.Part[] memory) {
        return creators[_id];
    }

    function _addMinted(uint256 tokenId, uint amount) internal {
        minted[tokenId] += amount;
    }

    function _getMinted(uint256 tokenId) internal view returns (uint) {
        return minted[tokenId];
    }

    function _getSupply(uint256 tokenId) internal view returns (uint) {
        return supply[tokenId];
    }

    uint256[50] private __gap;
}
          

@rarible/lib-part/contracts/LibPart.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

library LibPart {
    bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)");

    struct Part {
        address payable account;
        uint96 value;
    }

    function hash(Part memory part) internal pure returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, part.account, part.value));
    }
}
          

@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}
          

@rarible/royalties/contracts/IERC2981.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;
import "@rarible/lib-part/contracts/LibPart.sol";
///
/// @dev Interface for the NFT Royalty Standard
///
//interface IERC2981 is IERC165 {
interface IERC2981 {
    /// ERC165 bytes to add to interface array - set in parent contract
    /// implementing this standard
    ///
    /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
    /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
    /// _registerInterface(_INTERFACE_ID_ERC2981);

    /// @notice Called with the sale price to determine how much royalty
    //          is owed and to whom.
    /// @param _tokenId - the NFT asset queried for royalty information
    /// @param _salePrice - the sale price of the NFT asset specified by _tokenId
    /// @return receiver - address of who should be sent the royalty payment
    /// @return royaltyAmount - the royalty payment amount for _salePrice
    function royaltyInfo(
        uint256 _tokenId,
        uint256 _salePrice
    ) external view returns (
        address receiver,
        uint256 royaltyAmount
    );
}
          

@rarible/tokens/contracts/erc-1155/ERC1155BurnableUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable {
    function __ERC1155Burnable_init() internal {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155Burnable_init_unchained();
    }

    function __ERC1155Burnable_init_unchained() internal {
    }
    function burn(address account, uint256 id, uint256 value) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burnBatch(account, ids, values);
    }
    
    uint256[50] private __gap;
}
          

@rarible/royalties/contracts/LibRoyaltiesV2.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

library LibRoyaltiesV2 {
    /*
     * bytes4(keccak256('getRaribleV2Royalties(uint256)')) == 0xcad96cca
     */
    bytes4 constant _INTERFACE_ID_ROYALTIES = 0xcad96cca;
}
          

@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155ReceiverUpgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC1155ReceiverUpgradeable.sol";
import "../../introspection/ERC165Upgradeable.sol";
import "../../proxy/Initializable.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155ReceiverUpgradeable is Initializable, ERC165Upgradeable, IERC1155ReceiverUpgradeable {
    function __ERC1155Receiver_init() internal initializer {
        __ERC165_init_unchained();
        __ERC1155Receiver_init_unchained();
    }

    function __ERC1155Receiver_init_unchained() internal initializer {
        _registerInterface(
            ERC1155ReceiverUpgradeable(address(0)).onERC1155Received.selector ^
            ERC1155ReceiverUpgradeable(address(0)).onERC1155BatchReceived.selector
        );
    }
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

@rarible/tokens/contracts/erc-1155/ERC1155BaseURI.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "../LibURI.sol";

import "./ERC1155Upgradeable.sol";

contract ERC1155BaseURI is ERC1155Upgradeable {
    using StringsUpgradeable for uint;

    // Optional mapping for token URIs
    mapping (uint256 => string) private _tokenURIs;

    // Base URI
    string private _baseURI;

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a prefix in {tokenURI} to each token's URI, or
    * to the token ID if no specific URI is set for that token ID.
    */
    function baseURI() public view virtual returns (string memory) {
        return _baseURI;
    }

    function uri(uint id) external view override virtual returns (string memory) {
        return _tokenURI(id);
    }

    function _tokenURI(uint256 tokenId) internal view virtual returns (string memory) {
        string memory __tokenURI = _tokenURIs[tokenId];
        string memory base = baseURI();

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return __tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(__tokenURI).length > 0) {
            return LibURI.checkPrefix(base, __tokenURI);
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(base, tokenId.toString()));
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _uri) internal virtual {
        _tokenURIs[tokenId] = _uri;
        emit URI(_tokenURI(tokenId), tokenId);
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    uint256[50] private __gap;
}
          

@rarible/lazy-mint/contracts/erc-1155/IERC1155LazyMint.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;
pragma abicoder v2;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";
import "./LibERC1155LazyMint.sol";
import "@rarible/lib-part/contracts/LibPart.sol";

interface IERC1155LazyMint is IERC1155Upgradeable {

    event Supply(
        uint256 tokenId,
        uint256 value
    );
    event Creators(
        uint256 tokenId,
        LibPart.Part[] creators
    );

    function mintAndTransfer(
        LibERC1155LazyMint.Mint1155Data memory data,
        address to,
        uint256 _amount
    ) external;

    function transferFromOrMint(
        LibERC1155LazyMint.Mint1155Data memory data,
        address from,
        address to,
        uint256 amount
    ) external;
}
          

@rarible/tokens/contracts/erc-1271/ERC1271Validator.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

import "@rarible/lib-signature/contracts/ERC1271.sol";
import "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol";
import "@rarible/lib-signature/contracts/LibSignature.sol";

abstract contract ERC1271Validator is EIP712Upgradeable {
    using AddressUpgradeable for address;
    using LibSignature for bytes32;

    string constant SIGNATURE_ERROR = "signature verification error";
    bytes4 constant internal MAGICVALUE = 0x1626ba7e;

    function validate1271(address signer, bytes32 structHash, bytes memory signature) internal view {
        bytes32 hash = _hashTypedDataV4(structHash);

        address signerFromSig;
        if (signature.length == 65) {
            signerFromSig = hash.recover(signature);
        }
        if  (signerFromSig != signer) {
            if (signer.isContract()) {
                require(
                    ERC1271(signer).isValidSignature(hash, signature) == MAGICVALUE,
                    SIGNATURE_ERROR
                );
            } else {
                revert(SIGNATURE_ERROR);
            }
        }
    }
    uint256[50] private __gap;
}
          

@rarible/tokens/contracts/LibURI.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

library LibURI {
    /// @dev checks if _tokenURI starts with base. if true returns _tokenURI, else base + _tokenURI
    function checkPrefix(string memory base, string memory _tokenURI)
        internal
        pure
        returns (string memory)
    {
        bytes memory whatBytes = bytes(base);
        bytes memory whereBytes = bytes(_tokenURI);

        if (whatBytes.length > whereBytes.length) {
            return string(abi.encodePacked(base, _tokenURI));
        }

        for (uint256 j = 0; j < whatBytes.length; j++) {
            if (whereBytes[j] != whatBytes[j]) {
                return string(abi.encodePacked(base, _tokenURI));
            }
        }

        return _tokenURI;
    }
}
          

@rarible/royalties/contracts/RoyaltiesV2.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;
pragma abicoder v2;

import "@rarible/lib-part/contracts/LibPart.sol";

interface RoyaltiesV2 {
    event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties);

    function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory);
}
          

Contract ABI

[{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__ERC1155RaribleUser_init","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"string","name":"baseURI","internalType":"string"},{"type":"string","name":"contractURI","internalType":"string"},{"type":"address[]","name":"operators","internalType":"address[]"},{"type":"address","name":"transferProxy","internalType":"address"},{"type":"address","name":"lazyTransferProxy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__ERC1155Rarible_init","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"string","name":"baseURI","internalType":"string"},{"type":"string","name":"contractURI","internalType":"string"},{"type":"address","name":"transferProxy","internalType":"address"},{"type":"address","name":"lazyTransferProxy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinter","inputs":[{"type":"address","name":"minter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinters","inputs":[{"type":"address[]","name":"minters","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"balanceOfBatch","inputs":[{"type":"address[]","name":"accounts","internalType":"address[]"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"baseURI","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnBatch","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"contractURI","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct LibPart.Part[]","components":[{"type":"address"},{"type":"uint96"}]}],"name":"getCreators","inputs":[{"type":"uint256","name":"_id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct LibPart.Part[]","components":[{"type":"address"},{"type":"uint96"}]}],"name":"getRaribleV2Royalties","inputs":[{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"_owner","internalType":"address"},{"type":"address","name":"_operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMinter","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintAndTransfer","inputs":[{"type":"tuple","name":"data","internalType":"struct LibERC1155LazyMint.Mint1155Data","components":[{"type":"uint256"},{"type":"string"},{"type":"uint256"},{"type":"tuple[]","components":[{"type":"address"},{"type":"uint96"}]},{"type":"tuple[]","components":[{"type":"address"},{"type":"uint96"}]},{"type":"bytes[]"}]},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMinter","inputs":[{"type":"address","name":"_minter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"royaltyAmount","internalType":"uint256"}],"name":"royaltyInfo","inputs":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"_salePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeBatchTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseURI","inputs":[{"type":"string","name":"newBaseURI","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFromOrMint","inputs":[{"type":"tuple","name":"data","internalType":"struct LibERC1155LazyMint.Mint1155Data","components":[{"type":"uint256"},{"type":"string"},{"type":"uint256"},{"type":"tuple[]","components":[{"type":"address"},{"type":"uint96"}]},{"type":"tuple[]","components":[{"type":"address"},{"type":"uint96"}]},{"type":"bytes[]"}]},{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateAccount","inputs":[{"type":"uint256","name":"_id","internalType":"uint256"},{"type":"address","name":"_from","internalType":"address"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uri","inputs":[{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"account","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}],"anonymous":false},{"type":"event","name":"BaseUriChanged","inputs":[{"type":"string","name":"newBaseURI","indexed":false}],"anonymous":false},{"type":"event","name":"BurnLazy","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"uint256","name":"id","indexed":false},{"type":"uint256","name":"amount","indexed":false}],"anonymous":false},{"type":"event","name":"BurnLazyBatch","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"uint256[]","name":"ids","indexed":false},{"type":"uint256[]","name":"amounts","indexed":false}],"anonymous":false},{"type":"event","name":"CreateERC1155Rarible","inputs":[{"type":"address","name":"owner","indexed":false},{"type":"string","name":"name","indexed":false},{"type":"string","name":"symbol","indexed":false}],"anonymous":false},{"type":"event","name":"CreateERC1155RaribleUser","inputs":[{"type":"address","name":"owner","indexed":false},{"type":"string","name":"name","indexed":false},{"type":"string","name":"symbol","indexed":false}],"anonymous":false},{"type":"event","name":"Creators","inputs":[{"type":"uint256","name":"tokenId","indexed":false},{"type":"tuple[]","name":"creators","indexed":false,"components":[{"type":"address"},{"type":"uint96"}]}],"anonymous":false},{"type":"event","name":"DefaultApproval","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"hasApproval","indexed":false}],"anonymous":false},{"type":"event","name":"MinterStatusChanged","inputs":[{"type":"address","name":"minter","indexed":true},{"type":"bool","name":"status","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}],"anonymous":false},{"type":"event","name":"RoyaltiesSet","inputs":[{"type":"uint256","name":"tokenId","indexed":false},{"type":"tuple[]","name":"royalties","indexed":false,"components":[{"type":"address"},{"type":"uint96"}]}],"anonymous":false},{"type":"event","name":"Supply","inputs":[{"type":"uint256","name":"tokenId","indexed":false},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"TransferBatch","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256[]","name":"ids","indexed":false},{"type":"uint256[]","name":"values","indexed":false}],"anonymous":false},{"type":"event","name":"TransferSingle","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"id","indexed":false},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"URI","inputs":[{"type":"string","name":"value","indexed":false},{"type":"uint256","name":"id","indexed":true}],"anonymous":false}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101d95760003560e01c806371e2a65711610104578063cad96cca116100a2578063f242432a11610071578063f242432a146103f1578063f2fde38b14610404578063f5298aca14610417578063ffc4e0a71461042a576101d9565b8063cad96cca146103b0578063e07f2319146103c3578063e8a3d485146103d6578063e985e9c5146103de576101d9565b806395d89b41116100de57806395d89b411461036f578063983b2d5614610377578063a22cb4651461038a578063aa271e1a1461039d576101d9565b806371e2a65714610327578063891be9741461033a5780638da5cb5b1461035a576101d9565b80632eb2c2d61161017c57806361e054591161014b57806361e05459146102f15780636b20c454146103045780636c0360eb14610317578063715018a61461031f576101d9565b80632eb2c2d6146102985780633092afd5146102ab5780634e1273f4146102be57806355f804b3146102de576101d9565b80630e89341c116101b85780630e89341c1461023c5780630eaead671461024f578063173c43d2146102645780632a55205a14610277576101d9565b8062fdd58e146101de57806301ffc9a71461020757806306fdde0314610227575b600080fd5b6101f16101ec366004614963565b61043d565b6040516101fe91906151cf565b60405180910390f35b61021a610215366004614a5c565b6104af565b6040516101fe9190614f20565b61022f6104c2565b6040516101fe9190614f2b565b61022f61024a366004614d27565b610551565b61026261025d366004614cd0565b61055c565b005b610262610272366004614ab6565b610600565b61028a610285366004614d80565b610663565b6040516101fe929190614ebc565b6102626102a63660046147b1565b610771565b6102626102b936600461475d565b610a6f565b6102d16102cc3660046149fc565b610b1f565b6040516101fe9190614ee8565b6102626102ec366004614a84565b610c0a565b6102626102ff366004614b7d565b610caf565b6102626103123660046148c0565b610d16565b61022f610e9c565b610262610f34565b6102626103353660046149c2565b610fe0565b61034d610348366004614d27565b6110c9565b6040516101fe9190614ed5565b610362611159565b6040516101fe9190614e72565b61022f611168565b61026261038536600461475d565b6111c4565b610262610398366004614932565b611279565b61021a6103ab36600461475d565b611368565b61034d6103be366004614d27565b611387565b6102626103d1366004614d3f565b611402565b61022f611445565b61021a6103ec366004614779565b6114a1565b6102626103ff36600461485a565b6114b4565b61026261041236600461475d565b61166d565b61026261042536600461498e565b611770565b610262610438366004614c69565b6117ec565b60006001600160a01b0383166104845760405162461bcd60e51b815260040180806020018281038252602b81526020018061537b602b913960400191505060405180910390fd5b5060008181526097602090815260408083206001600160a01b03861684529091529020545b92915050565b60006104ba82611894565b90505b919050565b610262805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105495780601f1061051e57610100808354040283529160200191610549565b820191906000526020600020905b81548152906001019060200180831161052c57829003601f168201915b505050505081565b60606104ba82611933565b6102965460ff16156105f057826060015160008151811061057957fe5b6020026020010151600001516001600160a01b0316610596611159565b6001600160a01b031614806105cb57506105cb83606001516000815181106105ba57fe5b602002602001015160000151611368565b6105f05760405162461bcd60e51b81526004016105e790614f69565b60405180910390fd5b6105fb838383611ac9565b505050565b61060e868686868686611dc5565b610296805460ff191690557fcc215b7682459c30faa0e854780165d503a7d62d22a9aaaad6334585dc63343e610642611ef7565b878760405161065393929190614e86565b60405180910390a1505050505050565b60008281526101fa602052604081205481906106845750600090508061076a565b60008481526101fa6020908152604080832080548251818502810185019093528083529192909190849084015b8282101561070057600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016106b1565b5050505090508060008151811061071357fe5b60209081029190910101515192506000805b825181101561075e5782818151811061073a57fe5b6020026020010151602001516001600160601b031682019150806001019050610725565b50612710908502049150505b9250929050565b81518351146107b15760405162461bcd60e51b81526004018080602001828103825260288152602001806155c66028913960400191505060405180910390fd5b6001600160a01b0384166107f65760405162461bcd60e51b815260040180806020018281038252602581526020018061543b6025913960400191505060405180910390fd5b6107fe611ef7565b6001600160a01b0316856001600160a01b031614806108245750610824856103ec611ef7565b61085f5760405162461bcd60e51b81526004018080602001828103825260328152602001806154606032913960400191505060405180910390fd5b6000610869611ef7565b9050610879818787878787610a67565b60005b845181101561097f57600085828151811061089357fe5b6020026020010151905060008583815181106108ab57fe5b60200260200101519050610918816040518060600160405280602a8152602001615505602a91396097600086815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002054611efb9092919063ffffffff16565b60008381526097602090815260408083206001600160a01b038e811685529252808320939093558a168152205461094f9082611f92565b60009283526097602090815260408085206001600160a01b038c168652909152909220919091555060010161087c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610a055781810151838201526020016109ed565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610a44578181015183820152602001610a2c565b5050505090500194505050505060405180910390a4610a67818787878787611fec565b505050505050565b610a77611ef7565b6001600160a01b0316610a88611159565b6001600160a01b031614610ad1576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c86020526040808220805460ff19169055519091907f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd908390a350565b60608151835114610b615760405162461bcd60e51b815260040180806020018281038252602981526020018061559d6029913960400191505060405180910390fd5b600083516001600160401b0381118015610b7a57600080fd5b50604051908082528060200260200182016040528015610ba4578160200160208202803683370190505b50905060005b8451811015610c0257610be3858281518110610bc257fe5b6020026020010151858381518110610bd657fe5b602002602001015161043d565b828281518110610bef57fe5b6020908102919091010152600101610baa565b509392505050565b610c12611ef7565b6001600160a01b0316610c23611159565b6001600160a01b031614610c6c576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b610c7581612262565b7f87cdeaffd8e70903d6ce7cc983fac3b09ca79e83818124c98e47a1d70f8027d681604051610ca49190614f2b565b60405180910390a150565b610cbd878787878686611dc5565b610296805460ff191660011790557f7da6bc204c8c4856a6aff786a6cb81c59477c782191dc51837d644a8ad50f2cc610cf4611ef7565b8888604051610d0593929190614e86565b60405180910390a150505050505050565b8051825114610d375760405162461bcd60e51b81526004016105e790615118565b600082516001600160401b0381118015610d5057600080fd5b50604051908082528060200260200182016040528015610d7a578160200160208202803683370190505b509050600083516001600160401b0381118015610d9657600080fd5b50604051908082528060200260200182016040528015610dc0578160200160208202803683370190505b50905060005b8451811015610e3557610dff858281518110610dde57fe5b6020026020010151858381518110610df257fe5b6020026020010151612276565b848381518110610e0b57fe5b60200260200101848481518110610e1e57fe5b602090810291909101019190915252600101610dc6565b50610e418585846122eb565b846001600160a01b0316610e53611ef7565b6001600160a01b03167fcf3391513e21a9d4a0348f8e890080170eba18dc62db35b60d8a518b7088eb3a8684604051610e8d929190614efb565b60405180910390a35050505050565b61012f8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610f295780601f10610efe57610100808354040283529160200191610f29565b820191906000526020600020905b815481529060010190602001808311610f0c57829003601f168201915b505050505090505b90565b610f3c611ef7565b6001600160a01b0316610f4d611159565b6001600160a01b031614610f96576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b610fe8611ef7565b6001600160a01b0316610ff9611159565b6001600160a01b031614611042576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b60005b81518110156110c557600082828151811061105c57fe5b6020908102919091018101516001600160a01b03811660008181526102c89093526040808420805460ff1916600190811790915590519294509290917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd9190a350600101611045565b5050565b60606101fb6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561114e57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016110ff565b505050509050919050565b6033546001600160a01b031690565b610263805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105495780601f1061051e57610100808354040283529160200191610549565b6111cc611ef7565b6001600160a01b03166111dd611159565b6001600160a01b031614611226576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526102c86020526040808220805460ff1916600190811790915590519092917f3042b80e435ae46c334b2cfec51a66d64c9a8a8af4cd0c279a124c35a09e91dd91a350565b816001600160a01b031661128b611ef7565b6001600160a01b031614156112d15760405162461bcd60e51b81526004018080602001828103825260298152602001806155746029913960400191505060405180910390fd5b80609860006112de611ef7565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611322611ef7565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b6001600160a01b031660009081526102c8602052604090205460ff1690565b60008181526101fa6020908152604080832080548251818502810185019093528083526060949293919290918401821561114e57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b0316818301528252600190920191016110ff565b816001600160a01b0316611414611ef7565b6001600160a01b03161461143a5760405162461bcd60e51b81526004016105e790615020565b6105fb83838361235f565b610230805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105495780601f1061051e57610100808354040283529160200191610549565b60006114ad838361240b565b9392505050565b6001600160a01b0384166114f95760405162461bcd60e51b815260040180806020018281038252602581526020018061543b6025913960400191505060405180910390fd5b611501611ef7565b6001600160a01b0316856001600160a01b031614806115275750611527856103ec611ef7565b6115625760405162461bcd60e51b81526004018080602001828103825260298152602001806153f06029913960400191505060405180910390fd5b600061156c611ef7565b905061158c81878761157d88612437565b61158688612437565b87610a67565b6115d3836040518060600160405280602a8152602001615505602a913960008781526097602090815260408083206001600160a01b038d1684529091529020549190611efb565b60008581526097602090815260408083206001600160a01b038b8116855292528083209390935587168152205461160a9084611f92565b60008581526097602090815260408083206001600160a01b03808b168086529184529382902094909455805188815291820187905280518a84169386169260008051602061535b83398151915292908290030190a4610a6781878787878761247c565b611675611ef7565b6001600160a01b0316611686611159565b6001600160a01b0316146116cf576040805162461bcd60e51b8152602060048201819052602482015260008051602061552f833981519152604482015290519081900360640190fd5b6001600160a01b0381166117145760405162461bcd60e51b81526004018080602001828103825260268152602001806153a66026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60008061177d8484612276565b90925090508115611793576117938585846125ed565b80156117e557846001600160a01b03166117ab611ef7565b6001600160a01b03167f5110a21391aa55386de41fe7a3e3dffb40132d38d629a113a7f4afff251b1a018684604051610e8d9291906151f1565b5050505050565b60006117fc84866000015161043d565b90508181156118365782808310156118115750815b6118318686896000015184604051806020016040528060008152506114b4565b830390505b8015610a6757856060015160008151811061184d57fe5b6020026020010151600001516001600160a01b0316856001600160a01b0316146118895760405162461bcd60e51b81526004016105e790614f3e565b610a6786858361055c565b60006001600160e01b03198216636db15a0f60e01b14806118c557506001600160e01b0319821663656cb66560e11b145b806118e057506001600160e01b0319821663152a902d60e11b145b806118fb57506001600160e01b031982166301ffc9a760e01b145b8061191657506001600160e01b03198216636cdb3d1360e11b145b806104ba5750506001600160e01b0319166303a24d0760e21b1490565b600081815261012e6020908152604080832080548251601f60026000196101006001861615020190931692909204918201859004850281018501909352808352606094938301828280156119c85780601f1061199d576101008083540402835291602001916119c8565b820191906000526020600020905b8154815290600101906020018083116119ab57829003601f168201915b5050505050905060006119d9610e9c565b90508051600014156119ed575090506104bd565b815115611a07576119fe8183612661565b925050506104bd565b80611a1185612846565b6040516020018083805190602001908083835b60208310611a435780518252601f199092019160209182019101611a24565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310611a8b5780518252601f199092019160209182019101611a6c565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405292505050919050565b825160601c6000611ad8611ef7565b9050806001600160a01b0316826001600160a01b03161480611aff5750611aff82826114a1565b611b1b5760405162461bcd60e51b81526004016105e79061506f565b60008311611b3b5760405162461bcd60e51b81526004016105e790615045565b845160009081526101fc6020526040902054611ca4578460600151600081518110611b6257fe5b6020026020010151600001516001600160a01b0316826001600160a01b031614611b9e5760405162461bcd60e51b81526004016105e790614ff5565b6000856040015111611bc25760405162461bcd60e51b81526004016105e790614f96565b8460a001515185606001515114611bd857600080fd5b6000611be386612920565b905060005b866060015151811015611c5957600087606001518281518110611c0757fe5b6020026020010151600001519050836001600160a01b0316816001600160a01b031614611c5057611c5081848a60a001518581518110611c4357fe5b6020026020010151612b73565b50600101611be8565b50611c6c86600001518760400151612b7e565b611c7e86600001518760800151612be8565b611c9086600001518760600151612dd7565b611ca286600001518760200151612f86565b505b611cc3848660000151856040518060200160405280600081525061304a565b836001600160a01b0316826001600160a01b031614611d7457816001600160a01b031660006001600160a01b0316826001600160a01b031660008051602061535b833981519152886000015187604051611d1e9291906151f1565b60405180910390a4836001600160a01b0316826001600160a01b0316826001600160a01b031660008051602061535b833981519152886000015187604051611d679291906151f1565b60405180910390a46117e5565b836001600160a01b031660006001600160a01b0316826001600160a01b031660008051602061535b833981519152886000015187604051611db69291906151f1565b60405180910390a45050505050565b600054610100900460ff1680611dde5750611dde61305c565b80611dec575060005460ff16155b611e275760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015611e52576000805460ff1961ff0019909116610100171660011790555b611e5a61306d565b611e62613167565b611e6a613169565b611e7261321a565b611e7a6132ba565b611e926040518060200160405280600081525061338a565b611e9b84613455565b611ea3613167565b611eab613507565b611eb587876135a4565b611ebd61321a565b611ec685612262565b611ed18360016135cd565b611edc8260016135cd565b8015611eee576000805461ff00191690555b50505050505050565b3390565b60008184841115611f8a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f4f578181015183820152602001611f37565b50505050905090810190601f168015611f7c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156114ad576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b611ffe846001600160a01b031661362d565b15610a6757836001600160a01b031663bc197c8187878686866040518663ffffffff1660e01b815260040180866001600160a01b03168152602001856001600160a01b03168152602001806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561208c578181015183820152602001612074565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156120cb5781810151838201526020016120b3565b50505050905001848103825285818151815260200191508051906020019080838360005b838110156121075781810151838201526020016120ef565b50505050905090810190601f1680156121345780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b15801561215957600080fd5b505af192505050801561217e57506040513d602081101561217957600080fd5b505160015b6122135761218a615245565b8061219557506121dc565b60405162461bcd60e51b8152602060048201818152835160248401528351849391928392604401919085019080838360008315611f4f578181015183820152602001611f37565b60405162461bcd60e51b81526004018080602001828103825260348152602001806152ff6034913960400191505060405180910390fd5b6001600160e01b0319811663bc197c8160e01b14611eee5760405162461bcd60e51b81526004018080602001828103825260288152602001806153336028913960400191505060405180910390fd5b80516110c59061012f9060208401906143a1565b806000606084901c612286611ef7565b6001600160a01b0316816001600160a01b031614156122e35783915060006122ad86613633565b905080156122d25760006122c087613646565b82039050808611156122d0578093505b505b6122dc8684613659565b8285039350505b509250929050565b6122f3611ef7565b6001600160a01b0316836001600160a01b031614806123195750612319836103ec611ef7565b6123545760405162461bcd60e51b81526004018080602001828103825260298152602001806153f06029913960400191505060405180910390fd5b6105fb838383613672565b60008381526101fa6020526040812054905b818110156117e55760008581526101fa6020526040902080546001600160a01b0386169190839081106123a057fe5b6000918252602090912001546001600160a01b031614156124035760008581526101fa602052604090208054849190839081106123d957fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790555b600101612371565b6001600160a01b038116600090815260c9602052604081205460ff16806114ad57506114ad83836138e0565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061246b57fe5b602090810291909101015292915050565b61248e846001600160a01b031661362d565b15610a6757836001600160a01b031663f23a6e6187878686866040518663ffffffff1660e01b815260040180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561251d578181015183820152602001612505565b50505050905090810190601f16801561254a5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b15801561256d57600080fd5b505af192505050801561259257506040513d602081101561258d57600080fd5b505160015b61259e5761218a615245565b6001600160e01b0319811663f23a6e6160e01b14611eee5760405162461bcd60e51b81526004018080602001828103825260288152602001806153336028913960400191505060405180910390fd5b6125f5611ef7565b6001600160a01b0316836001600160a01b0316148061261b575061261b836103ec611ef7565b6126565760405162461bcd60e51b81526004018080602001828103825260298152602001806153f06029913960400191505060405180910390fd5b6105fb83838361390e565b8051825160609184918491101561272c5784846040516020018083805190602001908083835b602083106126a65780518252601f199092019160209182019101612687565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106126ee5780518252601f1990920191602091820191016126cf565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052925050506104a9565b60005b825181101561283c5782818151811061274457fe5b602001015160f81c60f81b6001600160f81b03191682828151811061276557fe5b01602001516001600160f81b031916146128345785856040516020018083805190602001908083835b602083106127ad5780518252601f19909201916020918201910161278e565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106127f55780518252601f1990920191602091820191016127d6565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405293505050506104a9565b60010161272f565b5092949350505050565b60608161286b57506040805180820190915260018152600360fc1b60208201526104bd565b8160005b811561288357600101600a8204915061286f565b6000816001600160401b038111801561289b57600080fd5b506040519080825280601f01601f1916602001820160405280156128c6576020820181803683370190505b50859350905060001982015b831561291757600a840660300160f81b828280600190039350815181106128f557fe5b60200101906001600160f81b031916908160001a905350600a840493506128d2565b50949350505050565b6000808260800151516001600160401b038111801561293e57600080fd5b50604051908082528060200260200182016040528015612968578160200160208202803683370190505b50905060005b8360800151518110156129ba5761299b8460800151828151811061298e57fe5b6020026020010151613a2f565b8282815181106129a757fe5b602090810291909101015260010161296e565b5060008360600151516001600160401b03811180156129d857600080fd5b50604051908082528060200260200182016040528015612a02578160200160208202803683370190505b50905060005b846060015151811015612a4757612a288560600151828151811061298e57fe5b828281518110612a3457fe5b6020908102919091010152600101612a08565b507ffb988707ebb338694f318760b0fd5cfe756d00a2ade251fda110b80c336a3c7f846000015185604001518660200151805190602001208460405160200180828051906020019060200280838360005b83811015612ab0578181015183820152602001612a98565b50505050905001915050604051602081830303815290604052805190602001208660405160200180828051906020019060200280838360005b83811015612b01578181015183820152602001612ae9565b50505050905001915050604051602081830303815290604052805190602001206040516020018087815260200186815260200185815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040528051906020012092505050919050565b6105fb838383613a9c565b60008281526101fc602052604090205415612b9857600080fd5b60008281526101fc602052604090819020829055517f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c90612bdc90849084906151f1565b60405180910390a15050565b6000805b8251811015612d8c5760006001600160a01b0316838281518110612c0c57fe5b6020026020010151600001516001600160a01b03161415612c74576040805162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e740000000000604482015290519081900360640190fd5b828181518110612c8057fe5b6020026020010151602001516001600160601b031660001415612cea576040805162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f736974697665604482015290519081900360640190fd5b828181518110612cf657fe5b6020026020010151602001516001600160601b0316820191506101fa6000858152602001908152602001600020838281518110612d2f57fe5b60209081029190910181015182546001818101855560009485529383902082519101805492909301516001600160601b0316600160a01b026001600160a01b039182166001600160a01b0319909316929092171617905501612bec565b506127108110612dcd5760405162461bcd60e51b815260040180806020018281038252602581526020018061554f6025913960400191505060405180910390fd5b6105fb8383613cde565b60008281526101fb6020526040812090805b8351811015612f255760006001600160a01b0316848281518110612e0957fe5b6020026020010151600001516001600160a01b03161415612e3c5760405162461bcd60e51b81526004016105e7906150e1565b838181518110612e4857fe5b6020026020010151602001516001600160601b031660001415612e7d5760405162461bcd60e51b81526004016105e790614fc0565b82848281518110612e8a57fe5b602090810291909101810151825460018101845560009384529282902081519301805491909201516001600160601b0316600160a01b026001600160a01b039384166001600160a01b0319909216919091179092169190911790558351612f1b90859083908110612ef757fe5b6020026020010151602001516001600160601b031683611f9290919063ffffffff16565b9150600101612de9565b508061271014612f475760405162461bcd60e51b81526004016105e790615181565b7f841ffb90d4cabdd1f16034f3fa831d79060febbb8167bdd54a49269365bdf78f8484604051612f789291906151d8565b60405180910390a150505050565b600082815261012e602090815260409091208251612fa6928401906143a1565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b612fd284611933565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561300c578181015183820152602001612ff4565b50505050905090810190601f1680156130395780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b61305684848484613d0f565b50505050565b60006130673061362d565b15905090565b600054610100900460ff1680613086575061308661305c565b80613094575060005460ff16155b6130cf5760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff161580156130fa576000805460ff1961ff0019909116610100171660011790555b6000613104611ef7565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015613164576000805461ff00191690555b50565b565b600054610100900460ff1680613182575061318261305c565b80613190575060005460ff16155b6131cb5760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff161580156131f6576000805460ff1961ff0019909116610100171660011790555b6132066301ffc9a760e01b613e21565b8015613164576000805461ff001916905550565b600054610100900460ff1680613233575061323361305c565b80613241575060005460ff16155b61327c5760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015613206576000805460ff1961ff0019909116610100171660011790558015613164576000805461ff001916905550565b600054610100900460ff16806132d357506132d361305c565b806132e1575060005460ff16155b61331c5760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015613347576000805460ff1961ff0019909116610100171660011790555b613206604051806040016040528060088152602001674d696e743131353560c01b815250604051806040016040528060018152602001603160f81b815250613ea5565b600054610100900460ff16806133a357506133a361305c565b806133b1575060005460ff16155b6133ec5760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015613417576000805460ff1961ff0019909116610100171660011790555b61342082613f67565b613430636cdb3d1360e11b613e21565b6134406303a24d0760e21b613e21565b80156110c5576000805461ff00191690555050565b600054610100900460ff168061346e575061346e61305c565b8061347c575060005460ff16155b6134b75760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff161580156134e2576000805460ff1961ff0019909116610100171660011790555b81516134f6906102309060208501906143a1565b5061344063e8a3d48560e01b613e21565b600054610100900460ff1680613520575061352061305c565b8061352e575060005460ff16155b6135695760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015613594576000805460ff1961ff0019909116610100171660011790555b61320663656cb66560e11b613e21565b81516135b8906102629060208501906143a1565b5080516105fb906102639060208401906143a1565b6001600160a01b038216600081815260c96020908152604091829020805460ff1916851515908117909155825190815291517f270dbb8ba4292910ae92862466486be25c355c837270a3d8824b36a8bc7c653b9281900390910190a25050565b3b151590565b60009081526101fc602052604090205490565b60009081526101fd602052604090205490565b60009182526101fd602052604090912080549091019055565b6001600160a01b0383166136b75760405162461bcd60e51b81526004018080602001828103825260238152602001806154e26023913960400191505060405180910390fd5b80518251146136f75760405162461bcd60e51b81526004018080602001828103825260288152602001806155c66028913960400191505060405180910390fd5b6000613701611ef7565b905061372181856000868660405180602001604052806000815250610a67565b60005b83518110156137ff576137b683828151811061373c57fe5b60200260200101516040518060600160405280602481526020016153cc602491396097600088868151811061376d57fe5b602002602001015181526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002054611efb9092919063ffffffff16565b609760008684815181106137c657fe5b602090810291909101810151825281810192909252604090810160009081206001600160a01b038a168252909252902055600101613724565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561388657818101518382015260200161386e565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156138c55781810151838201526020016138ad565b5050505090500194505050505060405180910390a450505050565b6001600160a01b03918216600090815260986020908152604080832093909416825291909152205460ff1690565b6001600160a01b0383166139535760405162461bcd60e51b81526004018080602001828103825260238152602001806154e26023913960400191505060405180910390fd5b600061395d611ef7565b905061398d8185600061396f87612437565b61397887612437565b60405180602001604052806000815250610a67565b6139d4826040518060600160405280602481526020016153cc6024913960008681526097602090815260408083206001600160a01b038b1684529091529020549190611efb565b60008481526097602090815260408083206001600160a01b03808a168086529184528285209590955581518881529283018790528151939490939086169260008051602061535b83398151915292908290030190a450505050565b8051602091820151604080517f397e04204c1e1a60ee8724b71f8244e10ab5f2e9009854d80f602bda21b59ebb818601526001600160a01b03909316838201526001600160601b039091166060808401919091528151808403909101815260809092019052805191012090565b6000613aa783613f7a565b90506000825160411415613ac257613abf8284613fc6565b90505b846001600160a01b0316816001600160a01b0316146117e557613aed856001600160a01b031661362d565b15613c665760408051630b135d3f60e11b808252600482018581526024830193845286516044840152865191936001600160a01b038a1693631626ba7e9388938a9390929091606490910190602085019080838360005b83811015613b5c578181015183820152602001613b44565b50505050905090810190601f168015613b895780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015613ba757600080fd5b505afa158015613bbb573d6000803e3d6000fd5b505050506040513d6020811015613bd157600080fd5b505160408051808201909152601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020820152916001600160e01b031990911614613c605760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611f4f578181015183820152602001611f37565b506117e5565b604080518082018252601c81527f7369676e617475726520766572696669636174696f6e206572726f72000000006020808301918252925162461bcd60e51b81526004810193845282516024820152825192939283926044909201919080838360008315611f4f578181015183820152602001611f37565b7f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df8282604051612bdc9291906151d8565b60008381526101fd6020526040812054613d2a908490611f92565b60008581526101fc6020526040902054909150811115613d5c5760405162461bcd60e51b81526004016105e7906150b7565b60008481526101fd602052604090208190556001600160a01b038516613d945760405162461bcd60e51b81526004016105e790615140565b6000613d9e611ef7565b9050613dbf81600088613db089612437565b613db989612437565b88610a67565b60008581526097602090815260408083206001600160a01b038a168452909152902054613dec9085611f92565b60008681526097602090815260408083206001600160a01b038b168452909152812091909155610a679082908888888861247c565b6001600160e01b03198082161415613e80576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152606560205260409020805460ff19166001179055565b600054610100900460ff1680613ebe5750613ebe61305c565b80613ecc575060005460ff16155b613f075760405162461bcd60e51b815260040180806020018281038252602e815260200180615492602e913960400191505060405180910390fd5b600054610100900460ff16158015613f32576000805460ff1961ff0019909116610100171660011790555b8251602080850191909120835191840191909120610162919091556101635580156105fb576000805461ff0019169055505050565b80516110c59060999060208401906143a1565b6000613f84614046565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b6000815160411461401e576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a61403c86828585614086565b9695505050505050565b60006140817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6140746142dc565b61407c6142e3565b6142ea565b905090565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156140e75760405162461bcd60e51b81526004018080602001828103825260228152602001806154196022913960400191505060405180910390fd5b6000601e8560ff1611156141c1576004850360ff16601b148061411057506004850360ff16601c145b61414b5760405162461bcd60e51b81526004018080602001828103825260228152602001806154c06022913960400191505060405180910390fd5b60016141568761434c565b60048703868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156141b0573d6000803e3d6000fd5b505050602060405103519050614278565b8460ff16601b14806141d657508460ff16601c145b6142115760405162461bcd60e51b81526004018080602001828103825260228152602001806154c06022913960400191505060405180910390fd5b60018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561426b573d6000803e3d6000fd5b5050506020604051035190505b6001600160a01b0381166142d3576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6101625490565b6101635490565b60008383836142f761439d565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b4690565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826143d7576000855561441d565b82601f106143f057805160ff191683800117855561441d565b8280016001018555821561441d579182015b8281111561441d578251825591602001919060010190614402565b5061442992915061442d565b5090565b5b80821115614429576000815560010161442e565b80356104bd816152e9565b600082601f83011261445d578081fd5b8135602061447261446d83615222565b6151ff565b828152818101908583018385028701840188101561448e578586fd5b855b858110156144b55781356144a3816152e9565b84529284019290840190600101614490565b5090979650505050505050565b600082601f8301126144d2578081fd5b813560206144e261446d83615222565b82815281810190858301855b858110156144b557614505898684358b010161462c565b845292840192908401906001016144ee565b600082601f830112614527578081fd5b8135602061453761446d83615222565b82815281810190858301604080860288018501891015614555578687fd5b865b868110156145c45781838b03121561456d578788fd5b81518281018181106001600160401b038211171561458757fe5b83528335614594816152e9565b8152838701356001600160601b03811681146145ae57898afd5b8188015285529385019391810191600101614557565b509198975050505050505050565b600082601f8301126145e2578081fd5b813560206145f261446d83615222565b828152818101908583018385028701840188101561460e578586fd5b855b858110156144b557813584529284019290840190600101614610565b600082601f83011261463c578081fd5b81356001600160401b0381111561464f57fe5b614662601f8201601f19166020016151ff565b818152846020838601011115614676578283fd5b816020850160208301379081016020019190915292915050565b600060c082840312156146a1578081fd5b6146ab60c06151ff565b90508135815260208201356001600160401b03808211156146cb57600080fd5b6146d78583860161462c565b60208401526040840135604084015260608401359150808211156146fa57600080fd5b61470685838601614517565b6060840152608084013591508082111561471f57600080fd5b61472b85838601614517565b608084015260a084013591508082111561474457600080fd5b50614751848285016144c2565b60a08301525092915050565b60006020828403121561476e578081fd5b81356114ad816152e9565b6000806040838503121561478b578081fd5b8235614796816152e9565b915060208301356147a6816152e9565b809150509250929050565b600080600080600060a086880312156147c8578081fd5b85356147d3816152e9565b945060208601356147e3816152e9565b935060408601356001600160401b03808211156147fe578283fd5b61480a89838a016145d2565b9450606088013591508082111561481f578283fd5b61482b89838a016145d2565b93506080880135915080821115614840578283fd5b5061484d8882890161462c565b9150509295509295909350565b600080600080600060a08688031215614871578283fd5b853561487c816152e9565b9450602086013561488c816152e9565b9350604086013592506060860135915060808601356001600160401b038111156148b4578182fd5b61484d8882890161462c565b6000806000606084860312156148d4578081fd5b83356148df816152e9565b925060208401356001600160401b03808211156148fa578283fd5b614906878388016145d2565b9350604086013591508082111561491b578283fd5b50614928868287016145d2565b9150509250925092565b60008060408385031215614944578182fd5b823561494f816152e9565b9150602083013580151581146147a6578182fd5b60008060408385031215614975578182fd5b8235614980816152e9565b946020939093013593505050565b6000806000606084860312156149a2578081fd5b83356149ad816152e9565b95602085013595506040909401359392505050565b6000602082840312156149d3578081fd5b81356001600160401b038111156149e8578182fd5b6149f48482850161444d565b949350505050565b60008060408385031215614a0e578182fd5b82356001600160401b0380821115614a24578384fd5b614a308683870161444d565b93506020850135915080821115614a45578283fd5b50614a52858286016145d2565b9150509250929050565b600060208284031215614a6d578081fd5b81356001600160e01b0319811681146114ad578182fd5b600060208284031215614a95578081fd5b81356001600160401b03811115614aaa578182fd5b6149f48482850161462c565b60008060008060008060c08789031215614ace578384fd5b86356001600160401b0380821115614ae4578586fd5b614af08a838b0161462c565b97506020890135915080821115614b05578586fd5b614b118a838b0161462c565b96506040890135915080821115614b26578586fd5b614b328a838b0161462c565b95506060890135915080821115614b47578283fd5b50614b5489828a0161462c565b935050614b6360808801614442565b9150614b7160a08801614442565b90509295509295509295565b600080600080600080600060e0888a031215614b97578485fd5b87356001600160401b0380821115614bad578687fd5b614bb98b838c0161462c565b985060208a0135915080821115614bce578687fd5b614bda8b838c0161462c565b975060408a0135915080821115614bef578687fd5b614bfb8b838c0161462c565b965060608a0135915080821115614c10578283fd5b614c1c8b838c0161462c565b955060808a0135915080821115614c31578283fd5b50614c3e8a828b0161444d565b935050614c4d60a08901614442565b9150614c5b60c08901614442565b905092959891949750929550565b60008060008060808587031215614c7e578182fd5b84356001600160401b03811115614c93578283fd5b614c9f87828801614690565b9450506020850135614cb0816152e9565b92506040850135614cc0816152e9565b9396929550929360600135925050565b600080600060608486031215614ce4578081fd5b83356001600160401b03811115614cf9578182fd5b614d0586828701614690565b9350506020840135614d16816152e9565b929592945050506040919091013590565b600060208284031215614d38578081fd5b5035919050565b600080600060608486031215614d53578081fd5b833592506020840135614d65816152e9565b91506040840135614d75816152e9565b809150509250925092565b60008060408385031215614d92578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b83811015614ded57815180516001600160a01b031688528301516001600160601b03168388015260409096019590820190600101614db4565b509495945050505050565b6000815180845260208085019450808401835b83811015614ded57815187529582019590820190600101614e0b565b60008151808452815b81811015614e4c57602081850181015186830182015201614e30565b81811115614e5d5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0384168152606060208201819052600090614eaa90830185614e27565b828103604084015261403c8185614e27565b6001600160a01b03929092168252602082015260400190565b6000602082526114ad6020830184614da1565b6000602082526114ad6020830184614df8565b600060408252614f0e6040830185614df8565b82810360208401526142d38185614df8565b901515815260200190565b6000602082526114ad6020830184614e27565b6020808252601190820152703bb937b7339037b93232b91036b0b5b2b960791b604082015260600190565b6020808252601390820152723737ba1037bbb732b91037b91036b4b73a32b960691b604082015260600190565b60208082526010908201526f1cdd5c1c1b1e481a5b98dbdc9c9958dd60821b604082015260600190565b6020808252818101527f43726561746f722073686172652073686f756c6420626520706f736974697665604082015260600190565b6020808252601190820152701d1bdad95b9259081a5b98dbdc9c9958dd607a1b604082015260600190565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b60208082526010908201526f185b5bdd5b9d081a5b98dbdc9c9958dd60821b604082015260600190565b60208082526028908201527f455243313135353a207472616e736665722063616c6c6572206973206e6f7420604082015267185c1c1c9bdd995960c21b606082015260800190565b60208082526010908201526f6d6f7265207468616e20737570706c7960801b604082015260600190565b60208082526019908201527f4163636f756e742073686f756c642062652070726573656e7400000000000000604082015260600190565b6020808252600e908201526d69647320213d20616d6f756e747360901b604082015260600190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252602e908201527f746f74616c20616d6f756e74206f662063726561746f7273207368617265207360408201526d0686f756c642062652031303030360941b606082015260800190565b90815260200190565b6000838252604060208301526149f46040830184614da1565b918252602082015260400190565b6040518181016001600160401b038111828210171561521a57fe5b604052919050565b60006001600160401b0382111561523557fe5b5060209081020190565b60e01c90565b600060443d101561525557610f31565b600481823e6308c379a0615269825161523f565b1461527357610f31565b6040513d600319016004823e80513d6001600160401b0381602484011181841117156152a25750505050610f31565b828401925082519150808211156152bc5750505050610f31565b503d830160208284010111156152d457505050610f31565b601f01601f1916810160200160405291505090565b6001600160a01b038116811461316457600080fdfe455243313135353a207472616e7366657220746f206e6f6e2045524331313535526563656976657220696d706c656d656e746572455243313135353a204552433131353552656365697665722072656a656374656420746f6b656e73c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62455243313135353a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373455243313135353a206275726e20616d6f756e7420657863656564732062616c616e6365455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656445434453413a20696e76616c6964207369676e6174757265202773272076616c7565455243313135353a207472616e7366657220746f20746865207a65726f2061646472657373455243313135353a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c7565455243313135353a206275726e2066726f6d20746865207a65726f2061646472657373455243313135353a20696e73756666696369656e742062616c616e636520666f72207472616e736665724f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f79616c747920746f74616c2076616c75652073686f756c64206265203c203130303030455243313135353a2073657474696e6720617070726f76616c2073746174757320666f722073656c66455243313135353a206163636f756e747320616e6420696473206c656e677468206d69736d61746368455243313135353a2069647320616e6420616d6f756e7473206c656e677468206d69736d61746368a26469706673582212204b2faac5df329fcac130f338c524cbabe652d98e0abe4c1cb108e899d1fa45c964736f6c63430007060033