-
Notifications
You must be signed in to change notification settings - Fork 1
/
Blacklistable.sol
50 lines (45 loc) · 1.31 KB
/
Blacklistable.sol
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "./WithMidasAccessControl.sol";
/**
* @title Blacklistable
* @notice Base contract that implements basic functions and modifiers
* to work with blacklistable
* @author RedDuck Software
*/
abstract contract Blacklistable is WithMidasAccessControl {
/**
* @dev checks that a given `account` doesnt
* have BLACKLISTED_ROLE
*/
modifier onlyNotBlacklisted(address account) {
_onlyNotBlacklisted(account);
_;
}
/**
* @dev upgradeable pattern contract`s initializer
* @param _accessControl MidasAccessControl contract address
*/
// solhint-disable func-name-mixedcase
function __Blacklistable_init(address _accessControl)
internal
onlyInitializing
{
__WithMidasAccessControl_init(_accessControl);
__Blacklistable_init_unchained();
}
/**
* @dev upgradeable pattern contract`s initializer unchained
*/
// solhint-disable func-name-mixedcase
function __Blacklistable_init_unchained() internal onlyInitializing {}
/**
* @dev checks that a given `account` doesnt
* have BLACKLISTED_ROLE
*/
function _onlyNotBlacklisted(address account)
internal
view
onlyNotRole(BLACKLISTED_ROLE, account)
{}
}