IAllowlistV1

Kiln

Allowlist Interface (v1)

This interface exposes methods to handle the list of allowed recipients.

Methods

allow

function allow(address[] _accounts, uint256[] _permissions) external nonpayable

Sets the allowlisting status for one or more accounts

The permission value is overridden and not updated

Parameters

NameTypeDescription

_accounts

address[]

Accounts with statuses to edit

_permissions

uint256[]

Allowlist permissions for each account, in the same order as _accounts

getAllower

function getAllower() external view returns (address)

Retrieves the allower address

Returns

NameTypeDescription

_0

address

The address of the allower

getPermissions

function getPermissions(address _account) external view returns (uint256)

This method retrieves the raw permission value

Parameters

NameTypeDescription

_account

address

Recipient to verify

Returns

NameTypeDescription

_0

uint256

The raw permissions value of the account

hasPermission

function hasPermission(address _account, uint256 _mask) external view returns (bool)

This method returns true if the user has the expected permission ignoring any deny list membership

Parameters

NameTypeDescription

_account

address

Recipient to verify

_mask

uint256

Combination of permissions to verify

Returns

NameTypeDescription

_0

bool

True if mask is respected

initAllowlistV1

function initAllowlistV1(address _admin, address _allower) external nonpayable

Initializes the allowlist

Parameters

NameTypeDescription

_admin

address

Address of the Allowlist administrator

_allower

address

Address of the allower

isAllowed

function isAllowed(address _account, uint256 _mask) external view returns (bool)

This method returns true if the user has the expected permission and is not in the deny list

Parameters

NameTypeDescription

_account

address

Recipient to verify

_mask

uint256

Combination of permissions to verify

Returns

NameTypeDescription

_0

bool

True if mask is respected and user is allowed

isDenied

function isDenied(address _account) external view returns (bool)

This method returns true if the user is in the deny list

Parameters

NameTypeDescription

_account

address

Recipient to verify

Returns

NameTypeDescription

_0

bool

True if user is denied access

onlyAllowed

function onlyAllowed(address _account, uint256 _mask) external view

This method should be used as a modifier and is expected to revert if the user hasn't got the required permission or if the user is in the deny list.

Parameters

NameTypeDescription

_account

address

Recipient to verify

_mask

uint256

Combination of permissions to verify

setAllower

function setAllower(address _newAllowerAddress) external nonpayable

Changes the allower address

Parameters

NameTypeDescription

_newAllowerAddress

address

New address allowed to edit the allowlist

Events

SetAllower

event SetAllower(address indexed allower)

The stored allower address has been changed

Parameters

NameTypeDescription

allower indexed

address

The new allower address

SetAllowlistPermissions

event SetAllowlistPermissions(address[] accounts, uint256[] permissions)

The permissions of several accounts have changed

Parameters

NameTypeDescription

accounts

address[]

List of accounts

permissions

uint256[]

New permissions for each account at the same index

Errors

Denied

error Denied(address _account)

The account is denied access

Parameters

NameTypeDescription

_account

address

The denied account

InvalidAlloweeCount

error InvalidAlloweeCount()

The provided accounts list is empty

MismatchedAlloweeAndStatusCount

error MismatchedAlloweeAndStatusCount()

The provided accounts and permissions list have different lengths

Last updated