blockful-io / external-resolver-dapp

https://external-resolver-dapp.vercel.app
2 stars 2 forks source link

feat: integrate ENSIP-16 v2 to manage domain page #137

Closed alextnetto closed 2 months ago

alextnetto commented 2 months ago

Feature Request

Describe the Feature Request

The dapp should be able to gather all the information related to any given domain, even those being stored off-chain. Although the The Graph is capable of handling domains stored on-chain, it lacks features for the domains stored anywhere other than the L1, which is where the ENSIP-16 comes into play.

Describe Preferred Solution

The dapp should be capable of gather the domain's record by following the steps below:

  1. Fetch the resolved by calling findResolver(bytes32 node) from the UniversalResolver
  2. *Check whether this resolve implements the function metadata() external view returns (string memory) function by calling supportsInterface(0x392f37e9) with 0x392f37e9 being the selector of the metadata function
  3. if it returns true it means the contract supports the ENSIP-16, exposing a GraphQL API on the URL returned by the metadata function. The latest version of the DatabaseResolver (0xfCfC138635e8c00BfDa78507C8abeD5013148150) returns the following this URL.
  4. the following is the query that fetches the most infos about a given domain:
    query Domain($name: String!) {
    domain(name: $name) {
    id
    context
    name
    namehash
    labelName
    labelhash
    resolvedAddress
    parent
    subdomains
    subdomainCount
    resolver {
      id
      node
      context
      address
      addr
      contentHash
      texts {
        key
        value
      }
      addresses {
        address
        coin
      }
    }
    expiryDate
    }
    }

P.S: the current implementation of the DBResolver doesn't return tru for the supportsInterface(<metadata selector> yet, it is still being developed. You can call the Metadata API directly for now.

pikonha commented 2 months ago

LGTM