Repository navigation
fix(contracts): unify contract ID env var naming across deploy paths - #110
Merged
Busiii-adetiba merged 1 commit intoOct 16, 2026
Merged
Conversation
03-deploy-contracts.sh, deploy-contracts.cjs and 04-init-contracts.sh each wrote a different key for the same contract IDs, so rollback could not consume files produced by the bash deploy path. Adopt the canonical STELLAR_CONTRACT_<NAME> scheme the backend reads (STELLAR_CONTRACT_VAULT_REGISTRY, STELLAR_CONTRACT_ACCESS_LEASE, STELLAR_CONTRACT_SUBSCRIPTION) and use it everywhere: - 03-deploy-contracts.sh / deploy-contracts.cjs now write those keys. - 04-init-contracts.sh consumes and prints them. - rollback-contracts.cjs normalises recognised keys from any deploy path (canonical, *_CONTRACT_ID/_CONTRACT, bare names, REGISTRY aliases) to the canonical names, keeps legacy aliases in the target .env in sync, and appends the canonical keys. - Update .env.example and docs; legacy names documented as deprecated aliases. - Update unit tests. Closes SynapsVault#17 Closes SynapsVault#18 Closes SynapsVault#19 Closes SynapsVault#20
|
@08038165041 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! 🚀 |
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.
Summary
The three deployed Soroban contract IDs were written under three different key spellings —
vault_registry(bash deployer),VAULT_REGISTRY_CONTRACT_ID(SDK deployer) andSTELLAR_CONTRACT_VAULT_REGISTRY(init output).rollback-contracts.cjsonly recognised keys ending in_CONTRACT_ID/_CONTRACT, socontract-ids.envfiles produced by the bash path could never be rolled back, and the backend read a name the deploy scripts did not write.This standardises on the naming scheme the backend reads —
STELLAR_CONTRACT_<NAME>— across every deploy path, and makes rollback understand files produced by any of them.Changes
scripts/03-deploy-contracts.sh: writesSTELLAR_CONTRACT_VAULT_REGISTRY,STELLAR_CONTRACT_ACCESS_LEASE,STELLAR_CONTRACT_SUBSCRIPTIONtocontract-ids.env.scripts/deploy-contracts.cjs: newcontractEnvName()emits the same canonical keys (previously*_CONTRACT_ID).scripts/04-init-contracts.sh: consumes and prints the canonical keys.scripts/rollback-contracts.cjs:canonicalContractKey()normalises recognised keys from either deploy path — canonicalSTELLAR_CONTRACT_*, legacy*_CONTRACT_ID/*_CONTRACT, bare names (vault_registry) and theREGISTRY_CONTRACT_IDalias — to canonical names.updateEnvFile()updates canonical keys in place, keeps legacy aliases present in the target.envin sync, and appends any missing canonical keys..env.exampleand docs (ENVIRONMENT-VARIABLES.md,DEPLOY-BACKEND-GUIDE.md,contract-deploy-guide.md) updated to the canonical scheme; legacy names documented as deprecated aliases.test/contract-scripts.test.cjsupdated and extended.Acceptance criteria
.env.exampleto use itCloses #17
Closes #18
Closes #19
Closes #20