ETH Price: $3,248.10 (+2.06%)
Gas: 2 Gwei

Contract

0x00059878282ec217c761F20e668932D1A7f3bb97
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040166017882023-02-10 23:57:47531 days ago1676073467IN
 Create: ERC1155TL
0 ETH0.0904740821.17812401

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC1155TL

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 20 : ERC1155TL.sol
// SPDX-License-Identifier: Apache-2.0

/// @title ERC1155TL.sol
/// @notice Transient Labs ERC-1155 Creator Contract
/// @dev features include
///      - batch minting
///      - airdrops
///      - ability to hook in external mint contracts
///      - ability to set multiple admins
///      - Story Contract
///      - BlockList
///      - individual token royalties
/// @author transientlabs.xyz

/*
    ____        _ __    __   ____  _ ________                     __ 
   / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
  / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /__ 
/_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__(_)*/

pragma solidity 0.8.17;

import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {
    ERC1155Upgradeable,
    IERC1155Upgradeable,
    ERC165Upgradeable
} from "openzeppelin-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import {EIP2981TLUpgradeable} from "tl-sol-tools/upgradeable/royalties/EIP2981TLUpgradeable.sol";
import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol";
import {StoryContractUpgradeable} from "tl-story/upgradeable/StoryContractUpgradeable.sol";
import {BlockListUpgradeable} from "tl-blocklist/BlockListUpgradeable.sol";

/*//////////////////////////////////////////////////////////////////////////
                            Custom Errors
//////////////////////////////////////////////////////////////////////////*/

/// @dev token uri is an empty string
error EmptyTokenURI();

/// @dev batch size too small
error BatchSizeTooSmall();

/// @dev mint to zero addresses
error MintToZeroAddresses();

/// @dev array length mismatch
error ArrayLengthMismatch();

/// @dev token not owned by the owner of the contract
error TokenNotOwnedByOwner();

/// @dev caller is not approved or owner
error CallerNotApprovedOrOwner();

/// @dev token does not exist
error TokenDoesNotExist();

/// @dev burning zero tokens
error BurnZeroTokens();

/*//////////////////////////////////////////////////////////////////////////
                            ERC1155TL
//////////////////////////////////////////////////////////////////////////*/

contract ERC1155TL is
    ERC1155Upgradeable,
    EIP2981TLUpgradeable,
    OwnableAccessControlUpgradeable,
    StoryContractUpgradeable,
    BlockListUpgradeable
{
    /*//////////////////////////////////////////////////////////////////////////
                                Custom Types
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev struct defining a token
    struct Token {
        bool created;
        string uri;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    uint256 public constant VERSION = 1;
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant APPROVED_MINT_CONTRACT = keccak256("APPROVED_MINT_CONTRACT");
    uint256 private _counter;
    string public name;
    string public symbol;
    mapping(uint256 => Token) private _tokens;

    /*//////////////////////////////////////////////////////////////////////////
                                Constructor
    //////////////////////////////////////////////////////////////////////////*/

    /// @param disable: boolean to disable initialization for the implementation contract
    constructor(bool disable) {
        if (disable) _disableInitializers();
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Initializer
    //////////////////////////////////////////////////////////////////////////*/

    /// @param name_: the name of the 1155 contract
    /// @param symbol_: the symbol for the 1155 contract
    /// @param defaultRoyaltyRecipient: the default address for royalty payments
    /// @param defaultRoyaltyPercentage: the default royalty percentage of basis points (out of 10,000)
    /// @param initOwner: the owner of the contract
    /// @param admins: array of admin addresses to add to the contract
    /// @param enableStory: a bool deciding whether to add story fuctionality or not
    /// @param blockListRegistry: address of the blocklist registry to use
    function initialize(
        string memory name_,
        string memory symbol_,
        address defaultRoyaltyRecipient,
        uint256 defaultRoyaltyPercentage,
        address initOwner,
        address[] memory admins,
        bool enableStory,
        address blockListRegistry
    ) external initializer {
        // initialize parent contracts
        __ERC1155_init("");
        __EIP2981TL_init(defaultRoyaltyRecipient, defaultRoyaltyPercentage);
        __OwnableAccessControl_init(initOwner);
        __StoryContractUpgradeable_init(enableStory);
        __BlockList_init(blockListRegistry);

        // add admins
        _setRole(ADMIN_ROLE, admins, true);

        // set name & symbol
        name = name_;
        symbol = symbol_;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                General Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to get token creation details
    /// @param tokenId: the token to lookup
    function getTokenDetails(uint256 tokenId) external view returns (Token memory) {
        return _tokens[tokenId];
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Access Control Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to set approved mint contracts
    /// @dev access to owner or admin
    /// @param minters: array of minters to grant approval to
    /// @param status: status for the minters
    function setApprovedMintContracts(address[] calldata minters, bool status) external onlyRoleOrOwner(ADMIN_ROLE) {
        _setRole(APPROVED_MINT_CONTRACT, minters, status);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Creation Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to create a token that can be minted to creator or airdropped
    /// @dev requires owner or admin
    /// @param newUri: the uri for the token to create
    /// @param addresses: the addresses to mint the new token to
    /// @param amounts: the amount of the new token to mint to each address
    function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts)
        external
        onlyRoleOrOwner(ADMIN_ROLE)
    {
        _createToken(newUri, addresses, amounts);
    }

    /// @notice function to create a token that can be minted to creator or airdropped
    /// @dev overloaded function where you can set the token royalty config in this tx
    /// @dev requires owner or admin
    /// @param newUri: the uri for the token to create
    /// @param addresses: the addresses to mint the new token to
    /// @param amounts: the amount of the new token to mint to each address
    /// @param royaltyAddress: royalty payout address for the created token
    /// @param royaltyPercent: royalty percentage for this token
    function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts, address royaltyAddress, uint256 royaltyPercent)
        external
        onlyRoleOrOwner(ADMIN_ROLE)
    {
       uint256 tokenId =  _createToken(newUri, addresses, amounts);
       _overrideTokenRoyaltyInfo(tokenId, royaltyAddress, royaltyPercent);
    }

    /// @notice function to batch create tokens that can be minted to creator or airdropped
    /// @dev requires owner or admin
    /// @param newUris: the uris for the tokens to create
    /// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to
    /// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address
    function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts)
        external
        onlyRoleOrOwner(ADMIN_ROLE)
    {
        if (newUris.length == 0) revert EmptyTokenURI();
        for (uint256 i = 0; i < newUris.length; i++) {
            _createToken(newUris[i], addresses[i], amounts[i]);
        }
    }

    /// @notice function to batch create tokens that can be minted to creator or airdropped
    /// @dev overloaded function where you can set the token royalty config in this tx
    /// @dev requires owner or admin
    /// @param newUris: the uris for the tokens to create
    /// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to
    /// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address
    /// @param royaltyAddresses: royalty payout addresses for the tokens
    /// @param royaltyPercents: royalty payout percents for the tokens
    function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts, address[] calldata royaltyAddresses, uint256[] calldata royaltyPercents)
        external
        onlyRoleOrOwner(ADMIN_ROLE)
    {
        if (newUris.length == 0) revert EmptyTokenURI();
        for (uint256 i = 0; i < newUris.length; i++) {
            uint256 tokenId = _createToken(newUris[i], addresses[i], amounts[i]);
            _overrideTokenRoyaltyInfo(tokenId, royaltyAddresses[i], royaltyPercents[i]);
        }
    }

    /// @notice private helper function to create a new token
    /// @param newUri: the uri for the token to create
    /// @param addresses: the addresses to mint the new token to
    /// @param amounts: the amount of the new token to mint to each address
    /// @return _counter: token id created
    function _createToken(string memory newUri, address[] memory addresses, uint256[] memory amounts) private returns(uint256) {
        if (bytes(newUri).length == 0) revert EmptyTokenURI();
        if (addresses.length == 0) revert MintToZeroAddresses();
        if (addresses.length != amounts.length) revert ArrayLengthMismatch();
        _counter++;
        _tokens[_counter] = Token(true, newUri);
        for (uint256 i = 0; i < addresses.length; i++) {
            _mint(addresses[i], _counter, amounts[i], "");
        }

        return _counter;
    }

    /// @notice private helper function to verify a token exists
    /// @param tokenId: the token to check existence for
    function _exists(uint256 tokenId) private view returns (bool) {
        return _tokens[tokenId].created;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Mint Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to mint existing token to recipients
    /// @dev requires owner or admin
    /// @param tokenId: the token to mint
    /// @param addresses: the addresses to mint to
    /// @param amounts: amounts of the token to mint to each address
    function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)
        external
        onlyRoleOrOwner(ADMIN_ROLE)
    {
        _mintToken(tokenId, addresses, amounts);
    }

    /// @notice external mint function
    /// @dev requires caller to be an approved mint contract
    /// @param tokenId: the token to mint
    /// @param addresses: the addresses to mint to
    /// @param amounts: amounts of the token to mint to each address
    function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)
        external
        onlyRole(APPROVED_MINT_CONTRACT)
    {
        _mintToken(tokenId, addresses, amounts);
    }

    /// @notice private helper function
    /// @param tokenId: the token to mint
    /// @param addresses: the addresses to mint to
    /// @param amounts: amounts of the token to mint to each address
    function _mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) private {
        if (!_exists(tokenId)) revert TokenDoesNotExist();
        if (addresses.length == 0) revert MintToZeroAddresses();
        if (addresses.length != amounts.length) revert ArrayLengthMismatch();
        for (uint256 i = 0; i < addresses.length; i++) {
            _mint(addresses[i], tokenId, amounts[i], "");
        }
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Burn Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to burn tokens from an account
    /// @dev msg.sender must be owner or operator
    /// @dev if this function is called from another contract as part of a burn/redeem,
    ///      the contract must ensure that no amount is '0' or if it is, that it isn't a vulnerability.
    /// @param from: address to burn from
    /// @param tokenIds: array of tokens to burn
    /// @param amounts: amount of each token to burn
    function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external {
        if (tokenIds.length == 0) revert BurnZeroTokens();
        if (msg.sender != from && !isApprovedForAll(from, msg.sender)) revert CallerNotApprovedOrOwner();
        _burnBatch(from, tokenIds, amounts);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Royalty Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to set the default royalty specification
    /// @dev requires owner
    /// @param newRecipient: the new royalty payout address
    /// @param newPercentage: the new royalty percentage in basis (out of 10,000)
    function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyOwner {
        _setDefaultRoyaltyInfo(newRecipient, newPercentage);
    }

    /// @notice function to override a token's royalty info
    /// @dev requires owner
    /// @param tokenId: the token to override royalty for
    /// @param newRecipient: the new royalty payout address for the token id
    /// @param newPercentage: the new royalty percentage in basis (out of 10,000) for the token id
    function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external onlyOwner {
        _overrideTokenRoyaltyInfo(tokenId, newRecipient, newPercentage);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Token Uri Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to set token Uri for a token
    /// @dev requires owner or admin
    /// @param tokenId: token to set a uri for
    /// @param newUri: the new uri for the token
    function setTokenUri(uint256 tokenId, string calldata newUri) external onlyRoleOrOwner(ADMIN_ROLE) {
        if (!_exists(tokenId)) revert TokenDoesNotExist();
        if (bytes(newUri).length == 0) revert EmptyTokenURI();
        _tokens[tokenId].uri = newUri;
        emit IERC1155Upgradeable.URI(newUri, tokenId);
    }

    /// @notice function for token uris
    /// @param tokenId: token for which to get the uri
    function uri(uint256 tokenId) public view override(ERC1155Upgradeable) returns (string memory) {
        if (!_exists(tokenId)) revert TokenDoesNotExist();
        return _tokens[tokenId].uri;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Story Contract Hooks
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc StoryContractUpgradeable
    /// @dev restricted to the owner of the contract
    function _isStoryAdmin(address potentialAdmin) internal view override(StoryContractUpgradeable) returns (bool) {
        return potentialAdmin == owner();
    }

    /// @inheritdoc StoryContractUpgradeable
    function _tokenExists(uint256 tokenId) internal view override(StoryContractUpgradeable) returns (bool) {
        return _exists(tokenId);
    }

    /// @inheritdoc StoryContractUpgradeable
    function _isTokenOwner(address potentialOwner, uint256 tokenId)
        internal
        view
        override(StoryContractUpgradeable)
        returns (bool)
    {
        return balanceOf(potentialOwner, tokenId) > 0;
    }

    /// @inheritdoc StoryContractUpgradeable
    /// @dev restricted to the owner of the contract
    function _isCreator(address potentialCreator, uint256 /* tokenId */ )
        internal
        view
        override(StoryContractUpgradeable)
        returns (bool)
    {
        return potentialCreator == owner();
    }

    /*//////////////////////////////////////////////////////////////////////////
                                BlockList Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc BlockListUpgradeable
    /// @dev restricted to the owner of the contract
    function isBlockListAdmin(address potentialAdmin) public view override(BlockListUpgradeable) returns (bool) {
        return potentialAdmin == owner();
    }

    /// @inheritdoc ERC1155Upgradeable
    /// @dev added the `notBlocked` modifier for blocklist
    function setApprovalForAll(address operator, bool approved)
        public
        override(ERC1155Upgradeable)
        notBlocked(operator)
    {
        ERC1155Upgradeable.setApprovalForAll(operator, approved);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                ERC-165 Support
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc ERC165Upgradeable
    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC1155Upgradeable, EIP2981TLUpgradeable, StoryContractUpgradeable)
        returns (bool)
    {
        return (
            ERC1155Upgradeable.supportsInterface(interfaceId) || EIP2981TLUpgradeable.supportsInterface(interfaceId)
                || StoryContractUpgradeable.supportsInterface(interfaceId)
        );
    }
}

File 2 of 20 : BlockListUpgradeable.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.17;

/// @title BlockList
/// @author transientlabs.xyz

/**
 *     ____        _ __    __   ____  _ ________                     __
 *    / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
 *   / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 *  / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /_
 * /_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__/
 */

import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {BlockedOperator, Unauthorized, IBlockList} from "./IBlockList.sol";
import {IBlockListRegistry} from "./IBlockListRegistry.sol";

/// @notice abstract contract that can be inherited to block
///         approvals from non-royalty paying marketplaces
abstract contract BlockListUpgradeable is Initializable, IBlockList {
    /*//////////////////////////////////////////////////////////////////////////
                                Public State Variables
    //////////////////////////////////////////////////////////////////////////*/

    IBlockListRegistry public blockListRegistry;

    /*//////////////////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////////////////*/

    event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry);

    /*//////////////////////////////////////////////////////////////////////////
                                Modifiers
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev modifier that can be applied to approval functions in order to block listings on marketplaces
    modifier notBlocked(address operator) {
        if (getBlockListStatus(operator)) {
            revert BlockedOperator();
        }
        _;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Initializer
    //////////////////////////////////////////////////////////////////////////*/

    /// @param blockListRegistryAddr - the initial BlockList Registry Address
    function __BlockList_init(address blockListRegistryAddr) internal onlyInitializing {
        __BlockList_init_unchained(blockListRegistryAddr);
    }

    /// @param blockListRegistryAddr - the initial BlockList Registry Address
    function __BlockList_init_unchained(address blockListRegistryAddr) internal onlyInitializing {
        blockListRegistry = IBlockListRegistry(blockListRegistryAddr);
        emit BlockListRegistryUpdated(msg.sender, address(0), blockListRegistryAddr);
    }

    /*//////////////////////////////////////////////////////////////////////////
                            Admin Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to transfer ownership of the blockList
    /// @dev requires blockList owner
    /// @dev can be transferred to the ZERO_ADDRESS if desired
    /// @dev BE VERY CAREFUL USING THIS
    /// @param newBlockListRegistry - the address of the new BlockList registry
    function updateBlockListRegistry(address newBlockListRegistry) public {
        if (!isBlockListAdmin(msg.sender)) revert Unauthorized();

        address oldRegistry = address(blockListRegistry);
        blockListRegistry = IBlockListRegistry(newBlockListRegistry);
        emit BlockListRegistryUpdated(msg.sender, oldRegistry, newBlockListRegistry);
    }

    /*//////////////////////////////////////////////////////////////////////////
                          Public Read Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc IBlockList
    function getBlockListStatus(address operator) public view override returns (bool) {
        if (address(blockListRegistry).code.length == 0) return false;
        try blockListRegistry.getBlockListStatus(operator) returns (bool isBlocked) {
            return isBlocked;
        } catch {
            return false;
        }
    }

    /// @notice Abstract function to determine if the operator is a blocklist admin.
    /// @param potentialAdmin - the potential admin address to check
    function isBlockListAdmin(address potentialAdmin) public view virtual returns (bool);

    /*//////////////////////////////////////////////////////////////////////////
                                Upgradeability Gap
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
    uint256[50] private _gap;
}

File 3 of 20 : IBlockList.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.17;

/*//////////////////////////////////////////////////////////////////////////
                                Custom Errors
//////////////////////////////////////////////////////////////////////////*/

/// @dev blocked operator error
error BlockedOperator();

/// @dev unauthorized to call fn method
error Unauthorized();

interface IBlockList {
    /// @notice function to get blocklist status with True meaning that the operator is blocked
    /// @dev must return false if the blocklist registry is an EOA or an incompatible contract, true/false if compatible
    /// @param operator - operator to check against for blocking
    function getBlockListStatus(address operator) external view returns (bool);
}

File 4 of 20 : IBlockListRegistry.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.17;

/**
 *     ____        _ __    __   ____  _ ________                     __
 *    / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
 *   / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 *  / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /_
 * /_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__/
 */

/// @title BlockList Registry
/// @notice interface for the BlockListRegistry Contract
/// @author transientlabs.xyz
interface IBlockListRegistry {
    /*//////////////////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////////////////*/

    event BlockListStatusChange(address indexed user, address indexed operator, bool indexed status);

    event BlockListCleared(address indexed user);

    /*//////////////////////////////////////////////////////////////////////////
                          Public Read Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to get blocklist status with True meaning that the operator is blocked
    function getBlockListStatus(address operator) external view returns (bool);

    /*//////////////////////////////////////////////////////////////////////////
                          Public Write Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to set the block list status for multiple operators
    /// @dev must be called by the blockList owner
    function setBlockListStatus(address[] calldata operators, bool status) external;

    /// @notice function to clear the block list status
    /// @dev must be called by the blockList owner
    function clearBlockList() external;
}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/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 onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 6 of 20 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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 proxied contracts do not make use of 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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 7 of 20 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/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 AddressUpgradeable for address;

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

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

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

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

    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
        _setURI(uri_);
    }

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

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

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

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

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

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

        return batchBalances;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

        return array;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[47] private __gap;
}

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

pragma solidity ^0.8.0;

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

/**
 * @dev _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.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

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

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

pragma solidity ^0.8.0;

import "../../utils/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 have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

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

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

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

File 11 of 20 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

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

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

File 15 of 20 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

File 16 of 20 : IStory.sol
// SPDX-License-Identifier: Apache-2.0

/// @title Story Contract Interface
/// @author transientlabs.xyz
/// @version 2.3.0

/*
    ____        _ __    __   ____  _ ________                     __ 
   / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
  / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /__ 
/_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__(_)*/

pragma solidity 0.8.17;

/*//////////////////////////////////////////////////////////////////////////
                            Custom Errors
//////////////////////////////////////////////////////////////////////////*/

/// @dev story additions are not enabled
error StoryNotEnabled();

/// @dev token does not exist
error TokenDoesNotExist();

/// @dev caller is not the token owner
error NotTokenOwner();

/// @dev caller is not the token creator
error NotTokenCreator();

/// @dev caller is not a story admin
error NotStoryAdmin();

/*//////////////////////////////////////////////////////////////////////////
                            IStory
//////////////////////////////////////////////////////////////////////////*/

interface IStory {
    /*//////////////////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice event describing a creator story getting added to a token
    /// @dev this events stores creator stories on chain in the event log
    /// @param tokenId - the token id to which the story is attached
    /// @param creatorAddress - the address of the creator of the token
    /// @param creatorName - string representation of the creator's name
    /// @param story - the story written and attached to the token id
    event CreatorStory(uint256 indexed tokenId, address indexed creatorAddress, string creatorName, string story);

    /// @notice event describing a collector story getting added to a token
    /// @dev this events stores collector stories on chain in the event log
    /// @param tokenId - the token id to which the story is attached
    /// @param collectorAddress - the address of the collector of the token
    /// @param collectorName - string representation of the collectors's name
    /// @param story - the story written and attached to the token id
    event Story(uint256 indexed tokenId, address indexed collectorAddress, string collectorName, string story);

    /*//////////////////////////////////////////////////////////////////////////
                                Story Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to let the creator add a story to any token they have created
    /// @dev depending on the implementation, this function may be restricted in various ways, such as
    ///      limiting the number of times the creator may write a story.
    /// @dev this function MUST emit the CreatorStory event each time it is called
    /// @dev this function MUST implement logic to restrict access to only the creator
    /// @dev this function MUST revert if a story is written to a non-existent token
    /// @param tokenId - the token id to which the story is attached
    /// @param creatorName - string representation of the creator's name
    /// @param story - the story written and attached to the token id
    function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story) external;

    /// @notice function to let collectors add a story to any token they own
    /// @dev depending on the implementation, this function may be restricted in various ways, such as
    ///      limiting the number of times a collector may write a story.
    /// @dev this function MUST emit the Story event each time it is called
    /// @dev this function MUST implement logic to restrict access to only the owner of the token
    /// @dev this function MUST revert if a story is written to a non-existent token
    /// @param tokenId - the token id to which the story is attached
    /// @param collectorName - string representation of the collectors's name
    /// @param story - the story written and attached to the token id
    function addStory(uint256 tokenId, string calldata collectorName, string calldata story) external;
}

File 17 of 20 : StoryContractUpgradeable.sol
// SPDX-License-Identifier: Apache-2.0

/// @title Story Contract
/// @dev upgradeable, inheritable abstract contract implementing the Story Contract interface
/// @author transientlabs.xyz
/// Version 2.3.0

/*
    ____        _ __    __   ____  _ ________                     __ 
   / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
  / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /__ 
/_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__(_)*/

pragma solidity 0.8.17;

/*//////////////////////////////////////////////////////////////////////////
                            Imports
//////////////////////////////////////////////////////////////////////////*/

import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {
    IStory, StoryNotEnabled, TokenDoesNotExist, NotTokenOwner, NotTokenCreator, NotStoryAdmin
} from "../IStory.sol";

/*//////////////////////////////////////////////////////////////////////////
                            Story Contract
//////////////////////////////////////////////////////////////////////////*/

abstract contract StoryContractUpgradeable is Initializable, IStory, ERC165Upgradeable {
    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    bool public storyEnabled;

    /*//////////////////////////////////////////////////////////////////////////
                                Modifiers
    //////////////////////////////////////////////////////////////////////////*/

    modifier storyMustBeEnabled() {
        if (!storyEnabled) revert StoryNotEnabled();
        _;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Initializer
    //////////////////////////////////////////////////////////////////////////*/

    /// @param enabled - a bool to enable or disable Story addition
    function __StoryContractUpgradeable_init(bool enabled) internal {
        __StoryContractUpgradeable_init_unchained(enabled);
    }

    /// @param enabled - a bool to enable or disable Story addition
    function __StoryContractUpgradeable_init_unchained(bool enabled) internal {
        storyEnabled = enabled;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Story Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev function to set story enabled/disabled
    /// @dev requires story admin
    /// @param enabled - a boolean setting to enable or disable Story additions
    function setStoryEnabled(bool enabled) external {
        if (!_isStoryAdmin(msg.sender)) revert NotStoryAdmin();
        storyEnabled = enabled;
    }

    /// @inheritdoc IStory
    function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story)
        external
        storyMustBeEnabled
    {
        if (!_tokenExists(tokenId)) revert TokenDoesNotExist();
        if (!_isCreator(msg.sender, tokenId)) revert NotTokenCreator();

        emit CreatorStory(tokenId, msg.sender, creatorName, story);
    }

    /// @inheritdoc IStory
    function addStory(uint256 tokenId, string calldata collectorName, string calldata story)
        external
        storyMustBeEnabled
    {
        if (!_tokenExists(tokenId)) revert TokenDoesNotExist();
        if (!_isTokenOwner(msg.sender, tokenId)) revert NotTokenOwner();

        emit Story(tokenId, msg.sender, collectorName, story);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Hooks
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev function to allow access to enabling/disabling story
    /// @param potentialAdmin - the address to check for admin priviledges
    function _isStoryAdmin(address potentialAdmin) internal view virtual returns (bool);

    /// @dev function to check if a token exists on the token contract
    /// @param tokenId - the token id to check for existence
    function _tokenExists(uint256 tokenId) internal view virtual returns (bool);

    /// @dev function to check ownership of a token
    /// @param potentialOwner - the address to check for ownership of `tokenId`
    /// @param tokenId - the token id to check ownership against
    function _isTokenOwner(address potentialOwner, uint256 tokenId) internal view virtual returns (bool);

    /// @dev function to check creatorship of a token
    /// @param potentialCreator - the address to check creatorship of `tokenId`
    /// @param tokenId - the token id to check creatorship against
    function _isCreator(address potentialCreator, uint256 tokenId) internal view virtual returns (bool);

    /*//////////////////////////////////////////////////////////////////////////
                                Overrides
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc ERC165Upgradeable
    function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165Upgradeable) returns (bool) {
        return interfaceId == type(IStory).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Upgradeability Gap
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
    uint256[50] private _gap;
}

File 18 of 20 : IEIP2981.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

///
/// @dev Interface for the NFT Royalty Standard
///
interface IEIP2981 {
    /// ERC165 bytes to add to interface array - set in parent contract
    /// implementing this standard
    ///
    /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a

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

File 19 of 20 : OwnableAccessControlUpgradeable.sol
// SPDX-License-Identifier: Apache-2.0

/// @title OwnableAccessControl.sol
/// @notice single owner, flexible access control mechanics
/// @dev can easily be extended by inheriting and applying additional roles
/// @dev by default, only the owner can grant roles but by inheriting, but you
///      may allow other roles to grant roles by using the internal helper.
/// @author transientlabs.xyz
/// https://github.com/Transient-Labs/tl-sol-tools
/// Version 1.0.0

/*
    ____        _ __    __   ____  _ ________                     __ 
   / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
  / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /__ 
/_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__(_)*/

pragma solidity 0.8.17;

/*//////////////////////////////////////////////////////////////////////////
                            Imports
//////////////////////////////////////////////////////////////////////////*/

import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {EnumerableSetUpgradeable} from "openzeppelin-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import {OwnableUpgradeable} from "openzeppelin-upgradeable/access/OwnableUpgradeable.sol";

/*//////////////////////////////////////////////////////////////////////////
                            Custom Errors
//////////////////////////////////////////////////////////////////////////*/

/// @dev does not have specified role
error NotSpecifiedRole(bytes32 role);

/// @dev is not specified role or owner
error NotRoleOrOwner(bytes32 role);

/*//////////////////////////////////////////////////////////////////////////
                            OwnableAccessControl
//////////////////////////////////////////////////////////////////////////*/

abstract contract OwnableAccessControlUpgradeable is Initializable, OwnableUpgradeable {
    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    uint256 private _c; // counter to be able to revoke all priviledges
    mapping(uint256 => mapping(bytes32 => mapping(address => bool))) private _roleStatus;
    mapping(uint256 => mapping(bytes32 => EnumerableSetUpgradeable.AddressSet)) private _roleMembers;

    /*//////////////////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////////////////*/

    /// @param from - address that authorized the role change
    /// @param user - the address who's role has been changed
    /// @param approved - boolean indicating the user's status in role
    /// @param role - the bytes32 role created in the inheriting contract
    event RoleChange(address indexed from, address indexed user, bool indexed approved, bytes32 role);
    
    /// @param from - address that authorized the revoke
    event AllRolesRevoked(address indexed from);

    /*//////////////////////////////////////////////////////////////////////////
                                Modifiers
    //////////////////////////////////////////////////////////////////////////*/

    modifier onlyRole(bytes32 role) {
        if (!hasRole(role, msg.sender)) {
            revert NotSpecifiedRole(role);
        }
        _;
    }

    modifier onlyRoleOrOwner(bytes32 role) {
        if (!hasRole(role, msg.sender) && owner() != msg.sender) {
            revert NotRoleOrOwner(role);
        }
        _;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Initializer
    //////////////////////////////////////////////////////////////////////////*/

    /// @param initOwner - the address of the initial owner
    function __OwnableAccessControl_init(address initOwner) internal onlyInitializing {
        __Ownable_init();
        _transferOwnership(initOwner);
        __OwnableAccessControl_init_unchained();
    }

    function __OwnableAccessControl_init_unchained() internal onlyInitializing {}

    /*//////////////////////////////////////////////////////////////////////////
                                External Role Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to revoke all roles currently present
    /// @dev increments the `_c` variables
    /// @dev requires owner privileges
    function revokeAllRoles() external onlyOwner {
        _c++;
        emit AllRolesRevoked(msg.sender);
    }

    /// @notice function to renounce role
    /// @param role - bytes32 role created in inheriting contracts
    function renounceRole(bytes32 role) external {
        address[] memory members = new address[](1);
        members[0] = msg.sender;
        _setRole(role, members, false);
    }

    /// @notice function to grant/revoke a role to an address
    /// @dev requires owner to call this function but this may be further
    ///      extended using the internal helper function in inheriting contracts
    /// @param role - bytes32 role created in inheriting contracts
    /// @param roleMembers - list of addresses that should have roles attached to them based on `status`
    /// @param status - bool whether to remove or add `roleMembers` to the `role`
    function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner {
        _setRole(role, roleMembers, status);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                External View Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to see if an address is the owner
    /// @param role - bytes32 role created in inheriting contracts
    /// @param potentialRoleMember - address to check for role membership
    function hasRole(bytes32 role, address potentialRoleMember) public view returns (bool) {
        return _roleStatus[_c][role][potentialRoleMember];
    }

    /// @notice function to get role members
    /// @param role - bytes32 role created in inheriting contracts
    function getRoleMembers(bytes32 role) public view returns (address[] memory) {
        return _roleMembers[_c][role].values();
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Internal Helper Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice helper function to set addresses for a role
    /// @param role - bytes32 role created in inheriting contracts
    /// @param roleMembers - list of addresses that should have roles attached to them based on `status`
    /// @param status - bool whether to remove or add `roleMembers` to the `role`
    function _setRole(bytes32 role, address[] memory roleMembers, bool status) internal {
        for (uint256 i = 0; i < roleMembers.length; i++) {
            _roleStatus[_c][role][roleMembers[i]] = status;
            if (status) {
                _roleMembers[_c][role].add(roleMembers[i]);
            } else {
                _roleMembers[_c][role].remove(roleMembers[i]);
            }
            emit RoleChange(msg.sender, roleMembers[i], status, role);
        }
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Upgradeability Gap
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
    uint256[50] private _gap;
}

File 20 of 20 : EIP2981TLUpgradeable.sol
// SPDX-License-Identifier: Apache-2.0

/// @title EIP2981TLUpgradeable.sol
/// @notice abstract contract to define a default royalty spec
///         while allowing for specific token overrides
/// @dev follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981)
/// @author transientlabs.xyz
/// https://github.com/Transient-Labs/tl-sol-tools
/// Version 1.0.0
/*
    ____        _ __    __   ____  _ ________                     __ 
   / __ )__  __(_) /___/ /  / __ \(_) __/ __/__  ________  ____  / /_
  / __  / / / / / / __  /  / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/
 / /_/ / /_/ / / / /_/ /  / /_/ / / __/ __/  __/ /  /  __/ / / / /__ 
/_____/\__,_/_/_/\__,_/  /_____/_/_/ /_/  \___/_/   \___/_/ /_/\__(_)*/

pragma solidity 0.8.17;

/*//////////////////////////////////////////////////////////////////////////
                            Imports
//////////////////////////////////////////////////////////////////////////*/

import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {IEIP2981} from "../../royalties/IEIP2981.sol";

/*//////////////////////////////////////////////////////////////////////////
                            Custom Errors
//////////////////////////////////////////////////////////////////////////*/

/// @dev error if the recipient is set to address(0)
error ZeroAddressError();

/// @dev error if the royalty percentage is greater than to 100%
error MaxRoyaltyError();

/*//////////////////////////////////////////////////////////////////////////
                            EIP2981TL
//////////////////////////////////////////////////////////////////////////*/

abstract contract EIP2981TLUpgradeable is IEIP2981, Initializable, ERC165Upgradeable {
    /*//////////////////////////////////////////////////////////////////////////
                                Royalty Struct
    //////////////////////////////////////////////////////////////////////////*/

    struct RoyaltySpec {
        address recipient;
        uint256 percentage;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    address private _defaultRecipient;
    uint256 private _defaultPercentage;
    mapping(uint256 => RoyaltySpec) private _tokenOverrides;

    /*//////////////////////////////////////////////////////////////////////////
                                Initializer
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to initialize the contract
    /// @param defaultRecipient - the default royalty payout address
    /// @param defaultPercentage - the deafult royalty percentage, out of 10,000
    function __EIP2981TL_init(address defaultRecipient, uint256 defaultPercentage) internal onlyInitializing {
        __EIP2981TL_init_unchained(defaultRecipient, defaultPercentage);
    }

    /// @notice unchained function to initialize the contract
    /// @param defaultRecipient - the default royalty payout address
    /// @param defaultPercentage - the deafult royalty percentage, out of 10,000
    function __EIP2981TL_init_unchained(address defaultRecipient, uint256 defaultPercentage)
        internal
        onlyInitializing
    {
        _setDefaultRoyaltyInfo(defaultRecipient, defaultPercentage);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Royalty Changing Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice function to set default royalty info
    /// @param newRecipient - the new default royalty payout address
    /// @param newPercentage - the new default royalty percentage, out of 10,000
    function _setDefaultRoyaltyInfo(address newRecipient, uint256 newPercentage) internal {
        if (newRecipient == address(0)) revert ZeroAddressError();
        if (newPercentage > 10_000) revert MaxRoyaltyError();
        _defaultRecipient = newRecipient;
        _defaultPercentage = newPercentage;
    }

    /// @notice function to override royalty spec on a specific token
    /// @param tokenId - the token id to override royalty for
    /// @param newRecipient - the new royalty payout address
    /// @param newPercentage - the new royalty percentage, out of 10,000
    function _overrideTokenRoyaltyInfo(uint256 tokenId, address newRecipient, uint256 newPercentage) internal {
        if (newRecipient == address(0)) revert ZeroAddressError();
        if (newPercentage > 10_000) revert MaxRoyaltyError();
        _tokenOverrides[tokenId].recipient = newRecipient;
        _tokenOverrides[tokenId].percentage = newPercentage;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Royalty Info
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc IEIP2981
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount)
    {
        address recipient = _defaultRecipient;
        uint256 percentage = _defaultPercentage;
        if (_tokenOverrides[tokenId].recipient != address(0)) {
            recipient = _tokenOverrides[tokenId].recipient;
            percentage = _tokenOverrides[tokenId].percentage;
        }
        return (recipient, salePrice / 10_000 * percentage); // divide first to avoid overflow
    }

    /*//////////////////////////////////////////////////////////////////////////
                                ERC-165 Override
    //////////////////////////////////////////////////////////////////////////*/

    /// @inheritdoc ERC165Upgradeable
    function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165Upgradeable) returns (bool) {
        return interfaceId == type(IEIP2981).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Upgradeability Gap
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
    uint256[50] private _gap;
}

Settings
{
  "remappings": [
    "blocklist/=lib/blocklist/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "story-contract/=lib/story-contract/src/",
    "tl-blocklist/=lib/blocklist/src/",
    "tl-sol-tools/=lib/tl-sol-tools/src/",
    "tl-story/=lib/story-contract/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bool","name":"disable","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BlockedOperator","type":"error"},{"inputs":[],"name":"BurnZeroTokens","type":"error"},{"inputs":[],"name":"CallerNotApprovedOrOwner","type":"error"},{"inputs":[],"name":"EmptyTokenURI","type":"error"},{"inputs":[],"name":"MaxRoyaltyError","type":"error"},{"inputs":[],"name":"MintToZeroAddresses","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotRoleOrOwner","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotSpecifiedRole","type":"error"},{"inputs":[],"name":"NotStoryAdmin","type":"error"},{"inputs":[],"name":"NotTokenCreator","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"StoryNotEnabled","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddressError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"}],"name":"AllRolesRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"oldRegistry","type":"address"},{"indexed":true,"internalType":"address","name":"newRegistry","type":"address"}],"name":"BlockListRegistryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"creatorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"creatorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"CreatorStory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bool","name":"approved","type":"bool"},{"indexed":false,"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"RoleChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"collectorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"collectorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"Story","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APPROVED_MINT_CONTRACT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"creatorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addCreatorStory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"collectorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addStory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"},{"internalType":"address[]","name":"royaltyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"royaltyPercents","type":"uint256[]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blockListRegistry","outputs":[{"internalType":"contract IBlockListRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint256","name":"royaltyPercent","type":"uint256"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"externalMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"getBlockListStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenDetails","outputs":[{"components":[{"internalType":"bool","name":"created","type":"bool"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct ERC1155TL.Token","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"potentialRoleMember","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"defaultRoyaltyRecipient","type":"address"},{"internalType":"uint256","name":"defaultRoyaltyPercentage","type":"uint256"},{"internalType":"address","name":"initOwner","type":"address"},{"internalType":"address[]","name":"admins","type":"address[]"},{"internalType":"bool","name":"enableStory","type":"bool"},{"internalType":"address","name":"blockListRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"potentialAdmin","type":"address"}],"name":"isBlockListAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeAllRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"minters","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedMintContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address[]","name":"roleMembers","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setStoryEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newUri","type":"string"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBlockListRegistry","type":"address"}],"name":"updateBlockListRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162004d5538038062004d5583398101604081905262000034916200010e565b80156200004557620000456200004c565b5062000139565b600054610100900460ff1615620000b95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156200010c576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012157600080fd5b815180151581146200013257600080fd5b9392505050565b614c0c80620001496000396000f3fe608060405234801561001057600080fd5b50600436106102e85760003560e01c806351dc02f211610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106c1578063f2fde38b146106d4578063ffa1ad74146106e757600080fd5b8063d8c3a2741461065f578063d8d045b414610672578063e985e9c51461068557600080fd5b8063a3246ad3116100c8578063a3246ad31461060c578063c1e037281461062c578063d4bf502a1461064c57600080fd5b8063a22cb465146105e5578063a25a3393146105f857600080fd5b806375b238fc1161014557806391d148541161011f57806391d148541461058657806395d89b41146105ca5780639713c807146105d257600080fd5b806375b238fc146105275780638bb9c5bf1461054e5780638da5cb5b1461056157600080fd5b806357f7789e1161017657806357f7789e146104f95780635b23e3ce1461050c578063715018a61461051f57600080fd5b806351dc02f2146104d357806356000f77146104e657600080fd5b80632d28c08b1161024a5780633db0f8ab116101fe578063485d3c07116101d8578063485d3c07146104925780634a597065146104a55780634e1273f4146104b357600080fd5b80633db0f8ab146104595780633f2bc9661461046c57806346317db71461047f57600080fd5b8063319210231161022f578063319210231461042b578063334980a51461043e57806333aa4fb31461045157600080fd5b80632d28c08b146104055780632eb2c2d61461041857600080fd5b80631fbd2402116102a1578063249fde3b11610286578063249fde3b146103ad57806324f029c3146103c05780632a55205a146103d357600080fd5b80631fbd2402146103735780631ff7f0bc1461038657600080fd5b806306fdde03116102d257806306fdde03146103365780630e89341c1461034b5780631258e8871461035e57600080fd5b8062fdd58e146102ed57806301ffc9a714610313575b600080fd5b6103006102fb366004613a71565b6106ef565b6040519081526020015b60405180910390f35b610326610321366004613ab1565b61079d565b604051901515815260200161030a565b61033e6107c6565b60405161030a9190613b14565b61033e610359366004613b27565b610855565b61037161036c366004613b40565b61092a565b005b610371610381366004613cc7565b6109cb565b6103007ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b6103716103bb366004613de1565b610b7d565b6103716103ce366004613e5b565b610c23565b6103e66103e1366004613e78565b610c76565b604080516001600160a01b03909316835260208301919091520161030a565b610371610413366004613edc565b610cee565b610371610426366004613ff6565b610e3b565b6103716104393660046140a0565b610edd565b61032661044c366004613b40565b61111a565b6103716111ca565b610371610467366004614191565b611214565b61032661047a366004613b40565b611331565b61037161048d3660046141cf565b611360565b6103716104a0366004614269565b611503565b610133546103269060ff1681565b6104c66104c13660046142a6565b611635565b60405161030a9190614345565b6103716104e1366004614358565b611773565b6103716104f43660046143af565b611869565b610371610507366004614418565b61195b565b61037161051a3660046143af565b611a9c565b610371611b7f565b6103007fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b61037161055c366004613b27565b611b93565b60cc546001600160a01b03165b6040516001600160a01b03909116815260200161030a565b610326610594366004614464565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b61033e611bf9565b6103716105e0366004614490565b611c07565b6103716105f33660046144c5565b611c1f565b6101665461056e906001600160a01b031681565b61061f61061a366004613b27565b611c6a565b60405161030a91906144fc565b61063f61063a366004613b27565b611c93565b60405161030a9190614549565b61037161065a366004614578565b611d69565b61037161066d366004613de1565b611d7c565b610371610680366004613a71565b611dfe565b6103266106933660046145c8565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6103716106cf3660046145f2565b611e10565b6103716106e2366004613b40565b611eab565b610300600181565b60006001600160a01b0383166107725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107a882611f3b565b806107b757506107b782611fbd565b8061079757506107978261200b565b61019a80546107d490614657565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614657565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff166108885760405163677510db60e11b815260040160405180910390fd5b600082815261019c6020526040902060010180546108a590614657565b80601f01602080910402602001604051908101604052809291908181526020018280546108d190614657565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b50505050509050919050565b61093333611331565b610969576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff16158080156109eb5750600054600160ff909116105b80610a055750303b158015610a05575060005460ff166001145b610a775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610769565b6000805460ff191660011790558015610a9a576000805461ff0019166101001790555b610ab260405180602001604052806000815250612059565b610abc87876120cd565b610ac585612142565b610adb83610133805460ff191682151517905550565b610ae4826121c6565b610b107fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177585600161223a565b61019a610b1d8a826146d7565b5061019b610b2b89826146d7565b508015610b72576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610bed575033610be160cc546001600160a01b031690565b6001600160a01b031614155b15610c0e576040516376c1743160e01b815260048101829052602401610769565b610c1b86868686866123c7565b505050505050565b610c2c33611331565b610c62576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610cc8575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610cd6612710886147ad565b610ce091906147cf565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610d5e575033610d5260cc546001600160a01b031690565b6001600160a01b031614155b15610d7f576040516376c1743160e01b815260048101829052602401610769565b6000610e228a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152506124e192505050565b9050610e2f818585612659565b50505050505050505050565b6001600160a01b038516331480610e575750610e578533610693565b610ec95760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612715565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610f4d575033610f4160cc546001600160a01b031690565b6001600160a01b031614155b15610f6e576040516376c1743160e01b815260048101829052602401610769565b60008a9003610f90576040516317314b6160e01b815260040160405180910390fd5b60005b8a81101561110c5760006110ae8d8d84818110610fb257610fb26147e6565b9050602002810190610fc491906147fc565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061100d5761100d6147e6565b905060200281019061101f9190614843565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d9150879050818110611065576110656147e6565b90506020028101906110779190614843565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506124e192505050565b90506110f9818888858181106110c6576110c66147e6565b90506020020160208101906110db9190613b40565b8787868181106110ed576110ed6147e6565b90506020020135612659565b50806111048161488d565b915050610f93565b505050505050505050505050565b610166546000906001600160a01b03163b810361113957506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa9250505080156111b9575060408051601f3d908101601f191682019092526111b6918101906148a7565b60015b61079757506000919050565b919050565b6111d26129ae565b60fe80549060006111e28361488d565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b600083900361124f576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0386161480159061128c57506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b156112c3576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ed68585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612a0892505050565b600061134560cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156113d05750336113c460cc546001600160a01b031690565b6001600160a01b031614155b156113f1576040516376c1743160e01b815260048101829052602401610769565b6000869003611413576040516317314b6160e01b815260040160405180910390fd5b60005b868110156114f9576114e6888883818110611433576114336147e6565b905060200281019061144591906147fc565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a925089915085905081811061148e5761148e6147e6565b90506020028101906114a09190614843565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250889150869050818110611065576110656147e6565b50806114f18161488d565b915050611416565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561157357503361156760cc546001600160a01b031690565b6001600160a01b031614155b15611594576040516376c1743160e01b815260048101829052602401610769565b6114f987878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152506124e192505050565b606081518351146116ae5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610769565b6000835167ffffffffffffffff8111156116ca576116ca613b5b565b6040519080825280602002602001820160405280156116f3578160200160208202803683370190505b50905060005b845181101561176b5761173e858281518110611717576117176147e6565b6020026020010151858381518110611731576117316147e6565b60200260200101516106ef565b828281518110611750576117506147e6565b60209081029190910101526117648161488d565b90506116f9565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156117e35750336117d760cc546001600160a01b031690565b6001600160a01b031614155b15611804576040516376c1743160e01b815260048101829052602401610769565b6118637ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525087925061223a915050565b50505050565b6101335460ff166118a6576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118af85612c96565b6118cc5760405163677510db60e11b815260040160405180910390fd5b6118d63386612cae565b61190c576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c18686868660405161194c94939291906148ef565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156119cb5750336119bf60cc546001600160a01b031690565b6001600160a01b031614155b156119ec576040516376c1743160e01b815260048101829052602401610769565b600084815261019c602052604090205460ff16611a1c5760405163677510db60e11b815260040160405180910390fd5b6000829003611a3e576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611a5b838583614921565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611a8e9291906149e1565b60405180910390a250505050565b6101335460ff16611ad9576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ae285612c96565b611aff5760405163677510db60e11b815260040160405180910390fd5b611b093386612cde565b611b3f576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac8686868660405161194c94939291906148ef565b611b876129ae565b611b916000612cf3565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611bc957611bc96147e6565b60200260200101906001600160a01b031690816001600160a01b031681525050611bf58282600061223a565b5050565b61019b80546107d490614657565b611c0f6129ae565b611c1a838383612659565b505050565b81611c298161111a565b15611c60576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c1a8383612d52565b60fe54600090815261010060209081526040808320848452909152902060609061079790612d5d565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611ce090614657565b80601f0160208091040260200160405190810160405280929190818152602001828054611d0c90614657565b8015611d595780601f10611d2e57610100808354040283529160200191611d59565b820191906000526020600020905b815481529060010190602001808311611d3c57829003601f168201915b5050505050815250509050919050565b611d716129ae565b611c1a83838361223a565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c0e576040517fee074e7400000000000000000000000000000000000000000000000000000000815260048101829052602401610769565b611e066129ae565b611bf58282612d71565b6001600160a01b038516331480611e2c5750611e2c8533610693565b611e9e5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612e20565b611eb36129ae565b6001600160a01b038116611f2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610769565b611f3881612cf3565b50565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480611f9e57506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f0d23ecb900000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b600054610100900460ff166120c45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f3881612fef565b600054610100900460ff166121385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bf58282613063565b600054610100900460ff166121ad5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b6121b56130ce565b6121be81612cf3565b611f38613141565b600054610100900460ff166122315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f38816131ac565b60005b82518110156118635760fe54600090815260ff6020908152604080832087845290915281208451849290869085908110612279576122796147e6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055508115612307576123018382815181106122d3576122d36147e6565b60209081029190910181015160fe546000908152610100835260408082208983529093529190912090613273565b5061234c565b61234a83828151811061231c5761231c6147e6565b60209081029190910181015160fe546000908152610100835260408082208983529093529190912090613288565b505b811515838281518110612361576123616147e6565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e876040516123ad91815260200190565b60405180910390a4806123bf8161488d565b91505061223d565b600085815261019c602052604090205460ff166123f75760405163677510db60e11b815260040160405180910390fd5b6000839003612432576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461246b576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c1b576124cf85858381811061248b5761248b6147e6565b90506020020160208101906124a09190613b40565b878585858181106124b3576124b36147e6565b905060200201356040518060200160405280600081525061329d565b806124d98161488d565b91505061246e565b60008351600003612505576040516317314b6160e01b815260040160405180910390fd5b8251600003612540576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815183511461257b576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610199805490600061258c8361488d565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff19169015151781559251919291908201906125da90826146d7565b5090505060005b835181101561264c5761263a8482815181106125ff576125ff6147e6565b60200260200101516101995485848151811061261d5761261d6147e6565b60200260200101516040518060200160405280600081525061329d565b806126448161488d565b9150506125e1565b5050610199549392505050565b6001600160a01b038216612699576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108111156126d5576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b815183511461278c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b0384166128085760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b3360005b8451811015612948576000858281518110612829576128296147e6565b602002602001015190506000858381518110612847576128476147e6565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156128ee5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061292d9084906149f5565b92505081905550505050806129419061488d565b905061280c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612998929190614a08565b60405180910390a4610c1b8187878787876133cf565b60cc546001600160a01b03163314611b915760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610769565b6001600160a01b038316612a845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610769565b8051825114612afb5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b604080516020810190915260009081905233905b8351811015612c29576000848281518110612b2c57612b2c6147e6565b602002602001015190506000848381518110612b4a57612b4a6147e6565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612bf05760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610769565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612c218161488d565b915050612b0f565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612c7a929190614a08565b60405180910390a4604080516020810190915260009052611863565b600081815261019c602052604081205460ff16610797565b6000612cc260cc546001600160a01b031690565b6001600160a01b0316836001600160a01b031614905092915050565b600080612ceb84846106ef565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611bf53383836135bb565b60606000612d6a836136af565b9392505050565b6001600160a01b038216612db1576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612ded576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612e9c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b336000612ea88561370a565b90506000612eb58561370a565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015612f505760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612f8f9084906149f5565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b72848a8a8a8a8a613755565b600054610100900460ff1661305a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f3881613898565b600054610100900460ff16611e065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166131395760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611b916138a4565b600054610100900460ff16611b915760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166132175760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612d6a836001600160a01b038416613918565b6000612d6a836001600160a01b038416613967565b6001600160a01b0384166133195760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610769565b3360006133258561370a565b905060006133328561370a565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906133669084906149f5565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133c683600089898989613755565b50505050505050565b6001600160a01b0384163b15610c1b576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c819061342c9089908990889088908890600401614a36565b6020604051808303816000875af1925050508015613467575060408051601f3d908101601f1916820190925261346491810190614a94565b60015b61351c57613473614ab1565b806308c379a0036134ac5750613487614acd565b8061349257506134ae565b8060405162461bcd60e51b81526004016107699190613b14565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610769565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146133c65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b816001600160a01b0316836001600160a01b0316036136425760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561091e57602002820191906000526020600020905b8154815260200190600101908083116136eb5750505050509050919050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613744576137446147e6565b602090810291909101015292915050565b6001600160a01b0384163b15610c1b576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137b29089908990889088908890600401614b75565b6020604051808303816000875af19250505080156137ed575060408051601f3d908101601f191682019092526137ea91810190614a94565b60015b6137f957613473614ab1565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146133c65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b6067611bf582826146d7565b600054610100900460ff1661390f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611b9133612cf3565b600081815260018301602052604081205461395f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610797565b506000610797565b60008181526001830160205260408120548015613a5057600061398b600183614bad565b855490915060009061399f90600190614bad565b9050818114613a045760008660000182815481106139bf576139bf6147e6565b90600052602060002001549050808760000184815481106139e2576139e26147e6565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a1557613a15614bc0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610797565b6000915050610797565b80356001600160a01b03811681146111c557600080fd5b60008060408385031215613a8457600080fd5b613a8d83613a5a565b946020939093013593505050565b6001600160e01b031981168114611f3857600080fd5b600060208284031215613ac357600080fd5b8135612d6a81613a9b565b6000815180845260005b81811015613af457602081850181015186830182015201613ad8565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612d6a6020830184613ace565b600060208284031215613b3957600080fd5b5035919050565b600060208284031215613b5257600080fd5b612d6a82613a5a565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613b9757613b97613b5b565b6040525050565b600082601f830112613baf57600080fd5b813567ffffffffffffffff811115613bc957613bc9613b5b565b604051613be06020601f19601f8501160182613b71565b818152846020838601011115613bf557600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613c2c57613c2c613b5b565b5060051b60200190565b600082601f830112613c4757600080fd5b81356020613c5482613c12565b604051613c618282613b71565b83815260059390931b8501820192828101915086841115613c8157600080fd5b8286015b84811015613ca357613c9681613a5a565b8352918301918301613c85565b509695505050505050565b8015158114611f3857600080fd5b80356111c581613cae565b600080600080600080600080610100898b031215613ce457600080fd5b883567ffffffffffffffff80821115613cfc57600080fd5b613d088c838d01613b9e565b995060208b0135915080821115613d1e57600080fd5b613d2a8c838d01613b9e565b9850613d3860408c01613a5a565b975060608b01359650613d4d60808c01613a5a565b955060a08b0135915080821115613d6357600080fd5b50613d708b828c01613c36565b935050613d7f60c08a01613cbc565b9150613d8d60e08a01613a5a565b90509295985092959890939650565b60008083601f840112613dae57600080fd5b50813567ffffffffffffffff811115613dc657600080fd5b6020830191508360208260051b8501011115610ce757600080fd5b600080600080600060608688031215613df957600080fd5b85359450602086013567ffffffffffffffff80821115613e1857600080fd5b613e2489838a01613d9c565b90965094506040880135915080821115613e3d57600080fd5b50613e4a88828901613d9c565b969995985093965092949392505050565b600060208284031215613e6d57600080fd5b8135612d6a81613cae565b60008060408385031215613e8b57600080fd5b50508035926020909101359150565b60008083601f840112613eac57600080fd5b50813567ffffffffffffffff811115613ec457600080fd5b602083019150836020828501011115610ce757600080fd5b60008060008060008060008060a0898b031215613ef857600080fd5b883567ffffffffffffffff80821115613f1057600080fd5b613f1c8c838d01613e9a565b909a50985060208b0135915080821115613f3557600080fd5b613f418c838d01613d9c565b909850965060408b0135915080821115613f5a57600080fd5b50613f678b828c01613d9c565b9095509350613f7a905060608a01613a5a565b9150608089013590509295985092959890939650565b600082601f830112613fa157600080fd5b81356020613fae82613c12565b604051613fbb8282613b71565b83815260059390931b8501820192828101915086841115613fdb57600080fd5b8286015b84811015613ca35780358352918301918301613fdf565b600080600080600060a0868803121561400e57600080fd5b61401786613a5a565b945061402560208701613a5a565b9350604086013567ffffffffffffffff8082111561404257600080fd5b61404e89838a01613f90565b9450606088013591508082111561406457600080fd5b61407089838a01613f90565b9350608088013591508082111561408657600080fd5b5061409388828901613b9e565b9150509295509295909350565b60008060008060008060008060008060a08b8d0312156140bf57600080fd5b8a3567ffffffffffffffff808211156140d757600080fd5b6140e38e838f01613d9c565b909c509a5060208d01359150808211156140fc57600080fd5b6141088e838f01613d9c565b909a50985060408d013591508082111561412157600080fd5b61412d8e838f01613d9c565b909850965060608d013591508082111561414657600080fd5b6141528e838f01613d9c565b909650945060808d013591508082111561416b57600080fd5b506141788d828e01613d9c565b915080935050809150509295989b9194979a5092959850565b6000806000806000606086880312156141a957600080fd5b6141b286613a5a565b9450602086013567ffffffffffffffff80821115613e1857600080fd5b600080600080600080606087890312156141e857600080fd5b863567ffffffffffffffff8082111561420057600080fd5b61420c8a838b01613d9c565b9098509650602089013591508082111561422557600080fd5b6142318a838b01613d9c565b9096509450604089013591508082111561424a57600080fd5b5061425789828a01613d9c565b979a9699509497509295939492505050565b6000806000806000806060878903121561428257600080fd5b863567ffffffffffffffff8082111561429a57600080fd5b61420c8a838b01613e9a565b600080604083850312156142b957600080fd5b823567ffffffffffffffff808211156142d157600080fd5b6142dd86838701613c36565b935060208501359150808211156142f357600080fd5b5061430085828601613f90565b9150509250929050565b600081518084526020808501945080840160005b8381101561433a5781518752958201959082019060010161431e565b509495945050505050565b602081526000612d6a602083018461430a565b60008060006040848603121561436d57600080fd5b833567ffffffffffffffff81111561438457600080fd5b61439086828701613d9c565b90945092505060208401356143a481613cae565b809150509250925092565b6000806000806000606086880312156143c757600080fd5b85359450602086013567ffffffffffffffff808211156143e657600080fd5b6143f289838a01613e9a565b9096509450604088013591508082111561440b57600080fd5b50613e4a88828901613e9a565b60008060006040848603121561442d57600080fd5b83359250602084013567ffffffffffffffff81111561444b57600080fd5b61445786828701613e9a565b9497909650939450505050565b6000806040838503121561447757600080fd5b8235915061448760208401613a5a565b90509250929050565b6000806000606084860312156144a557600080fd5b833592506144b560208501613a5a565b9150604084013590509250925092565b600080604083850312156144d857600080fd5b6144e183613a5a565b915060208301356144f181613cae565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561453d5783516001600160a01b031683529284019291840191600101614518565b50909695505050505050565b60208152815115156020820152600060208301516040808401526145706060840182613ace565b949350505050565b60008060006060848603121561458d57600080fd5b83359250602084013567ffffffffffffffff8111156145ab57600080fd5b6145b786828701613c36565b92505060408401356143a481613cae565b600080604083850312156145db57600080fd5b6145e483613a5a565b915061448760208401613a5a565b600080600080600060a0868803121561460a57600080fd5b61461386613a5a565b945061462160208701613a5a565b93506040860135925060608601359150608086013567ffffffffffffffff81111561464b57600080fd5b61409388828901613b9e565b600181811c9082168061466b57607f821691505b60208210810361468b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c1a57600081815260208120601f850160051c810160208610156146b85750805b601f850160051c820191505b81811015610c1b578281556001016146c4565b815167ffffffffffffffff8111156146f1576146f1613b5b565b614705816146ff8454614657565b84614691565b602080601f83116001811461473a57600084156147225750858301515b600019600386901b1c1916600185901b178555610c1b565b600085815260208120601f198616915b828110156147695788860151825594840194600190910190840161474a565b50858210156147875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000826147ca57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761079757610797614797565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261481357600080fd5b83018035915067ffffffffffffffff82111561482e57600080fd5b602001915036819003821315610ce757600080fd5b6000808335601e1984360301811261485a57600080fd5b83018035915067ffffffffffffffff82111561487557600080fd5b6020019150600581901b3603821315610ce757600080fd5b600060001982036148a0576148a0614797565b5060010190565b6000602082840312156148b957600080fd5b8151612d6a81613cae565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6040815260006149036040830186886148c4565b82810360208401526149168185876148c4565b979650505050505050565b67ffffffffffffffff83111561493957614939613b5b565b61494d836149478354614657565b83614691565b6000601f84116001811461498157600085156149695750838201355b600019600387901b1c1916600186901b178355610ed6565b600083815260209020601f19861690835b828110156149b25786850135825560209485019460019092019101614992565b50868210156149cf5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006145706020830184866148c4565b8082018082111561079757610797614797565b604081526000614a1b604083018561430a565b8281036020840152614a2d818561430a565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a6260a083018661430a565b8281036060840152614a74818661430a565b90508281036080840152614a888185613ace565b98975050505050505050565b600060208284031215614aa657600080fd5b8151612d6a81613a9b565b600060033d1115614aca5760046000803e5060005160e01c5b90565b600060443d1015614adb5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614b2957505050505090565b8285019150815181811115614b415750505050505090565b843d8701016020828501011115614b5b5750505050505090565b614b6a60208286010187613b71565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261491660a0830184613ace565b8181038181111561079757610797614797565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207f27652eaa992f3bab32f8d7465310c68264309b9221e1992b220301ebfc7f7c64736f6c634300081100330000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102e85760003560e01c806351dc02f211610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106c1578063f2fde38b146106d4578063ffa1ad74146106e757600080fd5b8063d8c3a2741461065f578063d8d045b414610672578063e985e9c51461068557600080fd5b8063a3246ad3116100c8578063a3246ad31461060c578063c1e037281461062c578063d4bf502a1461064c57600080fd5b8063a22cb465146105e5578063a25a3393146105f857600080fd5b806375b238fc1161014557806391d148541161011f57806391d148541461058657806395d89b41146105ca5780639713c807146105d257600080fd5b806375b238fc146105275780638bb9c5bf1461054e5780638da5cb5b1461056157600080fd5b806357f7789e1161017657806357f7789e146104f95780635b23e3ce1461050c578063715018a61461051f57600080fd5b806351dc02f2146104d357806356000f77146104e657600080fd5b80632d28c08b1161024a5780633db0f8ab116101fe578063485d3c07116101d8578063485d3c07146104925780634a597065146104a55780634e1273f4146104b357600080fd5b80633db0f8ab146104595780633f2bc9661461046c57806346317db71461047f57600080fd5b8063319210231161022f578063319210231461042b578063334980a51461043e57806333aa4fb31461045157600080fd5b80632d28c08b146104055780632eb2c2d61461041857600080fd5b80631fbd2402116102a1578063249fde3b11610286578063249fde3b146103ad57806324f029c3146103c05780632a55205a146103d357600080fd5b80631fbd2402146103735780631ff7f0bc1461038657600080fd5b806306fdde03116102d257806306fdde03146103365780630e89341c1461034b5780631258e8871461035e57600080fd5b8062fdd58e146102ed57806301ffc9a714610313575b600080fd5b6103006102fb366004613a71565b6106ef565b6040519081526020015b60405180910390f35b610326610321366004613ab1565b61079d565b604051901515815260200161030a565b61033e6107c6565b60405161030a9190613b14565b61033e610359366004613b27565b610855565b61037161036c366004613b40565b61092a565b005b610371610381366004613cc7565b6109cb565b6103007ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b6103716103bb366004613de1565b610b7d565b6103716103ce366004613e5b565b610c23565b6103e66103e1366004613e78565b610c76565b604080516001600160a01b03909316835260208301919091520161030a565b610371610413366004613edc565b610cee565b610371610426366004613ff6565b610e3b565b6103716104393660046140a0565b610edd565b61032661044c366004613b40565b61111a565b6103716111ca565b610371610467366004614191565b611214565b61032661047a366004613b40565b611331565b61037161048d3660046141cf565b611360565b6103716104a0366004614269565b611503565b610133546103269060ff1681565b6104c66104c13660046142a6565b611635565b60405161030a9190614345565b6103716104e1366004614358565b611773565b6103716104f43660046143af565b611869565b610371610507366004614418565b61195b565b61037161051a3660046143af565b611a9c565b610371611b7f565b6103007fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b61037161055c366004613b27565b611b93565b60cc546001600160a01b03165b6040516001600160a01b03909116815260200161030a565b610326610594366004614464565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b61033e611bf9565b6103716105e0366004614490565b611c07565b6103716105f33660046144c5565b611c1f565b6101665461056e906001600160a01b031681565b61061f61061a366004613b27565b611c6a565b60405161030a91906144fc565b61063f61063a366004613b27565b611c93565b60405161030a9190614549565b61037161065a366004614578565b611d69565b61037161066d366004613de1565b611d7c565b610371610680366004613a71565b611dfe565b6103266106933660046145c8565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6103716106cf3660046145f2565b611e10565b6103716106e2366004613b40565b611eab565b610300600181565b60006001600160a01b0383166107725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107a882611f3b565b806107b757506107b782611fbd565b8061079757506107978261200b565b61019a80546107d490614657565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614657565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff166108885760405163677510db60e11b815260040160405180910390fd5b600082815261019c6020526040902060010180546108a590614657565b80601f01602080910402602001604051908101604052809291908181526020018280546108d190614657565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b50505050509050919050565b61093333611331565b610969576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff16158080156109eb5750600054600160ff909116105b80610a055750303b158015610a05575060005460ff166001145b610a775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610769565b6000805460ff191660011790558015610a9a576000805461ff0019166101001790555b610ab260405180602001604052806000815250612059565b610abc87876120cd565b610ac585612142565b610adb83610133805460ff191682151517905550565b610ae4826121c6565b610b107fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177585600161223a565b61019a610b1d8a826146d7565b5061019b610b2b89826146d7565b508015610b72576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610bed575033610be160cc546001600160a01b031690565b6001600160a01b031614155b15610c0e576040516376c1743160e01b815260048101829052602401610769565b610c1b86868686866123c7565b505050505050565b610c2c33611331565b610c62576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610cc8575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610cd6612710886147ad565b610ce091906147cf565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610d5e575033610d5260cc546001600160a01b031690565b6001600160a01b031614155b15610d7f576040516376c1743160e01b815260048101829052602401610769565b6000610e228a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152506124e192505050565b9050610e2f818585612659565b50505050505050505050565b6001600160a01b038516331480610e575750610e578533610693565b610ec95760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612715565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610f4d575033610f4160cc546001600160a01b031690565b6001600160a01b031614155b15610f6e576040516376c1743160e01b815260048101829052602401610769565b60008a9003610f90576040516317314b6160e01b815260040160405180910390fd5b60005b8a81101561110c5760006110ae8d8d84818110610fb257610fb26147e6565b9050602002810190610fc491906147fc565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061100d5761100d6147e6565b905060200281019061101f9190614843565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d9150879050818110611065576110656147e6565b90506020028101906110779190614843565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506124e192505050565b90506110f9818888858181106110c6576110c66147e6565b90506020020160208101906110db9190613b40565b8787868181106110ed576110ed6147e6565b90506020020135612659565b50806111048161488d565b915050610f93565b505050505050505050505050565b610166546000906001600160a01b03163b810361113957506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa9250505080156111b9575060408051601f3d908101601f191682019092526111b6918101906148a7565b60015b61079757506000919050565b919050565b6111d26129ae565b60fe80549060006111e28361488d565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b600083900361124f576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0386161480159061128c57506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b156112c3576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ed68585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612a0892505050565b600061134560cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156113d05750336113c460cc546001600160a01b031690565b6001600160a01b031614155b156113f1576040516376c1743160e01b815260048101829052602401610769565b6000869003611413576040516317314b6160e01b815260040160405180910390fd5b60005b868110156114f9576114e6888883818110611433576114336147e6565b905060200281019061144591906147fc565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a925089915085905081811061148e5761148e6147e6565b90506020028101906114a09190614843565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250889150869050818110611065576110656147e6565b50806114f18161488d565b915050611416565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561157357503361156760cc546001600160a01b031690565b6001600160a01b031614155b15611594576040516376c1743160e01b815260048101829052602401610769565b6114f987878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152506124e192505050565b606081518351146116ae5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610769565b6000835167ffffffffffffffff8111156116ca576116ca613b5b565b6040519080825280602002602001820160405280156116f3578160200160208202803683370190505b50905060005b845181101561176b5761173e858281518110611717576117176147e6565b6020026020010151858381518110611731576117316147e6565b60200260200101516106ef565b828281518110611750576117506147e6565b60209081029190910101526117648161488d565b90506116f9565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156117e35750336117d760cc546001600160a01b031690565b6001600160a01b031614155b15611804576040516376c1743160e01b815260048101829052602401610769565b6118637ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525087925061223a915050565b50505050565b6101335460ff166118a6576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118af85612c96565b6118cc5760405163677510db60e11b815260040160405180910390fd5b6118d63386612cae565b61190c576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c18686868660405161194c94939291906148ef565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156119cb5750336119bf60cc546001600160a01b031690565b6001600160a01b031614155b156119ec576040516376c1743160e01b815260048101829052602401610769565b600084815261019c602052604090205460ff16611a1c5760405163677510db60e11b815260040160405180910390fd5b6000829003611a3e576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611a5b838583614921565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611a8e9291906149e1565b60405180910390a250505050565b6101335460ff16611ad9576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ae285612c96565b611aff5760405163677510db60e11b815260040160405180910390fd5b611b093386612cde565b611b3f576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac8686868660405161194c94939291906148ef565b611b876129ae565b611b916000612cf3565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611bc957611bc96147e6565b60200260200101906001600160a01b031690816001600160a01b031681525050611bf58282600061223a565b5050565b61019b80546107d490614657565b611c0f6129ae565b611c1a838383612659565b505050565b81611c298161111a565b15611c60576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c1a8383612d52565b60fe54600090815261010060209081526040808320848452909152902060609061079790612d5d565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611ce090614657565b80601f0160208091040260200160405190810160405280929190818152602001828054611d0c90614657565b8015611d595780601f10611d2e57610100808354040283529160200191611d59565b820191906000526020600020905b815481529060010190602001808311611d3c57829003601f168201915b5050505050815250509050919050565b611d716129ae565b611c1a83838361223a565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c0e576040517fee074e7400000000000000000000000000000000000000000000000000000000815260048101829052602401610769565b611e066129ae565b611bf58282612d71565b6001600160a01b038516331480611e2c5750611e2c8533610693565b611e9e5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612e20565b611eb36129ae565b6001600160a01b038116611f2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610769565b611f3881612cf3565b50565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480611f9e57506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f0d23ecb900000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b600054610100900460ff166120c45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f3881612fef565b600054610100900460ff166121385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bf58282613063565b600054610100900460ff166121ad5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b6121b56130ce565b6121be81612cf3565b611f38613141565b600054610100900460ff166122315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f38816131ac565b60005b82518110156118635760fe54600090815260ff6020908152604080832087845290915281208451849290869085908110612279576122796147e6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055508115612307576123018382815181106122d3576122d36147e6565b60209081029190910181015160fe546000908152610100835260408082208983529093529190912090613273565b5061234c565b61234a83828151811061231c5761231c6147e6565b60209081029190910181015160fe546000908152610100835260408082208983529093529190912090613288565b505b811515838281518110612361576123616147e6565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e876040516123ad91815260200190565b60405180910390a4806123bf8161488d565b91505061223d565b600085815261019c602052604090205460ff166123f75760405163677510db60e11b815260040160405180910390fd5b6000839003612432576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461246b576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c1b576124cf85858381811061248b5761248b6147e6565b90506020020160208101906124a09190613b40565b878585858181106124b3576124b36147e6565b905060200201356040518060200160405280600081525061329d565b806124d98161488d565b91505061246e565b60008351600003612505576040516317314b6160e01b815260040160405180910390fd5b8251600003612540576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815183511461257b576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610199805490600061258c8361488d565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff19169015151781559251919291908201906125da90826146d7565b5090505060005b835181101561264c5761263a8482815181106125ff576125ff6147e6565b60200260200101516101995485848151811061261d5761261d6147e6565b60200260200101516040518060200160405280600081525061329d565b806126448161488d565b9150506125e1565b5050610199549392505050565b6001600160a01b038216612699576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108111156126d5576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b815183511461278c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b0384166128085760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b3360005b8451811015612948576000858281518110612829576128296147e6565b602002602001015190506000858381518110612847576128476147e6565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156128ee5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061292d9084906149f5565b92505081905550505050806129419061488d565b905061280c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612998929190614a08565b60405180910390a4610c1b8187878787876133cf565b60cc546001600160a01b03163314611b915760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610769565b6001600160a01b038316612a845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610769565b8051825114612afb5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b604080516020810190915260009081905233905b8351811015612c29576000848281518110612b2c57612b2c6147e6565b602002602001015190506000848381518110612b4a57612b4a6147e6565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612bf05760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610769565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612c218161488d565b915050612b0f565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612c7a929190614a08565b60405180910390a4604080516020810190915260009052611863565b600081815261019c602052604081205460ff16610797565b6000612cc260cc546001600160a01b031690565b6001600160a01b0316836001600160a01b031614905092915050565b600080612ceb84846106ef565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611bf53383836135bb565b60606000612d6a836136af565b9392505050565b6001600160a01b038216612db1576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612ded576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612e9c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b336000612ea88561370a565b90506000612eb58561370a565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015612f505760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612f8f9084906149f5565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b72848a8a8a8a8a613755565b600054610100900460ff1661305a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f3881613898565b600054610100900460ff16611e065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166131395760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611b916138a4565b600054610100900460ff16611b915760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166132175760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612d6a836001600160a01b038416613918565b6000612d6a836001600160a01b038416613967565b6001600160a01b0384166133195760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610769565b3360006133258561370a565b905060006133328561370a565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906133669084906149f5565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133c683600089898989613755565b50505050505050565b6001600160a01b0384163b15610c1b576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c819061342c9089908990889088908890600401614a36565b6020604051808303816000875af1925050508015613467575060408051601f3d908101601f1916820190925261346491810190614a94565b60015b61351c57613473614ab1565b806308c379a0036134ac5750613487614acd565b8061349257506134ae565b8060405162461bcd60e51b81526004016107699190613b14565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610769565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146133c65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b816001600160a01b0316836001600160a01b0316036136425760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561091e57602002820191906000526020600020905b8154815260200190600101908083116136eb5750505050509050919050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613744576137446147e6565b602090810291909101015292915050565b6001600160a01b0384163b15610c1b576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137b29089908990889088908890600401614b75565b6020604051808303816000875af19250505080156137ed575060408051601f3d908101601f191682019092526137ea91810190614a94565b60015b6137f957613473614ab1565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146133c65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b6067611bf582826146d7565b600054610100900460ff1661390f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611b9133612cf3565b600081815260018301602052604081205461395f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610797565b506000610797565b60008181526001830160205260408120548015613a5057600061398b600183614bad565b855490915060009061399f90600190614bad565b9050818114613a045760008660000182815481106139bf576139bf6147e6565b90600052602060002001549050808760000184815481106139e2576139e26147e6565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a1557613a15614bc0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610797565b6000915050610797565b80356001600160a01b03811681146111c557600080fd5b60008060408385031215613a8457600080fd5b613a8d83613a5a565b946020939093013593505050565b6001600160e01b031981168114611f3857600080fd5b600060208284031215613ac357600080fd5b8135612d6a81613a9b565b6000815180845260005b81811015613af457602081850181015186830182015201613ad8565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612d6a6020830184613ace565b600060208284031215613b3957600080fd5b5035919050565b600060208284031215613b5257600080fd5b612d6a82613a5a565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613b9757613b97613b5b565b6040525050565b600082601f830112613baf57600080fd5b813567ffffffffffffffff811115613bc957613bc9613b5b565b604051613be06020601f19601f8501160182613b71565b818152846020838601011115613bf557600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613c2c57613c2c613b5b565b5060051b60200190565b600082601f830112613c4757600080fd5b81356020613c5482613c12565b604051613c618282613b71565b83815260059390931b8501820192828101915086841115613c8157600080fd5b8286015b84811015613ca357613c9681613a5a565b8352918301918301613c85565b509695505050505050565b8015158114611f3857600080fd5b80356111c581613cae565b600080600080600080600080610100898b031215613ce457600080fd5b883567ffffffffffffffff80821115613cfc57600080fd5b613d088c838d01613b9e565b995060208b0135915080821115613d1e57600080fd5b613d2a8c838d01613b9e565b9850613d3860408c01613a5a565b975060608b01359650613d4d60808c01613a5a565b955060a08b0135915080821115613d6357600080fd5b50613d708b828c01613c36565b935050613d7f60c08a01613cbc565b9150613d8d60e08a01613a5a565b90509295985092959890939650565b60008083601f840112613dae57600080fd5b50813567ffffffffffffffff811115613dc657600080fd5b6020830191508360208260051b8501011115610ce757600080fd5b600080600080600060608688031215613df957600080fd5b85359450602086013567ffffffffffffffff80821115613e1857600080fd5b613e2489838a01613d9c565b90965094506040880135915080821115613e3d57600080fd5b50613e4a88828901613d9c565b969995985093965092949392505050565b600060208284031215613e6d57600080fd5b8135612d6a81613cae565b60008060408385031215613e8b57600080fd5b50508035926020909101359150565b60008083601f840112613eac57600080fd5b50813567ffffffffffffffff811115613ec457600080fd5b602083019150836020828501011115610ce757600080fd5b60008060008060008060008060a0898b031215613ef857600080fd5b883567ffffffffffffffff80821115613f1057600080fd5b613f1c8c838d01613e9a565b909a50985060208b0135915080821115613f3557600080fd5b613f418c838d01613d9c565b909850965060408b0135915080821115613f5a57600080fd5b50613f678b828c01613d9c565b9095509350613f7a905060608a01613a5a565b9150608089013590509295985092959890939650565b600082601f830112613fa157600080fd5b81356020613fae82613c12565b604051613fbb8282613b71565b83815260059390931b8501820192828101915086841115613fdb57600080fd5b8286015b84811015613ca35780358352918301918301613fdf565b600080600080600060a0868803121561400e57600080fd5b61401786613a5a565b945061402560208701613a5a565b9350604086013567ffffffffffffffff8082111561404257600080fd5b61404e89838a01613f90565b9450606088013591508082111561406457600080fd5b61407089838a01613f90565b9350608088013591508082111561408657600080fd5b5061409388828901613b9e565b9150509295509295909350565b60008060008060008060008060008060a08b8d0312156140bf57600080fd5b8a3567ffffffffffffffff808211156140d757600080fd5b6140e38e838f01613d9c565b909c509a5060208d01359150808211156140fc57600080fd5b6141088e838f01613d9c565b909a50985060408d013591508082111561412157600080fd5b61412d8e838f01613d9c565b909850965060608d013591508082111561414657600080fd5b6141528e838f01613d9c565b909650945060808d013591508082111561416b57600080fd5b506141788d828e01613d9c565b915080935050809150509295989b9194979a5092959850565b6000806000806000606086880312156141a957600080fd5b6141b286613a5a565b9450602086013567ffffffffffffffff80821115613e1857600080fd5b600080600080600080606087890312156141e857600080fd5b863567ffffffffffffffff8082111561420057600080fd5b61420c8a838b01613d9c565b9098509650602089013591508082111561422557600080fd5b6142318a838b01613d9c565b9096509450604089013591508082111561424a57600080fd5b5061425789828a01613d9c565b979a9699509497509295939492505050565b6000806000806000806060878903121561428257600080fd5b863567ffffffffffffffff8082111561429a57600080fd5b61420c8a838b01613e9a565b600080604083850312156142b957600080fd5b823567ffffffffffffffff808211156142d157600080fd5b6142dd86838701613c36565b935060208501359150808211156142f357600080fd5b5061430085828601613f90565b9150509250929050565b600081518084526020808501945080840160005b8381101561433a5781518752958201959082019060010161431e565b509495945050505050565b602081526000612d6a602083018461430a565b60008060006040848603121561436d57600080fd5b833567ffffffffffffffff81111561438457600080fd5b61439086828701613d9c565b90945092505060208401356143a481613cae565b809150509250925092565b6000806000806000606086880312156143c757600080fd5b85359450602086013567ffffffffffffffff808211156143e657600080fd5b6143f289838a01613e9a565b9096509450604088013591508082111561440b57600080fd5b50613e4a88828901613e9a565b60008060006040848603121561442d57600080fd5b83359250602084013567ffffffffffffffff81111561444b57600080fd5b61445786828701613e9a565b9497909650939450505050565b6000806040838503121561447757600080fd5b8235915061448760208401613a5a565b90509250929050565b6000806000606084860312156144a557600080fd5b833592506144b560208501613a5a565b9150604084013590509250925092565b600080604083850312156144d857600080fd5b6144e183613a5a565b915060208301356144f181613cae565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561453d5783516001600160a01b031683529284019291840191600101614518565b50909695505050505050565b60208152815115156020820152600060208301516040808401526145706060840182613ace565b949350505050565b60008060006060848603121561458d57600080fd5b83359250602084013567ffffffffffffffff8111156145ab57600080fd5b6145b786828701613c36565b92505060408401356143a481613cae565b600080604083850312156145db57600080fd5b6145e483613a5a565b915061448760208401613a5a565b600080600080600060a0868803121561460a57600080fd5b61461386613a5a565b945061462160208701613a5a565b93506040860135925060608601359150608086013567ffffffffffffffff81111561464b57600080fd5b61409388828901613b9e565b600181811c9082168061466b57607f821691505b60208210810361468b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c1a57600081815260208120601f850160051c810160208610156146b85750805b601f850160051c820191505b81811015610c1b578281556001016146c4565b815167ffffffffffffffff8111156146f1576146f1613b5b565b614705816146ff8454614657565b84614691565b602080601f83116001811461473a57600084156147225750858301515b600019600386901b1c1916600185901b178555610c1b565b600085815260208120601f198616915b828110156147695788860151825594840194600190910190840161474a565b50858210156147875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000826147ca57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761079757610797614797565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261481357600080fd5b83018035915067ffffffffffffffff82111561482e57600080fd5b602001915036819003821315610ce757600080fd5b6000808335601e1984360301811261485a57600080fd5b83018035915067ffffffffffffffff82111561487557600080fd5b6020019150600581901b3603821315610ce757600080fd5b600060001982036148a0576148a0614797565b5060010190565b6000602082840312156148b957600080fd5b8151612d6a81613cae565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6040815260006149036040830186886148c4565b82810360208401526149168185876148c4565b979650505050505050565b67ffffffffffffffff83111561493957614939613b5b565b61494d836149478354614657565b83614691565b6000601f84116001811461498157600085156149695750838201355b600019600387901b1c1916600186901b178355610ed6565b600083815260209020601f19861690835b828110156149b25786850135825560209485019460019092019101614992565b50868210156149cf5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006145706020830184866148c4565b8082018082111561079757610797614797565b604081526000614a1b604083018561430a565b8281036020840152614a2d818561430a565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a6260a083018661430a565b8281036060840152614a74818661430a565b90508281036080840152614a888185613ace565b98975050505050505050565b600060208284031215614aa657600080fd5b8151612d6a81613a9b565b600060033d1115614aca5760046000803e5060005160e01c5b90565b600060443d1015614adb5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614b2957505050505090565b8285019150815181811115614b415750505050505090565b843d8701016020828501011115614b5b5750505050505090565b614b6a60208286010187613b71565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261491660a0830184613ace565b8181038181111561079757610797614797565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207f27652eaa992f3bab32f8d7465310c68264309b9221e1992b220301ebfc7f7c64736f6c63430008110033

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

0000000000000000000000000000000000000000000000000000000000000001

-----Decoded View---------------
Arg [0] : disable (bool): True

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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