hackquest logo

Scavenger Hunt NFT

Create a scavenger hunt game with NFT rewards for participants. Write this smart contract in Solidity, no imports and constructors, with no input fields.

描述

# 🕵️‍♂️ Scavenger Hunt NFT Game 🎭

## 📌 Overview

Scavenger Hunt NFT is a blockchain-based game where participants can claim NFTs as rewards for solving challenges.

This contract is simple, gas-efficient, and deployed on Edu Chain.

## 🚀 Features

Decentralized NFT Claiming – Players can claim an NFT if they haven't already.

Fair & Transparent – The smart contract ensures each user can claim only once.

Minimal Gas Fees – Designed for efficiency without unnecessary storage costs.

## 📍 Smart Contract Address

Deployed on Edu Chain:

0xE6959a4531145d52B04d40cf7B621768cDF024D3

## 🔧 How It Works

1. Any user can call the claimNFT() function.

2. The contract checks if they have already claimed an NFT.

3. If not, their claim is registered, and the counter increments.

## 📜 Smart Contract (Simplified Version)

```solidity

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract ScavengerHuntNFT {

address public owner;

uint256 public nextTokenId;

mapping(address => bool) public hasClaimed;

function claimNFT() public {

require(!hasClaimed[msg.sender], "You have already claimed an NFT!");

hasClaimed[msg.sender] = true;

nextTokenId++;

}

}

本次黑客松进展

60

技术栈

Solidity

融资状态

0

更多项目