Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AddressList

Git Source

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

NameTypeDescription
initialAuthorityaddressAddress 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

NameTypeDescription
useraddressAddress to add

remove

Removes an address from the list

Only callable through AccessManager with appropriate role

function remove(address user) external override restricted;

Parameters

NameTypeDescription
useraddressAddress to remove

contains

Checks if an address is in the list

function contains(address user) external view override returns (bool);

Parameters

NameTypeDescription
useraddressAddress to check

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
<none>uint256Number of addresses

at

Returns the address at the given index

function at(uint256 index) external view override returns (address);

Parameters

NameTypeDescription
indexuint256Index of the address to retrieve

Returns

NameTypeDescription
<none>addressAddress at the given index