Created
February 1, 2023 17:37
-
-
Save bartubozkurt/5176ad01dca2434d4b1146b1e2fcaf6d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
contract Guarded { | |
... | |
bool locked = false; | |
function withdraw() external { | |
require(!locked, "Reentrant call detected!"); | |
locked = true; | |
... | |
locked = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment