ENS Logo
Docs

Interface Standards

This page is a collection of methods that a resolver MAY implement

UsageInterface ID
Read Ethereum Addressaddr(bytes32 node) view returns (address)
Read Multicoin Addressaddr(bytes32 node, uint coinType) view returns (byte memory)
Read Content Hashcontenthash(bytes32 node) view returns (bytes memory)
Read Text Recordtext(bytes32 node, string key) view returns (string memory)
Read Contract ABIABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes memory)
Read Public Keypubkey(bytes32 node) view returns (bytes32 x, bytes32 y)
Read Name (for reverse records)name(bytes32 node) view returns (string memory)
Write Ethereum AdresssetAddr(bytes32 node, address addr)
Set Multicoin AddresssetAddr(bytes32 node, uint coinType, bytes calldata a)
Write Content HashsetContenthash(bytes32 node, bytes calldata hash)
Write Text RecordsetText(bytes32 node, string calldata key, string calldata value)
Write Contract ABIsetABI(bytes32 node, uint256 contentType, bytes calldata data)
Write Public KeysetPubkey(bytes32 node, bytes32 x, bytes32 y)
Write Name (for reverse records)setName(bytes32 node, string calldata name)
Batch Read/Writemulticall(bytes[] calldata data) view returns (bytes[] memory results)

Check Interface Support

function supportsInterface(bytes4 interfaceID) external pure returns (bool)

Read Ethereum Address

Function
addr(bytes32 node) view returns (address)

Interface ID is 0x3b3b57de

ENSIP-1 / EIP-137

Outputs

Ethereum address or the zero address if no address is set.

Read Multicoin Address

Function
addr(bytes32 node, uint coinType) view returns (byte memory)

Interface ID is 0xf1cb7e06

ENSIP-9 / [EIP-2304](https://eips.ethereum.org/EIPS/eip-2304)

Outputs

Cryptocurrency address in its native binary format. For example, the Bitcoin address `1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa` base58check decodes to the 21 bytes `0062e907b15cbf27d5425399ebf6f0fb50ebb88f18` then scriptPubkey encodes to 25 bytes `76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac` whereas the BNB address `bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2` Bech32 decodes to the binary representation `40c2979694bbc961023d1d27be6fc4d21a9febe6`. A zero-length string ("") will be returned if the specified coin type is not set.

Read Content Hash

Function
contenthash(bytes32 node) view returns (bytes memory)

Interface ID is 0xbc1c58d1

ENSIP-7 / EIP-1577

Read Text Record

Function
text(bytes32 node, string key) view returns (string memory)

Interface ID is 0x59d1d43c

ENSIP-5 / EIP-634

Outputs

The value of the text record associated with key, or the empty string if no such record exists.

Read Contract ABI

Function
ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes memory)

Interface ID is 0x2203ab56

ENSIP-4 / EIP-205

Outputs

ABI returns a two-tuple of the content type ID and the ABI data. If no data of the appropriate content type ID was found, 0 is returned for the content type ID, and the ABI data will be the empty string.

Read Public Key

Function
pubkey(bytes32 node) view returns (bytes32 x, bytes32 y)

Interface ID is 0xc8690233

ENSIP- / EIP-619

Outputs

The ECDSA SECP256k1 public key for node, as a 2-tuple (x, y). If no public key is set, (0, 0) is returned.

Read Name (for reverse records)

Function
name(bytes32 node) view returns (string memory)

Interface ID is 0x691f3431

Implemented by Public Resolver

Write Ethereum Adress

Function
setAddr(bytes32 node, address addr)

Interface ID is 0x3b3b57de

Implemented by Public Resolver

Set Multicoin Address

Function
setAddr(bytes32 node, uint coinType, bytes calldata a)

Interface ID is 0x8b95dd71

Implemented by Public Resolver

Write Content Hash

Function
setContenthash(bytes32 node, bytes calldata hash)

Interface ID is 0x304e6ade

Implemented by Public Resolver

Write Text Record

Function
setText(bytes32 node, string calldata key, string calldata value)

Interface ID is 0xa4d3fbb2

Implemented by Public Resolver

Write Contract ABI

Function
setABI(bytes32 node, uint256 contentType, bytes calldata data)

Interface ID is 0x623195b0

Implemented by Public Resolver

Write Public Key

Function
setPubkey(bytes32 node, bytes32 x, bytes32 y)

Interface ID is 0x29cd62ea

Implemented by Public Resolver

Write Name (for reverse records)

Function
setName(bytes32 node, string calldata name)

Interface ID is 0x77372213

Implemented by Public Resolver

Batch Read/Write

Function
multicall(bytes[] calldata data) view returns (bytes[] memory results)

Interface ID is 0xac9650d8

Implemented by Public Resolver
Last Modified
3 minutes ago