ETH Price: $3,339.33 (-1.05%)

Token

Dava (DAVA)
 

Overview

Max Total Supply

0 DAVA

Holders

1,526

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 DAVA
0x688576371e9e54186658db78172d5b403f811824
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Dava

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 33 : Dava.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {UpgradeableBeacon} from "./libraries/UpgradeableBeacon.sol";
import {MinimalProxy} from "./libraries/MinimalProxy.sol";
import {GatewayHandler} from "./libraries/GatewayHandler.sol";
import {Part, IAvatar} from "./interfaces/IAvatar.sol";
import {IFrameCollection} from "./interfaces/IFrameCollection.sol";
import {IPartCollection} from "./interfaces/IPartCollection.sol";
import {IDava} from "./interfaces/IDava.sol";
import {IGatewayHandler} from "./interfaces/IGatewayHandler.sol";

contract Dava is IDava, Ownable, UpgradeableBeacon, AccessControl, ERC721 {
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.Bytes32Set;
    using Clones for address;

    bytes32 public constant DAVA_GATEWAY_KEY = keccak256("DAVA_GATEWAY");

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

    address public override frameCollection;

    EnumerableSet.AddressSet private _registeredCollections;
    EnumerableSet.Bytes32Set private _supportedCategories;
    address private _minimalProxy;
    IGatewayHandler public gatewayHandler;

    uint48 public constant MAX_SUPPLY = 10000;

    event CollectionRegistered(address collection);
    event CollectionDeregistered(address collection);
    event DefaultCollectionRegistered(address collection);
    event CategoryRegistered(bytes32 categoryId);
    event CategoryDeregistered(bytes32 categoryId);

    // DAO contract owns this registry
    constructor(address minimalProxy_, IGatewayHandler gatewayHandler_)
        ERC721("Dava", "DAVA")
        UpgradeableBeacon(minimalProxy_)
        Ownable()
    {
        _minimalProxy = minimalProxy_;
        gatewayHandler = gatewayHandler_;

        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(MINTER_ROLE, msg.sender);
        _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE);
        _setupRole(PART_MANAGER_ROLE, msg.sender);
        _setRoleAdmin(PART_MANAGER_ROLE, DEFAULT_ADMIN_ROLE);
        _setupRole(UPGRADE_MANAGER_ROLE, msg.sender);
        _setRoleAdmin(UPGRADE_MANAGER_ROLE, DEFAULT_ADMIN_ROLE);
    }

    function baseURI() external view override returns (string memory) {
        return gatewayHandler.gateways(DAVA_GATEWAY_KEY);
    }

    function upgradeTo(address newImplementation)
        external
        onlyRole(UPGRADE_MANAGER_ROLE)
    {
        _upgradeTo(newImplementation);
    }

    function mint(address to, uint256 id)
        external
        override
        onlyRole(MINTER_ROLE)
        returns (address)
    {
        require(id < uint256(MAX_SUPPLY), "Dava: Invalid id");
        return _mintWithProxy(to, id);
    }

    function registerCollection(address collection)
        external
        override
        onlyRole(PART_MANAGER_ROLE)
    {
        require(
            IERC165(collection).supportsInterface(
                type(IPartCollection).interfaceId
            ),
            "Dava: Does not support IPartCollection interface"
        );
        require(
            !_registeredCollections.contains(collection),
            "Dava: already registered collection"
        );
        _registeredCollections.add(collection);

        emit CollectionRegistered(collection);
    }

    function registerCategory(bytes32 categoryId)
        external
        override
        onlyRole(PART_MANAGER_ROLE)
    {
        require(
            !_supportedCategories.contains(categoryId),
            "Dava: category is already registered"
        );
        _supportedCategories.add(categoryId);

        emit CategoryRegistered(categoryId);
    }

    function registerFrameCollection(address collection)
        external
        override
        onlyRole(PART_MANAGER_ROLE)
    {
        require(
            IERC165(collection).supportsInterface(
                type(IFrameCollection).interfaceId
            ),
            "Dava: Does not support IFrameCollection interface"
        );

        frameCollection = collection;

        emit DefaultCollectionRegistered(collection);
    }

    function deregisterCollection(address collection)
        external
        override
        onlyRole(PART_MANAGER_ROLE)
    {
        require(
            _registeredCollections.contains(collection),
            "Dava: Not registered collection"
        );

        _registeredCollections.remove(collection);

        emit CollectionDeregistered(collection);
    }

    function deregisterCategory(bytes32 categoryId)
        external
        override
        onlyRole(PART_MANAGER_ROLE)
    {
        require(
            _supportedCategories.contains(categoryId),
            "Dava: non registered category"
        );
        _supportedCategories.remove(categoryId);

        emit CategoryDeregistered(categoryId);
    }

    function zap(
        uint256 tokenId,
        Part[] calldata partsOn,
        bytes32[] calldata partsOff
    ) external override {
        require(
            msg.sender == ownerOf(tokenId),
            "Dava: msg.sender is not the owner of avatar"
        );
        address avatarAddress = getAvatar(tokenId);
        IAvatar avatar = IAvatar(avatarAddress);
        for (uint256 i = 0; i < partsOff.length; i += 1) {
            Part memory equippedPart = avatar.part(partsOff[i]);
            IERC1155 collection = IERC1155(equippedPart.collection);
            if (
                equippedPart.collection != address(0x0) &&
                collection.balanceOf(avatarAddress, equippedPart.id) > 0
            ) {
                collection.safeTransferFrom(
                    avatarAddress,
                    msg.sender,
                    equippedPart.id,
                    1,
                    ""
                );
            }
        }

        for (uint256 i = 0; i < partsOn.length; i += 1) {
            IERC1155 collection = IERC1155(partsOn[i].collection);
            require(
                collection.supportsInterface(type(IERC1155).interfaceId),
                "Dava: collection is not an erc1155 format"
            );
            require(
                collection.balanceOf(msg.sender, partsOn[i].id) >= 1,
                "Dava: owner does not hold the part"
            );
            collection.safeTransferFrom(
                msg.sender,
                avatarAddress,
                partsOn[i].id,
                1,
                ""
            );
        }

        IAvatar(getAvatar(tokenId)).dress(partsOn, partsOff);
    }

    function isRegisteredCollection(address collection)
        external
        view
        override
        returns (bool)
    {
        return _registeredCollections.contains(collection);
    }

    function isSupportedCategory(bytes32 categoryId)
        external
        view
        override
        returns (bool)
    {
        return _supportedCategories.contains(categoryId);
    }

    function isDavaPart(address collection, bytes32 categoryId)
        external
        view
        override
        returns (bool)
    {
        return
            _registeredCollections.contains(collection) &&
            _supportedCategories.contains(categoryId);
    }

    function getAvatar(uint256 tokenId) public view override returns (address) {
        return
            _minimalProxy.predictDeterministicAddress(
                bytes32(tokenId),
                address(this)
            );
    }

    function getAllSupportedCategories()
        external
        view
        override
        returns (bytes32[] memory categoryIds)
    {
        return _supportedCategories.values();
    }

    function getRegisteredCollections()
        external
        view
        override
        returns (address[] memory)
    {
        return _registeredCollections.values();
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override
        returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        return IAvatar(getAvatar(tokenId)).getMetadata();
    }

    function getPFP(uint256 tokenId)
        external
        view
        override
        returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        return IAvatar(getAvatar(tokenId)).getPFP();
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(IERC165, AccessControl, ERC721)
        returns (bool)
    {
        return
            interfaceId == type(IDava).interfaceId ||
            interfaceId == type(IAccessControl).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function _mintWithProxy(address to, uint256 id) internal returns (address) {
        address avatar = _minimalProxy.cloneDeterministic(bytes32(id));
        MinimalProxy(payable(avatar)).initialize(id);
        super._mint(to, id);
        return avatar;
    }
}

File 2 of 33 : Clones.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create(0, ptr, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create2(0, ptr, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), salt)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt)
        internal
        view
        returns (address predicted)
    {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}

File 3 of 33 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 33 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 33 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 6 of 33 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 7 of 33 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 8 of 33 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 9 of 33 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }
}

File 10 of 33 : UpgradeableBeacon.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/**
 * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their
 * implementation contract, which is where they will delegate all function calls.
 *
 * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.
 */
contract UpgradeableBeacon is IBeacon {
    address private _implementation;

    /**
     * @dev Emitted when the implementation returned by the beacon is changed.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the
     * beacon.
     */
    constructor(address implementation_) {
        _setImplementation(implementation_);
    }

    /**
     * @dev Returns the current implementation address.
     */
    function implementation() public view virtual override returns (address) {
        return _implementation;
    }

    /**
     * @dev Upgrades the beacon to a new implementation.
     *
     * Emits an {Upgraded} event.
     *
     * Requirements:
     *
     * - msg.sender must be the owner of the contract.
     * - `newImplementation` must be a contract.
     */
    function _upgradeTo(address newImplementation) internal virtual {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Sets the implementation contract address for this beacon
     *
     * Requirements:
     *
     * - `newImplementation` must be a contract.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");
        _implementation = newImplementation;
    }
}

File 11 of 33 : MinimalProxy.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol";
import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol";
import {IBeacon} from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
import {ERC1967Upgrade} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";
import {Part} from "../interfaces/IAvatar.sol";

struct Props {
    uint256 davaId;
    mapping(bytes32 => Part) parts;
}

contract MinimalProxy is Initializable, Proxy, ERC1967Upgrade {
    bytes32 internal constant DAVA_CONTRACT_SLOT =
        bytes32(uint256(keccak256("dava.contract")) - 1);
    bytes32 internal constant PROPS_SLOT =
        bytes32(uint256(keccak256("dava.props.v1")) - 1);

    function initialize(uint256 davaId_) public virtual initializer {
        _upgradeBeaconToAndCall(msg.sender, "", false);
        StorageSlot.getAddressSlot(DAVA_CONTRACT_SLOT).value = msg.sender;
        _props().davaId = davaId_;
    }

    function _props() internal pure virtual returns (Props storage r) {
        bytes32 slot = PROPS_SLOT;
        assembly {
            r.slot := slot
        }
    }

    // See openzeppelin's BeaconProxy.sol

    function _beacon() internal view virtual returns (address) {
        return _getBeacon();
    }

    function _implementation()
        internal
        view
        virtual
        override
        returns (address)
    {
        return IBeacon(_getBeacon()).implementation();
    }

    function _setBeacon(address beacon, bytes memory data) internal virtual {
        _upgradeBeaconToAndCall(beacon, data, false);
    }
}

File 12 of 33 : GatewayHandler.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;

import {IGatewayHandler} from "../interfaces/IGatewayHandler.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract GatewayHandler is IGatewayHandler, Ownable {
    mapping(bytes32 => string) public override gateways;

    function setGateway(bytes32 key_, string calldata gateway_)
        external
        override
        onlyOwner
    {
        gateways[key_] = gateway_;
    }
}

File 13 of 33 : IAvatar.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

struct Part {
    address collection;
    uint96 id;
}

interface IAvatar {
    function dress(Part[] calldata partsOn, bytes32[] calldata partsOff)
        external;

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

    function dava() external view returns (address);

    function davaId() external view returns (uint256);

    function part(bytes32 categoryId) external view returns (Part memory);

    function allParts() external view returns (Part[] memory parts);

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

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

    function externalImgUri() external view returns (string memory);
}

File 14 of 33 : IFrameCollection.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";

interface IFrameCollection is IERC165 {
    struct Frame {
        uint256 zIndex;
        string ipfsHash;
    }

    struct FrameWithUri {
        uint256 id;
        string ipfsHash;
        string imgUri;
        uint256 zIndex;
    }

    function frameOf(uint256 frameId)
        external
        view
        returns (FrameWithUri memory);

    function getAllFrames() external view returns (FrameWithUri[] memory);

    function totalFrames() external view returns (uint256);
}

File 15 of 33 : IPartCollection.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

import {IERC1155} from "@openzeppelin/contracts/interfaces/IERC1155.sol";

interface IPartCollection is IERC1155 {
    struct Attribute {
        string trait_type;
        string value;
    }

    function createPart(
        bytes32 categoryId_,
        string memory title_,
        string memory description_,
        string memory ipfsHash_,
        Attribute[] memory attributes_,
        uint256 maxSupply_
    ) external;

    function createCategory(
        string memory title_,
        uint256 backgroundImageTokenId_,
        uint256 foregroundImageTokenId_,
        uint256 zIndex_
    ) external;

    function dava() external view returns (address);

    function numberOfParts() external view returns (uint256);

    function description(uint256 tokenId) external view returns (string memory);

    function imageUri(uint256 tokenId_) external view returns (string memory);

    function zIndex(uint256 tokenId_) external view returns (uint256);

    function categoryInfo(bytes32 categoryId_)
        external
        view
        returns (
            string memory name_,
            uint256 backgroundImgTokenId_,
            uint256 foregroundImgTokenId_,
            uint256 zIndex_
        );

    function categoryId(uint256 tokenId_) external view returns (bytes32);

    function categoryTitle(uint256 tokenId_)
        external
        view
        returns (string memory);

    function partTitle(uint256 tokenId_) external view returns (string memory);

    function image(uint256 tokenId_) external view returns (string memory);

    function maxSupply(uint256 tokenId_) external view returns (uint256);
}

File 16 of 33 : IDava.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

import {IERC721} from "@openzeppelin/contracts/interfaces/IERC721.sol";
import {IHost} from "../interfaces/IHost.sol";
import {Part} from "../interfaces/IAvatar.sol";

interface IDava is IERC721, IHost {
    function mint(address to, uint256 id) external returns (address);

    function registerCollection(address collection) external;

    function registerCategory(bytes32 categoryId) external;

    function registerFrameCollection(address collection) external;

    function deregisterCollection(address collection) external;

    function deregisterCategory(bytes32 categoryId) external;

    function zap(
        uint256 tokenId,
        Part[] calldata partsOn,
        bytes32[] calldata partsOff
    ) external;

    function frameCollection() external view returns (address);

    function isRegisteredCollection(address collection)
        external
        view
        returns (bool);

    function isSupportedCategory(bytes32 categoryId)
        external
        view
        returns (bool);

    function isDavaPart(address collection, bytes32 categoryId)
        external
        view
        returns (bool);

    function getAvatar(uint256 id) external view returns (address);

    function getAllSupportedCategories()
        external
        view
        returns (bytes32[] memory);

    function getRegisteredCollections()
        external
        view
        returns (address[] memory);

    function getPFP(uint256 id) external view returns (string memory);
}

File 17 of 33 : IGatewayHandler.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;

interface IGatewayHandler {
    function setGateway(bytes32 key_, string calldata gateway_) external;

    function gateways(bytes32 key_) external view returns (string memory);
}

File 18 of 33 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 19 of 33 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

File 20 of 33 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 21 of 33 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

File 22 of 33 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 23 of 33 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 24 of 33 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 25 of 33 : IBeacon.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 26 of 33 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

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

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

        _;

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

File 27 of 33 : StorageSlot.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 28 of 33 : Proxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overriden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

File 29 of 33 : ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967Upgrade {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            Address.functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

File 30 of 33 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 31 of 33 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../token/ERC1155/IERC1155.sol";

File 32 of 33 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 33 of 33 : IHost.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
pragma abicoder v2;

interface IHost {
    function baseURI() external view returns (string memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"minimalProxy_","type":"address"},{"internalType":"contract IGatewayHandler","name":"gatewayHandler_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"CategoryDeregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"CategoryRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"CollectionDeregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"CollectionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"DefaultCollectionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DAVA_GATEWAY_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PART_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"deregisterCategory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"deregisterCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"frameCollection","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gatewayHandler","outputs":[{"internalType":"contract IGatewayHandler","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllSupportedCategories","outputs":[{"internalType":"bytes32[]","name":"categoryIds","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getAvatar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPFP","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRegisteredCollections","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"isDavaPart","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"isRegisteredCollection","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"isSupportedCategory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"mint","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"categoryId","type":"bytes32"}],"name":"registerCategory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"registerCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"registerFrameCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint96","name":"id","type":"uint96"}],"internalType":"struct Part[]","name":"partsOn","type":"tuple[]"},{"internalType":"bytes32[]","name":"partsOff","type":"bytes32[]"}],"name":"zap","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200384f3803806200384f83398101604081905262000034916200045b565b604051806040016040528060048152602001634461766160e01b815250604051806040016040528060048152602001634441564160e01b815250836200008962000083620001ad60201b60201c565b620001b1565b620000948162000201565b508151620000aa906003906020850190620003b5565b508051620000c0906004906020840190620003b5565b5050600e80546001600160a01b038086166001600160a01b031992831617909255600f8054928516929091169190911790555062000100600033620002b0565b6200011b6000805160206200382f83398151915233620002b0565b620001376000805160206200382f8339815191526000620002c0565b620001526000805160206200380f83398151915233620002b0565b6200016e6000805160206200380f8339815191526000620002c0565b62000189600080516020620037ef83398151915233620002b0565b620001a5600080516020620037ef8339815191526000620002c0565b5050620004ef565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b62000217816200030b60201b62001bd21760201c565b6200028e5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b620002bc828262000311565b5050565b600082815260026020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b3b151590565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16620002bc5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003713390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b828054620003c39062000499565b90600052602060002090601f016020900481019282620003e7576000855562000432565b82601f106200040257805160ff191683800117855562000432565b8280016001018555821562000432579182015b828111156200043257825182559160200191906001019062000415565b506200044092915062000444565b5090565b5b8082111562000440576000815560010162000445565b600080604083850312156200046e578182fd5b82516200047b81620004d6565b60208401519092506200048e81620004d6565b809150509250929050565b600181811c90821680620004ae57607f821691505b60208210811415620004d057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0381168114620004ec57600080fd5b50565b6132f080620004ff6000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80636f7994411161015c578063bde909df116100ce578063d547741f11610087578063d547741f146105f5578063dcf3c4be14610608578063e985e9c51461061b578063ebf26f2c14610657578063f2fde38b1461066a578063f91fe6bf1461067d57600080fd5b8063bde909df1461056d578063bff25d1314610582578063c553825c14610595578063c87b56dd146105a8578063ca123b2d146105bb578063d5391393146105ce57600080fd5b806391d148541161012057806391d148541461050f578063957b4c381461052257806395d89b4114610537578063a217fddf1461053f578063a22cb46514610547578063b88d4fde1461055a57600080fd5b80636f799441146104bd57806370a08231146104d0578063715018a6146104e35780637d4da9a7146104eb5780638da5cb5b146104fe57600080fd5b806332cb6b0c1161020057806343ffa64e116101b957806343ffa64e1461044257806356c617921461046957806356f035501461047c5780635c60da1b146104915780636352211e146104a25780636c0360eb146104b557600080fd5b806332cb6b0c146103c357806336568abe146103e35780633659cfe6146103f657806340c10f191461040957806341c405761461041c57806342842e0e1461042f57600080fd5b80631328ec9b116102525780631328ec9b146103415780631ddb946d1461035457806323b872dd14610367578063248a9ca31461037a5780632f2ff15d1461039d5780633000186b146103b057600080fd5b806301ffc9a71461028f57806306fdde03146102b7578063081812fc146102cc578063095ea7b3146102f75780630a323bea1461030c575b600080fd5b6102a261029d366004612bd2565b610690565b60405190151581526020015b60405180910390f35b6102bf6106d6565b6040516102ae9190612ff6565b6102df6102da366004612b96565b610768565b6040516001600160a01b0390911681526020016102ae565b61030a610305366004612b4f565b610802565b005b6103337f4bcafa307edced29184180ecf3a3ef99cd92e9f26df7c14cbec7a5c02db836f581565b6040519081526020016102ae565b6102df61034f366004612b96565b610918565b6102a2610362366004612b96565b61098b565b61030a610375366004612a3b565b610998565b610333610388366004612b96565b60009081526002602052604090206001015490565b61030a6103ab366004612bae565b6109c9565b6102a26103be3660046129e7565b6109ef565b6103cc61271081565b60405165ffffffffffff90911681526020016102ae565b61030a6103f1366004612bae565b6109fc565b61030a6104043660046129e7565b610a7a565b6102df610417366004612b4f565b610aae565b61030a61042a3660046129e7565b610b31565b61030a61043d366004612a3b565b610cde565b6103337fa76ace73a908083d89af9ff88e5b4f7cadb3591a80631063f68b695fda726db581565b61030a6104773660046129e7565b610cf9565b610484610e44565b6040516102ae9190612f20565b6001546001600160a01b03166102df565b6102df6104b0366004612b96565b610e55565b6102bf610ecc565b61030a6104cb3660046129e7565b610f6c565b6103336104de3660046129e7565b611021565b61030a6110a8565b61030a6104f9366004612cf3565b61110e565b6000546001600160a01b03166102df565b6102a261051d366004612bae565b6116e7565b61033360008051602061329b83398151915281565b6102bf611712565b610333600081565b61030a610555366004612b22565b611721565b61030a610568366004612a7b565b6117e6565b61057561181e565b6040516102ae9190612ed3565b6009546102df906001600160a01b031681565b6102a26105a3366004612b4f565b61182a565b6102bf6105b6366004612b96565b611850565b61030a6105c9366004612b96565b611904565b6103337f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61030a610603366004612bae565b6119b0565b6102bf610616366004612b96565b6119d6565b6102a2610629366004612a03565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61030a610665366004612b96565b611a4e565b61030a6106783660046129e7565b611b07565b600f546102df906001600160a01b031681565b60006001600160e01b031982166317af33f960e01b14806106c157506001600160e01b03198216637965db0b60e01b145b806106d057506106d082611bd8565b92915050565b6060600380546106e5906131e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610711906131e5565b801561075e5780601f106107335761010080835404028352916020019161075e565b820191906000526020600020905b81548152906001019060200180831161074157829003601f168201915b5050505050905090565b6000818152600560205260408120546001600160a01b03166107e65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061080d82610e55565b9050806001600160a01b0316836001600160a01b0316141561087b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107dd565b336001600160a01b038216148061089757506108978133610629565b6109095760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107dd565b6109138383611c18565b505050565b600e546000906106d0906001600160a01b03168330604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606093841b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b6028820152921b6038830152604c8201526037808220606c830152605591012090565b60006106d0600c83611c86565b6109a23382611c9e565b6109be5760405162461bcd60e51b81526004016107dd906130aa565b610913838383611d91565b6000828152600260205260409020600101546109e58133611f31565b6109138383611f95565b60006106d0600a8361201b565b6001600160a01b0381163314610a6c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107dd565b610a76828261203d565b5050565b7fa76ace73a908083d89af9ff88e5b4f7cadb3591a80631063f68b695fda726db5610aa58133611f31565b610a76826120a4565b60007f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610adb8133611f31565b6127108310610b1f5760405162461bcd60e51b815260206004820152601060248201526f11185d984e88125b9d985b1a59081a5960821b60448201526064016107dd565b610b2984846120e4565b949350505050565b60008051602061329b833981519152610b4a8133611f31565b6040516301ffc9a760e01b815263a3a3de6b60e01b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc89190612b7a565b610c2d5760405162461bcd60e51b815260206004820152603060248201527f446176613a20446f6573206e6f7420737570706f7274204950617274436f6c6c60448201526f656374696f6e20696e7465726661636560801b60648201526084016107dd565b610c38600a8361201b565b15610c915760405162461bcd60e51b815260206004820152602360248201527f446176613a20616c7265616479207265676973746572656420636f6c6c65637460448201526234b7b760e91b60648201526084016107dd565b610c9c600a83612166565b506040516001600160a01b03831681527ffb99393fd31547f4a765604f2c2d122ce8ccb313edeef8b951130d8bcca866e9906020015b60405180910390a15050565b610913838383604051806020016040528060008152506117e6565b60008051602061329b833981519152610d128133611f31565b6040516301ffc9a760e01b815263641cb2cf60e01b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015610d5857600080fd5b505afa158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d909190612b7a565b610df65760405162461bcd60e51b815260206004820152603160248201527f446176613a20446f6573206e6f7420737570706f727420494672616d65436f6c6044820152706c656374696f6e20696e7465726661636560781b60648201526084016107dd565b600980546001600160a01b0319166001600160a01b0384169081179091556040519081527f97ed937116d4d2193376f807f2264376bd5f2f343dfabde1a91bb290030c52bd90602001610cd2565b6060610e50600c61217b565b905090565b6000818152600560205260408120546001600160a01b0316806106d05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107dd565b600f5460405163fbe336ff60e01b81527f4bcafa307edced29184180ecf3a3ef99cd92e9f26df7c14cbec7a5c02db836f560048201526060916001600160a01b03169063fbe336ff9060240160006040518083038186803b158015610f3057600080fd5b505afa158015610f44573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e509190810190612c0a565b60008051602061329b833981519152610f858133611f31565b610f90600a8361201b565b610fdc5760405162461bcd60e51b815260206004820152601f60248201527f446176613a204e6f74207265676973746572656420636f6c6c656374696f6e0060448201526064016107dd565b610fe7600a83612186565b506040516001600160a01b03831681527ff7dcc61d36be3d19f4edbadd9dd8824cf42d8b95a135c8aeca4eb6f160f7a08690602001610cd2565b60006001600160a01b03821661108c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107dd565b506001600160a01b031660009081526006602052604090205490565b6000546001600160a01b031633146111025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107dd565b61110c600061219b565b565b61111785610e55565b6001600160a01b0316336001600160a01b03161461118b5760405162461bcd60e51b815260206004820152602b60248201527f446176613a206d73672e73656e646572206973206e6f7420746865206f776e6560448201526a391037b31030bb30ba30b960a91b60648201526084016107dd565b600061119686610918565b90508060005b83811015611376576000826001600160a01b0316637281a0398787858181106111d557634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016111fa91815260200190565b604080518083038186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112499190612c7d565b80519091506001600160a01b038116158015906112f257506020820151604051627eeac760e11b81526001600160a01b0387811660048301526001600160601b03909216602482015260009183169062fdd58e9060440160206040518083038186803b1580156112b857600080fd5b505afa1580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f09190612cdb565b115b15611361576020820151604051637921219560e11b81526001600160a01b0383169163f242432a9161132e918991339190600190600401612e92565b600060405180830381600087803b15801561134857600080fd5b505af115801561135c573d6000803e3d6000fd5b505050505b5061136f9050600182613154565b905061119c565b5060005b858110156116715760008787838181106113a457634e487b7160e01b600052603260045260246000fd5b6113ba92602060409092020190810191506129e7565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201529091506001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561140357600080fd5b505afa158015611417573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143b9190612b7a565b6114995760405162461bcd60e51b815260206004820152602960248201527f446176613a20636f6c6c656374696f6e206973206e6f7420616e2065726331316044820152680d4d48199bdc9b585d60ba1b60648201526084016107dd565b6001816001600160a01b031662fdd58e338b8b878181106114ca57634e487b7160e01b600052603260045260246000fd5b90506040020160200160208101906114e29190612d98565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526001600160601b0316602482015260440160206040518083038186803b15801561152f57600080fd5b505afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115679190612cdb565b10156115c05760405162461bcd60e51b815260206004820152602260248201527f446176613a206f776e657220646f6573206e6f7420686f6c64207468652070616044820152611c9d60f21b60648201526084016107dd565b806001600160a01b031663f242432a33868b8b878181106115f157634e487b7160e01b600052603260045260246000fd5b90506040020160200160208101906116099190612d98565b60016040518563ffffffff1660e01b815260040161162a9493929190612e92565b600060405180830381600087803b15801561164457600080fd5b505af1158015611658573d6000803e3d6000fd5b505050505060018161166a9190613154565b905061137a565b5061167b87610918565b6001600160a01b031663867cee71878787876040518563ffffffff1660e01b81526004016116ac9493929190612f58565b600060405180830381600087803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b5050505050505050505050565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106e5906131e5565b6001600160a01b03821633141561177a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107dd565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6117f03383611c9e565b61180c5760405162461bcd60e51b81526004016107dd906130aa565b611818848484846121eb565b50505050565b6060610e50600a61221e565b6000611837600a8461201b565b80156118495750611849600c83611c86565b9392505050565b6000818152600560205260409020546060906001600160a01b03166118875760405162461bcd60e51b81526004016107dd9061305b565b61189082610918565b6001600160a01b0316637a5b4f596040518163ffffffff1660e01b815260040160006040518083038186803b1580156118c857600080fd5b505afa1580156118dc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106d09190810190612c0a565b60008051602061329b83398151915261191d8133611f31565b611928600c83611c86565b6119745760405162461bcd60e51b815260206004820152601d60248201527f446176613a206e6f6e20726567697374657265642063617465676f727900000060448201526064016107dd565b61197f600c8361222b565b506040518281527f35ade638434aa66cd59ce09d433fe9a1cf77d3666b3bbde63c76771ec048357990602001610cd2565b6000828152600260205260409020600101546119cc8133611f31565b610913838361203d565b6000818152600560205260409020546060906001600160a01b0316611a0d5760405162461bcd60e51b81526004016107dd9061305b565b611a1682610918565b6001600160a01b03166346d227e86040518163ffffffff1660e01b815260040160006040518083038186803b1580156118c857600080fd5b60008051602061329b833981519152611a678133611f31565b611a72600c83611c86565b15611acb5760405162461bcd60e51b8152602060048201526024808201527f446176613a2063617465676f727920697320616c726561647920726567697374604482015263195c995960e21b60648201526084016107dd565b611ad6600c83612237565b506040518281527f0c5febd4c62522dc83ff4b05f4d9a6d3ad6102ae57917397e05cccabd1aa60ee90602001610cd2565b6000546001600160a01b03163314611b615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107dd565b6001600160a01b038116611bc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107dd565b611bcf8161219b565b50565b3b151590565b60006001600160e01b031982166380ac58cd60e01b1480611c0957506001600160e01b03198216635b5e139f60e01b145b806106d057506106d082612243565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c4d82610e55565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526001830160205260408120541515611849565b6000818152600560205260408120546001600160a01b0316611d175760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107dd565b6000611d2283610e55565b9050806001600160a01b0316846001600160a01b03161480611d5d5750836001600160a01b0316611d5284610768565b6001600160a01b0316145b80610b2957506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff16610b29565b826001600160a01b0316611da482610e55565b6001600160a01b031614611e0c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107dd565b6001600160a01b038216611e6e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107dd565b611e79600082611c18565b6001600160a01b0383166000908152600660205260408120805460019290611ea290849061318b565b90915550506001600160a01b0382166000908152600660205260408120805460019290611ed0908490613154565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611f3b82826116e7565b610a7657611f53816001600160a01b03166014612278565b611f5e836020612278565b604051602001611f6f929190612de0565b60408051601f198184030181529082905262461bcd60e51b82526107dd91600401612ff6565b611f9f82826116e7565b610a765760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fd73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811660009081526001830160205260408120541515611849565b61204782826116e7565b15610a765760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6120ad8161245a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600e5460009081906120ff906001600160a01b0316846124e6565b60405163fe4b84df60e01b8152600481018590529091506001600160a01b0382169063fe4b84df90602401600060405180830381600087803b15801561214457600080fd5b505af1158015612158573d6000803e3d6000fd5b505050506118498484612586565b6000611849836001600160a01b0384166126c8565b60606106d082612717565b6000611849836001600160a01b038416612773565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6121f6848484611d91565b61220284848484612890565b6118185760405162461bcd60e51b81526004016107dd90613009565b6060600061184983612717565b60006118498383612773565b600061184983836126c8565b60006001600160e01b03198216637965db0b60e01b14806106d057506301ffc9a760e01b6001600160e01b03198316146106d0565b6060600061228783600261316c565b612292906002613154565b67ffffffffffffffff8111156122b857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122e2576020820181803683370190505b509050600360fc1b8160008151811061230b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061234857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061236c84600261316c565b612377906001613154565b90505b600181111561240b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106123b957634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106123dd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612404816131ce565b905061237a565b5083156118495760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107dd565b803b6124c45760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016107dd565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b0381166106d05760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016107dd565b6001600160a01b0382166125dc5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107dd565b6000818152600560205260409020546001600160a01b0316156126415760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107dd565b6001600160a01b038216600090815260066020526040812080546001929061266a908490613154565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260018301602052604081205461270f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106d0565b5060006106d0565b60608160000180548060200260200160405190810160405280929190818152602001828054801561276757602002820191906000526020600020905b815481526020019060010190808311612753575b50505050509050919050565b6000818152600183016020526040812054801561288657600061279760018361318b565b85549091506000906127ab9060019061318b565b905081811461282c5760008660000182815481106127d957634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061280a57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061284b57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106d0565b60009150506106d0565b60006001600160a01b0384163b1561299257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128d4903390899088908890600401612e55565b602060405180830381600087803b1580156128ee57600080fd5b505af192505050801561291e575060408051601f3d908101601f1916820190925261291b91810190612bee565b60015b612978573d80801561294c576040519150601f19603f3d011682016040523d82523d6000602084013e612951565b606091505b5080516129705760405162461bcd60e51b81526004016107dd90613009565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610b29565b506001949350505050565b60008083601f8401126129ae578182fd5b50813567ffffffffffffffff8111156129c5578182fd5b6020830191508360208260051b85010111156129e057600080fd5b9250929050565b6000602082840312156129f8578081fd5b81356118498161324c565b60008060408385031215612a15578081fd5b8235612a208161324c565b91506020830135612a308161324c565b809150509250929050565b600080600060608486031215612a4f578081fd5b8335612a5a8161324c565b92506020840135612a6a8161324c565b929592945050506040919091013590565b60008060008060808587031215612a90578081fd5b8435612a9b8161324c565b93506020850135612aab8161324c565b925060408501359150606085013567ffffffffffffffff811115612acd578182fd5b8501601f81018713612add578182fd5b8035612af0612aeb8261312c565b6130fb565b818152886020838501011115612b04578384fd5b81602084016020830137908101602001929092525092959194509250565b60008060408385031215612b34578182fd5b8235612b3f8161324c565b91506020830135612a3081613261565b60008060408385031215612b61578182fd5b8235612b6c8161324c565b946020939093013593505050565b600060208284031215612b8b578081fd5b815161184981613261565b600060208284031215612ba7578081fd5b5035919050565b60008060408385031215612bc0578182fd5b823591506020830135612a308161324c565b600060208284031215612be3578081fd5b81356118498161326f565b600060208284031215612bff578081fd5b81516118498161326f565b600060208284031215612c1b578081fd5b815167ffffffffffffffff811115612c31578182fd5b8201601f81018413612c41578182fd5b8051612c4f612aeb8261312c565b818152856020838501011115612c63578384fd5b612c748260208301602086016131a2565b95945050505050565b600060408284031215612c8e578081fd5b6040516040810181811067ffffffffffffffff82111715612cb157612cb1613236565b6040528251612cbf8161324c565b81526020830151612ccf81613285565b60208201529392505050565b600060208284031215612cec578081fd5b5051919050565b600080600080600060608688031215612d0a578283fd5b85359450602086013567ffffffffffffffff80821115612d28578485fd5b818801915088601f830112612d3b578485fd5b813581811115612d49578586fd5b8960208260061b8501011115612d5d578586fd5b602083019650809550506040880135915080821115612d7a578283fd5b50612d878882890161299d565b969995985093965092949392505050565b600060208284031215612da9578081fd5b813561184981613285565b60008151808452612dcc8160208601602086016131a2565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612e188160178501602088016131a2565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612e498160288401602088016131a2565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e8890830184612db4565b9695505050505050565b6001600160a01b0394851681529290931660208301526001600160601b03166040820152606081019190915260a06080820181905260009082015260c00190565b6020808252825182820181905260009190848201906040850190845b81811015612f145783516001600160a01b031683529284019291840191600101612eef565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612f1457835183529284019291840191600101612f3c565b60408082528181018590526000908660608401835b88811015612fb7578235612f808161324c565b6001600160a01b03168252602083810135612f9a81613285565b6001600160601b0316908301529183019190830190600101612f6d565b5084810360208601528581526001600160fb1b03861115612fd6578384fd5b8560051b9250828760208301379091016020019182525095945050505050565b6020815260006118496020830184612db4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561312457613124613236565b604052919050565b600067ffffffffffffffff82111561314657613146613236565b50601f01601f191660200190565b6000821982111561316757613167613220565b500190565b600081600019048311821515161561318657613186613220565b500290565b60008282101561319d5761319d613220565b500390565b60005b838110156131bd5781810151838201526020016131a5565b838111156118185750506000910152565b6000816131dd576131dd613220565b506000190190565b600181811c908216806131f957607f821691505b6020821081141561321a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611bcf57600080fd5b8015158114611bcf57600080fd5b6001600160e01b031981168114611bcf57600080fd5b6001600160601b0381168114611bcf57600080fdfee7f424cdcf5917c204b2aaa3c70b281b51918cb8efe92018a27908ae19f9c48aa2646970667358221220c6a297407c75171e058f93b0236909b48edd54a419a061798bb350d9d2f7c6a164736f6c63430008040033a76ace73a908083d89af9ff88e5b4f7cadb3591a80631063f68b695fda726db5e7f424cdcf5917c204b2aaa3c70b281b51918cb8efe92018a27908ae19f9c48a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a60000000000000000000000002f5e324ec0e2fd9925165c66e0daade39837adb5000000000000000000000000e0172b80b1410e198f94a8213842c635383ceed2

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80636f7994411161015c578063bde909df116100ce578063d547741f11610087578063d547741f146105f5578063dcf3c4be14610608578063e985e9c51461061b578063ebf26f2c14610657578063f2fde38b1461066a578063f91fe6bf1461067d57600080fd5b8063bde909df1461056d578063bff25d1314610582578063c553825c14610595578063c87b56dd146105a8578063ca123b2d146105bb578063d5391393146105ce57600080fd5b806391d148541161012057806391d148541461050f578063957b4c381461052257806395d89b4114610537578063a217fddf1461053f578063a22cb46514610547578063b88d4fde1461055a57600080fd5b80636f799441146104bd57806370a08231146104d0578063715018a6146104e35780637d4da9a7146104eb5780638da5cb5b146104fe57600080fd5b806332cb6b0c1161020057806343ffa64e116101b957806343ffa64e1461044257806356c617921461046957806356f035501461047c5780635c60da1b146104915780636352211e146104a25780636c0360eb146104b557600080fd5b806332cb6b0c146103c357806336568abe146103e35780633659cfe6146103f657806340c10f191461040957806341c405761461041c57806342842e0e1461042f57600080fd5b80631328ec9b116102525780631328ec9b146103415780631ddb946d1461035457806323b872dd14610367578063248a9ca31461037a5780632f2ff15d1461039d5780633000186b146103b057600080fd5b806301ffc9a71461028f57806306fdde03146102b7578063081812fc146102cc578063095ea7b3146102f75780630a323bea1461030c575b600080fd5b6102a261029d366004612bd2565b610690565b60405190151581526020015b60405180910390f35b6102bf6106d6565b6040516102ae9190612ff6565b6102df6102da366004612b96565b610768565b6040516001600160a01b0390911681526020016102ae565b61030a610305366004612b4f565b610802565b005b6103337f4bcafa307edced29184180ecf3a3ef99cd92e9f26df7c14cbec7a5c02db836f581565b6040519081526020016102ae565b6102df61034f366004612b96565b610918565b6102a2610362366004612b96565b61098b565b61030a610375366004612a3b565b610998565b610333610388366004612b96565b60009081526002602052604090206001015490565b61030a6103ab366004612bae565b6109c9565b6102a26103be3660046129e7565b6109ef565b6103cc61271081565b60405165ffffffffffff90911681526020016102ae565b61030a6103f1366004612bae565b6109fc565b61030a6104043660046129e7565b610a7a565b6102df610417366004612b4f565b610aae565b61030a61042a3660046129e7565b610b31565b61030a61043d366004612a3b565b610cde565b6103337fa76ace73a908083d89af9ff88e5b4f7cadb3591a80631063f68b695fda726db581565b61030a6104773660046129e7565b610cf9565b610484610e44565b6040516102ae9190612f20565b6001546001600160a01b03166102df565b6102df6104b0366004612b96565b610e55565b6102bf610ecc565b61030a6104cb3660046129e7565b610f6c565b6103336104de3660046129e7565b611021565b61030a6110a8565b61030a6104f9366004612cf3565b61110e565b6000546001600160a01b03166102df565b6102a261051d366004612bae565b6116e7565b61033360008051602061329b83398151915281565b6102bf611712565b610333600081565b61030a610555366004612b22565b611721565b61030a610568366004612a7b565b6117e6565b61057561181e565b6040516102ae9190612ed3565b6009546102df906001600160a01b031681565b6102a26105a3366004612b4f565b61182a565b6102bf6105b6366004612b96565b611850565b61030a6105c9366004612b96565b611904565b6103337f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61030a610603366004612bae565b6119b0565b6102bf610616366004612b96565b6119d6565b6102a2610629366004612a03565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61030a610665366004612b96565b611a4e565b61030a6106783660046129e7565b611b07565b600f546102df906001600160a01b031681565b60006001600160e01b031982166317af33f960e01b14806106c157506001600160e01b03198216637965db0b60e01b145b806106d057506106d082611bd8565b92915050565b6060600380546106e5906131e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610711906131e5565b801561075e5780601f106107335761010080835404028352916020019161075e565b820191906000526020600020905b81548152906001019060200180831161074157829003601f168201915b5050505050905090565b6000818152600560205260408120546001600160a01b03166107e65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061080d82610e55565b9050806001600160a01b0316836001600160a01b0316141561087b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107dd565b336001600160a01b038216148061089757506108978133610629565b6109095760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107dd565b6109138383611c18565b505050565b600e546000906106d0906001600160a01b03168330604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606093841b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b6028820152921b6038830152604c8201526037808220606c830152605591012090565b60006106d0600c83611c86565b6109a23382611c9e565b6109be5760405162461bcd60e51b81526004016107dd906130aa565b610913838383611d91565b6000828152600260205260409020600101546109e58133611f31565b6109138383611f95565b60006106d0600a8361201b565b6001600160a01b0381163314610a6c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107dd565b610a76828261203d565b5050565b7fa76ace73a908083d89af9ff88e5b4f7cadb3591a80631063f68b695fda726db5610aa58133611f31565b610a76826120a4565b60007f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610adb8133611f31565b6127108310610b1f5760405162461bcd60e51b815260206004820152601060248201526f11185d984e88125b9d985b1a59081a5960821b60448201526064016107dd565b610b2984846120e4565b949350505050565b60008051602061329b833981519152610b4a8133611f31565b6040516301ffc9a760e01b815263a3a3de6b60e01b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc89190612b7a565b610c2d5760405162461bcd60e51b815260206004820152603060248201527f446176613a20446f6573206e6f7420737570706f7274204950617274436f6c6c60448201526f656374696f6e20696e7465726661636560801b60648201526084016107dd565b610c38600a8361201b565b15610c915760405162461bcd60e51b815260206004820152602360248201527f446176613a20616c7265616479207265676973746572656420636f6c6c65637460448201526234b7b760e91b60648201526084016107dd565b610c9c600a83612166565b506040516001600160a01b03831681527ffb99393fd31547f4a765604f2c2d122ce8ccb313edeef8b951130d8bcca866e9906020015b60405180910390a15050565b610913838383604051806020016040528060008152506117e6565b60008051602061329b833981519152610d128133611f31565b6040516301ffc9a760e01b815263641cb2cf60e01b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b158015610d5857600080fd5b505afa158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d909190612b7a565b610df65760405162461bcd60e51b815260206004820152603160248201527f446176613a20446f6573206e6f7420737570706f727420494672616d65436f6c6044820152706c656374696f6e20696e7465726661636560781b60648201526084016107dd565b600980546001600160a01b0319166001600160a01b0384169081179091556040519081527f97ed937116d4d2193376f807f2264376bd5f2f343dfabde1a91bb290030c52bd90602001610cd2565b6060610e50600c61217b565b905090565b6000818152600560205260408120546001600160a01b0316806106d05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107dd565b600f5460405163fbe336ff60e01b81527f4bcafa307edced29184180ecf3a3ef99cd92e9f26df7c14cbec7a5c02db836f560048201526060916001600160a01b03169063fbe336ff9060240160006040518083038186803b158015610f3057600080fd5b505afa158015610f44573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e509190810190612c0a565b60008051602061329b833981519152610f858133611f31565b610f90600a8361201b565b610fdc5760405162461bcd60e51b815260206004820152601f60248201527f446176613a204e6f74207265676973746572656420636f6c6c656374696f6e0060448201526064016107dd565b610fe7600a83612186565b506040516001600160a01b03831681527ff7dcc61d36be3d19f4edbadd9dd8824cf42d8b95a135c8aeca4eb6f160f7a08690602001610cd2565b60006001600160a01b03821661108c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107dd565b506001600160a01b031660009081526006602052604090205490565b6000546001600160a01b031633146111025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107dd565b61110c600061219b565b565b61111785610e55565b6001600160a01b0316336001600160a01b03161461118b5760405162461bcd60e51b815260206004820152602b60248201527f446176613a206d73672e73656e646572206973206e6f7420746865206f776e6560448201526a391037b31030bb30ba30b960a91b60648201526084016107dd565b600061119686610918565b90508060005b83811015611376576000826001600160a01b0316637281a0398787858181106111d557634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016111fa91815260200190565b604080518083038186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112499190612c7d565b80519091506001600160a01b038116158015906112f257506020820151604051627eeac760e11b81526001600160a01b0387811660048301526001600160601b03909216602482015260009183169062fdd58e9060440160206040518083038186803b1580156112b857600080fd5b505afa1580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f09190612cdb565b115b15611361576020820151604051637921219560e11b81526001600160a01b0383169163f242432a9161132e918991339190600190600401612e92565b600060405180830381600087803b15801561134857600080fd5b505af115801561135c573d6000803e3d6000fd5b505050505b5061136f9050600182613154565b905061119c565b5060005b858110156116715760008787838181106113a457634e487b7160e01b600052603260045260246000fd5b6113ba92602060409092020190810191506129e7565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201529091506001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561140357600080fd5b505afa158015611417573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143b9190612b7a565b6114995760405162461bcd60e51b815260206004820152602960248201527f446176613a20636f6c6c656374696f6e206973206e6f7420616e2065726331316044820152680d4d48199bdc9b585d60ba1b60648201526084016107dd565b6001816001600160a01b031662fdd58e338b8b878181106114ca57634e487b7160e01b600052603260045260246000fd5b90506040020160200160208101906114e29190612d98565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526001600160601b0316602482015260440160206040518083038186803b15801561152f57600080fd5b505afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115679190612cdb565b10156115c05760405162461bcd60e51b815260206004820152602260248201527f446176613a206f776e657220646f6573206e6f7420686f6c64207468652070616044820152611c9d60f21b60648201526084016107dd565b806001600160a01b031663f242432a33868b8b878181106115f157634e487b7160e01b600052603260045260246000fd5b90506040020160200160208101906116099190612d98565b60016040518563ffffffff1660e01b815260040161162a9493929190612e92565b600060405180830381600087803b15801561164457600080fd5b505af1158015611658573d6000803e3d6000fd5b505050505060018161166a9190613154565b905061137a565b5061167b87610918565b6001600160a01b031663867cee71878787876040518563ffffffff1660e01b81526004016116ac9493929190612f58565b600060405180830381600087803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b5050505050505050505050565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106e5906131e5565b6001600160a01b03821633141561177a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107dd565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6117f03383611c9e565b61180c5760405162461bcd60e51b81526004016107dd906130aa565b611818848484846121eb565b50505050565b6060610e50600a61221e565b6000611837600a8461201b565b80156118495750611849600c83611c86565b9392505050565b6000818152600560205260409020546060906001600160a01b03166118875760405162461bcd60e51b81526004016107dd9061305b565b61189082610918565b6001600160a01b0316637a5b4f596040518163ffffffff1660e01b815260040160006040518083038186803b1580156118c857600080fd5b505afa1580156118dc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106d09190810190612c0a565b60008051602061329b83398151915261191d8133611f31565b611928600c83611c86565b6119745760405162461bcd60e51b815260206004820152601d60248201527f446176613a206e6f6e20726567697374657265642063617465676f727900000060448201526064016107dd565b61197f600c8361222b565b506040518281527f35ade638434aa66cd59ce09d433fe9a1cf77d3666b3bbde63c76771ec048357990602001610cd2565b6000828152600260205260409020600101546119cc8133611f31565b610913838361203d565b6000818152600560205260409020546060906001600160a01b0316611a0d5760405162461bcd60e51b81526004016107dd9061305b565b611a1682610918565b6001600160a01b03166346d227e86040518163ffffffff1660e01b815260040160006040518083038186803b1580156118c857600080fd5b60008051602061329b833981519152611a678133611f31565b611a72600c83611c86565b15611acb5760405162461bcd60e51b8152602060048201526024808201527f446176613a2063617465676f727920697320616c726561647920726567697374604482015263195c995960e21b60648201526084016107dd565b611ad6600c83612237565b506040518281527f0c5febd4c62522dc83ff4b05f4d9a6d3ad6102ae57917397e05cccabd1aa60ee90602001610cd2565b6000546001600160a01b03163314611b615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107dd565b6001600160a01b038116611bc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107dd565b611bcf8161219b565b50565b3b151590565b60006001600160e01b031982166380ac58cd60e01b1480611c0957506001600160e01b03198216635b5e139f60e01b145b806106d057506106d082612243565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c4d82610e55565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526001830160205260408120541515611849565b6000818152600560205260408120546001600160a01b0316611d175760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107dd565b6000611d2283610e55565b9050806001600160a01b0316846001600160a01b03161480611d5d5750836001600160a01b0316611d5284610768565b6001600160a01b0316145b80610b2957506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff16610b29565b826001600160a01b0316611da482610e55565b6001600160a01b031614611e0c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107dd565b6001600160a01b038216611e6e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107dd565b611e79600082611c18565b6001600160a01b0383166000908152600660205260408120805460019290611ea290849061318b565b90915550506001600160a01b0382166000908152600660205260408120805460019290611ed0908490613154565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611f3b82826116e7565b610a7657611f53816001600160a01b03166014612278565b611f5e836020612278565b604051602001611f6f929190612de0565b60408051601f198184030181529082905262461bcd60e51b82526107dd91600401612ff6565b611f9f82826116e7565b610a765760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fd73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811660009081526001830160205260408120541515611849565b61204782826116e7565b15610a765760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6120ad8161245a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600e5460009081906120ff906001600160a01b0316846124e6565b60405163fe4b84df60e01b8152600481018590529091506001600160a01b0382169063fe4b84df90602401600060405180830381600087803b15801561214457600080fd5b505af1158015612158573d6000803e3d6000fd5b505050506118498484612586565b6000611849836001600160a01b0384166126c8565b60606106d082612717565b6000611849836001600160a01b038416612773565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6121f6848484611d91565b61220284848484612890565b6118185760405162461bcd60e51b81526004016107dd90613009565b6060600061184983612717565b60006118498383612773565b600061184983836126c8565b60006001600160e01b03198216637965db0b60e01b14806106d057506301ffc9a760e01b6001600160e01b03198316146106d0565b6060600061228783600261316c565b612292906002613154565b67ffffffffffffffff8111156122b857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122e2576020820181803683370190505b509050600360fc1b8160008151811061230b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061234857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061236c84600261316c565b612377906001613154565b90505b600181111561240b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106123b957634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106123dd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612404816131ce565b905061237a565b5083156118495760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107dd565b803b6124c45760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016107dd565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b0381166106d05760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016107dd565b6001600160a01b0382166125dc5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107dd565b6000818152600560205260409020546001600160a01b0316156126415760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107dd565b6001600160a01b038216600090815260066020526040812080546001929061266a908490613154565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260018301602052604081205461270f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106d0565b5060006106d0565b60608160000180548060200260200160405190810160405280929190818152602001828054801561276757602002820191906000526020600020905b815481526020019060010190808311612753575b50505050509050919050565b6000818152600183016020526040812054801561288657600061279760018361318b565b85549091506000906127ab9060019061318b565b905081811461282c5760008660000182815481106127d957634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061280a57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061284b57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106d0565b60009150506106d0565b60006001600160a01b0384163b1561299257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128d4903390899088908890600401612e55565b602060405180830381600087803b1580156128ee57600080fd5b505af192505050801561291e575060408051601f3d908101601f1916820190925261291b91810190612bee565b60015b612978573d80801561294c576040519150601f19603f3d011682016040523d82523d6000602084013e612951565b606091505b5080516129705760405162461bcd60e51b81526004016107dd90613009565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610b29565b506001949350505050565b60008083601f8401126129ae578182fd5b50813567ffffffffffffffff8111156129c5578182fd5b6020830191508360208260051b85010111156129e057600080fd5b9250929050565b6000602082840312156129f8578081fd5b81356118498161324c565b60008060408385031215612a15578081fd5b8235612a208161324c565b91506020830135612a308161324c565b809150509250929050565b600080600060608486031215612a4f578081fd5b8335612a5a8161324c565b92506020840135612a6a8161324c565b929592945050506040919091013590565b60008060008060808587031215612a90578081fd5b8435612a9b8161324c565b93506020850135612aab8161324c565b925060408501359150606085013567ffffffffffffffff811115612acd578182fd5b8501601f81018713612add578182fd5b8035612af0612aeb8261312c565b6130fb565b818152886020838501011115612b04578384fd5b81602084016020830137908101602001929092525092959194509250565b60008060408385031215612b34578182fd5b8235612b3f8161324c565b91506020830135612a3081613261565b60008060408385031215612b61578182fd5b8235612b6c8161324c565b946020939093013593505050565b600060208284031215612b8b578081fd5b815161184981613261565b600060208284031215612ba7578081fd5b5035919050565b60008060408385031215612bc0578182fd5b823591506020830135612a308161324c565b600060208284031215612be3578081fd5b81356118498161326f565b600060208284031215612bff578081fd5b81516118498161326f565b600060208284031215612c1b578081fd5b815167ffffffffffffffff811115612c31578182fd5b8201601f81018413612c41578182fd5b8051612c4f612aeb8261312c565b818152856020838501011115612c63578384fd5b612c748260208301602086016131a2565b95945050505050565b600060408284031215612c8e578081fd5b6040516040810181811067ffffffffffffffff82111715612cb157612cb1613236565b6040528251612cbf8161324c565b81526020830151612ccf81613285565b60208201529392505050565b600060208284031215612cec578081fd5b5051919050565b600080600080600060608688031215612d0a578283fd5b85359450602086013567ffffffffffffffff80821115612d28578485fd5b818801915088601f830112612d3b578485fd5b813581811115612d49578586fd5b8960208260061b8501011115612d5d578586fd5b602083019650809550506040880135915080821115612d7a578283fd5b50612d878882890161299d565b969995985093965092949392505050565b600060208284031215612da9578081fd5b813561184981613285565b60008151808452612dcc8160208601602086016131a2565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612e188160178501602088016131a2565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612e498160288401602088016131a2565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e8890830184612db4565b9695505050505050565b6001600160a01b0394851681529290931660208301526001600160601b03166040820152606081019190915260a06080820181905260009082015260c00190565b6020808252825182820181905260009190848201906040850190845b81811015612f145783516001600160a01b031683529284019291840191600101612eef565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612f1457835183529284019291840191600101612f3c565b60408082528181018590526000908660608401835b88811015612fb7578235612f808161324c565b6001600160a01b03168252602083810135612f9a81613285565b6001600160601b0316908301529183019190830190600101612f6d565b5084810360208601528581526001600160fb1b03861115612fd6578384fd5b8560051b9250828760208301379091016020019182525095945050505050565b6020815260006118496020830184612db4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561312457613124613236565b604052919050565b600067ffffffffffffffff82111561314657613146613236565b50601f01601f191660200190565b6000821982111561316757613167613220565b500190565b600081600019048311821515161561318657613186613220565b500290565b60008282101561319d5761319d613220565b500390565b60005b838110156131bd5781810151838201526020016131a5565b838111156118185750506000910152565b6000816131dd576131dd613220565b506000190190565b600181811c908216806131f957607f821691505b6020821081141561321a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611bcf57600080fd5b8015158114611bcf57600080fd5b6001600160e01b031981168114611bcf57600080fd5b6001600160601b0381168114611bcf57600080fdfee7f424cdcf5917c204b2aaa3c70b281b51918cb8efe92018a27908ae19f9c48aa2646970667358221220c6a297407c75171e058f93b0236909b48edd54a419a061798bb350d9d2f7c6a164736f6c63430008040033

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

0000000000000000000000002f5e324ec0e2fd9925165c66e0daade39837adb5000000000000000000000000e0172b80b1410e198f94a8213842c635383ceed2

-----Decoded View---------------
Arg [0] : minimalProxy_ (address): 0x2F5E324EC0E2Fd9925165c66e0DAAde39837ADb5
Arg [1] : gatewayHandler_ (address): 0xe0172b80b1410E198f94a8213842C635383Ceed2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002f5e324ec0e2fd9925165c66e0daade39837adb5
Arg [1] : 000000000000000000000000e0172b80b1410e198f94a8213842c635383ceed2


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.