AddressList
Inherits: AccessManaged, IAddressList, EInvalidAddress
Title: AddressList
Central address list management for the Apyx protocol
Provides a single source of truth for blocked/allowed addresses across all Apyx contracts Features:
- Centralized address management
- Access controlled via AccessManager
- Enumerable for off-chain iteration
- Gas-efficient set operations
State Variables
_addresses
Set of addresses in the list
EnumerableSet.AddressSet private _addresses
Functions
constructor
Initializes the AddressList contract
constructor(address initialAuthority) AccessManaged(initialAuthority);
Parameters
| Name | Type | Description |
|---|---|---|
initialAuthority | address | Address of the AccessManager contract |
add
Adds an address to the list
Only callable through AccessManager with appropriate role
function add(address user) external override restricted;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | Address to add |
remove
Removes an address from the list
Only callable through AccessManager with appropriate role
function remove(address user) external override restricted;
Parameters
| Name | Type | Description |
|---|---|---|
user | address | Address to remove |
contains
Checks if an address is in the list
function contains(address user) external view override returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | Address to check |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if address is in the list, false otherwise |
length
Returns the number of addresses in the list
function length() external view override returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Number of addresses |
at
Returns the address at the given index
function at(uint256 index) external view override returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
index | uint256 | Index of the address to retrieve |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | Address at the given index |