feat(contracts): adopt Soroban WASM versioning across all contracts#370
Merged
Oluwaseyi89 merged 3 commits intoJul 8, 2026
Merged
Conversation
|
@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! 🚀 |
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 |
Contributor
Author
|
On it already |
a616be3 to
57ec671
Compare
- 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.
57ec671 to
5035bff
Compare
Contributor
Author
|
@Oluwaseyi89 You haven't reviewed this |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #355
Summary
build.rsadded to each contract package — injectsGIT_COMMIT_HASH,BUILD_TIMESTAMP, andRUSTC_VERSIONat compile time viacargo:rustc-env, with graceful fallback to"unknown"when git is unavailable.src/version.rsadded to each contract — exposesVERSION,VERSION_FULL, andBUILD_METADATAconstants computed withenv!()/concat!()(zero runtime cost, fullyno_stdcompatible).version()andget_version()functions added to every contract impl — callable on-chain to retrieve"0.1.0+abc1234"or the full metadata string.Cargo.tomlextended with[workspace.metadata.versioning]documenting the strategy.GIT_COMMIT_HASH,BUILD_TIMESTAMP, andRUSTC_VERSIONbefore the build step.scripts/deployment_manifest.shrecords every deployment indeployments/manifest.json(contract, version, git commit, WASM hash, network, timestamp).scripts/deploy_factory.shupdated to inject version env vars and call the manifest recorder.scripts/deploy_all.shadded for deploying all four contracts in a single invocation.VERSIONING.mddocuments the strategy, version format, on-chain query commands, and incident response checklist.Contracts changed
contracts/collection_factorycontracts/nft_contractcontracts/marketplace_settlementcontracts/transaction_contractTest plan
cargo checkpasses for all contracts.cargo testpasses for all contracts.cargo build --target wasm32-unknown-unknown --releaseembeds version metadata.stellar contract invoke ... -- versionreturns"0.1.0+<hash>".stellar contract invoke ... -- get_versionreturns the full metadata string.GIT_COMMIT_HASH,BUILD_TIMESTAMP, andRUSTC_VERSIONin the "Print embedded version info" step.scripts/deploy_factory.shappends an entry todeployments/manifest.json.