Predictify-org/predictify-contracts

Add ReentrancyGuard::scope_stack debug introspection helper

Geschlossen

#666 geöffnet am 27.06.2026

 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (182 Forks)auto 404
GRANTFOX OSSOFFICIAL CAMPAIGNStellar Wavegood first issuerustsmart-contractsorobantesting

Repository-Metriken

Stars
 (7 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Description

reentrancy_guard.rs keeps a per-entrypoint scope but does not expose its current depth for tests. Add a #[cfg(test)] pub fn current_scope_stack() helper returning the active scope chain so integration tests can assert correct nesting and detect accidental cross-scope leakage.

Requirements and Context

  • Helper compiled only under #[cfg(test)]
  • Returns Vec<Symbol> of active scopes
  • Used by at least two existing tests
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b task/reentrancy-scope-introspection
    
  2. Implement changes
    • contracts/predictify-hybrid/src/reentrancy_guard.rs
    • Update an existing test in tests/
  3. Test and commit
    • cargo test -p predictify-hybrid reentrancy
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

test: expose reentrancy guard scope stack for assertions

Acceptance Criteria

  • Helper is gated to cfg(test)
  • Two pre-existing tests adopt the helper
  • No public surface change for production builds

Guidelines

  • NatSpec-style /// doc comments where relevant
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Contributor Guide