-
Notifications
You must be signed in to change notification settings - Fork 142
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
feat: add standards
key to ContractSourceMetadata
#351
feat: add standards
key to ContractSourceMetadata
#351
Conversation
Your Render PR Server URL is https://nomicon-pr-351.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c989ll0ivq0br030qri0. |
ContractSourceMetadata
ContractSourceMetadata
standards
key to ContractSourceMetadata
@near/wg-contract-standards This is a small extension to an existing NEP, so let's review it before our next Working Group call |
Co-authored-by: Vlad Frolov <[email protected]>
Co-authored-by: Vlad Frolov <[email protected]>
8379750
to
a54f6b1
Compare
As a subject matter expert, I recommend moving this NEP forward and for @near/wg-contract-standards to accept it based on the following benefits and all the concerns being resolved. Benefits
Blockers & Concerns
As a working group member, I lean towards approving this NEP extension. |
It is a valuable and natural extension of NEP-330 in a non-breaking way. As a WG member, I lean towards approving this proposal. Meta Question: Should contract developers include nep330 / nep351 as implemented standards? We should suggest in this document whether these standards should be included. It seems a good idea if they are included (to keep track of the version). |
I think it makes sense to include nep330. There is no strategy at the moment regarding the NEP extension numbering where we evolve the existing NEP and thus the NEP-330 has no mentions of this PR #351. Another follow-up idea is that it is going to be useful to have JSON Events fired when the metadata gets updated (similar to how it is proposed to do for NEP-171 metadata updates in #423) |
I lean towards approving this request. With more standards being integrated into wallets and other user-facing tools, it would be great to be able to efficiently enumerate the interfaces a contract supports. |
As the moderator, I would like to thank the author @esaminu for submitting this NEP extension, and for the @near/wg-contract-standards working group members for your review. Based on the voting indications above, it seems like this proposal is close to a decision. We are therefore scheduling the third Contract Standards Working group meeting next week, where this NEP can enter the final voting stage. We encourage anyone who is interested to join the meeting. Meeting Info |
Thank you to everyone who attended the third Contract Standards Working Group meeting today! The working group members reviewed the NEP and reached the following consensus: Status: Approved
Meeting Recording: @esaminu Thank you for authoring this NEP! Next Steps:
Implementation Status: Community contributions to the SDKs are welcome! |
@ori-near, we can merge this PR before all the steps are completed. I suggest we add this PR to the main page (README.md) and open a new issue to track the next steps. |
… clarified the need to include NEP-330 v1.1.0 on the list of supported NEPs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I embedded the "Decision Context" section with Benefits and Concerns for future reference.
As a moderator, I am approving this PR based on #351 (comment)
:::caution | ||
This is part of proposed spec [NEP-330](https://github.com/near/NEPs/blob/master/neps/nep-0330.md) and subject to change. | ||
::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this scary disclaimer is not necessary anymore. This NEP is well-reviewed by Contract Standards Working Group and well-received by the community.
{ | ||
standard: "nep330", | ||
version: "1.1.0" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added reference to NEP-330 into all the examples to ensure that readers follow the advice.
- `version`: a string that references the specific commit hash or version of the code that is currently deployed on-chain. This can be included regardless of whether or not the contract is open-sourced and can also be used for organizational purposes. | ||
- `link`: a string that references the link to the open-source code. This can be anything such as Github or a CID to somewhere on IPFS. | ||
- `standards`: a list of objects (see type definition below) that enumerates the NEPs supported by the contract. If this extension is supported, it is advised to also include NEP-330 version 1.1.0 in the list (`{standard: "nep330", version: "1.1.0"}`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@esaminu I have added the standards
field description here as you mentioned before.
Type: Standards Track | ||
Category: Contract | ||
Version: 1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ori-near I have introduced NEPs versioning as part of the metadata. I will go over all of the approved NEPs and set the version to 1.0.0 if it is not set, and update NEP-001.
## Decision Context | ||
|
||
### 1.0.0 - Initial Version | ||
|
||
The initial version of NEP-330 was approved by @jlogelin on Mar 29, 2022. | ||
|
||
### 1.1.0 - Contract Metadata Extension | ||
|
||
The extension NEP-351 that added Contract Metadata to this NEP-330 was approved by Contract Standards Working Group members on January 17, 2023 ([meeting recording](https://youtu.be/pBLN9UyE6AA)). | ||
|
||
#### Benefits | ||
|
||
- Unlocks NEP extensions that otherwise would be hard to integrate into the tooling as it would be guess-based (e.g. see "interface detection" concerns in the Non-transferrable NFT NEP) | ||
- Standardization enables composability as it makes it easier to interact with contracts when you can programmatically check compatibility | ||
- This NEP extension introduces an optional field, so there is no breaking change to the original NEP | ||
|
||
#### Concerns | ||
|
||
| # | Concern | Resolution | Status | | ||
| - | - | - | - | | ||
| 1 | Integer field as a standard reference is limiting as third-party projects may want to introduce their own standards without pushing it through the NEP process | Author accepted the proposed string-value standard reference (e.g. “nep123” instead of just 123, and allow “xyz001” as previously it was not possible to express it) | Resolved | | ||
| 2 | NEP-330 and NEP-351 should be included in the list of the supported NEPs | There seems to be a general agreement that it is a good default, so NEP was updated | Resolved | | ||
| 3 | JSON Event could be beneficial, so tooling can react to the changes in the supported standards | It is outside the scope of this NEP. Also, list of supported standards only changes with contract re-deployment, so tooling can track DEPLOY_CODE events and check the list of supported standards when new code is deployed | Won’t fix | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this "Decision Context" as per NEP process
This PR proposes the addition of an optional
standards
value to theContractSourceMetadata
type recently introduced in NEP-330 (#330).This will allow wallets and Dapps to be able to more easily identify what type of contract they are dealing with and what functionality to expect and render without having to test for those methods and events existing.
One example use case of this is to introduce an extension that implements
buy
/sell
for the USN contract and add it asContractSourceMetadata
so we can provide the functionality conditionally for fungible tokens in near/near-wallet#2568.Additionally, this PR fixes missed updates of
ContractMetadata
toContractSourceMetadata
here and here.