Skip to content
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

ink! V4 Metadata JSON schema #1564

Closed
XY-Wang opened this issue Dec 20, 2022 · 4 comments
Closed

ink! V4 Metadata JSON schema #1564

XY-Wang opened this issue Dec 20, 2022 · 4 comments
Assignees
Labels
A-ink_metadata [ink_metadata] Work item

Comments

@XY-Wang
Copy link

XY-Wang commented Dec 20, 2022

Hi,

We're currently working on our W3F grant to decode verified ink! contract messages and events for our contracts explorer. Since verification is only possible for contracts written with ink! v4.0.0-alpha.3 onward, we would need a ink-v4-schema.json to validate metadata prior to decoding.

We are currently using a manually-patched version on top of the ink-v3-schema.json provided in this repo but ideally we would want to use the officially generated version.

Is there any plan to provide the V4 schema or a tool to generate it?

Thanks!

@HCastano
Copy link
Contributor

Yes, there are plans but it probably won't happen until some of the other 4.0 related issues get sorted (as mentioned here).

The 4.0 metadata format has been finalized, so there's nothing blocking this other than developer time. Is this something you'd be interesting in picking up?

@XY-Wang
Copy link
Author

XY-Wang commented Dec 23, 2022

So, I did a quick-and-dirty patch across the three repos ink, cargo-contract and scale-info, following mostly the changes in your branch, and generated the new V4 schema.

I validated the schema against example contracts Flipper, Incrementer and our own Crowdfund contract built with cargo-contract2.0.0-beta and against the example contracts ERC20 and Payment-Channel built with cargo-contract2.0.0-beta.1.

You can find the V4 schema here: https://gist.github.com/XY-Wang/b54d3b4a14d12df7e273c5eece274682

Please let us know if it works for you 😺

@SkymanOne
Copy link
Contributor

SkymanOne commented Jun 1, 2023

Formal definition has been updated on master. And some groundwork has been done to automatically generate the definition in #1765

We are now just left with use-ink/cargo-contract#1090

@SkymanOne
Copy link
Contributor

Closed via use-ink/cargo-contract#1090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ink_metadata [ink_metadata] Work item
Projects
None yet
Development

No branches or pull requests

3 participants