Skip to content

Generate extended contract metadata#62

Merged
ascjones merged 54 commits into
masterfrom
aj-metadata
Jul 23, 2020
Merged

Generate extended contract metadata#62
ascjones merged 54 commits into
masterfrom
aj-metadata

Conversation

@ascjones

@ascjones ascjones commented Jul 3, 2020

Copy link
Copy Markdown
Collaborator

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).

Comment thread src/cmd/metadata/contract.rs
@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
Comment thread Cargo.toml
Comment thread src/cmd/metadata/contract.rs
Comment thread src/cmd/metadata/contract.rs Outdated
Comment thread src/cmd/metadata/contract.rs Outdated
Comment thread src/cmd/metadata/mod.rs Outdated
Comment thread src/cmd/metadata/mod.rs
Comment thread src/cmd/metadata/mod.rs
Comment thread src/workspace/mod.rs
Comment thread templates/tools/generate-metadata/main.rs

@Robbepop Robbepop left a comment

Copy link
Copy Markdown
Contributor

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