Contract 0xb258FffbfE673773969d96a216283e7C25c309cC

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xae4316641738503378bf2d428961ea246f5212767a0de364beb129429b975308Create Token291717102022-06-04 22:28:2020 days 16 hrs ago0x3d8b76bc4af39ae38baa5764a4044ba7b68e79bd IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.093986220043 30.000000014
0x568bc655c952a095ec840f6005aa90d6ae88fa52bc48097c5f60ef26cd78898eCreate Token287771232022-05-26 3:22:3830 days 11 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.10347016424 33.025590001
0x212c3cc658766ecbb95198b464e7193a69ef405bff8170a00d38adbb67bd0ddfCreate Token285233102022-05-19 21:35:0336 days 17 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.101226794273 32.309675295
0xca4ae8b27f8e1c621d45ab458c04372fe95179c77ebb166069ab845ff682e3e1Create Token283599122022-05-15 19:42:5540 days 18 hrs ago0x9941548e3eba6fd41e8a8e8e2121c3230ad929a4 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.09915444039931.648461631
0x0c200517898e28656bf0833d6be7ab79171e83946af88325a6162518b25f9e89Create Token282719902022-05-13 15:08:5142 days 23 hrs ago0xd163f05916ea324b5aa0e66b6a941144e81a9e7d IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.249292593267 79.573435813
0x5a7ca2e0f5849dcc609789569c6ec2679692939cf7ff3f81d6919a66912c6064Create Token282544332022-05-13 4:43:5043 days 9 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.130563227674 41.674266864
0x65f5d5cebf0731d9dbe767dbe5555c290bc087ebd5d688b2d7f209d389cf631aCreate Token282420252022-05-12 21:12:1843 days 17 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.590539053896 188.486714208
0xa67f5f52fe442bfd99194793a0b4038f508e6a1ee35a7dfc565643fd87a63fecCreate Token282420022022-05-12 21:11:3243 days 17 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.756485217541 241.452977683
0x6bfc1b210815505354f7ee3ff220f6ca855aaa05f0a7f4e74db0107096593052Create Token282416372022-05-12 20:56:5043 days 17 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.4481308361 143.033230867
0x570821fa88ff01b8dd4de0d3297b7c519492577ffb500a7e5dc1ee57bef342fbCreate Token282413982022-05-12 20:46:2843 days 17 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.522658592456 166.82080566
0xfcca67d4859dfa083cfe6991e4cfc75cf493f8f4153338dc5d682b06f21c9f29Create Token282377102022-05-12 18:21:2843 days 20 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.274412643508 87.587317886
0x18e779aead44c0b168fb92f8eb58765925f11d526d3b9d290b13e81f0a0423f4Create Token281745772022-05-11 2:27:0445 days 12 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC3.126010306624 997.751812329
0x6bcfc5f538ea8eca72f4eec59d911782e5c240811b4af84914872dd74f596359Create Token281617822022-05-10 18:19:4445 days 20 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.449697651268 143.538270774
0xca34de491fb499956327dbf392028950b86498d290a2de1a8d61de2a7de6ef21Create Token281617022022-05-10 18:17:0045 days 20 hrs ago0xe97ff52931b01ba3c21bd09577c10452ca0f4468 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.567928849847 181.276297085
0x2d77a896b8fdb774caee46d4dbf8c1133b36041642b72ccca88a0e1366633233Create Token276345042022-04-27 10:54:4159 days 3 hrs ago0x3d8b76bc4af39ae38baa5764a4044ba7b68e79bd IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.103105857886 32.90994101
0x7de3a1790dca3535f0ca9650aee2ffdb622b10f1588753b57270c489cb9cb32fCreate Token275644132022-04-25 16:21:3760 days 22 hrs ago0xb5e5fbb827759d8eb8435bc91d81d6af7fdb97ca IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.157841339162 50.064082739
0x5b525895f8d5e41b5a769a54ce13f5ebd8310ac8b30b5c174c83ca4fbe31e1d2Create Token275623902022-04-25 15:07:4660 days 23 hrs ago0x7663a13abfb1e27b50bce3ac195a1e404e2566f7 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.1253188 40
0xcab078635dd06faeb1eac5fb4890d8b515fe3cd7b61dc9a2b34947387f16187eCreate Token275415522022-04-25 2:02:3061 days 12 hrs ago0x49a8010cf25b0f8e7e831dfc5ab3f950c2e2c557 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.152917688005 48.500000319
0x7aaf5dc9b03298846ed40e3ff0835af16dc7bf4c0805636e33e1ddd51a89c818Create Token275388322022-04-25 0:25:0861 days 14 hrs ago0x49a8010cf25b0f8e7e831dfc5ab3f950c2e2c557 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.148323561326 47.045056907
0x660c7d6b4670be785da9a7d9105cbfb58098a3a5e5ad98883e192113f3001aa1Create Token274439492022-04-22 13:38:1964 days 59 mins ago0xf676f77664df857bcb665bfeebdbdfd2709ab854 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.126982239332 40.273900617
0x6a09b39714cdd49118618e6ab2f9e8c155c321eeda0f041c47b0cc86b3e8e3b3Transfer Ownersh...273870202022-04-21 3:47:4265 days 10 hrs ago0xf45f62e4333103aa6b725b32681c9010f057dae7 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.00085729618 30.006866661
0x15c280f408843bdca2c85cfa180a4698840de2e52fb3194d887756d4f0ff0509Create Token273774432022-04-20 22:03:1165 days 16 hrs ago0x9a6e7dd06f7120127a9c504226b621cfc4ddf02d IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.10396315004 32.97538658
0xd56cb5aa6122bff91cc796ad16323ab76cdfa254a8198029fd988ffa45305ab1Create Token273771052022-04-20 21:51:3565 days 16 hrs ago0xeba2d193323211cf5365d1812c039f75a4b32193 IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.103324163511 32.980000061
0x284d1e8875b579092f7784b6bc49ffd29d5935fabc6e9014ddf13aa03b6173f2Create Token273769792022-04-20 21:46:5665 days 16 hrs ago0x61550d1246793a52300dae2925155b98be83605f IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.10636310747 33.949999416
0x6abdeba9182bf28f41960abb51cdae6eecd566ff8ad777dc89aa17aae3d7963dCreate Token273769482022-04-20 21:45:2865 days 16 hrs ago0x61550d1246793a52300dae2925155b98be83605f IN  0xb258fffbfe673773969d96a216283e7c25c309cc0 MATIC0.110647530538 35.317001674
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xae4316641738503378bf2d428961ea246f5212767a0de364beb129429b975308291717102022-06-04 22:28:2020 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x568bc655c952a095ec840f6005aa90d6ae88fa52bc48097c5f60ef26cd78898e287771232022-05-26 3:22:3830 days 11 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x212c3cc658766ecbb95198b464e7193a69ef405bff8170a00d38adbb67bd0ddf285233102022-05-19 21:35:0336 days 17 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xca4ae8b27f8e1c621d45ab458c04372fe95179c77ebb166069ab845ff682e3e1283599122022-05-15 19:42:5540 days 18 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x0c200517898e28656bf0833d6be7ab79171e83946af88325a6162518b25f9e89282719902022-05-13 15:08:5142 days 23 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x5a7ca2e0f5849dcc609789569c6ec2679692939cf7ff3f81d6919a66912c6064282544332022-05-13 4:43:5043 days 9 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x65f5d5cebf0731d9dbe767dbe5555c290bc087ebd5d688b2d7f209d389cf631a282420252022-05-12 21:12:1843 days 17 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xa67f5f52fe442bfd99194793a0b4038f508e6a1ee35a7dfc565643fd87a63fec282420022022-05-12 21:11:3243 days 17 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x6bfc1b210815505354f7ee3ff220f6ca855aaa05f0a7f4e74db0107096593052282416372022-05-12 20:56:5043 days 17 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x570821fa88ff01b8dd4de0d3297b7c519492577ffb500a7e5dc1ee57bef342fb282413982022-05-12 20:46:2843 days 17 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xfcca67d4859dfa083cfe6991e4cfc75cf493f8f4153338dc5d682b06f21c9f29282377102022-05-12 18:21:2843 days 20 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x18e779aead44c0b168fb92f8eb58765925f11d526d3b9d290b13e81f0a0423f4281745772022-05-11 2:27:0445 days 12 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x6bcfc5f538ea8eca72f4eec59d911782e5c240811b4af84914872dd74f596359281617822022-05-10 18:19:4445 days 20 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xca34de491fb499956327dbf392028950b86498d290a2de1a8d61de2a7de6ef21281617022022-05-10 18:17:0045 days 20 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x2d77a896b8fdb774caee46d4dbf8c1133b36041642b72ccca88a0e1366633233276345042022-04-27 10:54:4159 days 3 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x7de3a1790dca3535f0ca9650aee2ffdb622b10f1588753b57270c489cb9cb32f275644132022-04-25 16:21:3760 days 22 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x5b525895f8d5e41b5a769a54ce13f5ebd8310ac8b30b5c174c83ca4fbe31e1d2275623902022-04-25 15:07:4660 days 23 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xcab078635dd06faeb1eac5fb4890d8b515fe3cd7b61dc9a2b34947387f16187e275415522022-04-25 2:02:3061 days 12 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x7aaf5dc9b03298846ed40e3ff0835af16dc7bf4c0805636e33e1ddd51a89c818275388322022-04-25 0:25:0861 days 14 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x660c7d6b4670be785da9a7d9105cbfb58098a3a5e5ad98883e192113f3001aa1274439492022-04-22 13:38:1964 days 59 mins ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x15c280f408843bdca2c85cfa180a4698840de2e52fb3194d887756d4f0ff0509273774432022-04-20 22:03:1165 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xd56cb5aa6122bff91cc796ad16323ab76cdfa254a8198029fd988ffa45305ab1273771052022-04-20 21:51:3565 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x284d1e8875b579092f7784b6bc49ffd29d5935fabc6e9014ddf13aa03b6173f2273769792022-04-20 21:46:5665 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0x6abdeba9182bf28f41960abb51cdae6eecd566ff8ad777dc89aa17aae3d7963d273769482022-04-20 21:45:2865 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
0xbbb3d6c58aa846b686dac6212653bf0d48d37d8b4c27628b75de2e356d08cfd4273769222022-04-20 21:43:4465 days 16 hrs ago 0xb258fffbfe673773969d96a216283e7c25c309cc  Contract Creation0 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC1155LuxyPrivateFactory

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 27 : ERC1155PrivateFactory.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "../ERC1155/ERC1155Private.sol";

contract ERC1155LuxyPrivateFactory is Ownable {
    event Create1155LuxyContract(address erc1155);
    event Create1155LuxyPrivateContract(address erc1155);

    constructor() {}

    function createToken(
        string memory _name,
        string memory _symbol,
        string memory _baseURI,
        address[] memory _minters,
        bool _isChangeable,
        uint256 _maxSupply,
        uint256 _salt 
    ) external {
        address luxy1155Token = deployProxy(
            getData(_name, _symbol, _baseURI, _minters, _isChangeable,_maxSupply),
            _salt
        );

        ERC1155LuxyPrivate token = ERC1155LuxyPrivate(luxy1155Token);
        token.__ERC1155PrivateLuxy_init(
            _name,
            _symbol,
            _baseURI,
            _minters,
            _isChangeable,
            _maxSupply
        );
        token.transferOwnership(_msgSender());
        emit Create1155LuxyContract(luxy1155Token);
    }

    //deploying Luxy1155 contract with create2
    function deployProxy(bytes memory data, uint256 salt)
        internal
        returns (address proxy)
    {
        bytes memory bytecode = getCreationBytecode(data);
        assembly {
            proxy := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
            if iszero(extcodesize(proxy)) {
                revert(0, 0)
            }
        }
    }

    //adding  unnecessary constructor arguments to Luxy1155 bytecode, to get less change for collision on contract address
    function getCreationBytecode(bytes memory _data)
        internal
        pure
        returns (bytes memory)
    {
        return
            abi.encodePacked(
                type(ERC1155LuxyPrivate).creationCode,
                abi.encode(_data)
            );
    }

    //returns address that contract with such arguments will be deployed on
    function getAddress(
        string memory _name,
        string memory _symbol,
        string memory baseURI,
        address[] memory _minters,
        bool isChangeable,
        uint256 _maxSupply,
        uint256 _salt
    ) public view returns (address) {
        bytes memory bytecode = getCreationBytecode(
            getData(_name, _symbol, baseURI, _minters, isChangeable,_maxSupply)
        );

        bytes32 hash = keccak256(
            abi.encodePacked(
                bytes1(0xff),
                address(this),
                _salt,
                keccak256(bytecode)
            )
        );

        return address(uint160(uint256(hash)));
    }

    function getData(
        string memory _name,
        string memory _symbol,
        string memory baseURI,
        address[] memory _minters,
        bool _isChangeable,
        uint256 _maxSupply
    ) internal pure returns (bytes memory) {
        return
            abi.encodeWithSelector(
                ERC1155LuxyPrivate.__ERC1155PrivateLuxy_init.selector,
                _name,
                _symbol,
                baseURI,
                _minters,
                _isChangeable,
                _maxSupply
            );
    }
}

File 2 of 27 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

File 3 of 27 : ERC1155Private.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";
import "./ERC1155BaseUri.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "../../RoyaltiesV1Luxy.sol";
import "../ERC1271/ERC1271.sol";

contract ERC1155LuxyPrivate is
    OwnableUpgradeable,
    ERC1155BurnableUpgradeable,
    ERC1155BaseURI,
    RoyaltiesV1Luxy
{
    string public name;
    string public symbol;
    bool public isChangeable;
    uint256 public maxSupply;
    mapping(address => bool) private defaultApprovals;
    event DefaultApproval(address indexed operator, bool hasApproval);
    using CountersUpgradeable for CountersUpgradeable.Counter;
    CountersUpgradeable.Counter private _tokenIds;
    mapping(address => bool) private approvedMinters;

    function __ERC1155PrivateLuxy_init(
        string memory _name,
        string memory _symbol,
        string memory _baseURI,
        address[] memory _minters,
        bool _isChangeable,
        uint256 _maxSupply
    ) public initializer {
        name = _name;
        symbol = _symbol;
        __Ownable_init_unchained();
        __ERC1155Burnable_init_unchained();
        __Context_init_unchained();
        __ERC165_init_unchained();
        _setBaseURI(_baseURI);
        _setInitialMinters(_minters);
        _setChangeable(_isChangeable);
        _setMaxSupply(_maxSupply);
    }

    function __ERC1155PrivateLuxy_init_unchained(string memory _baseURI, address[] memory _minters, bool _isChangeable, uint256 _maxSupply)
        internal
        initializer
    {
        _setBaseURI(_baseURI);
        _setInitialMinters(_minters);
        _setChangeable(_isChangeable);
        _setMaxSupply(_maxSupply);
    }

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

    function setApprovedMinter(address _minter, bool _approved)
        external
        onlyOwner
    {
        approvedMinters[_minter] = _approved;
    }

    function _isApprovedMinterorOwner(address minter)
        internal
        view
        virtual
        returns (bool)
    {
        if (minter == owner()) return true;
        require(minter != address(0));
        return approvedMinters[minter];
    }

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

    function setDefaultApproval(address operator, bool hasApproval)
        external
        onlyOwner
    {
        _setDefaultApproval(operator, hasApproval);
    }

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

    function mint(
        address account,
        uint256 amount,
        LibPart.Part[] memory royalties,
        string memory tokenURI
    ) public {
        require(
            _isApprovedMinterorOwner(_msgSender()),
            "Sender must be an approved minter or owner"
        );
        uint256 id = _tokenIds.current();
        if(maxSupply != 0){
            require(id < maxSupply, "ERC721: minting above the total supply");
        }
        _mint(account, id, amount, "");
        _setRoyalties(id, royalties);
        _setTokenURI(id, tokenURI);
        _tokenIds.increment();
    }

    function transferFrom(
        uint256 id,
        address from,
        address to,
        uint256 amount
    ) public {
        uint256 balance = balanceOf(from, id);
        if (balance != 0) {
            require(balance >= amount, "Insufficient balance");
            super.safeTransferFrom(from, to, id, amount, "");
        }
    }

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

    function setBaseURI(string memory _baseURI) external onlyOwner {
        require(isChangeable, "Base URI is not changeable.");
        _setBaseURI(_baseURI);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 _interfaceId)
        public
        view
        override(ERC1155Upgradeable, ERC1155BaseURI, IERC165Upgradeable)
        returns (bool)
    {
        return
            _interfaceId == type(RoyaltiesV1Luxy).interfaceId ||
            _interfaceId == type(ERC1155BaseURI).interfaceId ||
            _interfaceId == type(ERC1155BurnableUpgradeable).interfaceId ||
            _interfaceId == type(OwnableUpgradeable).interfaceId ||
            super.supportsInterface(_interfaceId);
    }

    function _setMaxSupply(uint256 maxSupply_) internal virtual {
        maxSupply = maxSupply_;
    }

    function getMaxSupply() public view returns (uint256) {
        require(maxSupply > 0, "There is no MaxSupply for this collection.");
        return maxSupply;
    }

    /**
     * @dev Internal function to set changeability of BaseURI for NFT drops.
     */
    function _setInitialMinters(address[] memory minters) internal virtual {
        //initializing base minters list
        for (uint256 i = 0; i < minters.length; i++) {
            approvedMinters[minters[i]] = true;
        }
    }

    /**
     * @dev Internal function to set changeability of BaseURI for NFT drops.
     */
    function _setChangeable(bool isChangeable_) internal virtual {
        isChangeable = isChangeable_;
    }

    uint256[100] private __gap;
}

File 4 of 27 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 5 of 27 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

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

File 6 of 27 : ERC1155BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;

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

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

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

        _burn(account, id, value);
    }

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

        _burnBatch(account, ids, values);
    }

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

File 7 of 27 : ERC1155BaseUri.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";

abstract contract ERC1155BaseURI is ERC1155Upgradeable {
    using StringsUpgradeable for uint256;

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

    // Base URI
    string private _baseURI;

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

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

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

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

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

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

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

    uint256[50] private __gap;
}

File 8 of 27 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library CountersUpgradeable {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 9 of 27 : RoyaltiesV1Luxy.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LibPart.sol";
import "./tokens/ERC2981/IERC2981.sol";
import "./exchange/lib/LibBP.sol";

//InterfaceID = 0x25292224
abstract contract RoyaltiesV1Luxy is IERC2981 {
    using LibBP for uint256;
    event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties);
    event RoyaltieAccountUpdate(
        uint256 tokenId,
        uint256 index,
        address previousAccount,
        address newAccount
    );
    mapping(uint256 => LibPart.Part[]) internal royalties;

    function getRoyalties(uint256 id)
        public
        view
        virtual
        returns (LibPart.Part[] memory)
    {
        return royalties[id];
    }

    function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
        external
        view
        override
        returns (address receiver, uint256 royaltyAmount)
    {
        require(royalties[_tokenId].length != 0, "Royalties not set yet");
        require(
            royalties[_tokenId].length == 1,
            "Multiples Royalties is not supported by EIP2981, use LuxyRoyaltiesV1"
        );
        require(
            royalties[_tokenId][0].value <= 9800,
            "Royalties are too high (>98%)"
        );
        royaltyAmount = _salePrice.bp(royalties[_tokenId][0].value);
        receiver = royalties[_tokenId][0].account;
    }


    //Not deployed yet current InterfaceID is 0x25292224
    // function calcRoyaltiesInterfaceId() external pure returns (bytes4) {
    //     return type(RoyaltiesV1Luxy).interfaceId;
    // }

    function _setRoyalties(uint256 _id, LibPart.Part[] memory _royalties)
        internal
    {
        require(royalties[_id].length == 0, "Royalties already set");
        for (uint256 i = 0; i < _royalties.length; i++) {
            require(
                _royalties[i].account != address(0x0),
                "Recipient should be present"
            );
            require(
                _royalties[i].value != 0,
                "Royalty value should be positive"
            );
            royalties[_id].push(_royalties[i]);
        }
        emit RoyaltiesSet(_id, _royalties);
    }

    function _updateAccount(
        uint256 _id,
        address _from,
        address _to
    ) internal {
        uint256 length = royalties[_id].length;
        address previousAccount = address(0x0);
        uint256 index = 0;
        for (uint256 i = 0; i < length; i++) {
            if (royalties[_id][i].account == _from) {
                previousAccount = royalties[_id][i].account;
                index = i;
                royalties[_id][i].account = payable(address(uint160(_to)));
            }
        }
        require(
            previousAccount != address(0x0),
            "Account not found, are you using the correct wallet?"
        );
        emit RoyaltieAccountUpdate(
            _id,
            index,
            previousAccount,
            royalties[_id][index].account
        );
    }

    uint256[50] private __gap;
}

File 10 of 27 : ERC1271.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";

abstract contract ERC1271Upgradeable is EIP712Upgradeable {
    using ECDSAUpgradeable for bytes32;

    bytes4 public constant ERC1271_INTERFACE_ID = 0xfb855dc9; // this.isValidSignature.selector

    bytes4 public constant ERC1271_RETURN_VALID_SIGNATURE = 0x1626ba7e;
    bytes4 public constant ERC1271_RETURN_INVALID_SIGNATURE = 0x00000000;
    string constant CONTRACT_SIGNATURE_ERROR =
        "contract signature verification error";
    string constant SIGNATURE_ERROR = "signature verification error";

    function __ERC1271Upgradeable_init(
        string memory name,
        string memory version
    ) internal initializer {
        __EIP712_init_unchained(name, version);
        __ERC1271Upgradeable_init_unchained();
    }

    function __ERC1271Upgradeable_init_unchained() internal initializer {}

    function isContract(address addr) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(addr)
        }
        return size > 0;
    }

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

    function _validate(
        address signer,
        bytes32 structHash,
        bytes memory signature
    ) internal view {
        bytes32 hash = _hashTypedDataV4(structHash);
        if (isContract(signer)) {
            require(
                IERC1271Upgradeable(signer).isValidSignature(hash, signature) ==
                    ERC1271_RETURN_VALID_SIGNATURE,
                CONTRACT_SIGNATURE_ERROR
            );
        } else {
            require(hash.recover(signature) == signer, SIGNATURE_ERROR);
        }
    }

    uint256[50] private __gap;
}

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

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

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

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

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

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

File 12 of 27 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 13 of 27 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 14 of 27 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

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

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

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

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

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

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

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

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

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

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

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

        return batchBalances;
    }

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

        return array;
    }

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

File 15 of 27 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must 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 16 of 27 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC1155Upgradeable.sol";

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 21 of 27 : LibPart.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

    struct Part {
        address payable account;
        uint96 value;
    }
}

File 22 of 27 : IERC2981.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";

///
/// @dev Interface for the NFT Royalty Standard
///
interface IERC2981 is IERC165Upgradeable {
    /// ERC165 bytes to add to interface array - set in parent contract
    /// implementing this standard
    ///
    /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
    /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
    /// _registerInterface(_INTERFACE_ID_ERC2981);

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

File 23 of 27 : LibBP.sol
/*
                            __;φφφ≥,,╓╓,__
                           _φ░░░░░░░░░░░░░φ,_
                           φ░░░░░░░░░░░░╚░░░░_
                           ░░░░░░░░░░░░░░░▒▒░▒_
                          _░░░░░░░░░░░░░░░░╬▒░░_
    _≤,                    _░░░░░░░░░░░░░░░░╠░░ε
    _Σ░≥_                   `░░░░░░░░░░░░░░░╚░░░_
     _φ░░                     ░░░░░░░░░░░░░░░▒░░
       ░░░,                    `░░░░░░░░░░░░░╠░░___
       _░░░░░≥,                 _`░░░░░░░░░░░░░░░░░φ≥, _
       ▒░░░░░░░░,_                _ ░░░░░░░░░░░░░░░░░░░░░≥,_
      ▐░░░░░░░░░░░                 φ░░░░░░░░░░░░░░░░░░░░░░░▒,
       ░░░░░░░░░░░[             _;░░░░░░░░░░░░░░░░░░░░░░░░░░░
       \░░░░░░░░░░░»;;--,,. _  ,░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Γ
       _`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ,,
         _"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"=░░░░░░░░░░░░░░░░░
            Σ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_    `╙δ░░░░Γ"  ²░Γ_
         ,φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░_
       _φ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░φ░░≥_
      ,▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░≥
     ,░░░░░░░░░░░░░░░░░╠▒░▐░░░░░░░░░░░░░░░╚░░░░░≥
    _░░░░░░░░░░░░░░░░░░▒░░▐░░░░░░░░░░░░░░░░╚▒░░░░░
    φ░░░░░░░░░░░░░░░░░φ░░Γ'░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░_ ░░░░░░░░░░░░░░░░░░░░░░░░[
    ╚░░░░░░░░░░░░░░░░░░░_  └░░░░░░░░░░░░░░░░░░░░░░░░
    _╚░░░░░░░░░░░░░▒"^     _7░░░░░░░░░░░░░░░░░░░░░░Γ
     _`╚░░░░░░░░╚²_          \░░░░░░░░░░░░░░░░░░░░Γ
         ____                _`░░░░░░░░░░░░░░░Γ╙`
                               _"φ░░░░░░░░░░╚_
                                 _ `""²ⁿ""

        ██╗         ██╗   ██╗    ██╗  ██╗    ██╗   ██╗
        ██║         ██║   ██║    ╚██╗██╔╝    ╚██╗ ██╔╝
        ██║         ██║   ██║     ╚███╔╝      ╚████╔╝ 
        ██║         ██║   ██║     ██╔██╗       ╚██╔╝  
        ███████╗    ╚██████╔╝    ██╔╝ ██╗       ██║   
        ╚══════╝     ╚═════╝     ╚═╝  ╚═╝       ╚═╝   
*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";

library LibBP {
    using SafeMathUpgradeable for uint256;

    function bp(uint256 value, uint256 bpValue)
        internal
        pure
        returns (uint256)
    {
        return value.mul(bpValue).div(uint256(10000));
    }
}

File 24 of 27 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

File 25 of 27 : IERC1271Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271Upgradeable {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

File 26 of 27 : draft-EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

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

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

    /* solhint-enable var-name-mixedcase */

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

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

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

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

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

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

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

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

File 27 of 27 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

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

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc1155","type":"address"}],"name":"Create1155LuxyContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc1155","type":"address"}],"name":"Create1155LuxyPrivateContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"address[]","name":"_minters","type":"address[]"},{"internalType":"bool","name":"_isChangeable","type":"bool"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_salt","type":"uint256"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"address[]","name":"_minters","type":"address[]"},{"internalType":"bool","name":"isChangeable","type":"bool"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_salt","type":"uint256"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6142db8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100b05780638da5cb5b146100b8578063f2fde38b146100c957600080fd5b8063394e21d01461006c5780635a5acb931461009b575b600080fd5b61007f61007a36600461070c565b6100dc565b6040516001600160a01b03909116815260200160405180910390f35b6100ae6100a936600461070c565b610175565b005b6100ae6102e3565b6000546001600160a01b031661007f565b6100ae6100d73660046106eb565b61034e565b6000806100f56100f08a8a8a8a8a8a610430565b6104c0565b8051602091820120604080517fff00000000000000000000000000000000000000000000000000000000000000818501523060601b6bffffffffffffffffffffffff191660218201526035810196909652605580870192909252805180870390920182526075909501909452835193019290922098975050505050505050565b600061018e610188898989898989610430565b83610529565b6040517f3c5ee84c00000000000000000000000000000000000000000000000000000000815290915081906001600160a01b03821690633c5ee84c906101e2908c908c908c908c908c908c90600401610846565b600060405180830381600087803b1580156101fc57600080fd5b505af1158015610210573d6000803e3d6000fd5b50505050806001600160a01b031663f2fde38b61022a3390565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561028357600080fd5b505af1158015610297573d6000803e3d6000fd5b50506040516001600160a01b03851681527f7c103ae6bc1f6dbc6da61f4a4ebd9084cf9e704c516e5addb13b810b925b200d9250602001905060405180910390a1505050505050505050565b6000546001600160a01b031633146103425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61034c6000610555565b565b6000546001600160a01b031633146103a85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610339565b6001600160a01b0381166104245760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610339565b61042d81610555565b50565b6060633c5ee84c60e01b87878787878760405160240161045596959493929190610846565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290509695505050505050565b6060604051806020016104d2906105bd565b601f1982820381018352601f9091011660408190526104f5908490602001610833565b60408051601f19818403018152908290526105139291602001610804565b6040516020818303038152906040529050919050565b600080610535846104c0565b9050828151602083016000f59150813b61054e57600080fd5b5092915050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6139338061097383390190565b80356001600160a01b03811681146105e157600080fd5b919050565b600082601f8301126105f6578081fd5b8135602067ffffffffffffffff82111561061257610612610943565b8160051b6106218282016108e2565b83815282810190868401838801850189101561063b578687fd5b8693505b8584101561066457610650816105ca565b83526001939093019291840191840161063f565b50979650505050505050565b803580151581146105e157600080fd5b600082601f830112610690578081fd5b813567ffffffffffffffff8111156106aa576106aa610943565b6106bd601f8201601f19166020016108e2565b8181528460208386010111156106d1578283fd5b816020850160208301379081016020019190915292915050565b6000602082840312156106fc578081fd5b610705826105ca565b9392505050565b600080600080600080600060e0888a031215610726578283fd5b873567ffffffffffffffff8082111561073d578485fd5b6107498b838c01610680565b985060208a013591508082111561075e578485fd5b61076a8b838c01610680565b975060408a013591508082111561077f578485fd5b61078b8b838c01610680565b965060608a01359150808211156107a0578485fd5b506107ad8a828b016105e6565b9450506107bc60808901610670565b925060a0880135915060c0880135905092959891949750929550565b600081518084526107f0816020860160208601610913565b601f01601f19169290920160200192915050565b60008351610816818460208801610913565b83519083019061082a818360208801610913565b01949350505050565b60208152600061070560208301846107d8565b60c08152600061085960c08301896107d8565b60208382038185015261086c828a6107d8565b9150838203604085015261088082896107d8565b84810360608601528751808252828901935090820190845b818110156108bd5784516001600160a01b031683529383019391830191600101610898565b5050861515608086015292506108d1915050565b8260a0830152979650505050505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561090b5761090b610943565b604052919050565b60005b8381101561092e578181015183820152602001610916565b8381111561093d576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfe608060405234801561001057600080fd5b50613913806100206000396000f3fe608060405234801561001057600080fd5b50600436106101c35760003560e01c80636c0360eb116100f9578063d5abeb0111610097578063f148d99f11610071578063f148d99f146103be578063f242432a146103d1578063f2fde38b146103e4578063f5298aca146103f757600080fd5b8063d5abeb011461038e578063e07f231914610398578063e985e9c5146103ab57600080fd5b806395d89b41116100d357806395d89b4114610345578063a22cb4651461034d578063ab9772ac14610360578063bb3bafd61461036e57600080fd5b80636c0360eb1461031a578063715018a6146103225780638da5cb5b1461032a57600080fd5b80632a55205a116101665780634c0f38c2116101405780634c0f38c2146102cc5780634e1273f4146102d457806355f804b3146102f45780636b20c4541461030757600080fd5b80632a55205a146102745780632eb2c2d6146102a65780633c5ee84c146102b957600080fd5b80630e89341c116101a25780630e89341c1461022657806318054c37146102395780631c0f12b61461024e57806329ec16dd1461026157600080fd5b8062fdd58e146101c857806301ffc9a7146101ee57806306fdde0314610211575b600080fd5b6101db6101d636600461307f565b61040a565b6040519081526020015b60405180910390f35b6102016101fc366004613267565b6104b5565b60405190151581526020016101e5565b610219610595565b6040516101e5919061362f565b610219610234366004613393565b610624565b61024c61024736600461304b565b61062f565b005b61024c61025c3660046133ec565b610697565b61024c61026f36600461304b565b61071e565b610287610282366004613433565b6107a4565b604080516001600160a01b0390931683526020830191909152016101e5565b61024c6102b4366004612ec7565b6109f2565b61024c6102c73660046132d2565b610a8d565b6101db610bd0565b6102e76102e2366004613206565b610c52565b6040516101e591906135ee565b61024c61030236600461329f565b610dc8565b61024c610315366004612fd8565b610e81565b610219610f0b565b61024c610f9d565b6033546040516001600160a01b0390911681526020016101e5565b610219611003565b61024c61035b36600461304b565b611011565b610164546102019060ff1681565b61038161037c366004613393565b61101c565b6040516101e591906135db565b6101db6101655481565b61024c6103a63660046133ab565b6110b1565b6102016103b9366004612e8f565b611114565b61024c6103cc3660046130aa565b611168565b61024c6103df366004612f71565b6112b2565b61024c6103f2366004612e73565b611339565b61024c6104053660046131d2565b611418565b60006001600160a01b03831661048d5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526097602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b031982167f916e8f8c00000000000000000000000000000000000000000000000000000000148061051857506001600160e01b031982167f63759d5000000000000000000000000000000000000000000000000000000000145b8061054c57506001600160e01b031982167f9e094e9e00000000000000000000000000000000000000000000000000000000145b8061058057506001600160e01b031982167f0e08307600000000000000000000000000000000000000000000000000000000145b8061058f575061058f8261149d565b92915050565b61016280546105a390613711565b80601f01602080910402602001604051908101604052809291908181526020018280546105cf90613711565b801561061c5780601f106105f15761010080835404028352916020019161061c565b820191906000526020600020905b8154815290600101906020018083116105ff57829003601f168201915b505050505081565b606061058f826114a8565b6033546001600160a01b031633146106895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610484565b61069382826115b0565b5050565b60006106a3848661040a565b9050801561071757818110156106fb5760405162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e742062616c616e63650000000000000000000000006044820152606401610484565b61071784848785604051806020016040528060008152506112b2565b5050505050565b6033546001600160a01b031633146107785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610484565b6001600160a01b0391909116600090815261016860205260409020805460ff1916911515919091179055565b600082815261012f602052604081205481906108025760405162461bcd60e51b815260206004820152601560248201527f526f79616c74696573206e6f74207365742079657400000000000000000000006044820152606401610484565b600084815261012f60205260409020546001146108ae5760405162461bcd60e51b8152602060048201526044602482018190527f4d756c7469706c657320526f79616c74696573206973206e6f7420737570706f908201527f7274656420627920454950323938312c20757365204c757879526f79616c746960648201527f6573563100000000000000000000000000000000000000000000000000000000608482015260a401610484565b600084815261012f60205260408120805461264892906108de57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600160a01b90046bffffffffffffffffffffffff16111561094d5760405162461bcd60e51b815260206004820152601d60248201527f526f79616c746965732061726520746f6f206869676820283e393825290000006044820152606401610484565b600084815261012f6020526040812080546109a5929061097d57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001548490600160a01b90046bffffffffffffffffffffffff16611611565b600085815261012f602052604081208054929350916109d457634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031694909350915050565b6001600160a01b038516331480610a0e5750610a0e8533611114565b610a805760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610484565b6107178585858585611629565b600054610100900460ff16610aa85760005460ff1615610aac565b303b155b610b1e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610484565b600054610100900460ff16158015610b40576000805461ffff19166101011790555b8651610b54906101629060208a0190612c72565b508551610b6990610163906020890190612c72565b50610b726118a6565b610b7a61191a565b610b8261191a565b610b8a61191a565b610b9385611985565b610b9c84611998565b610164805460ff1916841515179055610bb58261016555565b8015610bc7576000805461ff00191690555b50505050505050565b6000806101655411610c4a5760405162461bcd60e51b815260206004820152602a60248201527f5468657265206973206e6f204d6178537570706c7920666f722074686973206360448201527f6f6c6c656374696f6e2e000000000000000000000000000000000000000000006064820152608401610484565b506101655490565b60608151835114610ccb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610484565b6000835167ffffffffffffffff811115610cf557634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d1e578160200160208202803683370190505b50905060005b8451811015610dc057610d85858281518110610d5057634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610d7857634e487b7160e01b600052603260045260246000fd5b602002602001015161040a565b828281518110610da557634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610db98161379f565b9050610d24565b509392505050565b6033546001600160a01b03163314610e225760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610484565b6101645460ff16610e755760405162461bcd60e51b815260206004820152601b60248201527f4261736520555249206973206e6f74206368616e676561626c652e00000000006044820152606401610484565b610e7e81611985565b50565b6001600160a01b038316331480610e9d5750610e9d8333611114565b610efb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610484565b610f06838383611a0f565b505050565b606060fc8054610f1a90613711565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4690613711565b8015610f935780601f10610f6857610100808354040283529160200191610f93565b820191906000526020600020905b815481529060010190602001808311610f7657829003601f168201915b5050505050905090565b6033546001600160a01b03163314610ff75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610484565b6110016000611c63565b565b61016380546105a390613711565b610693338383611cc2565b606061012f6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156110a657600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1681830152825260019092019101611052565b505050509050919050565b336001600160a01b038316146111095760405162461bcd60e51b815260206004820152600b60248201527f6e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610484565b610f06838383611db7565b6001600160a01b0381166000908152610166602052604081205460ff168061116157506001600160a01b0380841660009081526098602090815260408083209386168352929052205460ff165b9392505050565b61117133612008565b6111e35760405162461bcd60e51b815260206004820152602a60248201527f53656e646572206d75737420626520616e20617070726f766564206d696e746560448201527f72206f72206f776e6572000000000000000000000000000000000000000000006064820152608401610484565b60006111ef6101675490565b905061016554600014611274576101655481106112745760405162461bcd60e51b815260206004820152602660248201527f4552433732313a206d696e74696e672061626f76652074686520746f74616c2060448201527f737570706c7900000000000000000000000000000000000000000000000000006064820152608401610484565b61128f85828660405180602001604052806000815250612070565b6112998184612198565b6112a381836123e1565b61071761016780546001019055565b6001600160a01b0385163314806112ce57506112ce8533611114565b61132c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610484565b6107178585858585612439565b6033546001600160a01b031633146113935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610484565b6001600160a01b03811661140f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610484565b610e7e81611c63565b6001600160a01b03831633148061143457506114348333611114565b6114925760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610484565b610f068383836125d2565b600061058f82612750565b600081815260fb60205260408120805460609291906114c690613711565b80601f01602080910402602001604051908101604052809291908181526020018280546114f290613711565b801561153f5780601f106115145761010080835404028352916020019161153f565b820191906000526020600020905b81548152906001019060200180831161152257829003601f168201915b505050505090506000611550610f0b565b9050805160001415611563575092915050565b81511561159557808260405160200161157d92919061350b565b60405160208183030381529060405292505050919050565b8061159f856127eb565b60405160200161157d92919061350b565b6001600160a01b03821660008181526101666020908152604091829020805460ff191685151590811790915591519182527f270dbb8ba4292910ae92862466486be25c355c837270a3d8824b36a8bc7c653b91015b60405180910390a25050565b60006111616127106116238585612941565b9061294d565b815183511461168b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610484565b6001600160a01b0384166116ef5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610484565b3360005b845181101561183857600085828151811061171e57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061174a57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526097835260408082206001600160a01b038e1683529093529190912054909150818110156117de5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610484565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061181d90849061367f565b92505081905550505050806118319061379f565b90506116f3565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611888929190613601565b60405180910390a461189e818787878787612959565b505050505050565b600054610100900460ff166119115760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610484565b61100133611c63565b600054610100900460ff166110015760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610484565b80516106939060fc906020840190612c72565b60005b815181101561069357600161016860008484815181106119cb57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611a078161379f565b91505061199b565b6001600160a01b038316611a715760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610484565b8051825114611ad35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610484565b604080516020810190915260009081905233905b8351811015611c04576000848281518110611b1257634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110611b3e57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526097835260408082206001600160a01b038c168352909352919091205490915081811015611bcb5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610484565b60009283526097602090815260408085206001600160a01b038b1686529091529092209103905580611bfc8161379f565b915050611ae7565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611c55929190613601565b60405180910390a450505050565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611d4a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610484565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600083815261012f60205260408120549080805b83811015611ef157600087815261012f6020526040902080546001600160a01b038816919083908110611e0e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415611edf57600087815261012f60205260409020805482908110611e5857634e487b7160e01b600052603260045260246000fd5b600091825260208083209091015489835261012f909152604090912080546001600160a01b0390921694509192508291869183908110611ea857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790555b80611ee98161379f565b915050611dcb565b506001600160a01b038216611f6e5760405162461bcd60e51b815260206004820152603460248201527f4163636f756e74206e6f7420666f756e642c2061726520796f75207573696e6760448201527f2074686520636f72726563742077616c6c65743f0000000000000000000000006064820152608401610484565b7fbc005e8cd5d1fa8b5fb9cf764b8619c96158b19deb0e54a3ca7877fb6cdf59f086828461012f60008b81526020019081526020016000208581548110611fc557634e487b7160e01b600052603260045260246000fd5b6000918252602091829020015460408051958652918501939093526001600160a01b039182169084015216606082015260800160405180910390a1505050505050565b600061201c6033546001600160a01b031690565b6001600160a01b0316826001600160a01b0316141561203d57506001919050565b6001600160a01b03821661205057600080fd5b506001600160a01b03166000908152610168602052604090205460ff1690565b6001600160a01b0384166120ec5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610484565b33612106816000876120fd88612b0e565b61071788612b0e565b60008481526097602090815260408083206001600160a01b03891684529091528120805485929061213890849061367f565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461071781600087878787612b67565b600082815261012f6020526040902054156121f55760405162461bcd60e51b815260206004820152601560248201527f526f79616c7469657320616c72656164792073657400000000000000000000006044820152606401610484565b60005b81518110156123a35760006001600160a01b031682828151811061222c57634e487b7160e01b600052603260045260246000fd5b6020026020010151600001516001600160a01b0316141561228f5760405162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e7400000000006044820152606401610484565b8181815181106122af57634e487b7160e01b600052603260045260246000fd5b6020026020010151602001516bffffffffffffffffffffffff16600014156123195760405162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f7369746976656044820152606401610484565b600083815261012f60205260409020825183908390811061234a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518254600181018455600093845292829020815191909201516bffffffffffffffffffffffff16600160a01b026001600160a01b03909116179101558061239b8161379f565b9150506121f8565b507f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df82826040516123d5929190613642565b60405180910390a15050565b600082815260fb60209081526040909120825161240092840190612c72565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b61242c846114a8565b604051611605919061362f565b6001600160a01b03841661249d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610484565b336124ad8187876120fd88612b0e565b60008481526097602090815260408083206001600160a01b038a168452909152902054838110156125335760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610484565b60008581526097602090815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061257290849061367f565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610bc7828888888888612b67565b6001600160a01b0383166126345760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610484565b336126648185600061264587612b0e565b61264e87612b0e565b5050604080516020810190915260009052505050565b60008381526097602090815260408083206001600160a01b0388168452909152902054828110156126e35760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610484565b60008481526097602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806127b357506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061058f57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461058f565b60608161282b57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612855578061283f8161379f565b915061284e9050600a83613697565b915061282f565b60008167ffffffffffffffff81111561287e57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156128a8576020820181803683370190505b5090505b8415612939576128bd6001836136ca565b91506128ca600a866137ba565b6128d590603061367f565b60f81b8183815181106128f857634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612932600a86613697565b94506128ac565b949350505050565b600061116182846136ab565b60006111618284613697565b6001600160a01b0384163b1561189e5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061299d908990899088908890889060040161353a565b602060405180830381600087803b1580156129b757600080fd5b505af19250505080156129e7575060408051601f3d908101601f191682019092526129e491810190613283565b60015b612a9d576129f3613810565b806308c379a01415612a2d5750612a08613828565b80612a135750612a2f565b8060405162461bcd60e51b8152600401610484919061362f565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610484565b6001600160e01b0319811663bc197c8160e01b14610bc75760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610484565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612b5657634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b1561189e5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612bab9089908990889088908890600401613598565b602060405180830381600087803b158015612bc557600080fd5b505af1925050508015612bf5575060408051601f3d908101601f19168201909252612bf291810190613283565b60015b612c01576129f3613810565b6001600160e01b0319811663f23a6e6160e01b14610bc75760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610484565b828054612c7e90613711565b90600052602060002090601f016020900481019282612ca05760008555612ce6565b82601f10612cb957805160ff1916838001178555612ce6565b82800160010185558215612ce6579182015b82811115612ce6578251825591602001919060010190612ccb565b50612cf2929150612cf6565b5090565b5b80821115612cf25760008155600101612cf7565b600082601f830112612d1b578081fd5b81356020612d288261365b565b604051612d358282613772565b8381528281019150858301600585901b87018401881015612d54578586fd5b855b85811015612d7b578135612d69816138b2565b84529284019290840190600101612d56565b5090979650505050505050565b600082601f830112612d98578081fd5b81356020612da58261365b565b604051612db28282613772565b8381528281019150858301600585901b87018401881015612dd1578586fd5b855b85811015612d7b57813584529284019290840190600101612dd3565b80358015158114612dff57600080fd5b919050565b600082601f830112612e14578081fd5b813567ffffffffffffffff811115612e2e57612e2e6137fa565b604051612e45601f8301601f191660200182613772565b818152846020838601011115612e59578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215612e84578081fd5b8135611161816138b2565b60008060408385031215612ea1578081fd5b8235612eac816138b2565b91506020830135612ebc816138b2565b809150509250929050565b600080600080600060a08688031215612ede578081fd5b8535612ee9816138b2565b94506020860135612ef9816138b2565b9350604086013567ffffffffffffffff80821115612f15578283fd5b612f2189838a01612d88565b94506060880135915080821115612f36578283fd5b612f4289838a01612d88565b93506080880135915080821115612f57578283fd5b50612f6488828901612e04565b9150509295509295909350565b600080600080600060a08688031215612f88578081fd5b8535612f93816138b2565b94506020860135612fa3816138b2565b93506040860135925060608601359150608086013567ffffffffffffffff811115612fcc578182fd5b612f6488828901612e04565b600080600060608486031215612fec578081fd5b8335612ff7816138b2565b9250602084013567ffffffffffffffff80821115613013578283fd5b61301f87838801612d88565b93506040860135915080821115613034578283fd5b5061304186828701612d88565b9150509250925092565b6000806040838503121561305d578182fd5b8235613068816138b2565b915061307660208401612def565b90509250929050565b60008060408385031215613091578182fd5b823561309c816138b2565b946020939093013593505050565b600080600080608085870312156130bf578182fd5b84356130ca816138b2565b9350602085810135935060408087013567ffffffffffffffff808211156130ef578586fd5b818901915089601f830112613102578586fd5b813561310d8161365b565b84516131198282613772565b8281528681019150848701600684901b860188018e101561313857898afd5b8995505b8386101561319f5786818f03121561315257898afd5b865161315d8161374c565b8135613168816138b2565b8152818901356bffffffffffffffffffffffff81168114613187578b8cfd5b818a015283526001959095019491870191860161313c565b509750505060608901359350808411156131b7578485fd5b5050506131c687828801612e04565b91505092959194509250565b6000806000606084860312156131e6578081fd5b83356131f1816138b2565b95602085013595506040909401359392505050565b60008060408385031215613218578182fd5b823567ffffffffffffffff8082111561322f578384fd5b61323b86838701612d0b565b93506020850135915080821115613250578283fd5b5061325d85828601612d88565b9150509250929050565b600060208284031215613278578081fd5b8135611161816138c7565b600060208284031215613294578081fd5b8151611161816138c7565b6000602082840312156132b0578081fd5b813567ffffffffffffffff8111156132c6578182fd5b61293984828501612e04565b60008060008060008060c087890312156132ea578384fd5b863567ffffffffffffffff80821115613301578586fd5b61330d8a838b01612e04565b97506020890135915080821115613322578586fd5b61332e8a838b01612e04565b96506040890135915080821115613343578586fd5b61334f8a838b01612e04565b95506060890135915080821115613364578283fd5b5061337189828a01612d0b565b93505061338060808801612def565b915060a087013590509295509295509295565b6000602082840312156133a4578081fd5b5035919050565b6000806000606084860312156133bf578081fd5b8335925060208401356133d1816138b2565b915060408401356133e1816138b2565b809150509250925092565b60008060008060808587031215613401578182fd5b843593506020850135613413816138b2565b92506040850135613423816138b2565b9396929550929360600135925050565b60008060408385031215613445578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b838110156134a557815180516001600160a01b031688528301516bffffffffffffffffffffffff168388015260409096019590820190600101613467565b509495945050505050565b6000815180845260208085019450808401835b838110156134a5578151875295820195908201906001016134c3565b600081518084526134f78160208601602086016136e1565b601f01601f19169290920160200192915050565b6000835161351d8184602088016136e1565b8351908301906135318183602088016136e1565b01949350505050565b60006001600160a01b03808816835280871660208401525060a0604083015261356660a08301866134b0565b828103606084015261357881866134b0565b9050828103608084015261358c81856134df565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526135d060a08301846134df565b979650505050505050565b6020815260006111616020830184613454565b60208152600061116160208301846134b0565b60408152600061361460408301856134b0565b828103602084015261362681856134b0565b95945050505050565b60208152600061116160208301846134df565b8281526040602082015260006129396040830184613454565b600067ffffffffffffffff821115613675576136756137fa565b5060051b60200190565b60008219821115613692576136926137ce565b500190565b6000826136a6576136a66137e4565b500490565b60008160001904831182151516156136c5576136c56137ce565b500290565b6000828210156136dc576136dc6137ce565b500390565b60005b838110156136fc5781810151838201526020016136e4565b8381111561370b576000848401525b50505050565b600181811c9082168061372557607f821691505b6020821081141561374657634e487b7160e01b600052602260045260246000fd5b50919050565b6040810181811067ffffffffffffffff8211171561376c5761376c6137fa565b60405250565b601f8201601f1916810167ffffffffffffffff81118282101715613798576137986137fa565b6040525050565b60006000198214156137b3576137b36137ce565b5060010190565b6000826137c9576137c96137e4565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561382557600481823e5160e01c5b90565b600060443d10156138365790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561386657505050505090565b828501915081518181111561387e5750505050505090565b843d87010160208285010111156138985750505050505090565b6138a760208286010187613772565b509095945050505050565b6001600160a01b0381168114610e7e57600080fd5b6001600160e01b031981168114610e7e57600080fdfea264697066735822122092a51a52b91c2340646e501d3e7ba299077294e208c3e3b980856f8320bc5c8164736f6c63430008040033a2646970667358221220d977e745105314e5368ef9273812fed553d8d7c85b36ac1e4b33119c68cac43f64736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.