Skip to content

security(contract): harden upgrade authorization and wasm hash verification #78

Description

@arisu6804

Problem

An incorrectly authorized or unverified upgrade could replace vault logic with incompatible or malicious code.

Objective

Harden the upgrade path so only the documented authority can apply an approved artifact and every failure is state-preserving.

Implementation scope

  • Require the documented administrator or governance authority for upgrades.
  • Verify the expected WASM hash or approved artifact metadata before applying an upgrade.
  • Emit an auditable upgrade event and reject mismatches before state changes.

Acceptance criteria

  • Unauthorized callers cannot upgrade the contract.
  • A mismatched artifact is rejected atomically.
  • A successful upgrade records the verified artifact identity.

Required validation

  • Add authorization, hash mismatch, rollback, event, and state-preservation tests.
  • Existing tests and CI remain passing.
  • Do not weaken, delete, or skip unrelated tests to obtain a green build.

PR quality bar

  • Explain the trust model, artifact verification, compatibility impact, and test evidence.
  • Keep the PR focused; do not submit a docs-only or cosmetic change.

Out of scope

  • Unrelated contract redesigns or broad deployment rewrites.

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSOpen-source issue tracked by GrantFoxMAYBE REWARDEDThis issue may carry a rewardThird CampaignThird Campaign contributionenhancementNew feature or requestpriority:highHigh implementation priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions