Docs
Reference
Contract documentation
common
AddressResolver

AddressResolver

This contract acts as a bridge for name-to-address resolution. It delegates the resolution to the AddressManager. By separating the logic, we can maintain flexibility in address management without affecting the resolving process.

_addressManager

contract IAddressManager _addressManager

AddressManagerChanged

event AddressManagerChanged(address addressManager)

RESOLVER_DENIED

error RESOLVER_DENIED()

RESOLVER_INVALID_ADDR

error RESOLVER_INVALID_ADDR()

RESOLVER_ZERO_ADDR

error RESOLVER_ZERO_ADDR(uint256 chainId, bytes32 name)

onlyFromNamed

modifier onlyFromNamed(bytes32 name)

Parameters

NameTypeDescription
namebytes32The name to check against.

onlyFromNamed2

modifier onlyFromNamed2(bytes32 name1, bytes32 name2)

Parameters

NameTypeDescription
name1bytes32The first name to check against.
name2bytes32The second name to check against.

resolve

function resolve(bytes32 name, bool allowZeroAddress) public view virtual returns (address payable addr)

Resolves a name to its address on the current chain.

Parameters

NameTypeDescription
namebytes32Name whose address is to be resolved.
allowZeroAddressboolIf set to true, does not throw if the resolved address is address(0).

Return Values

NameTypeDescription
addraddress payableAddress associated with the given name.

resolve

function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) public view virtual returns (address payable addr)

Resolves a name to its address on a specified chain.

Parameters

NameTypeDescription
chainIduint256The chainId of interest.
namebytes32Name whose address is to be resolved.
allowZeroAddressboolIf set to true, does not throw if the resolved address is address(0).

Return Values

NameTypeDescription
addraddress payableAddress associated with the given name on the specified chain.

addressManager

function addressManager() public view returns (address)

Fetches the AddressManager's address.

Return Values

NameTypeDescription
[0]addressThe current address of the AddressManager.

_init

function _init(address addressManager_) internal virtual

Parameters

NameTypeDescription
addressManager_addressAddress of the AddressManager.