Skip to content

refactor(upgrade): enforce auth and state preconditions before WASM upgrade (#352) - #420

Merged
godamongstmen897 merged 1 commit into
Goldii-locks:mainfrom
Awosdot:feature/issue-352-upgrade-authorization-preconditions
Sep 1, 2026
Merged

refactor(upgrade): enforce auth and state preconditions before WASM upgrade (#352)#420
godamongstmen897 merged 1 commit into
Goldii-locks:mainfrom
Awosdot:feature/issue-352-upgrade-authorization-preconditions

Conversation

@Awosdot

@Awosdot Awosdot commented Aug 28, 2026

Copy link
Copy Markdown

Summary of Changes

  • Guard Clause Reordering: Refactored the upgrade entrypoint to execute caller authorization (admin.require_auth()) and contract state precondition checks prior to reading or mutating any storage entries or executing WASM updates.
  • Gas & Storage Integrity: Ensured early exit with appropriate typed errors on failure (e.g., unauthorized caller or paused/invalid contract state) while guaranteeing zero ledger storage mutations occur.
  • Unit Testing: Added comprehensive test coverage asserting proper typed error returns for unauthorized/illegal state calls and verifying state non-mutation.

Closes #352

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

@godamongstmen897
godamongstmen897 merged commit 18b76a5 into Goldii-locks:main Sep 1, 2026
1 check 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.

Harden caller authorization and precondition guards in upgrade

2 participants