Skip to content

[Feature] Contract Upgradability Pattern (WASM Swap) #177

Description

@AlAfiz

Description: We need a secure, admin-controlled mechanism to upgrade the smart contracts without migrating liquidity or losing state.
Context / Motivation: TradeFlow is in active development. We must be able to patch bugs and deploy new features to the core contracts without disrupting user balances or breaking frontend integrations.
Acceptance Criteria: - [ ] Implement an upgrade function in the core contracts.

  • Ensure the function requires authorization strictly from the designated Admin address.
  • Utilize env.deployer().update_current_contract_wasm() to swap the executable code.
  • Write integration tests verifying state persists across a mock upgrade.
    Technical Pointers: Review the Soroban documentation on contract upgrades. Pay close attention to how data schemas in storage are handled post-upgrade; ensure no breaking changes in storage struct definitions occur in your tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions