Skip to content

core: implement reentrancy guard across all mutating functions #11

@EmeditWeb

Description

@EmeditWeb

Problem

None of the StepFi contracts implement a reentrancy
guard. A malicious contract could call back into
a StepFi contract during execution, potentially
draining funds or corrupting state.

Context

Reentrancy is one of the most common and damaging
smart contract vulnerabilities. Soroban contracts
can call other contracts and those contracts can
call back. Without a guard this is exploitable.

What To Build

  1. Create a ReentrancyGuard in each contract.

  2. Apply to ALL mutating functions in all 5 contracts.

  3. Write tests that verify reentrancy is rejected.

Files To Touch

All 5 contract lib.rs, storage.rs, errors.rs, tests.rs files

Acceptance Criteria

  • Every mutating function has reentrancy guard
  • Reentrant calls return ContractError::Reentrant
  • Tests verify guard works
  • All existing tests still pass
  • cargo build passes

Mandatory Checks Before PR

  • cargo build passes
  • All tests pass
  • PR references this issue

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions