Skip to content

feat(devops): implement group treasury deploy automation#60

Merged
codebestia merged 2 commits into
codebestia:mainfrom
Depo-dev:feat/group-treasury-deploy-script-42
May 31, 2026
Merged

feat(devops): implement group treasury deploy automation#60
codebestia merged 2 commits into
codebestia:mainfrom
Depo-dev:feat/group-treasury-deploy-script-42

Conversation

@Depo-dev
Copy link
Copy Markdown
Contributor

Summary

  • Adds contracts/scripts/deploy_group_treasury.sh mirroring the structure of deploy_token_transfer.sh
  • Validates all required env vars before doing any network work
  • Adds GROUP_TREASURY_CONTRACT_ID to .env.example

Deployment flow

  1. Validate env vars (DEPLOYER_SECRET, ADMIN_ADDRESS, TOKEN_CONTRACT_ID, INITIAL_MEMBERS)
  2. Validate INITIAL_MEMBERS: parse comma-separated list, reject empty entries
  3. Build group_treasury WASM with cargo build
  4. Upload WASM to testnet, capture WASM_HASH
  5. Deploy contract instance, capture CONTRACT_ID
  6. Call initialize with --admin, --token_contract, and --members flags
  7. Print contract ID and .env setup instructions

Env var requirements

  • DEPLOYER_SECRET: Stellar secret key of the deployer account
  • ADMIN_ADDRESS: Stellar public key for the treasury admin
  • TOKEN_CONTRACT_ID: Contract ID of the SEP-41 token
  • INITIAL_MEMBERS: Comma-separated Stellar public keys (e.g. G...,G...,G...)

Initialization logic

Members are parsed from the comma-separated INITIAL_MEMBERS string and passed as repeated --members flags to the stellar CLI. Whitespace around each address is trimmed.

Output

On success the script prints:

  • WASM hash
  • Contract ID
  • Admin, token, and member summary
  • Ready-to-paste .env line: GROUP_TREASURY_CONTRACT_ID=

Validation performed

  • bash -n syntax check passes (no errors)
  • Script structure reviewed against deploy_token_transfer.sh conventions
  • All env guards use set -euo pipefail for immediate failure on any error

Fixes #42

Adds contracts/scripts/deploy_group_treasury.sh mirroring deploy_token_transfer.sh.
Validates DEPLOYER_SECRET, ADMIN_ADDRESS, TOKEN_CONTRACT_ID, and INITIAL_MEMBERS
(comma-separated) before building, uploading WASM, deploying, and calling initialize.
Outputs contract ID and .env setup instructions. Adds GROUP_TREASURY_CONTRACT_ID
to .env.example.

Fixes codebestia#42
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Depo-dev 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

@codebestia
Copy link
Copy Markdown
Owner

Please resolve the conflicts.

Align deploy script with upstream/main's simplified contract API:
- Remove INITIAL_MEMBERS and ADMIN_ADDRESS env vars
- Derive admin public key from DEPLOYER_SECRET
- Use --token flag to match initialize(admin, token) signature
Copy link
Copy Markdown
Owner

@codebestia codebestia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks

@codebestia codebestia merged commit 0b60227 into codebestia:main May 31, 2026
0 of 2 checks passed
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.

[CONTRACT] Write deploy script for Group Treasury contract

2 participants