Closed
Description
A comment at function _nonReentrantBefore()
in ReentrancyGuardTransientUpgradeable
is misleading.
💻 Environment
ReentrancyGuardTransientUpgradeable.sol
Latest version of the code, also present in release-v5.2
📝 Details
The following comment is present in ReentrancyGuardTransientUpgradeable.sol#L47:
// On the first call to nonReentrant, _status will be NOT_ENTERED
As everyone knows, NOT_ENTERED
has the value of 1, see ReentrancyGuardUpgradeable.sol#L38:
uint256 private constant NOT_ENTERED = 1;
However in ReentrancyGuardTransientUpgradeable
the initial value will be 0 or false
.
Also _status
isn't present in the code.
Suggested solution
Consider changing the code to something like:
-// On the first call to nonReentrant, _status will be NOT_ENTERED
+// On the first call to nonReentrant, REENTRANCY_GUARD_STORAGE.asBoolean().tload() will be false
🔢 Code to reproduce bug
NA
Metadata
Assignees
Labels
No labels
Activity