diff --git a/contracts/utils/ReentrancyGuard.sol b/contracts/utils/ReentrancyGuard.sol index c156fa1cc96..6771ed0b77a 100644 --- a/contracts/utils/ReentrancyGuard.sol +++ b/contracts/utils/ReentrancyGuard.sol @@ -20,6 +20,10 @@ import {StorageSlot} from "./StorageSlot.sol"; * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * + * NOTE: {ReentrancyGuard} and {ReentrancyGuardTransient} are not interoperable. Since + * each tracks reentrancy state independently, a `nonReentrant` function from one will not + * prevent reentrant calls to a `nonReentrant` function from the other. + * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. diff --git a/contracts/utils/ReentrancyGuardTransient.sol b/contracts/utils/ReentrancyGuardTransient.sol index 273a5dcd308..67e6604d578 100644 --- a/contracts/utils/ReentrancyGuardTransient.sol +++ b/contracts/utils/ReentrancyGuardTransient.sol @@ -10,6 +10,10 @@ import {TransientSlot} from "./TransientSlot.sol"; * * NOTE: This variant only works on networks where EIP-1153 is available. * + * NOTE: {ReentrancyGuardTransient} and {ReentrancyGuard} are not interoperable. Since + * each tracks reentrancy state independently, a `nonReentrant` function from one will not + * prevent reentrant calls to a `nonReentrant` function from the other. + * * _Available since v5.1._ * * @custom:stateless