-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIUR.sol
39 lines (34 loc) · 1.3 KB
/
IUR.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
struct Lookup {
bytes dns; // dns-encoded name (safe to decode)
uint256 offset; // byte offset into dns for basename
bytes32 node; // namehash(dns)
bytes32 basenode; // namehash(dns.slice(offset))
address resolver; // resolver(basenode), null if invalid
bool extended; // IExtendedResolver
}
struct Response {
uint256 bits; // ResponseBits
bytes call; // record calldata
bytes data; // answer (or error)
}
library ResponseBits {
uint256 constant ERROR = 1 << 0; // resolution failed
uint256 constant OFFCHAIN = 1 << 1; // reverted OffchainLookup
uint256 constant BATCHED = 1 << 2; // used Batched Gateway
uint256 constant RESOLVED = 1 << 3; // resolution finished (internal flag)
}
error LengthMismatch();
interface IUR {
function registry() external view returns (address);
function lookupName(bytes memory dns) external view returns (Lookup memory lookup);
function resolve(bytes memory dns, bytes[] memory calls, string[] memory batchedGateways)
external
view
returns (Lookup memory lookup, Response[] memory res);
function resolveCallback(bytes memory ccip, bytes memory batchedCarry)
external
view
returns (Lookup memory lookup, Response[] memory res);
}