Contracts - Add deployment and initialization script under contracts for testnet
Description
There is no scripted deploy for the escrow contract. Add a script that builds, deploys, and initializes the contract on Stellar testnet using the stellar CLI, wiring the resulting contract id into the env vars consumed by src/lib/backend/config.ts.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Build with
stellar contract build against contracts/Cargo.toml
- Deploy and call
initialize(admin, token, fee_recipient)
- Output the contract id for
NEXT_PUBLIC_COMMITMENT_CORE_CONTRACT
- Keep secrets out of the script (read from env)
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/contracts-testnet-deploy-script
- Implement changes
- Add
contracts/scripts/deploy-testnet.sh
- Add a dry-run test or lint where feasible
- Document the deploy flow in
contracts/README.md
- Add env-var safety comments
- Test and commit
- Run tests, cover edge cases
- Include test output and notes
Example commit message
feat: add testnet deploy and init script for escrow contract
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Contracts - Add deployment and initialization script under contracts for testnet
Description
There is no scripted deploy for the escrow contract. Add a script that builds, deploys, and initializes the contract on Stellar testnet using the
stellarCLI, wiring the resulting contract id into the env vars consumed bysrc/lib/backend/config.ts.Requirements and context
stellar contract buildagainstcontracts/Cargo.tomlinitialize(admin, token, fee_recipient)NEXT_PUBLIC_COMMITMENT_CORE_CONTRACTSuggested execution
git checkout -b feature/contracts-testnet-deploy-scriptcontracts/scripts/deploy-testnet.shcontracts/README.mdExample commit message
feat: add testnet deploy and init script for escrow contractGuidelines