Skip to main content

AddressResolver

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

_addressManager

contract IAddressManager _addressManager

RESOLVER_DENIED

error RESOLVER_DENIED()

RESOLVER_INVALID_ADDR

error RESOLVER_INVALID_ADDR()

onlyFromNamed

modifier onlyFromNamed(string name)

resolve

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).

Parameters

NameTypeDescription
namestringThe name to resolve.
allowZeroAddressboolTrue to allow zero address to be returned.

Return Values

NameTypeDescription
[0]address payableThe name's corresponding address.

resolve

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).

Parameters

NameTypeDescription
chainIduint256The chainId.
namestringThe name to resolve.
allowZeroAddressboolTrue to allow zero address to be returned.

Return Values

NameTypeDescription
[0]address payableThe name's corresponding address.

addressManager

function addressManager() public view returns (address)

Returns the AddressManager's address.

Return Values

NameTypeDescription
[0]addressThe AddressManager's address.

_init

function _init(address addressManager_) internal virtual