Skip to content

Protect subscription charges against reentrancy#442

Open
TUPM96 wants to merge 1 commit into
Smartdevs17:mainfrom
TUPM96:codex/reentrancy-guard-423
Open

Protect subscription charges against reentrancy#442
TUPM96 wants to merge 1 commit into
Smartdevs17:mainfrom
TUPM96:codex/reentrancy-guard-423

Conversation

@TUPM96
Copy link
Copy Markdown

@TUPM96 TUPM96 commented May 25, 2026

Summary

  • add a shared ReentrancyLock(charge_subscription) storage key and guard the full charge flow
  • reorder charge_subscription to persist subscription/revenue effects before token and invoice cross-contract calls
  • add malicious-token callback regression coverage, a property test for reentrant charge attempts, and update the threat model/spec notes

Fixes #423

Validation

  • cargo test --workspace
  • cargo build --workspace --target wasm32v1-none --release

Both pass. The build still emits existing baseline warnings from the gas profiling/storage modules.

Copilot AI review requested due to automatic review settings May 25, 2026 11:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Add reentrancy protection for subscription charging contract

2 participants