// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.18; import "../../../SomaGuard/utils/GuardableUpgradeable.sol"; import "./IDeprecatableSecurity.sol"; import "./ERC20Partition.sol"; /** * @notice Implementation of the {IDeprecatableSecurity} interface. */ abstract contract DeprecatableSecurity is IDeprecatableSecurity, ERC20Partition, AccessibleUpgradeable { /** * @notice Initializer for extended contracts. */ function __DeprecatableSecurity_init() internal { __Accessible_init_unchained(); __SomaContract_init_unchained(); __ERC165_init_unchained(); __Context_init_unchained(); __Multicall_init_unchained(); __Pausable_init_unchained(); __DeprecatableSecurity_init_unchained(); } /** * @notice Unchained initializer. */ function __DeprecatableSecurity_init_unchained() internal onlyInitializing { LOCAL_DEPRECATE_ROLE = keccak256(abi.encodePacked(address(this), GLOBAL_DEPRECATE_ROLE)); } /** * @notice Returns the GLOBAL_DEPRECATE_ROLE. */ bytes32 public constant GLOBAL_DEPRECATE_ROLE = keccak256("DeprecatableSecurity.DEPRECATE_ROLE"); /** * @notice Returns the LOCAL_DEPRECATE_ROLE. */ bytes32 public LOCAL_DEPRECATE_ROLE; /** * @notice Modifier to restrict a function caller to accounts that have the GLOBAL_MINT_ROLE or LOCAL_MINT_ROLE. */ modifier onlyDeprecateRole() { address sender = _msgSender(); require( hasRole(LOCAL_DEPRECATE_ROLE, sender) || hasRole(GLOBAL_DEPRECATE_ROLE, sender), "DeprecatableSecurity: UNAUTHORIZED" ); _; } /** * @notice Checks if DeprecatableSecurity inherits a given contract interface. * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IDeprecatableSecurity).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IDeprecatableSecurity */ function deprecatePartition(bytes32 id, bytes memory data) public override onlyDeprecateRole { _deprecatePartition(id, data); } uint256[50] private __gap; }