paritytech / paritytech/contract-dependency-manager

Generate initialization files (Rust storage view derived from storageLayout)

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4
Forks
3
Avg merge
4d 13h
Merged PRs (30d)
3

Description

Writing an initialization today means hand-creating initializations/<version>.{rs,sol} — and in Rust, copy-pasting the contract's storage fields into the init's struct. The shapes are fully mechanical.

Proposal: a generator (e.g. cdm generate init <contract>) that scaffolds a blank initialization for the version being published. Solidity: a contract inheriting the target with an empty initialize. Rust: the full file including the storage struct, derived from the built artifact's storageLayout (universal since cargo-pvm-contract#155) — uint32Lazy<u32>, addressLazy<Address>, etc.; exotic types fall back to a TODO stub. The result compiles as-is; the deploy-time layout guard keeps it honest.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the cdm generate init <contract> command entry point and trace how the built artifact exposes storageLayout. Define the Solidity and Rust initialization outputs, including the stated primitive mappings and TODO fallback for exotic types. Done means the generated files compile as-is and the deploy-time layout guard remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, solidity, typescript
Domain
build-system, cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.