-
Notifications
You must be signed in to change notification settings - Fork 424
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
Additional contract metadata #299
Comments
For
Also we might be interested in the underlying compiler, so we might want to include the Rust version into
Not sure how we are going to compute the hashes but we should standardize a specific hash for that first.
So we end up having something like:
Also we maybe even want the date of creation of the metadata:
Maybe even a description of the whole contract might be handy:
We should be able to extract the contract description from the contract module doc comment in ink!. |
How about including the compiler version in the string which identifies the compiler.
which could also be:
|
I think some sort of link back to source code would be great. We could include the repo, but also the commit and filename? Or should that be part of the link itself.
|
We just had an audio call with the following extensional metadata support aggrement: Smart contract metadata is JSON encoded.
Watch list for additional metadata fields:
Example{
"metadata_version": "0.1.0",
"source": {
"hash": "0x...",
"language": "ink! 3.0/Rust",
"compiler": "rustc 1.45"
},
"contract": {
"name": "Flipper",
"version": "1.0.0",
"authors": [ "Parity Technologies <admin@parity.io>" ],
"description": "Very simple contract to flip a boolean value.",
"documentation": "https://my-documentation.com",
"repository": "https://github.com/examples/flipper",
"homepage": "https://flipper-homepage.com",
"license": "MIT OR APACHE-2",
},
"user": {
"some-user-provided-field": "and-its-value",
"more-user-provided-fields": ["and", "their", "values"],
},
"spec": {
"types": { ... },
"events": [ ... ],
"messages:" [ ... ],
"constructors:" [ ... ],
"layout": { ... },
},
} |
First auto-generated json of the new format (with hardcoded values)
|
New updated metadata:
|
Looking good so far! Reminder: That |
Could make it an optional field? |
Wait for action until we resolved this with @seanyoung please. |
The |
Generated for incrementer with no hardcoded values:
|
Very nice! How was the
Also due to the upcoming trait support we might have the need to find some ground rules or changes for message and constructor names since they now can overlap for ink!. |
|
Continuing a conversation I had with @Robbepop use-ink/cargo-contract#62 (comment). The question is: where the data structures which define the extended metadata (generated by Current status
Dependency on
|
@seanyoung an idea that @Robbepop and I discussed: we could extract the types which define the extended metadata into their own crate, which |
@ascjones that is a great solution, I like it very much! There is some precedent for a crate which just defines types. For example https://github.com/gluon-lang/lsp-types does this for the Language Server protocol. |
sorry 🙈 |
This has been implemented and is available with ink! 3.0. Closed. |
As discussed in #296 (comment).
Add extra data to at the
InkProject
struct level. e.g.version
as suggested by @jacogrlanguage
e.g.ink!
Update: see #299 (comment) below with outcome of meeting with @Robbepop @seanyoung
todo:
scale-info
v0.3.0
ink!
Define types and add to,InkProject
structAccept instances of contract metadata types via_ink_generate_metadata
cargo-contract
_ink_generate_metadata
The text was updated successfully, but these errors were encountered: