creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"
      },
      "contracts/administrator/Administrator.sol": {
        "content": "// SPDX-License-Identifier: GPL-2.0\n\npragma solidity 0.8.24;\n\nimport { Initializable }  from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { IRole } from \"./IRole.sol\";\nimport { IPausable } from \"./IPausable.sol\";\nimport { IBlackList } from \"./IBlackList.sol\";\n\ncontract Administrator is IRole, IPausable, IBlackList, Initializable {\n    /** Don't change the order of variables, always append */\n    bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN\");\n    bytes32 public constant OPERATOR_ROLE = keccak256(\"OPERATOR\");\n\n    bool paused;\n    mapping(bytes32 => mapping(address => bool)) private _roles;\n    mapping(address => bool) private _blackList;\n\n    function init(address admin) public initializer {\n        _roles[ADMIN_ROLE][admin] = true;\n    }\n\n    modifier onlyAdmin() {\n        require(hasRole(ADMIN_ROLE, msg.sender), \"!admin\");\n        _;\n    }\n\n    modifier onlyOperator() {\n        require(hasRole(OPERATOR_ROLE, msg.sender), \"!operator\");\n        _;\n    }\n\n    /** Function of Roles **/\n    function hasRole(\n        bytes32 role,\n        address account\n    ) public view override returns (bool) {\n        return _roles[role][account];\n    }\n\n    function hasRoles(\n        bytes32[] calldata role,\n        address[] calldata accounts\n    ) external view override returns (bool[] memory) {\n        bool[] memory result = new bool[](accounts.length);\n        for (uint256 i = 0; i < accounts.length; i++) {\n            for (uint256 j = 0; j < role.length; j++) {\n                result[i] = _roles[role[j]][accounts[i]];\n            }\n        }\n        return result;\n    }\n\n    function grantRoles(\n        bytes32 role,\n        address[] calldata accounts\n    ) external override onlyAdmin {\n        for (uint256 i = 0; i < accounts.length; i++) {\n            _roles[role][accounts[i]] = true;\n            emit RoleGranted(role, msg.sender, accounts[i]);\n        }\n    }\n\n    function revokeRoles(\n        bytes32 role,\n        address[] calldata accounts\n    ) external override onlyAdmin {\n        for (uint256 i = 0; i < accounts.length; i++) {\n            _roles[role][accounts[i]] = false;\n            emit RoleRevoked(role, msg.sender, accounts[i]);\n        }\n    }\n\n    /** Function of Pausable **/\n    function isPaused() external view override returns (bool) {\n        return paused;\n    }\n\n    function pause() external override onlyAdmin {\n        paused = true;\n        emit Paused(msg.sender);\n    }\n\n    function unpause() external override onlyAdmin {\n        paused = false;\n        emit Unpaused(msg.sender);\n    }\n\n    /** Function of blacklist  */\n    function addBlackListUsers(\n        address[] calldata evilUsers\n    ) external override onlyAdmin {\n        for (uint256 i = 0; i < evilUsers.length; i++) {\n            _blackList[evilUsers[i]] = true;\n            emit BlackListed(msg.sender, evilUsers[i]);\n        }\n    }\n\n    function removeBlackListUsers(\n        address[] calldata clearedUsers\n    ) external override onlyAdmin {\n        for (uint256 i = 0; i < clearedUsers.length; i++) {\n            _blackList[clearedUsers[i]] = false;\n            emit BlackListCleared(msg.sender, clearedUsers[i]);\n        }\n    }\n\n    function isBlackListed(\n        address user\n    ) external view override returns (bool) {\n        return _blackList[user];\n    }\n}"
      },
      "contracts/administrator/IBlackList.sol": {
        "content": "// SPDX-License-Identifier: GPL-2.0\npragma solidity 0.8.24;\n\ninterface IBlackList {\n\n    function addBlackListUsers(address[] calldata evilUsers) external;\n    function removeBlackListUsers(address[] calldata clearedUsers) external;\n\n    function isBlackListed(address user) external view returns (bool);\n    \n    event BlackListed(address indexed sender, address indexed user);\n    event BlackListCleared(address indexed sender, address indexed user);\n}"
      },
      "contracts/administrator/IPausable.sol": {
        "content": "// SPDX-License-Identifier: GPL-2.0\npragma solidity 0.8.24;\n\ninterface IPausable {\n    function pause() external;\n    function unpause() external;\n\n    function isPaused() external view returns (bool);\n\n    event Paused(address indexed sender);\n    event Unpaused(address indexed sender);\n}"
      },
      "contracts/administrator/IRole.sol": {
        "content": "// SPDX-License-Identifier: GPL-2.0\npragma solidity 0.8.24;\n\ninterface IRole {\n    function grantRoles(bytes32 role, address[] calldata accounts) external;\n    function revokeRoles(bytes32 role, address[] calldata accounts) external;\n\n    function hasRole(bytes32 role, address account) external view returns (bool);\n    function hasRoles(bytes32[] calldata role, address[] calldata accounts) external view returns (bool[] memory);\n\n    event RoleGranted(bytes32 indexed role, address indexed sender, address indexed account);\n    event RoleRevoked(bytes32 indexed role, address indexed sender, address indexed account);\n}"
      }
    },
    "settings": {
      "evmVersion": "paris",
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}