// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.18; import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts/access/IAccessControl.sol"; import "../../utils/security/IPausable.sol"; import "../../utils/SomaContractUpgradeable.sol"; import "../ISomaAccessControl.sol"; import "./IAccessible.sol"; /** * @title SOMA Accessible Upgradeable Contract. * @author SOMA.finance */ abstract contract AccessibleUpgradeable is IAccessible, SomaContractUpgradeable { /** * @notice Initializer for extended contracts. */ function __Accessible_init() internal onlyInitializing { __ERC165_init_unchained(); __Context_init_unchained(); __SomaContract_init_unchained(); __Multicall_init_unchained(); __Pausable_init_unchained(); __Accessible_init_unchained(); } /** * @notice Unchained initializer for extended contracts. */ function __Accessible_init_unchained() internal onlyInitializing {} /** * @notice The modifier that restricts a function caller to accounts that have been granted `role`. * @param role The role that an account must have to execute a function. */ modifier onlyRole(bytes32 role) { require(hasRole(role, _msgSender()), "SomaAccessControl: caller does not have the appropriate authority"); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessible).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IAccessible */ // slither-disable-next-line external-function function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return IAccessControlUpgradeable(SOMA.access()).getRoleAdmin(role); } /** * @inheritdoc IAccessible */ function hasRole(bytes32 role, address account) public view override returns (bool) { return IAccessControlUpgradeable(SOMA.access()).hasRole(role, account); } uint256[50] private __gap; }