TransientReentrancyGuard
Authors: Axicon Labs Limited, Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/TransientReentrancyGuard.sol), Modified from Soledge (https://github.com/Vectorized/soledge/blob/main/src/utils/ReentrancyGuard.sol)
Gas optimized reentrancy protection for smart contracts. Leverages Cancun transient storage.
State Variablesβ
REENTRANCY_GUARD_SLOTβ
uint256 private constant REENTRANCY_GUARD_SLOT = 0x8053dfe21e206073e7d912b6bcd2323894159cfd58d0a607082c42be308afb86
Functionsβ
nonReentrantβ
modifier nonReentrant() virtual;
ensureNonReentrantViewβ
Guards view functions against read-only reentrancy.
If the reentrancy lock is currently active (meaning we are inside a state-changing function), this modifier will revert. This ensures external callers cannot read inconsistent state.
modifier ensureNonReentrantView() virtual;
_ensureNonReentrantViewβ
function _ensureNonReentrantView() internal view;
_nonReentrantSetβ
function _nonReentrantSet() internal;
_nonReentrantResetβ
function _nonReentrantReset() internal;
reentrancyGuardEnteredβ
function reentrancyGuardEntered() public view returns (bool entered);