Skip to content

feat: add reentrancy guard for sensitive functions#115

Merged
ahmadogo merged 2 commits intoMentoNest:mainfrom
Mkalbani:feat/reentrancy-guard
Mar 29, 2026
Merged

feat: add reentrancy guard for sensitive functions#115
ahmadogo merged 2 commits intoMentoNest:mainfrom
Mkalbani:feat/reentrancy-guard

Conversation

@Mkalbani
Copy link
Copy Markdown
Contributor

closes #105

  • Add DataKey::ReentrancyLock for lock state storage
  • Add Error::Reentrancy = 30 for reentrant call detection
  • Add acquire_lock/release_lock helper functions
  • Guard lock_funds and complete_session against reentrancy

Pattern: check lock -> acquire -> execute -> release Reentrant calls return Error::Reentrancy

Mkalbani and others added 2 commits March 29, 2026 17:00
- Add DataKey::ReentrancyLock for lock state storage
- Add Error::Reentrancy = 30 for reentrant call detection
- Add acquire_lock/release_lock helper functions
- Guard lock_funds and complete_session against reentrancy

Pattern: check lock -> acquire -> execute -> release
Reentrant calls return Error::Reentrancy
@ahmadogo ahmadogo merged commit 24d60c4 into MentoNest:main Mar 29, 2026
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

2 participants