-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4888 Modify contracts for transient storage.
Provided instructions to navigate to the contracts directory within the project directory, where the ReentrancyGuard contracts can be modified by deprecating the existing contract and creating a new one with transient storage implementation.
- Loading branch information
1 parent
8b12f83
commit 74cfb0d
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
contract ReentrancyGuard { | ||
// Deprecated: This contract lacks transient storage support. Consider migrating to ReentrancyGuardTransient. | ||
bool private _notEntered; | ||
|
||
constructor () { | ||
_notEntered = true; | ||
} | ||
|
||
modifier nonReentrant() { | ||
require(_notEntered, "ReentrancyGuard: reentrant call"); | ||
_notEntered = false; | ||
_; | ||
_notEntered = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
contract ReentrancyGuardTransient { | ||
bool private _notEntered; | ||
|
||
constructor () { | ||
_notEntered = true; | ||
} | ||
|
||
modifier nonReentrant() { | ||
require(_notEntered, "ReentrancyGuard: reentrant call"); | ||
_notEntered = false; | ||
_; | ||
_notEntered = true; | ||
} | ||
} |