{"compilation":{"language":"Solidity","compiler":"solc","compilerVersion":"0.8.20+commit.a1b79de6","compilerSettings":{"libraries":{},"optimizer":{"runs":200,"enabled":true},"evmVersion":"london"},"name":"TimelockController","fullyQualifiedName":"TimelockController.sol:TimelockController"},"sources":{"TimelockController.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0 ^0.8.1 ^0.8.16;\r\n\r\n// contracts/external/openzeppelin/contracts/utils/Address.sol\r\n\r\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\r\n\r\n/**\r\n * @dev Collection of functions related to the address type\r\n */\r\nlibrary Address {\r\n  /**\r\n   * @dev Returns true if `account` is a contract.\r\n   *\r\n   * [IMPORTANT]\r\n   * ====\r\n   * It is unsafe to assume that an address for which this function returns\r\n   * false is an externally-owned account (EOA) and not a contract.\r\n   *\r\n   * Among others, `isContract` will return false for the following\r\n   * types of addresses:\r\n   *\r\n   *  - an externally-owned account\r\n   *  - a contract in construction\r\n   *  - an address where a contract will be created\r\n   *  - an address where a contract lived, but was destroyed\r\n   * ====\r\n   *\r\n   * [IMPORTANT]\r\n   * ====\r\n   * You shouldn't rely on `isContract` to protect against flash loan attacks!\r\n   *\r\n   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\r\n   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\r\n   * constructor.\r\n   * ====\r\n   */\r\n  function isContract(address account) internal view returns (bool) {\r\n    // This method relies on extcodesize/address.code.length, which returns 0\r\n    // for contracts in construction, since the code is only stored at the end\r\n    // of the constructor execution.\r\n\r\n    return account.code.length > 0;\r\n  }\r\n\r\n  /**\r\n   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\r\n   * `recipient`, forwarding all available gas and reverting on errors.\r\n   *\r\n   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\r\n   * of certain opcodes, possibly making contracts go over the 2300 gas limit\r\n   * imposed by `transfer`, making them unable to receive funds via\r\n   * `transfer`. {sendValue} removes this limitation.\r\n   *\r\n   * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\r\n   *\r\n   * IMPORTANT: because control is transferred to `recipient`, care must be\r\n   * taken to not create reentrancy vulnerabilities. Consider using\r\n   * {ReentrancyGuard} or the\r\n   * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\r\n   */\r\n  function sendValue(address payable recipient, uint256 amount) internal {\r\n    require(address(this).balance >= amount, \"Address: insufficient balance\");\r\n\r\n    (bool success, ) = recipient.call{value: amount}(\"\");\r\n    require(\r\n      success,\r\n      \"Address: unable to send value, recipient may have reverted\"\r\n    );\r\n  }\r\n\r\n  /**\r\n   * @dev Performs a Solidity function call using a low level `call`. A\r\n   * plain `call` is an unsafe replacement for a function call: use this\r\n   * function instead.\r\n   *\r\n   * If `target` reverts with a revert reason, it is bubbled up by this\r\n   * function (like regular Solidity function calls).\r\n   *\r\n   * Returns the raw returned data. To convert to the expected return value,\r\n   * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - `target` must be a contract.\r\n   * - calling `target` with `data` must not revert.\r\n   *\r\n   * _Available since v3.1._\r\n   */\r\n  function functionCall(address target, bytes memory data)\r\n    internal\r\n    returns (bytes memory)\r\n  {\r\n    return functionCall(target, data, \"Address: low-level call failed\");\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\r\n   * `errorMessage` as a fallback revert reason when `target` reverts.\r\n   *\r\n   * _Available since v3.1._\r\n   */\r\n  function functionCall(\r\n    address target,\r\n    bytes memory data,\r\n    string memory errorMessage\r\n  ) internal returns (bytes memory) {\r\n    return functionCallWithValue(target, data, 0, errorMessage);\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n   * but also transferring `value` wei to `target`.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the calling contract must have an ETH balance of at least `value`.\r\n   * - the called Solidity function must be `payable`.\r\n   *\r\n   * _Available since v3.1._\r\n   */\r\n  function functionCallWithValue(\r\n    address target,\r\n    bytes memory data,\r\n    uint256 value\r\n  ) internal returns (bytes memory) {\r\n    return\r\n      functionCallWithValue(\r\n        target,\r\n        data,\r\n        value,\r\n        \"Address: low-level call with value failed\"\r\n      );\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\r\n   * with `errorMessage` as a fallback revert reason when `target` reverts.\r\n   *\r\n   * _Available since v3.1._\r\n   */\r\n  function functionCallWithValue(\r\n    address target,\r\n    bytes memory data,\r\n    uint256 value,\r\n    string memory errorMessage\r\n  ) internal returns (bytes memory) {\r\n    require(\r\n      address(this).balance >= value,\r\n      \"Address: insufficient balance for call\"\r\n    );\r\n    require(isContract(target), \"Address: call to non-contract\");\r\n\r\n    (bool success, bytes memory returndata) = target.call{value: value}(data);\r\n    return verifyCallResult(success, returndata, errorMessage);\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n   * but performing a static call.\r\n   *\r\n   * _Available since v3.3._\r\n   */\r\n  function functionStaticCall(address target, bytes memory data)\r\n    internal\r\n    view\r\n    returns (bytes memory)\r\n  {\r\n    return\r\n      functionStaticCall(target, data, \"Address: low-level static call failed\");\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n   * but performing a static call.\r\n   *\r\n   * _Available since v3.3._\r\n   */\r\n  function functionStaticCall(\r\n    address target,\r\n    bytes memory data,\r\n    string memory errorMessage\r\n  ) internal view returns (bytes memory) {\r\n    require(isContract(target), \"Address: static call to non-contract\");\r\n\r\n    (bool success, bytes memory returndata) = target.staticcall(data);\r\n    return verifyCallResult(success, returndata, errorMessage);\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n   * but performing a delegate call.\r\n   *\r\n   * _Available since v3.4._\r\n   */\r\n  function functionDelegateCall(address target, bytes memory data)\r\n    internal\r\n    returns (bytes memory)\r\n  {\r\n    return\r\n      functionDelegateCall(\r\n        target,\r\n        data,\r\n        \"Address: low-level delegate call failed\"\r\n      );\r\n  }\r\n\r\n  /**\r\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n   * but performing a delegate call.\r\n   *\r\n   * _Available since v3.4._\r\n   */\r\n  function functionDelegateCall(\r\n    address target,\r\n    bytes memory data,\r\n    string memory errorMessage\r\n  ) internal returns (bytes memory) {\r\n    require(isContract(target), \"Address: delegate call to non-contract\");\r\n\r\n    (bool success, bytes memory returndata) = target.delegatecall(data);\r\n    return verifyCallResult(success, returndata, errorMessage);\r\n  }\r\n\r\n  /**\r\n   * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\r\n   * revert reason using the provided one.\r\n   *\r\n   * _Available since v4.3._\r\n   */\r\n  function verifyCallResult(\r\n    bool success,\r\n    bytes memory returndata,\r\n    string memory errorMessage\r\n  ) internal pure returns (bytes memory) {\r\n    if (success) {\r\n      return returndata;\r\n    } else {\r\n      // Look for revert reason and bubble it up if present\r\n      if (returndata.length > 0) {\r\n        // The easiest way to bubble the revert reason is using memory via assembly\r\n\r\n        assembly {\r\n          let returndata_size := mload(returndata)\r\n          revert(add(32, returndata), returndata_size)\r\n        }\r\n      } else {\r\n        revert(errorMessage);\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/utils/Context.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\r\n\r\n/**\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n  function _msgSender() internal view virtual returns (address) {\r\n    return msg.sender;\r\n  }\r\n\r\n  function _msgData() internal view virtual returns (bytes calldata) {\r\n    return msg.data;\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/utils/EnumerableSet.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)\r\n\r\n/**\r\n * @dev Library for managing\r\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\r\n * types.\r\n *\r\n * Sets have the following properties:\r\n *\r\n * - Elements are added, removed, and checked for existence in constant time\r\n * (O(1)).\r\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\r\n *\r\n * ```\r\n * contract Example {\r\n *     // Add the library methods\r\n *     using EnumerableSet for EnumerableSet.AddressSet;\r\n *\r\n *     // Declare a set state variable\r\n *     EnumerableSet.AddressSet private mySet;\r\n * }\r\n * ```\r\n *\r\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\r\n * and `uint256` (`UintSet`) are supported.\r\n */\r\nlibrary EnumerableSet {\r\n  // To implement this library for multiple types with as little code\r\n  // repetition as possible, we write it in terms of a generic Set type with\r\n  // bytes32 values.\r\n  // The Set implementation uses private functions, and user-facing\r\n  // implementations (such as AddressSet) are just wrappers around the\r\n  // underlying Set.\r\n  // This means that we can only create new EnumerableSets for types that fit\r\n  // in bytes32.\r\n\r\n  struct Set {\r\n    // Storage of set values\r\n    bytes32[] _values;\r\n    // Position of the value in the `values` array, plus 1 because index 0\r\n    // means a value is not in the set.\r\n    mapping(bytes32 => uint256) _indexes;\r\n  }\r\n\r\n  /**\r\n   * @dev Add a value to a set. O(1).\r\n   *\r\n   * Returns true if the value was added to the set, that is if it was not\r\n   * already present.\r\n   */\r\n  function _add(Set storage set, bytes32 value) private returns (bool) {\r\n    if (!_contains(set, value)) {\r\n      set._values.push(value);\r\n      // The value is stored at length-1, but we add 1 to all indexes\r\n      // and use 0 as a sentinel value\r\n      set._indexes[value] = set._values.length;\r\n      return true;\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n\r\n  /**\r\n   * @dev Removes a value from a set. O(1).\r\n   *\r\n   * Returns true if the value was removed from the set, that is if it was\r\n   * present.\r\n   */\r\n  function _remove(Set storage set, bytes32 value) private returns (bool) {\r\n    // We read and store the value's index to prevent multiple reads from the same storage slot\r\n    uint256 valueIndex = set._indexes[value];\r\n\r\n    if (valueIndex != 0) {\r\n      // Equivalent to contains(set, value)\r\n      // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\r\n      // the array, and then remove the last element (sometimes called as 'swap and pop').\r\n      // This modifies the order of the array, as noted in {at}.\r\n\r\n      uint256 toDeleteIndex = valueIndex - 1;\r\n      uint256 lastIndex = set._values.length - 1;\r\n\r\n      if (lastIndex != toDeleteIndex) {\r\n        bytes32 lastvalue = set._values[lastIndex];\r\n\r\n        // Move the last value to the index where the value to delete is\r\n        set._values[toDeleteIndex] = lastvalue;\r\n        // Update the index for the moved value\r\n        set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\r\n      }\r\n\r\n      // Delete the slot where the moved value was stored\r\n      set._values.pop();\r\n\r\n      // Delete the index for the deleted slot\r\n      delete set._indexes[value];\r\n\r\n      return true;\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n\r\n  /**\r\n   * @dev Returns true if the value is in the set. O(1).\r\n   */\r\n  function _contains(Set storage set, bytes32 value)\r\n    private\r\n    view\r\n    returns (bool)\r\n  {\r\n    return set._indexes[value] != 0;\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the number of values on the set. O(1).\r\n   */\r\n  function _length(Set storage set) private view returns (uint256) {\r\n    return set._values.length;\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the value stored at position `index` in the set. O(1).\r\n   *\r\n   * Note that there are no guarantees on the ordering of values inside the\r\n   * array, and it may change when more values are added or removed.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - `index` must be strictly less than {length}.\r\n   */\r\n  function _at(Set storage set, uint256 index) private view returns (bytes32) {\r\n    return set._values[index];\r\n  }\r\n\r\n  /**\r\n   * @dev Return the entire set in an array\r\n   *\r\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\r\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\r\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\r\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\r\n   */\r\n  function _values(Set storage set) private view returns (bytes32[] memory) {\r\n    return set._values;\r\n  }\r\n\r\n  // Bytes32Set\r\n\r\n  struct Bytes32Set {\r\n    Set _inner;\r\n  }\r\n\r\n  /**\r\n   * @dev Add a value to a set. O(1).\r\n   *\r\n   * Returns true if the value was added to the set, that is if it was not\r\n   * already present.\r\n   */\r\n  function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\r\n    return _add(set._inner, value);\r\n  }\r\n\r\n  /**\r\n   * @dev Removes a value from a set. O(1).\r\n   *\r\n   * Returns true if the value was removed from the set, that is if it was\r\n   * present.\r\n   */\r\n  function remove(Bytes32Set storage set, bytes32 value)\r\n    internal\r\n    returns (bool)\r\n  {\r\n    return _remove(set._inner, value);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns true if the value is in the set. O(1).\r\n   */\r\n  function contains(Bytes32Set storage set, bytes32 value)\r\n    internal\r\n    view\r\n    returns (bool)\r\n  {\r\n    return _contains(set._inner, value);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the number of values in the set. O(1).\r\n   */\r\n  function length(Bytes32Set storage set) internal view returns (uint256) {\r\n    return _length(set._inner);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the value stored at position `index` in the set. O(1).\r\n   *\r\n   * Note that there are no guarantees on the ordering of values inside the\r\n   * array, and it may change when more values are added or removed.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - `index` must be strictly less than {length}.\r\n   */\r\n  function at(Bytes32Set storage set, uint256 index)\r\n    internal\r\n    view\r\n    returns (bytes32)\r\n  {\r\n    return _at(set._inner, index);\r\n  }\r\n\r\n  /**\r\n   * @dev Return the entire set in an array\r\n   *\r\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\r\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\r\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\r\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\r\n   */\r\n  function values(Bytes32Set storage set)\r\n    internal\r\n    view\r\n    returns (bytes32[] memory)\r\n  {\r\n    return _values(set._inner);\r\n  }\r\n\r\n  // AddressSet\r\n\r\n  struct AddressSet {\r\n    Set _inner;\r\n  }\r\n\r\n  /**\r\n   * @dev Add a value to a set. O(1).\r\n   *\r\n   * Returns true if the value was added to the set, that is if it was not\r\n   * already present.\r\n   */\r\n  function add(AddressSet storage set, address value) internal returns (bool) {\r\n    return _add(set._inner, bytes32(uint256(uint160(value))));\r\n  }\r\n\r\n  /**\r\n   * @dev Removes a value from a set. O(1).\r\n   *\r\n   * Returns true if the value was removed from the set, that is if it was\r\n   * present.\r\n   */\r\n  function remove(AddressSet storage set, address value)\r\n    internal\r\n    returns (bool)\r\n  {\r\n    return _remove(set._inner, bytes32(uint256(uint160(value))));\r\n  }\r\n\r\n  /**\r\n   * @dev Returns true if the value is in the set. O(1).\r\n   */\r\n  function contains(AddressSet storage set, address value)\r\n    internal\r\n    view\r\n    returns (bool)\r\n  {\r\n    return _contains(set._inner, bytes32(uint256(uint160(value))));\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the number of values in the set. O(1).\r\n   */\r\n  function length(AddressSet storage set) internal view returns (uint256) {\r\n    return _length(set._inner);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the value stored at position `index` in the set. O(1).\r\n   *\r\n   * Note that there are no guarantees on the ordering of values inside the\r\n   * array, and it may change when more values are added or removed.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - `index` must be strictly less than {length}.\r\n   */\r\n  function at(AddressSet storage set, uint256 index)\r\n    internal\r\n    view\r\n    returns (address)\r\n  {\r\n    return address(uint160(uint256(_at(set._inner, index))));\r\n  }\r\n\r\n  /**\r\n   * @dev Return the entire set in an array\r\n   *\r\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\r\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\r\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\r\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\r\n   */\r\n  function values(AddressSet storage set)\r\n    internal\r\n    view\r\n    returns (address[] memory)\r\n  {\r\n    bytes32[] memory store = _values(set._inner);\r\n    address[] memory result;\r\n\r\n    assembly {\r\n      result := store\r\n    }\r\n\r\n    return result;\r\n  }\r\n\r\n  // UintSet\r\n\r\n  struct UintSet {\r\n    Set _inner;\r\n  }\r\n\r\n  /**\r\n   * @dev Add a value to a set. O(1).\r\n   *\r\n   * Returns true if the value was added to the set, that is if it was not\r\n   * already present.\r\n   */\r\n  function add(UintSet storage set, uint256 value) internal returns (bool) {\r\n    return _add(set._inner, bytes32(value));\r\n  }\r\n\r\n  /**\r\n   * @dev Removes a value from a set. O(1).\r\n   *\r\n   * Returns true if the value was removed from the set, that is if it was\r\n   * present.\r\n   */\r\n  function remove(UintSet storage set, uint256 value) internal returns (bool) {\r\n    return _remove(set._inner, bytes32(value));\r\n  }\r\n\r\n  /**\r\n   * @dev Returns true if the value is in the set. O(1).\r\n   */\r\n  function contains(UintSet storage set, uint256 value)\r\n    internal\r\n    view\r\n    returns (bool)\r\n  {\r\n    return _contains(set._inner, bytes32(value));\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the number of values on the set. O(1).\r\n   */\r\n  function length(UintSet storage set) internal view returns (uint256) {\r\n    return _length(set._inner);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the value stored at position `index` in the set. O(1).\r\n   *\r\n   * Note that there are no guarantees on the ordering of values inside the\r\n   * array, and it may change when more values are added or removed.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - `index` must be strictly less than {length}.\r\n   */\r\n  function at(UintSet storage set, uint256 index)\r\n    internal\r\n    view\r\n    returns (uint256)\r\n  {\r\n    return uint256(_at(set._inner, index));\r\n  }\r\n\r\n  /**\r\n   * @dev Return the entire set in an array\r\n   *\r\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\r\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\r\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\r\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\r\n   */\r\n  function values(UintSet storage set)\r\n    internal\r\n    view\r\n    returns (uint256[] memory)\r\n  {\r\n    bytes32[] memory store = _values(set._inner);\r\n    uint256[] memory result;\r\n\r\n    assembly {\r\n      result := store\r\n    }\r\n\r\n    return result;\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/access/IAccessControl.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\r\n\r\n/**\r\n * @dev External interface of AccessControl declared to support ERC165 detection.\r\n */\r\ninterface IAccessControl {\r\n  /**\r\n   * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\r\n   *\r\n   * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\r\n   * {RoleAdminChanged} not being emitted signaling this.\r\n   *\r\n   * _Available since v3.1._\r\n   */\r\n  event RoleAdminChanged(\r\n    bytes32 indexed role,\r\n    bytes32 indexed previousAdminRole,\r\n    bytes32 indexed newAdminRole\r\n  );\r\n\r\n  /**\r\n   * @dev Emitted when `account` is granted `role`.\r\n   *\r\n   * `sender` is the account that originated the contract call, an admin role\r\n   * bearer except when using {AccessControl-_setupRole}.\r\n   */\r\n  event RoleGranted(\r\n    bytes32 indexed role,\r\n    address indexed account,\r\n    address indexed sender\r\n  );\r\n\r\n  /**\r\n   * @dev Emitted when `account` is revoked `role`.\r\n   *\r\n   * `sender` is the account that originated the contract call:\r\n   *   - if using `revokeRole`, it is the admin role bearer\r\n   *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\r\n   */\r\n  event RoleRevoked(\r\n    bytes32 indexed role,\r\n    address indexed account,\r\n    address indexed sender\r\n  );\r\n\r\n  /**\r\n   * @dev Returns `true` if `account` has been granted `role`.\r\n   */\r\n  function hasRole(bytes32 role, address account) external view returns (bool);\r\n\r\n  /**\r\n   * @dev Returns the admin role that controls `role`. See {grantRole} and\r\n   * {revokeRole}.\r\n   *\r\n   * To change a role's admin, use {AccessControl-_setRoleAdmin}.\r\n   */\r\n  function getRoleAdmin(bytes32 role) external view returns (bytes32);\r\n\r\n  /**\r\n   * @dev Grants `role` to `account`.\r\n   *\r\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\r\n   * event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must have ``role``'s admin role.\r\n   */\r\n  function grantRole(bytes32 role, address account) external;\r\n\r\n  /**\r\n   * @dev Revokes `role` from `account`.\r\n   *\r\n   * If `account` had been granted `role`, emits a {RoleRevoked} event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must have ``role``'s admin role.\r\n   */\r\n  function revokeRole(bytes32 role, address account) external;\r\n\r\n  /**\r\n   * @dev Revokes `role` from the calling account.\r\n   *\r\n   * Roles are often managed via {grantRole} and {revokeRole}: this function's\r\n   * purpose is to provide a mechanism for accounts to lose their privileges\r\n   * if they are compromised (such as when a trusted device is misplaced).\r\n   *\r\n   * If the calling account had been granted `role`, emits a {RoleRevoked}\r\n   * event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must be `account`.\r\n   */\r\n  function renounceRole(bytes32 role, address account) external;\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/utils/IERC165.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\r\n\r\n/**\r\n * @dev Interface of the ERC165 standard, as defined in the\r\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\r\n *\r\n * Implementers can declare support of contract interfaces, which can then be\r\n * queried by others ({ERC165Checker}).\r\n *\r\n * For an implementation, see {ERC165}.\r\n */\r\ninterface IERC165 {\r\n  /**\r\n   * @dev Returns true if this contract implements the interface defined by\r\n   * `interfaceId`. See the corresponding\r\n   * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\r\n   * to learn more about how these ids are created.\r\n   *\r\n   * This function call must use less than 30 000 gas.\r\n   */\r\n  function supportsInterface(bytes4 interfaceId) external view returns (bool);\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/utils/Strings.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\r\n\r\n/**\r\n * @dev String operations.\r\n */\r\nlibrary Strings {\r\n  bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\r\n\r\n  /**\r\n   * @dev Converts a `uint256` to its ASCII `string` decimal representation.\r\n   */\r\n  function toString(uint256 value) internal pure returns (string memory) {\r\n    // Inspired by OraclizeAPI's implementation - MIT licence\r\n    // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\r\n\r\n    if (value == 0) {\r\n      return \"0\";\r\n    }\r\n    uint256 temp = value;\r\n    uint256 digits;\r\n    while (temp != 0) {\r\n      digits++;\r\n      temp /= 10;\r\n    }\r\n    bytes memory buffer = new bytes(digits);\r\n    while (value != 0) {\r\n      digits -= 1;\r\n      buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\r\n      value /= 10;\r\n    }\r\n    return string(buffer);\r\n  }\r\n\r\n  /**\r\n   * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\r\n   */\r\n  function toHexString(uint256 value) internal pure returns (string memory) {\r\n    if (value == 0) {\r\n      return \"0x00\";\r\n    }\r\n    uint256 temp = value;\r\n    uint256 length = 0;\r\n    while (temp != 0) {\r\n      length++;\r\n      temp >>= 8;\r\n    }\r\n    return toHexString(value, length);\r\n  }\r\n\r\n  /**\r\n   * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\r\n   */\r\n  function toHexString(uint256 value, uint256 length)\r\n    internal\r\n    pure\r\n    returns (string memory)\r\n  {\r\n    bytes memory buffer = new bytes(2 * length + 2);\r\n    buffer[0] = \"0\";\r\n    buffer[1] = \"x\";\r\n    for (uint256 i = 2 * length + 1; i > 1; --i) {\r\n      buffer[i] = _HEX_SYMBOLS[value & 0xf];\r\n      value >>= 4;\r\n    }\r\n    require(value == 0, \"Strings: hex length insufficient\");\r\n    return string(buffer);\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/utils/ERC165.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\r\n\r\n/**\r\n * @dev Implementation of the {IERC165} interface.\r\n *\r\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\r\n * for the additional interface id that will be supported. For example:\r\n *\r\n * ```solidity\r\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\r\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\r\n * }\r\n * ```\r\n *\r\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\r\n */\r\nabstract contract ERC165 is IERC165 {\r\n  /**\r\n   * @dev See {IERC165-supportsInterface}.\r\n   */\r\n  function supportsInterface(bytes4 interfaceId)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (bool)\r\n  {\r\n    return interfaceId == type(IERC165).interfaceId;\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol\r\n\r\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\r\n\r\n/**\r\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\r\n */\r\ninterface IAccessControlEnumerable is IAccessControl {\r\n  /**\r\n   * @dev Returns one of the accounts that have `role`. `index` must be a\r\n   * value between 0 and {getRoleMemberCount}, non-inclusive.\r\n   *\r\n   * Role bearers are not sorted in any particular way, and their ordering may\r\n   * change at any point.\r\n   *\r\n   * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\r\n   * you perform all queries on the same block. See the following\r\n   * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\r\n   * for more information.\r\n   */\r\n  function getRoleMember(bytes32 role, uint256 index)\r\n    external\r\n    view\r\n    returns (address);\r\n\r\n  /**\r\n   * @dev Returns the number of accounts that have `role`. Can be used\r\n   * together with {getRoleMember} to enumerate all bearers of a role.\r\n   */\r\n  function getRoleMemberCount(bytes32 role) external view returns (uint256);\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/access/AccessControl.sol\r\n\r\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\r\n\r\n/**\r\n * @dev Contract module that allows children to implement role-based access\r\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\r\n * members except through off-chain means by accessing the contract event logs. Some\r\n * applications may benefit from on-chain enumerability, for those cases see\r\n * {AccessControlEnumerable}.\r\n *\r\n * Roles are referred to by their `bytes32` identifier. These should be exposed\r\n * in the external API and be unique. The best way to achieve this is by\r\n * using `public constant` hash digests:\r\n *\r\n * ```\r\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\r\n * ```\r\n *\r\n * Roles can be used to represent a set of permissions. To restrict access to a\r\n * function call, use {hasRole}:\r\n *\r\n * ```\r\n * function foo() public {\r\n *     require(hasRole(MY_ROLE, msg.sender));\r\n *     ...\r\n * }\r\n * ```\r\n *\r\n * Roles can be granted and revoked dynamically via the {grantRole} and\r\n * {revokeRole} functions. Each role has an associated admin role, and only\r\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\r\n *\r\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\r\n * that only accounts with this role will be able to grant or revoke other\r\n * roles. More complex role relationships can be created by using\r\n * {_setRoleAdmin}.\r\n *\r\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\r\n * grant and revoke this role. Extra precautions should be taken to secure\r\n * accounts that have been granted it.\r\n */\r\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\r\n  struct RoleData {\r\n    mapping(address => bool) members;\r\n    bytes32 adminRole;\r\n  }\r\n\r\n  mapping(bytes32 => RoleData) private _roles;\r\n\r\n  bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\r\n\r\n  /**\r\n   * @dev Modifier that checks that an account has a specific role. Reverts\r\n   * with a standardized message including the required role.\r\n   *\r\n   * The format of the revert reason is given by the following regular expression:\r\n   *\r\n   *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\r\n   *\r\n   * _Available since v4.1._\r\n   */\r\n  modifier onlyRole(bytes32 role) {\r\n    _checkRole(role, _msgSender());\r\n    _;\r\n  }\r\n\r\n  /**\r\n   * @dev See {IERC165-supportsInterface}.\r\n   */\r\n  function supportsInterface(bytes4 interfaceId)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (bool)\r\n  {\r\n    return\r\n      interfaceId == type(IAccessControl).interfaceId ||\r\n      super.supportsInterface(interfaceId);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns `true` if `account` has been granted `role`.\r\n   */\r\n  function hasRole(bytes32 role, address account)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (bool)\r\n  {\r\n    return _roles[role].members[account];\r\n  }\r\n\r\n  /**\r\n   * @dev Revert with a standard message if `account` is missing `role`.\r\n   *\r\n   * The format of the revert reason is given by the following regular expression:\r\n   *\r\n   *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\r\n   */\r\n  function _checkRole(bytes32 role, address account) internal view virtual {\r\n    if (!hasRole(role, account)) {\r\n      revert(\r\n        string(\r\n          abi.encodePacked(\r\n            \"AccessControl: account \",\r\n            Strings.toHexString(uint160(account), 20),\r\n            \" is missing role \",\r\n            Strings.toHexString(uint256(role), 32)\r\n          )\r\n        )\r\n      );\r\n    }\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the admin role that controls `role`. See {grantRole} and\r\n   * {revokeRole}.\r\n   *\r\n   * To change a role's admin, use {_setRoleAdmin}.\r\n   */\r\n  function getRoleAdmin(bytes32 role)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (bytes32)\r\n  {\r\n    return _roles[role].adminRole;\r\n  }\r\n\r\n  /**\r\n   * @dev Grants `role` to `account`.\r\n   *\r\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\r\n   * event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must have ``role``'s admin role.\r\n   */\r\n  function grantRole(bytes32 role, address account)\r\n    public\r\n    virtual\r\n    override\r\n    onlyRole(getRoleAdmin(role))\r\n  {\r\n    _grantRole(role, account);\r\n  }\r\n\r\n  /**\r\n   * @dev Revokes `role` from `account`.\r\n   *\r\n   * If `account` had been granted `role`, emits a {RoleRevoked} event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must have ``role``'s admin role.\r\n   */\r\n  function revokeRole(bytes32 role, address account)\r\n    public\r\n    virtual\r\n    override\r\n    onlyRole(getRoleAdmin(role))\r\n  {\r\n    _revokeRole(role, account);\r\n  }\r\n\r\n  /**\r\n   * @dev Revokes `role` from the calling account.\r\n   *\r\n   * Roles are often managed via {grantRole} and {revokeRole}: this function's\r\n   * purpose is to provide a mechanism for accounts to lose their privileges\r\n   * if they are compromised (such as when a trusted device is misplaced).\r\n   *\r\n   * If the calling account had been revoked `role`, emits a {RoleRevoked}\r\n   * event.\r\n   *\r\n   * Requirements:\r\n   *\r\n   * - the caller must be `account`.\r\n   */\r\n  function renounceRole(bytes32 role, address account) public virtual override {\r\n    require(\r\n      account == _msgSender(),\r\n      \"AccessControl: can only renounce roles for self\"\r\n    );\r\n\r\n    _revokeRole(role, account);\r\n  }\r\n\r\n  /**\r\n   * @dev Grants `role` to `account`.\r\n   *\r\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\r\n   * event. Note that unlike {grantRole}, this function doesn't perform any\r\n   * checks on the calling account.\r\n   *\r\n   * [WARNING]\r\n   * ====\r\n   * This function should only be called from the constructor when setting\r\n   * up the initial roles for the system.\r\n   *\r\n   * Using this function in any other way is effectively circumventing the admin\r\n   * system imposed by {AccessControl}.\r\n   * ====\r\n   *\r\n   * NOTE: This function is deprecated in favor of {_grantRole}.\r\n   */\r\n  function _setupRole(bytes32 role, address account) internal virtual {\r\n    _grantRole(role, account);\r\n  }\r\n\r\n  /**\r\n   * @dev Sets `adminRole` as ``role``'s admin role.\r\n   *\r\n   * Emits a {RoleAdminChanged} event.\r\n   */\r\n  function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\r\n    bytes32 previousAdminRole = getRoleAdmin(role);\r\n    _roles[role].adminRole = adminRole;\r\n    emit RoleAdminChanged(role, previousAdminRole, adminRole);\r\n  }\r\n\r\n  /**\r\n   * @dev Grants `role` to `account`.\r\n   *\r\n   * Internal function without access restriction.\r\n   */\r\n  function _grantRole(bytes32 role, address account) internal virtual {\r\n    if (!hasRole(role, account)) {\r\n      _roles[role].members[account] = true;\r\n      emit RoleGranted(role, account, _msgSender());\r\n    }\r\n  }\r\n\r\n  /**\r\n   * @dev Revokes `role` from `account`.\r\n   *\r\n   * Internal function without access restriction.\r\n   */\r\n  function _revokeRole(bytes32 role, address account) internal virtual {\r\n    if (hasRole(role, account)) {\r\n      _roles[role].members[account] = false;\r\n      emit RoleRevoked(role, account, _msgSender());\r\n    }\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/access/AccessControlEnumerable.sol\r\n\r\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\r\n\r\n/**\r\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\r\n */\r\nabstract contract AccessControlEnumerable is\r\n  IAccessControlEnumerable,\r\n  AccessControl\r\n{\r\n  using EnumerableSet for EnumerableSet.AddressSet;\r\n\r\n  mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\r\n\r\n  /**\r\n   * @dev See {IERC165-supportsInterface}.\r\n   */\r\n  function supportsInterface(bytes4 interfaceId)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (bool)\r\n  {\r\n    return\r\n      interfaceId == type(IAccessControlEnumerable).interfaceId ||\r\n      super.supportsInterface(interfaceId);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns one of the accounts that have `role`. `index` must be a\r\n   * value between 0 and {getRoleMemberCount}, non-inclusive.\r\n   *\r\n   * Role bearers are not sorted in any particular way, and their ordering may\r\n   * change at any point.\r\n   *\r\n   * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\r\n   * you perform all queries on the same block. See the following\r\n   * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\r\n   * for more information.\r\n   */\r\n  function getRoleMember(bytes32 role, uint256 index)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (address)\r\n  {\r\n    return _roleMembers[role].at(index);\r\n  }\r\n\r\n  /**\r\n   * @dev Returns the number of accounts that have `role`. Can be used\r\n   * together with {getRoleMember} to enumerate all bearers of a role.\r\n   */\r\n  function getRoleMemberCount(bytes32 role)\r\n    public\r\n    view\r\n    virtual\r\n    override\r\n    returns (uint256)\r\n  {\r\n    return _roleMembers[role].length();\r\n  }\r\n\r\n  /**\r\n   * @dev Overload {_grantRole} to track enumerable memberships\r\n   */\r\n  function _grantRole(bytes32 role, address account) internal virtual override {\r\n    super._grantRole(role, account);\r\n    _roleMembers[role].add(account);\r\n  }\r\n\r\n  /**\r\n   * @dev Overload {_revokeRole} to track enumerable memberships\r\n   */\r\n  function _revokeRole(bytes32 role, address account)\r\n    internal\r\n    virtual\r\n    override\r\n  {\r\n    super._revokeRole(role, account);\r\n    _roleMembers[role].remove(account);\r\n  }\r\n}\r\n\r\n// contracts/external/openzeppelin/contracts/security/TimelockController.sol\r\n// Copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d9933585b6c134589d6819909a932de4c1a0db7f/contracts/governance/TimelockController.sol\r\n// NOTE: Removed inheritance of `ERC721Holder` and `ERC1155Holder`, as our TimelockController\r\n//       is intended to be used for administrative tasks only. Also changed from using AccessControl\r\n//       to using AccessControlEnumerable, as this aligns better with our standards.\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/TimelockController.sol)\r\n\r\n/**\r\n * @dev Contract module which acts as a timelocked controller. When set as the\r\n * owner of an `Ownable` smart contract, it enforces a timelock on all\r\n * `onlyOwner` maintenance operations. This gives time for users of the\r\n * controlled contract to exit before a potentially dangerous maintenance\r\n * operation is applied.\r\n *\r\n * By default, this contract is self administered, meaning administration tasks\r\n * have to go through the timelock process. The proposer (resp executor) role\r\n * is in charge of proposing (resp executing) operations. A common use case is\r\n * to position this {TimelockController} as the owner of a smart contract, with\r\n * a multisig or a DAO as the sole proposer.\r\n */\r\ncontract TimelockController is AccessControlEnumerable {\r\n    bytes32 public constant PROPOSER_ROLE = keccak256(\"PROPOSER_ROLE\");\r\n    bytes32 public constant EXECUTOR_ROLE = keccak256(\"EXECUTOR_ROLE\");\r\n    bytes32 public constant CANCELLER_ROLE = keccak256(\"CANCELLER_ROLE\");\r\n    uint256 internal constant _DONE_TIMESTAMP = uint256(1);\r\n\r\n    mapping(bytes32 => uint256) private _timestamps;\r\n    uint256 private _minDelay;\r\n\r\n    enum OperationState {\r\n        Unset,\r\n        Waiting,\r\n        Ready,\r\n        Done\r\n    }\r\n\r\n    /**\r\n     * @dev Mismatch between the parameters length for an operation call.\r\n     */\r\n    error TimelockInvalidOperationLength(uint256 targets, uint256 payloads, uint256 values);\r\n\r\n    /**\r\n     * @dev The schedule operation doesn't meet the minimum delay.\r\n     */\r\n    error TimelockInsufficientDelay(uint256 delay, uint256 minDelay);\r\n\r\n    /**\r\n     * @dev The current state of an operation is not as required.\r\n     * The `expectedStates` is a bitmap with the bits enabled for each OperationState enum position\r\n     * counting from right to left.\r\n     *\r\n     * See {_encodeStateBitmap}.\r\n     */\r\n    error TimelockUnexpectedOperationState(bytes32 operationId, bytes32 expectedStates);\r\n\r\n    /**\r\n     * @dev The predecessor to an operation not yet done.\r\n     */\r\n    error TimelockUnexecutedPredecessor(bytes32 predecessorId);\r\n\r\n    /**\r\n     * @dev The caller account is not authorized.\r\n     */\r\n    error TimelockUnauthorizedCaller(address caller);\r\n\r\n    /**\r\n     * @dev Emitted when a call is scheduled as part of operation `id`.\r\n     */\r\n    event CallScheduled(\r\n        bytes32 indexed id,\r\n        uint256 indexed index,\r\n        address target,\r\n        uint256 value,\r\n        bytes data,\r\n        bytes32 predecessor,\r\n        uint256 delay\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when a call is performed as part of operation `id`.\r\n     */\r\n    event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data);\r\n\r\n    /**\r\n     * @dev Emitted when new proposal is scheduled with non-zero salt.\r\n     */\r\n    event CallSalt(bytes32 indexed id, bytes32 salt);\r\n\r\n    /**\r\n     * @dev Emitted when operation `id` is cancelled.\r\n     */\r\n    event Cancelled(bytes32 indexed id);\r\n\r\n    /**\r\n     * @dev Emitted when the minimum delay for future operations is modified.\r\n     */\r\n    event MinDelayChange(uint256 oldDuration, uint256 newDuration);\r\n\r\n    /**\r\n     * @dev Initializes the contract with the following parameters:\r\n     *\r\n     * - `minDelay`: initial minimum delay in seconds for operations\r\n     * - `proposers`: accounts to be granted proposer and canceller roles\r\n     * - `executors`: accounts to be granted executor role\r\n     * - `admin`: optional account to be granted admin role; disable with zero address\r\n     *\r\n     * IMPORTANT: The optional admin can aid with initial configuration of roles after deployment\r\n     * without being subject to delay, but this role should be subsequently renounced in favor of\r\n     * administration through timelocked proposals. Previous versions of this contract would assign\r\n     * this admin to the deployer automatically and should be renounced as well.\r\n     */\r\n    constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) {\r\n        // self administration\r\n        _grantRole(DEFAULT_ADMIN_ROLE, address(this));\r\n\r\n        // optional admin\r\n        if (admin != address(0)) {\r\n            _grantRole(DEFAULT_ADMIN_ROLE, admin);\r\n        }\r\n\r\n        // register proposers and cancellers\r\n        for (uint256 i = 0; i < proposers.length; ++i) {\r\n            _grantRole(PROPOSER_ROLE, proposers[i]);\r\n            _grantRole(CANCELLER_ROLE, proposers[i]);\r\n        }\r\n\r\n        // register executors\r\n        for (uint256 i = 0; i < executors.length; ++i) {\r\n            _grantRole(EXECUTOR_ROLE, executors[i]);\r\n        }\r\n\r\n        _minDelay = minDelay;\r\n        emit MinDelayChange(0, minDelay);\r\n    }\r\n\r\n    /**\r\n     * @dev Modifier to make a function callable only by a certain role. In\r\n     * addition to checking the sender's role, `address(0)` 's role is also\r\n     * considered. Granting a role to `address(0)` is equivalent to enabling\r\n     * this role for everyone.\r\n     */\r\n    modifier onlyRoleOrOpenRole(bytes32 role) {\r\n        if (!hasRole(role, address(0))) {\r\n            _checkRole(role, _msgSender());\r\n        }\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Contract might receive/hold ETH as part of the maintenance process.\r\n     */\r\n    receive() external payable virtual {}\r\n\r\n    /**\r\n     * @dev See {IERC165-supportsInterface}.\r\n     */\r\n    function supportsInterface(\r\n        bytes4 interfaceId\r\n    ) public view virtual override(AccessControlEnumerable) returns (bool) {\r\n        return super.supportsInterface(interfaceId);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns whether an id corresponds to a registered operation. This\r\n     * includes both Waiting, Ready, and Done operations.\r\n     */\r\n    function isOperation(bytes32 id) public view returns (bool) {\r\n        return getOperationState(id) != OperationState.Unset;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns whether an operation is pending or not. Note that a \"pending\" operation may also be \"ready\".\r\n     */\r\n    function isOperationPending(bytes32 id) public view returns (bool) {\r\n        OperationState state = getOperationState(id);\r\n        return state == OperationState.Waiting || state == OperationState.Ready;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns whether an operation is ready for execution. Note that a \"ready\" operation is also \"pending\".\r\n     */\r\n    function isOperationReady(bytes32 id) public view returns (bool) {\r\n        return getOperationState(id) == OperationState.Ready;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns whether an operation is done or not.\r\n     */\r\n    function isOperationDone(bytes32 id) public view returns (bool) {\r\n        return getOperationState(id) == OperationState.Done;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the timestamp at which an operation becomes ready (0 for\r\n     * unset operations, 1 for done operations).\r\n     */\r\n    function getTimestamp(bytes32 id) public view virtual returns (uint256) {\r\n        return _timestamps[id];\r\n    }\r\n\r\n    /**\r\n     * @dev Returns operation state.\r\n     */\r\n    function getOperationState(bytes32 id) public view virtual returns (OperationState) {\r\n        uint256 timestamp = getTimestamp(id);\r\n        if (timestamp == 0) {\r\n            return OperationState.Unset;\r\n        } else if (timestamp == _DONE_TIMESTAMP) {\r\n            return OperationState.Done;\r\n        } else if (timestamp > block.timestamp) {\r\n            return OperationState.Waiting;\r\n        } else {\r\n            return OperationState.Ready;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the minimum delay in seconds for an operation to become valid.\r\n     *\r\n     * This value can be changed by executing an operation that calls `updateDelay`.\r\n     */\r\n    function getMinDelay() public view virtual returns (uint256) {\r\n        return _minDelay;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the identifier of an operation containing a single\r\n     * transaction.\r\n     */\r\n    function hashOperation(\r\n        address target,\r\n        uint256 value,\r\n        bytes calldata data,\r\n        bytes32 predecessor,\r\n        bytes32 salt\r\n    ) public pure virtual returns (bytes32) {\r\n        return keccak256(abi.encode(target, value, data, predecessor, salt));\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the identifier of an operation containing a batch of\r\n     * transactions.\r\n     */\r\n    function hashOperationBatch(\r\n        address[] calldata targets,\r\n        uint256[] calldata values,\r\n        bytes[] calldata payloads,\r\n        bytes32 predecessor,\r\n        bytes32 salt\r\n    ) public pure virtual returns (bytes32) {\r\n        return keccak256(abi.encode(targets, values, payloads, predecessor, salt));\r\n    }\r\n\r\n    /**\r\n     * @dev Schedule an operation containing a single transaction.\r\n     *\r\n     * Emits {CallSalt} if salt is nonzero, and {CallScheduled}.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have the 'proposer' role.\r\n     */\r\n    function schedule(\r\n        address target,\r\n        uint256 value,\r\n        bytes calldata data,\r\n        bytes32 predecessor,\r\n        bytes32 salt,\r\n        uint256 delay\r\n    ) public virtual onlyRole(PROPOSER_ROLE) {\r\n        bytes32 id = hashOperation(target, value, data, predecessor, salt);\r\n        _schedule(id, delay);\r\n        emit CallScheduled(id, 0, target, value, data, predecessor, delay);\r\n        if (salt != bytes32(0)) {\r\n            emit CallSalt(id, salt);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Schedule an operation containing a batch of transactions.\r\n     *\r\n     * Emits {CallSalt} if salt is nonzero, and one {CallScheduled} event per transaction in the batch.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have the 'proposer' role.\r\n     */\r\n    function scheduleBatch(\r\n        address[] calldata targets,\r\n        uint256[] calldata values,\r\n        bytes[] calldata payloads,\r\n        bytes32 predecessor,\r\n        bytes32 salt,\r\n        uint256 delay\r\n    ) public virtual onlyRole(PROPOSER_ROLE) {\r\n        if (targets.length != values.length || targets.length != payloads.length) {\r\n            revert TimelockInvalidOperationLength(targets.length, payloads.length, values.length);\r\n        }\r\n\r\n        bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt);\r\n        _schedule(id, delay);\r\n        for (uint256 i = 0; i < targets.length; ++i) {\r\n            emit CallScheduled(id, i, targets[i], values[i], payloads[i], predecessor, delay);\r\n        }\r\n        if (salt != bytes32(0)) {\r\n            emit CallSalt(id, salt);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Schedule an operation that is to become valid after a given delay.\r\n     */\r\n    function _schedule(bytes32 id, uint256 delay) private {\r\n        if (isOperation(id)) {\r\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Unset));\r\n        }\r\n        uint256 minDelay = getMinDelay();\r\n        if (delay < minDelay) {\r\n            revert TimelockInsufficientDelay(delay, minDelay);\r\n        }\r\n        _timestamps[id] = block.timestamp + delay;\r\n    }\r\n\r\n    /**\r\n     * @dev Cancel an operation.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have the 'canceller' role.\r\n     */\r\n    function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) {\r\n        if (!isOperationPending(id)) {\r\n            revert TimelockUnexpectedOperationState(\r\n                id,\r\n                _encodeStateBitmap(OperationState.Waiting) | _encodeStateBitmap(OperationState.Ready)\r\n            );\r\n        }\r\n        delete _timestamps[id];\r\n\r\n        emit Cancelled(id);\r\n    }\r\n\r\n    /**\r\n     * @dev Execute an (ready) operation containing a single transaction.\r\n     *\r\n     * Emits a {CallExecuted} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have the 'executor' role.\r\n     */\r\n    // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,\r\n    // thus any modifications to the operation during reentrancy should be caught.\r\n    // slither-disable-next-line reentrancy-eth\r\n    function execute(\r\n        address target,\r\n        uint256 value,\r\n        bytes calldata payload,\r\n        bytes32 predecessor,\r\n        bytes32 salt\r\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\r\n        bytes32 id = hashOperation(target, value, payload, predecessor, salt);\r\n\r\n        _beforeCall(id, predecessor);\r\n        _execute(target, value, payload);\r\n        emit CallExecuted(id, 0, target, value, payload);\r\n        _afterCall(id);\r\n    }\r\n\r\n    /**\r\n     * @dev Execute an (ready) operation containing a batch of transactions.\r\n     *\r\n     * Emits one {CallExecuted} event per transaction in the batch.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have the 'executor' role.\r\n     */\r\n    // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,\r\n    // thus any modifications to the operation during reentrancy should be caught.\r\n    // slither-disable-next-line reentrancy-eth\r\n    function executeBatch(\r\n        address[] calldata targets,\r\n        uint256[] calldata values,\r\n        bytes[] calldata payloads,\r\n        bytes32 predecessor,\r\n        bytes32 salt\r\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\r\n        if (targets.length != values.length || targets.length != payloads.length) {\r\n            revert TimelockInvalidOperationLength(targets.length, payloads.length, values.length);\r\n        }\r\n\r\n        bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt);\r\n\r\n        _beforeCall(id, predecessor);\r\n        for (uint256 i = 0; i < targets.length; ++i) {\r\n            address target = targets[i];\r\n            uint256 value = values[i];\r\n            bytes calldata payload = payloads[i];\r\n            _execute(target, value, payload);\r\n            emit CallExecuted(id, i, target, value, payload);\r\n        }\r\n        _afterCall(id);\r\n    }\r\n\r\n    /**\r\n     * @dev Execute an operation's call.\r\n     */\r\n    function _execute(address target, uint256 value, bytes calldata data) internal virtual {\r\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\r\n        Address.verifyCallResult(success, returndata, \"Error: call failed\");\r\n    }\r\n\r\n    /**\r\n     * @dev Checks before execution of an operation's calls.\r\n     */\r\n    function _beforeCall(bytes32 id, bytes32 predecessor) private view {\r\n        if (!isOperationReady(id)) {\r\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready));\r\n        }\r\n        if (predecessor != bytes32(0) && !isOperationDone(predecessor)) {\r\n            revert TimelockUnexecutedPredecessor(predecessor);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Checks after execution of an operation's calls.\r\n     */\r\n    function _afterCall(bytes32 id) private {\r\n        if (!isOperationReady(id)) {\r\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready));\r\n        }\r\n        _timestamps[id] = _DONE_TIMESTAMP;\r\n    }\r\n\r\n    /**\r\n     * @dev Changes the minimum timelock duration for future operations.\r\n     *\r\n     * Emits a {MinDelayChange} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing\r\n     * an operation where the timelock is the target and the data is the ABI-encoded call to this function.\r\n     */\r\n    function updateDelay(uint256 newDelay) external virtual {\r\n        address sender = _msgSender();\r\n        if (sender != address(this)) {\r\n            revert TimelockUnauthorizedCaller(sender);\r\n        }\r\n        emit MinDelayChange(_minDelay, newDelay);\r\n        _minDelay = newDelay;\r\n    }\r\n\r\n    /**\r\n     * @dev Encodes a `OperationState` into a `bytes32` representation where each bit enabled corresponds to\r\n     * the underlying position in the `OperationState` enum. For example:\r\n     *\r\n     * 0x000...1000\r\n     *   ^^^^^^----- ...\r\n     *         ^---- Done\r\n     *          ^--- Ready\r\n     *           ^-- Waiting\r\n     *            ^- Unset\r\n     */\r\n    function _encodeStateBitmap(OperationState operationState) internal pure returns (bytes32) {\r\n        return bytes32(1 << uint8(operationState));\r\n    }\r\n}"}},"matchId":"53370659","creationMatch":null,"runtimeMatch":"match","verifiedAt":"2026-09-27T10:16:57Z","match":"match","chainId":"56","address":"0x8860bbfc7A83E4788a981f4e9f30878331413b26"}