Skip to content

Instantly share code, notes, and snippets.

@zh
Created January 27, 2023 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zh/15fcb5e690d9a91382680c2a493e0945 to your computer and use it in GitHub Desktop.
Save zh/15fcb5e690d9a91382680c2a493e0945 to your computer and use it in GitHub Desktop.
// 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