Allowlist Interface
Understand the AllowList interface used by many Avalanche L1 precompiles and how its roles work.
Avalanche L1s ship multiple default precompiles that need access control, this is done via the same audited permission interface: the AllowList interface.
Permission levels
The roles are:
- Admin: can manage all roles (Admin, Manager, Enabled).
- Manager: can manage Enabled addresses only.
- Enabled: can use the precompile’s functionality (what that means depends on the specific precompile).
- None: no access.
This is a role-based access control pattern, implemented consistently across precompiles that opt into it.
AllowList interface
This interface exposes a small set of functions to manage roles for addresses:
Functions
setAdmin(address addr): giveaddrAdmin role.setManager(address addr): giveaddrManager role.setEnabled(address addr): giveaddrEnabled role.setNone(address addr): remove any role fromaddr(back to None).readAllowList(address addr) -> uint256: read the current role value.
Precompiles that use AllowList
Several default Avalanche L1 precompiles implement this interface (examples):
Is this guide helpful?
