Skip to content

Add ReentrancyGuard to all StepFi contracts#28

Merged
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
deslawson:main
Jun 18, 2026
Merged

Add ReentrancyGuard to all StepFi contracts#28
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
deslawson:main

Conversation

@deslawson

@deslawson deslawson commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Added reentrancy guards (enter_non_reentrant/exit_non_reentrant) to all mutating functions in Reputation, VendorRegistry, and Vouching contracts, with 20 tests verifying reentrant calls are rejected. Follows the same pattern already used by the other 3 contracts.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changes Made

  • Added ReentrancyDetected error variant to ReputationContract, VendorRegistryContract, VouchingContract
  • Added LOCKED storage key + is_reentrancy_locked/set_reentrancy_locked to storage modules
  • Added enter_non_reentrant/exit_non_reentrant helpers to each contract's impl block
  • Wrapped all mutating functions with guard calls
  • Added 20 new tests verifying reentrancy rejection, normal operation, and lock release

Testing

  • Tests pass locally
  • New tests added (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated
  • No new warnings generated

Closed #11

Added reentrancy guards (enter_non_reentrant/exit_non_reentrant) to all mutating functions in Reputation, VendorRegistry, and Vouching contracts, with 20 tests verifying reentrant calls are rejected. Follows the same pattern already used by the other 3 contracts.

@EmeditWeb EmeditWeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well implemented

@EmeditWeb EmeditWeb merged commit 94142f3 into StepFi-app:main Jun 18, 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.

core: implement reentrancy guard across all mutating functions

2 participants