Skip to content

Address Resolver

This abstract contract provides a name-to-address lookup. Under the hood, it uses an AddressManager to manage the name-to-address mapping.

contract IAddressManager _addressManager
error RESOLVER_DENIED()
error RESOLVER_INVALID_ADDR()
modifier onlyFromNamed(string name)
function resolve(string name, bool allowZeroAddress) public view virtual returns (address payable)

Resolves a name to an address on the current chain.

This function will throw if the resolved address is address(0).

NameTypeDescription
namestringThe name to resolve.
allowZeroAddressboolTrue to allow zero address to be returned.
NameTypeDescription
[0]address payableThe name’s corresponding address.
function resolve(uint256 chainId, string name, bool allowZeroAddress) public view virtual returns (address payable)

Resolves a name to an address on the specified chain.

This function will throw if the resolved address is address(0).

NameTypeDescription
chainIduint256The chainId.
namestringThe name to resolve.
allowZeroAddressboolTrue to allow zero address to be returned.
NameTypeDescription
[0]address payableThe name’s corresponding address.
function addressManager() public view returns (address)

Returns the AddressManager’s address.

NameTypeDescription
[0]addressThe AddressManager’s address.
function _init(address addressManager_) internal virtual