Add ReentrancyGuard status getter (#3714)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
zhiqiangxu
2022-10-17 20:43:45 +08:00
committed by GitHub
parent c463b8a67e
commit eb03304b70
4 changed files with 28 additions and 0 deletions

View File

@ -66,4 +66,12 @@ abstract contract ReentrancyGuard {
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}