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

AddressProvider

Inherits: IAddressProvider, Initializable, UUPSUpgradeable

This contract serves as a centralized registry for managing and providing access to key addresses used throughout the system.

State Variables

s_accessController

IAccessControl private s_accessController;

s_addresses

mapping(string name => address contractAddress) private s_addresses;

s_names

string[] private s_names;

Functions

onlyMaintainer

modifier onlyMaintainer();

constructor

Note: oz-upgrades-unsafe-allow: constructor

constructor();

initialize

Initialize for the AddressProvider contract.

function initialize(address accessController) external initializer;

Parameters

NameTypeDescription
accessControlleraddressThe address of the access controller

setAddress

function setAddress(string calldata name, address addr) external override onlyMaintainer;

setAccessController

function setAccessController(address accessController) external override onlyMaintainer;

getAddress

function getAddress(string calldata name) external view override returns (address);

getContractsName

function getContractsName() external view override returns (string[] memory);

getAccessController

function getAccessController() external view override returns (IAccessControl);

_setAddress

function _setAddress(string memory name, address addr) private;

_setAccessController

function _setAccessController(address accessController) private;

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal override onlyMaintainer;