Skip to content

opt(reentrancy-guard): using transient storage to optimize reentrancy guard#15

Open
SocksNFlops wants to merge 1 commit intoz0r0z:mainfrom
SocksNFlops:main
Open

opt(reentrancy-guard): using transient storage to optimize reentrancy guard#15
SocksNFlops wants to merge 1 commit intoz0r0z:mainfrom
SocksNFlops:main

Conversation

@SocksNFlops
Copy link

@SocksNFlops SocksNFlops commented Mar 25, 2025

Changes:

  • Reimplemented ReentrancyGuard.sol to leverage transient storage
  • Open to feedback & suggestions to improve PR

Tests:

  • Outperforms everywhere except slightly in the allow-reentrancy test.
Before After
[PASS] testGuardValueReset() (gas: 36965) [PASS] testGuardValueReset() (gas: 32474)
[PASS] testProtectedFunctionPreventsReentrancy() (gas: 36096) [PASS] testProtectedFunctionPreventsReentrancy() (gas: 31268)
[PASS] testUnprotectedFunctionAllowsReentrancy() (gas: 32284) [PASS] testUnprotectedFunctionAllowsReentrancy() (gas: 32325)

Reviewers:

@z0r0z

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.

1 participant