-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseComn.sol
More file actions
34 lines (29 loc) · 884 Bytes
/
BaseComn.sol
File metadata and controls
34 lines (29 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;
import "./comn/IAdmin.sol";
import {StorageSlot} from "@openzeppelin/contracts@5.0.0/utils/StorageSlot.sol";
/**
* @title BaseComn
* @dev Contains the core constants and base functionality
*/
abstract contract BaseComn {
bytes32 constant _ADMIN_SLOT =
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
modifier onlyMaster() {
IAdmin(getAdminAddr()).mustMaster(msg.sender);
_;
}
/**
* @dev Throws if called by any account other than the admin.
*/
modifier onlyAdmin() {
IAdmin(getAdminAddr()).mustAdmin(msg.sender);
_;
}
/**
* @dev Returns the admin address from storage slot
*/
function getAdminAddr() public view returns (address) {
return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
}
}