BlockListRegistry

Git Source

Inherits: IBlockListRegistry, OwnableAccessControlUpgradeable, ERC165Upgradeable

Author: transientlabs.xyz

Registry that can be used to block approvals from non-royalty paying marketplaces

State Variables

BLOCK_LIST_ADMIN_ROLE

bytes32 public constant BLOCK_LIST_ADMIN_ROLE = keccak256("BLOCK_LIST_ADMIN_ROLE");

_c

uint256 private _c;

_blockList

mapping(uint256 => mapping(address => bool)) private _blockList;

Functions

constructor

constructor(bool disable);

Parameters

NameTypeDescription
disableboolDisable the initalizer on deployment

initialize

Function that can be called once to initialize the registry

function initialize(address newOwner, address[] memory initBlockList) external initializer;

Parameters

NameTypeDescription
newOwneraddressThe initial owner of this contract
initBlockListaddress[]Initial list of addresses to add to the blocklist

clearBlockList

Function to clear the block list status

Must be called by the blockList owner or blocklist admin

function clearBlockList() external onlyRoleOrOwner(BLOCK_LIST_ADMIN_ROLE);

getBlockListStatus

Function to get blocklist status with True meaning that the operator is blocked

function getBlockListStatus(address operator) public view returns (bool);

Parameters

NameTypeDescription
operatoraddressThe operator in question to check against the blocklist

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool);

setBlockListStatus

Function to set the block list status for multiple operators

Must be called by the blockList owner

function setBlockListStatus(address[] calldata operators, bool status)
    external
    onlyRoleOrOwner(BLOCK_LIST_ADMIN_ROLE);

Parameters

NameTypeDescription
operatorsaddress[]An address array of operators to set a status for
statusboolThe status to set for all operators

_getBlockListStatus

Internal function to get blockList status

function _getBlockListStatus(address operator) internal view returns (bool);

Parameters

NameTypeDescription
operatoraddressThe address for which to get the BlockList status

_setBlockListStatus

Internal function to set blockList status for one operator

function _setBlockListStatus(address operator, bool status) internal;

Parameters

NameTypeDescription
operatoraddressAddress to set the status for
statusboolTrue means add to the BlockList