Blacklister
Inherits: OwnableUpgradeable, IBlacklister
Title: Blacklister
Author: Merge Layers Inc.
Contract for managing blacklisted addresses
State Variables
isBlacklisted
Mapping of addresses to their blacklist status
mapping(address user => bool isBlacklisted) public isBlacklisted
_blacklistedList
List of blacklisted addresses
address[] private _blacklistedList
rolesOperator
The roles operator contract
IRoles public rolesOperator
Functions
onlyOwnerOrGuardian
Modifier to restrict access to owner or has guardian blacklist role
modifier onlyOwnerOrGuardian() ;
constructor
Disables initializers on implementation contract
Note: oz-upgrades-unsafe-allow: constructor
constructor() ;
initialize
Initialize the contract
function initialize(address payable _owner, address _roles) external initializer;
Parameters
| Name | Type | Description |
|---|---|---|
_owner | address payable | The owner address |
_roles | address | The roles contract address |
blacklist
Blacklists a user immediately (onlyOwner).
function blacklist(address user) external override onlyOwnerOrGuardian;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to blacklist |
unblacklist
Removes a user from the blacklist (onlyOwner).
function unblacklist(address user) external override onlyOwnerOrGuardian;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to unblacklist |
unblacklist
Removes a user from the blacklist (onlyOwner).
function unblacklist(address user, uint256 index) external override onlyOwnerOrGuardian;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to unblacklist |
index | uint256 | The index of the user in blacklist array |
getBlacklistedAddresses
Returns the list of currently blacklisted addresses.
function getBlacklistedAddresses() external view returns (address[] memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | blacklistedAddresses Array of blacklisted addresses |
_addToBlacklist
Internal function to add an address to blacklist
function _addToBlacklist(address user) internal;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to blacklist |
_removeFromBlacklist
Internal function to remove an address from blacklist list
function _removeFromBlacklist(address user) internal;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to remove |
_removeFromBlacklist
Internal function to remove an address from blacklist list by index
function _removeFromBlacklist(address user, uint256 index) internal;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address to remove |
index | uint256 | The index in the blacklist array |