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

Generate extended contract metadata #62

Merged
merged 54 commits into from
Jul 23, 2020
Merged

Generate extended contract metadata #62

merged 54 commits into from
Jul 23, 2020

Conversation

ascjones
Copy link
Collaborator

@ascjones ascjones commented Jul 3, 2020

Closes #57. Part of use-ink/ink#299.

Generates extended metadata described here: use-ink/ink#299 (comment) (reproduced below)

  • In root:
    • metadata_version: Required semantic version for the smart contract metadata.
  • In source section:
    • hash: Required of the associated Wasm file using BLAKE2 256-bit
    • language: e.g. Solidity, AssemblyScript or Rust (including version X.Y.Z (semantic versioning))
    • compiler: e.g. Solang, ink!/Rust (including version X.Y.Z (semantic versioning))
  • In contract section:
    • name: Required identifier for the smart contract name. (https://crates.io/crates/unicode-xid)
    • version: Required semantic version field for the smart contract.
    • authors: Required non-empty sequence of strings.
    • description: Optional short description about the smart contract.
    • documentation: Optional URL to link to API-level documentation of the smart contract.
    • repository: Optional URL to link to the repository.
    • homepage: Optional URL to link to the smart contract's associated homepage.
    • license: Optional field to identify the license of the smart contract given in SPDX license list 3.6 format OR a URL to a user provided non-standard license.
  • Add user section for custom metadata fields that are generally ignored by standard tools.

Types for the extended metadata are defined in cargo-contract and combined with metadata generated by ink_lang. This maintains minimal coupling with ink! allowing for forwards/backwards compatibility. See the reasoning here use-ink/ink#299 (comment).

@ascjones ascjones requested a review from Robbepop July 15, 2020 08:04
@Robbepop Robbepop requested a review from cmichi July 15, 2020 16:27
@ascjones ascjones changed the title Generate additional contract metadata Generate extended contract metadata Jul 16, 2020
Cargo.toml Outdated Show resolved Hide resolved
src/cmd/metadata/contract.rs Show resolved Hide resolved
src/cmd/metadata/contract.rs Outdated Show resolved Hide resolved
src/cmd/metadata/contract.rs Outdated Show resolved Hide resolved
src/cmd/metadata/mod.rs Outdated Show resolved Hide resolved
src/cmd/metadata/mod.rs Show resolved Hide resolved
src/cmd/metadata/mod.rs Show resolved Hide resolved
src/workspace/mod.rs Show resolved Hide resolved
templates/tools/generate-metadata/main.rs Show resolved Hide resolved
Copy link
Contributor

@Robbepop Robbepop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ascjones ascjones merged commit d28a743 into master Jul 23, 2020
@ascjones ascjones deleted the aj-metadata branch July 23, 2020 10:36
@ascjones ascjones mentioned this pull request Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend contract metadata with cargo metadata
2 participants