Skip to content

Feature/contract upgrade mechanism - #148

Merged
manoahLinks merged 5 commits into
crowdpass-live:mainfrom
devJaja:feature/contract-upgrade-mechanism
Mar 29, 2026
Merged

Feature/contract upgrade mechanism#148
manoahLinks merged 5 commits into
crowdpass-live:mainfrom
devJaja:feature/contract-upgrade-mechanism

Conversation

@devJaja

@devJaja devJaja commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a safe, planned upgrade path for all deployed CrowdPass Soroban contracts via a shared upgradeable crate.
Implements admin-controlled upgrades with a ~24h timelock, version tracking, emergency pause, and on-chain event
emissions for full transparency.

Fixes #100

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Test coverage improvement

Changes Made

  • Added shared contracts/upgradeable library with timelock upgrade flow, pause/unpause, version tracking, admin
    transfer, and event emissions
  • Integrated upgrade mechanism into all 6 contracts: event_manager, marketplace, ticket_factory, ticket_nft,
    tba_registry, tba_account
  • Fixed pre-existing compile errors in event_manager (missing DataKey/Error variants, missing
    try_promote_from_waitlist, missing escrow balance tracking)
  • Fixed pre-existing broken unit tests across ticket_nft, ticket_factory, tba_account, tba_registry (unclosed
    delimiters, spurious .unwrap() on non-Result types, broken test file structure)
  • Updated integration tests to match updated constructor/initializer signatures

Testing

  • All workspace unit tests pass (cargo test --workspace)
  • WASM release build passes (cargo build --target wasm32-unknown-unknown --release)
  • Integration tests pass (10/10)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

Upgrade flow:

  1. Admin calls schedule_upgrade(new_wasm_hash) — emits upgrade_scheduled with effective-at ledger
  2. After ~24h (17,280 ledgers), admin calls commit_upgrade() — swaps WASM, bumps version, emits upgraded
  3. Admin can call cancel_upgrade() at any point before commit

Emergency pause via pause() / unpause() blocks all state-mutating operations instantly without requiring an upgrade
cycle.

devJaja added 2 commits March 29, 2026 00:45
- Add shared upgradeable crate with timelock (~24h), pause/unpause,
  version tracking, admin transfer, and upgrade event emissions
- Integrate upgrade functions into all 6 contracts (event_manager,
  marketplace, ticket_factory, ticket_nft, tba_registry, tba_account)
- Fix pre-existing compile errors in event_manager (missing DataKey
  variants, Error variants, try_promote_from_waitlist stub, escrow balance)
- Fix pre-existing broken unit tests across ticket_nft, ticket_factory,
  tba_account, tba_registry (unwrap on non-Result, unclosed delimiters,
  undefined variables)
- Update integration tests for new initialize/constructor signatures
@drips-wave

drips-wave Bot commented Mar 29, 2026

Copy link
Copy Markdown

@devJaja 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

@manoahLinks
manoahLinks merged commit 30f6531 into crowdpass-live:main Mar 29, 2026
1 of 3 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.

Implement contract upgrade mechanism

2 participants