-
Couldn't load subscription status.
- Fork 326
ENSIP-16 - CCIP metadata #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0a7eff8
First draft ccip-metadata
jefflau 61d470f
Add more functions
jefflau d973f53
Add Record Keys
jefflau a43d393
Remove ccip vocab
jefflau 350321b
Update ens-improvement-proposals/ensip-14-ccip-metadata.md
jefflau e52200e
Merge branch 'master' of github.com:ensdomains/docs into ensip-14
jefflau 2ca5e18
Add return types, expand on MUST statement
jefflau ecc5ffe
Switch to graphql data type
jefflau beb8f9d
Merge
jefflau a979c83
Create graphurl endpoint and support for owned node
makoto 67aa91c
Add comments on schema
makoto c697ad7
Add Open Items
makoto 90fa9d4
Fix typo
makoto d27f5db
Fix typo
makoto d8eac7e
Merge pull request #136 from ensdomains/metadata-ensip-withowned-node
jefflau 92c0097
Merge branch 'master' into ensip-14
makoto acbfbe5
Add Context (#142)
makoto 3181488
Remove xx
makoto c7abdad
Modify the graph structure
makoto 751b5ce
Changed the order of address and context
makoto 4b3365f
Shuffle the order of context and dynamic metadata
makoto 16299de
Revert changes
makoto 7c1dae5
Add an explanation of context
makoto 2d7a184
Remove implementation specific requirement for owner
makoto c0aafd9
Address feedbacks
makoto a730620
Apply suggestions from code review
makoto e83d4ad
Address feedback
makoto a388a9c
ADD isApprovedFor to both l1 and l2 contracts
makoto be1bbc1
Add comment
makoto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| description: Allows metadata to be queried on CCIP enabled names | ||
| --- | ||
|
|
||
| # ENSIP-14: CCIP-read metadata | ||
|
|
||
| | **Author** | Jeff Lau \<[email protected]> | | ||
| | ------------- | ---------------------------- | | ||
| | **Status** | Draft | | ||
| | **Submitted** | 2022-09-22 | | ||
|
|
||
| ### Abstract | ||
|
|
||
| This ENSIP allows metadata to be queried directly on the resolver for CCIP-read enabled names. CCIP-read will power many of the domains in the future, however since the retrieval mechanism uses wildcard + offchain resolver, there is no standardised way to retrieve important metadata information such as the owner (who can change the records), or L2/offchain database the records are stored on. | ||
|
|
||
| ### Motivation | ||
|
|
||
| With CCIP-read subdomains already starting to get used by larger partners in the ENS ecosystem, it is important that there is a way of frontend interfaces to get important metadata to allow a smooth user interface. For instance the owner of a CCIP enabled name would need to be known, for a UI to show whether or not the currently connected account has the rights to edit the records. If the owner was not known, the only way to know would be to make the edit and wait for failure. | ||
|
|
||
| This ENSIP addresses this by adding a way of important metadata to be gathered on the offchain resolver, which would likely revert and be also resolved offchain, however there is an option for it to be also left onchain if there value was static and wouldn't need to be changed often. | ||
|
|
||
| ### Specification | ||
|
|
||
| Add metadata functions to the resolver. The first argument MUST have the node if it is specific to a node. | ||
|
|
||
| ```solidity | ||
|
|
||
|
|
||
| interface OffChainResolver { | ||
jefflau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| owner(bytes32 node); | ||
makoto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
jefflau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| isApprovedForAll(address account, address operator) | ||
makoto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| dataLocation(bytes32 node) returns (string); | ||
makoto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| allRecords(bytes32 node) returns (Records); | ||
makoto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| recordKeys(bytes32 node) returns (RecordsKeys) | ||
makoto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### Example | ||
|
|
||
| ```javascript | ||
| const node = namehash('ccipreadsub.example.eth') | ||
| const resolver = await ens.resolver(node) | ||
| const owner = await resolver.owner(node) | ||
| // 0x123... | ||
| const dataLocation = await.resolver.dataLocation(node) | ||
| // { | ||
| // name: "Optimism", | ||
| // type: "Layer 2", | ||
| // chainId: 5 | ||
| // } | ||
|
|
||
| const recordKeys = await.resolver.recordKeys(node) | ||
| // { | ||
| // addr: [60, 1] | ||
| // textRecords: ['url', 'avatar'] | ||
| // contentHash: true | ||
| // } | ||
|
|
||
| ``` | ||
|
|
||
| #### Backwards Compatibility | ||
|
|
||
| None | ||
|
|
||
| ### Copyright | ||
|
|
||
| Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.