Skip to main content

libid_contracts/bindings/
ens.rs

1//! Bindings for the ENS resolver (`solidity/contracts/ens/`).
2
3/// Bindings for `ens/HandleResolver.sol` — the wildcard resolver for
4/// `handles.link`.
5///
6/// Not a proxy: the owner, the gateway endpoints and the signer set arrive in
7/// the constructor, and replacing the contract is `setResolver` on the ENS
8/// name. Deploy it with `deploy_with_ctor` and the ABI-encoded constructor
9/// tuple; `resolve` is absent because it always reverts `OffchainLookup` —
10/// the client-side protocol, not something a Rust consumer calls.
11#[allow(clippy::too_many_arguments, unused_attributes)]
12mod inner {
13    use alloy::sol;
14
15    sol! {
16        #[sol(rpc)]
17        contract HandleResolver {
18            constructor(address owner_, string[] memory urls_, address[] memory signers_);
19
20            function urls(uint256 index) external view returns (string memory);
21            function urlCount() external view returns (uint256);
22            function signers(address signer) external view returns (bool);
23            function MAX_LIFETIME() external view returns (uint256);
24            function makeSignatureHash(address target, uint64 expires, bytes memory request, bytes memory result) external pure returns (bytes32);
25            function resolveWithProof(bytes calldata response, bytes calldata extraData) external view returns (bytes memory);
26            function supportsInterface(bytes4 interfaceId) external pure returns (bool);
27
28            function setUrls(string[] calldata urls_) external;
29            function setSigner(address signer, bool trusted) external;
30
31            function owner() external view returns (address);
32            function pendingOwner() external view returns (address);
33            function transferOwnership(address newOwner) external;
34            function acceptOwnership() external;
35
36            event UrlsChanged(string[] urls);
37            event SignerChanged(address indexed signer, bool trusted);
38        }
39    }
40}
41
42pub use inner::HandleResolver;