AllowlistV1
Kiln
Allowlist (v1)
This contract handles the list of allowed recipients.All accounts have an uint256 value associated with their addresses whereeach bit represents a right in the system. The DENY_MASK defined the maskused to identify if the denied bit is on, preventing users from interactingwith the system
Methods
acceptAdmin
Accept the transfer of ownership
Only callable by the pending admin. Resets the pending admin if succesful.
allow
Sets the allowlisting status for one or more accounts
The permission value is overridden and not updated
Parameters
Name | Type | Description |
---|---|---|
_accounts | address[] | Accounts with statuses to edit |
_permissions | uint256[] | Allowlist permissions for each account, in the same order as _accounts |
getAdmin
Retrieves the current admin address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The admin address |
getAllower
Retrieves the allower address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The address of the allower |
getPendingAdmin
Retrieve the current pending admin address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The pending admin address |
getPermissions
This method retrieves the raw permission value
Parameters
Name | Type | Description |
---|---|---|
_account | address | Recipient to verify |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The raw permissions value of the account |
hasPermission
This method returns true if the user has the expected permission ignoring any deny list membership
Parameters
Name | Type | Description |
---|---|---|
_account | address | Recipient to verify |
_mask | uint256 | Combination of permissions to verify |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if mask is respected |
initAllowlistV1
Initializes the allowlist
Parameters
Name | Type | Description |
---|---|---|
_admin | address | Address of the Allowlist administrator |
_allower | address | Address of the allower |
isAllowed
This method returns true if the user has the expected permission and is not in the deny list
Parameters
Name | Type | Description |
---|---|---|
_account | address | Recipient to verify |
_mask | uint256 | Combination of permissions to verify |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if mask is respected and user is allowed |
isDenied
This method returns true if the user is in the deny list
Parameters
Name | Type | Description |
---|---|---|
_account | address | Recipient to verify |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if user is denied access |
onlyAllowed
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
Name | Type | Description |
---|---|---|
_account | address | Recipient to verify |
_mask | uint256 | Combination of permissions to verify |
proposeAdmin
Proposes a new address as admin
This security prevents setting an invalid address as an admin. The pendingadmin has to claim its ownership of the contract, and prove that the newaddress is able to perform regular transactions.
Parameters
Name | Type | Description |
---|---|---|
_newAdmin | address | New admin address |
setAllower
Changes the allower address
Parameters
Name | Type | Description |
---|---|---|
_newAllowerAddress | address | New address allowed to edit the allowlist |
Events
Initialize
Emitted when the contract is properly initialized
Parameters
Name | Type | Description |
---|---|---|
version | uint256 | undefined |
cdata | bytes | undefined |
SetAdmin
The admin address changed
Parameters
Name | Type | Description |
---|---|---|
admin | address | undefined |
SetAllower
The stored allower address has been changed
Parameters
Name | Type | Description |
---|---|---|
allower | address | undefined |
SetAllowlistPermissions
The permissions of several accounts have changed
Parameters
Name | Type | Description |
---|---|---|
accounts | address[] | undefined |
permissions | uint256[] | undefined |
SetPendingAdmin
The pending admin address changed
Parameters
Name | Type | Description |
---|---|---|
pendingAdmin | address | undefined |
Errors
Denied
The account is denied access
Parameters
Name | Type | Description |
---|---|---|
_account | address | The denied account |
InvalidAlloweeCount
The provided accounts list is empty
InvalidInitialization
An error occured during the initialization
Parameters
Name | Type | Description |
---|---|---|
version | uint256 | The version that was attempting to be initialized |
expectedVersion | uint256 | The version that was expected |
InvalidZeroAddress
The address is zero
MismatchedAlloweeAndStatusCount
The provided accounts and permissions list have different lengths
Unauthorized
The operator is unauthorized for the caller
Parameters
Name | Type | Description |
---|---|---|
caller | address | Address performing the call |
Last updated