Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transient version of ReentrancyGuard #4988

Merged

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Apr 3, 2024

Fixes #4205
Fixes #4888
Replace #4955

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Copy link

changeset-bot bot commented Apr 3, 2024

🦋 Changeset detected

Latest commit: 0b73212

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

contracts/utils/ReentrancyGuard.sol Outdated Show resolved Hide resolved
contracts/utils/README.adoc Outdated Show resolved Hide resolved
@ernestognw ernestognw merged commit b6e0791 into OpenZeppelin:master Apr 4, 2024
18 checks passed
@Amxx Amxx deleted the feature/transient/reentrancyGuard branch April 5, 2024 13:00
@fuelfoundry
Copy link

Apologies if this has already been brought up elsewhere, but is anyone else getting:

Warning: Unreachable code.
--> @openzeppelin/contracts/utils/ReentrancyGuard.sol:58:9:
|
58 | _nonReentrantAfter();
| ^^^^^^^^^^^^^^^^^^^^

Weirdly I only started seeing this today, it's balking at the modifier; gotta be the IDE just trippin.

Respectfully,
-T

@Amxx
Copy link
Collaborator Author

Amxx commented May 2, 2024

@fuelfoundry there has been no change to the non-transient reentrancy guard in this PR.

Could you make a minimal reproductible example and open an issue ?

@fuelfoundry
Copy link

fuelfoundry commented May 2, 2024

Thank you for reaching out, turns out it's a non-issue. Upon review, it appears during a previous code reorganization I implemented a unnecessarily overly secure fallback function, more out of an abundance of caution, as shown below:

fallback() external payable nonReentrant { revert("tisk, tisk..."); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use transient storage in ReentrancyGuard ReentrancyGuard with transient opcodes TSTORE and TLOAD
3 participants