Skip to content

Backend: Add Smart Contract Upgrade Health Check and Validation Service #474

Description

@Smartdevs17

Context

Smart contract upgrades carry significant risk. A faulty upgrade can lock funds, break integrations, or introduce vulnerabilities.

Current Limitation/Problem

Contract upgrades are deployed with manual verification. There is no automated pre-deployment health check, state compatibility validation, or post-deployment smoke test suite.

Expected Outcome

An automated upgrade safety service that validates contract upgrades before deployment, checks storage layout compatibility, simulates upgrade, and runs smoke tests post-deployment.

Acceptance Criteria

  • Storage layout diff checker: detect variable reordering, type changes, slot collisions
  • Simulate upgrade on a fork (Hardhat mainnet fork / Soroban sandbox)
  • Run automated test suite against upgraded contract on fork
  • Check admin/key permissions are preserved after upgrade
  • Verify proxy admin ownership is not accidentally renounced
  • Post-deployment: verify implementation address, run health check transactions
  • Rollback capability if smoke tests fail
  • Dashboard showing upgrade history and safety check results

Technical Scope

  • backend/src/services/contracts/upgrade-validator.ts - upgrade validation
  • Hardhat mainnet forking for EVM simulation
  • Soroban sandbox for Stellar simulation
  • Prisma: ContractUpgrade, UpgradeValidationReport models
  • CI integration: required before deployment to mainnet
  • Edge cases: immutable variables, constructor args in upgrades, beacon proxies

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions