Skip to content

feat(contracts): adopt Soroban WASM versioning across all contracts#370

Merged
Oluwaseyi89 merged 3 commits into
NFTopia-Foundation:mainfrom
Fury03:feat/soroban-contract-wasm-versioning
Jul 8, 2026
Merged

feat(contracts): adopt Soroban WASM versioning across all contracts#370
Oluwaseyi89 merged 3 commits into
NFTopia-Foundation:mainfrom
Fury03:feat/soroban-contract-wasm-versioning

Conversation

@Fury03

@Fury03 Fury03 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #355


Summary

  • build.rs added to each contract package — injects GIT_COMMIT_HASH, BUILD_TIMESTAMP, and RUSTC_VERSION at compile time via cargo:rustc-env, with graceful fallback to "unknown" when git is unavailable.
  • src/version.rs added to each contract — exposes VERSION, VERSION_FULL, and BUILD_METADATA constants computed with env!()/concat!() (zero runtime cost, fully no_std compatible).
  • version() and get_version() functions added to every contract impl — callable on-chain to retrieve "0.1.0+abc1234" or the full metadata string.
  • Workspace Cargo.toml extended with [workspace.metadata.versioning] documenting the strategy.
  • CI workflow updated to export GIT_COMMIT_HASH, BUILD_TIMESTAMP, and RUSTC_VERSION before the build step.
  • scripts/deployment_manifest.sh records every deployment in deployments/manifest.json (contract, version, git commit, WASM hash, network, timestamp).
  • scripts/deploy_factory.sh updated to inject version env vars and call the manifest recorder.
  • scripts/deploy_all.sh added for deploying all four contracts in a single invocation.
  • VERSIONING.md documents the strategy, version format, on-chain query commands, and incident response checklist.

Contracts changed

  • contracts/collection_factory
  • contracts/nft_contract
  • contracts/marketplace_settlement
  • contracts/transaction_contract

Test plan

  • cargo check passes for all contracts.
  • cargo test passes for all contracts.
  • cargo build --target wasm32-unknown-unknown --release embeds version metadata.
  • stellar contract invoke ... -- version returns "0.1.0+<hash>".
  • stellar contract invoke ... -- get_version returns the full metadata string.
  • CI pipeline shows GIT_COMMIT_HASH, BUILD_TIMESTAMP, and RUSTC_VERSION in the "Print embedded version info" step.
  • scripts/deploy_factory.sh appends an entry to deployments/manifest.json.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Fury03 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Oluwaseyi89

Copy link
Copy Markdown
Contributor

@Fury03 who authorize you to modify CI file? Your PR will not be merge until you delete that modified CI file without committing then go copy the same CI file from our main branch back to the same file path and commit and push.

@Fury03

Fury03 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

On it already

@Fury03 Fury03 force-pushed the feat/soroban-contract-wasm-versioning branch from a616be3 to 57ec671 Compare June 29, 2026 21:36
Fury03 added 3 commits July 8, 2026 13:33
- Add build.rs to each contract package to inject GIT_COMMIT_HASH,
  BUILD_TIMESTAMP, and RUSTC_VERSION at compile time via cargo:rustc-env.
- Add src/version.rs to each contract exposing VERSION, VERSION_FULL
  and BUILD_METADATA constants computed with env!()/concat!() — zero
  runtime cost, no_std compatible.
- Expose version() and get_version() public functions on every contract
  so callers can query the deployed version on-chain.
- Update workspace Cargo.toml with [workspace.metadata.versioning] for
  documentation purposes.
- Update CI workflow to export GIT_COMMIT_HASH, BUILD_TIMESTAMP, and
  RUSTC_VERSION before the build step for reproducible metadata.
- Add scripts/deployment_manifest.sh to record each deployment in
  deployments/manifest.json with contract, version, git commit,
  network, and timestamp.
- Update scripts/deploy_factory.sh to inject version env vars and call
  the manifest recorder after deployment.
- Add scripts/deploy_all.sh for deploying all contracts in one shot.
- Add VERSIONING.md documenting the versioning strategy and incident
  response workflow.
pub mod version already brings the module into scope; adding
use crate::version caused E0255 (name defined multiple times).
Reverting unauthorized CI modifications per maintainer request.
Restores original workflow without version env var injection steps.
@Fury03 Fury03 force-pushed the feat/soroban-contract-wasm-versioning branch from 57ec671 to 5035bff Compare July 8, 2026 13:33
@Fury03

Fury03 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@Oluwaseyi89 You haven't reviewed this

@Oluwaseyi89 Oluwaseyi89 merged commit 700731a into NFTopia-Foundation:main Jul 8, 2026
1 check passed
@Oluwaseyi89

Oluwaseyi89 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@Fury03 please, I will advise you to go open a ticket on Discord to claim your points; as the system hasn't automatically assign the points.

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.

Adopt Soroban contract versioning in WASM metadata

2 participants