Created
January 27, 2023 16:28
-
-
Save zh/15fcb5e690d9a91382680c2a493e0945 to your computer and use it in GitHub Desktop.
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.7; | |
/** | |
* @title Guard Contract. | |
* @author Anthony (fps) https://github.com/0xfps. | |
*/ | |
abstract contract Guard { | |
bool locked; | |
modifier noReentrance { | |
require(!locked, "Locked"); | |
locked = true; | |
_; | |
locked = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment