Skip to content

Commit

Permalink
guard against reentrancy
Browse files Browse the repository at this point in the history
  • Loading branch information
michojekunle committed Sep 16, 2024
1 parent 313b5e4 commit 4ac7480
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/NFTGatedEventManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ pragma solidity ^0.8.17;

import {IERC721} from "./interfaces/IERC721.sol";
import {IERC165} from "./interfaces/IERC165.sol";
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';

contract NFTGatedEventManager {
contract NFTGatedEventManager is ReentrancyGuard {
struct Event {
string eventName; // Name of the event
uint256 eventDate; // Event date (timestamp)
Expand Down Expand Up @@ -86,7 +87,7 @@ contract NFTGatedEventManager {
}

// Register for an event: Verifies NFT ownership
function registerForEvent(uint256 _eventId) external {
function registerForEvent(uint256 _eventId) external nonReentrant {
Event storage currentEvent = events[_eventId];
require(currentEvent.isActive, "Event is not active.");
require(
Expand Down

0 comments on commit 4ac7480

Please sign in to comment.