Skip to main content

VaultBlocklist

Git Source

Inherits: Initializable, VaultAdmin, IVaultBlocklist

Author: StakeWise

Defines the functionality for blocking addresses for the Vault

State Variables

blocklistManager

Blocklist manager address

address public override blocklistManager;

blockedAccounts

Checks whether account is blocked or not

mapping(address => bool) public override blockedAccounts;

__gap

This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps

uint256[50] private __gap;

Functions

updateBlocklist

Add or remove account from the blocklist. Can only be called by the blocklist manager.

function updateBlocklist(address account, bool isBlocked) public virtual override;

Parameters

NameTypeDescription
accountaddressThe account to add or remove to the blocklist
isBlockedboolWhether account should be blocked or not

setBlocklistManager

Used to update the blocklist manager. Can only be called by the Vault admin.

function setBlocklistManager(address _blocklistManager) external override;

Parameters

NameTypeDescription
_blocklistManageraddressThe address of the new blocklist manager

_checkBlocklist

Internal function for checking blocklist

function _checkBlocklist(address account) internal view;

Parameters

NameTypeDescription
accountaddressThe address of the account to check

_setBlocklistManager

Internal function for updating the blocklist manager externally or from the initializer

function _setBlocklistManager(address _blocklistManager) private;

Parameters

NameTypeDescription
_blocklistManageraddressThe address of the new blocklist manager

__VaultBlocklist_init

Initializes the VaultBlocklist contract

function __VaultBlocklist_init(address _blocklistManager) internal onlyInitializing;

Parameters

NameTypeDescription
_blocklistManageraddressThe address of the blocklist manager