Skip to content

Instantly share code, notes, and snippets.

@zh
Created January 27, 2023 16:28
Show Gist options
  • 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