|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity 0.8.30; |
| 3 | + |
| 4 | +import {IENS} from './IENS.sol'; |
| 5 | +import {INameWrapper} from './INameWrapper.sol'; |
| 6 | + |
| 7 | +/** |
| 8 | + * @title IL2Resolver |
| 9 | + * @author @defi-wonderland |
| 10 | + */ |
| 11 | +interface IL2Resolver { |
| 12 | + /*/////////////////////////////////////////////////////////////// |
| 13 | + EVENTS |
| 14 | + //////////////////////////////////////////////////////////////*/ |
| 15 | + |
| 16 | + /*/////////////////////////////////////////////////////////////// |
| 17 | + ERRORS |
| 18 | + //////////////////////////////////////////////////////////////*/ |
| 19 | + |
| 20 | + /*/////////////////////////////////////////////////////////////// |
| 21 | + LOGIC |
| 22 | + //////////////////////////////////////////////////////////////*/ |
| 23 | + |
| 24 | + /*/////////////////////////////////////////////////////////////// |
| 25 | + VARIABLES |
| 26 | + //////////////////////////////////////////////////////////////*/ |
| 27 | + /** |
| 28 | + * @notice The key used in records to store the EIP-7930 chain identifier bytes for a forward resolution. |
| 29 | + * @return _key The key used for a forward resolution. |
| 30 | + */ |
| 31 | + function CHAIN_IDENTIFIER_EIP7930_KEY() external view returns (string memory _key); |
| 32 | + |
| 33 | + /** |
| 34 | + * @notice Stores arbitrary data for each ENS node. |
| 35 | + * @dev For domain-to-chain-identifier resolution, the key will be a pre-defined string. |
| 36 | + * (e.g., CHAIN_IDENTIFIER_EIP7930_KEY) and data will be the raw EIP-7930 chain identifier |
| 37 | + * bytes (formatted with AddressLength = 0). |
| 38 | + * @dev For EIP-7930-chain-identifier-to-domain resolution (reverse lookup), the REVERSE_LOOKUP_NODE is used. |
| 39 | + * The key is constructed by concatenating a prefix (e.g., CHAIN_IDENTIFIER_EIP7930_KEY)with the hexadecimal string |
| 40 | + * representation of the keccak256 hash of the EIP-7930 chain identifier bytes. The data stored is the |
| 41 | + * ABI-encoded human-readable ENS name string (e.g., abi.encode("optimism.l2.eth")). |
| 42 | + * @param _node The ENS node to store the data for. |
| 43 | + * @param _key The key to store the data under. |
| 44 | + * @return _data The data stored under the key. |
| 45 | + */ |
| 46 | + function records(bytes32 _node, string calldata _key) external view returns (bytes memory _data); |
| 47 | + |
| 48 | + /** |
| 49 | + * @notice A dedicated node hash for storing reverse lookup entries. |
| 50 | + * @return _reverseLookupNode The reverse lookup node. |
| 51 | + */ |
| 52 | + function REVERSE_LOOKUP_NODE() external view returns (bytes32 _reverseLookupNode); |
| 53 | + |
| 54 | + /** |
| 55 | + * @notice The ENS registry. |
| 56 | + * @return _ensRegistry The ENS registry address. |
| 57 | + */ |
| 58 | + function ENS_REGISTRY() external view returns (IENS _ensRegistry); |
| 59 | + |
| 60 | + /** |
| 61 | + * @notice The ENS name wrapper. |
| 62 | + * @return _nameWrapper The ENS name wrapper address. |
| 63 | + */ |
| 64 | + function NAME_WRAPPER() external view returns (INameWrapper _nameWrapper); |
| 65 | + |
| 66 | + /** |
| 67 | + * @notice The admin authorized to set the reverse lookup node values. |
| 68 | + * @return _adminAddress The admin address. |
| 69 | + */ |
| 70 | + function REVERSE_ADMIN() external view returns (address _adminAddress); |
| 71 | + |
| 72 | + /** |
| 73 | + * @notice The parent node namehash for wildcard resolution and authorization. |
| 74 | + * @return _parentNode The parent node namehash. |
| 75 | + */ |
| 76 | + function PARENT_NODE() external view returns (bytes32 _parentNode); |
| 77 | +} |
0 commit comments