Skip to content
forked from d6o/echoNFTs

Decentralized application for minting and battling unique Echo NFTs on the Ethereum blockchain.

Notifications You must be signed in to change notification settings

WeeklySky/echoNFTs

 
 

Repository files navigation

Echo NFT Battle

Overview

Echo NFT Battle is a decentralized application (dApp) that allows users to mint unique Echo NFTs and battle them against each other on the Ethereum blockchain. Each Echo NFT has unique attributes, and users can engage in battles to determine the strongest Echo.

Features

  • Mint unique Echo NFTs with random attributes
  • Battle your Echo NFTs against others
  • View the winner of each battle

Prerequisites

Links

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4

Installation

  1. Clone the repository:
git clone https://github.com/d6o/echoNFTs.git
cd echoNFTs
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory and add your Infura project ID, private key, and Etherscan API key (if you want to validate the contract on it):
INFURA_PROJECT=your_infura_project_url
PRIVATE_KEY=your_private_key
ETHERSCAN_API_KEY=your_api_key

Compilation and Deployment

  1. Compile the smart contracts:
npx hardhat compile
  1. Deploy the smart contracts to the Sepolia test network:
npx hardhat run scripts/deploy.js --network sepolia
  1. Note the deployed contract address from the console output.

Extract ABI

  1. Run the provided script to extract the ABI:
./extract-abi.sh

Update Frontend

  1. Open static/index.html
  2. Replace the contract address.
  3. Replace the ABI using the one from abi/EchoNFT.json.

Running the Backend Server

  1. Start the Go server to serve the static files:
go run main.go

Using the dApp

  1. Open http://localhost:3000 in your browser with MetaMask installed.
  2. Connect your wallet.
  3. Mint a new Echo NFT by entering a name and clicking "Mint".
  4. Select your Echo NFT and click "Battle" to engage in a battle.
  5. View the winner's token ID.

Makefile Commands

To simplify the workflow, you can use the provided Makefile to manage the project. Here are the available commands:

  • Compile the smart contracts:
make compile
  • Deploy the smart contracts to Sepolia network:
make deploy
  • Extract the ABI:
make extract-abi
  • Start the Go server:
make start-server
  • Clean the project directory:
make clean
  • Display help:
make help

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Decentralized application for minting and battling unique Echo NFTs on the Ethereum blockchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 83.5%
  • Solidity 6.4%
  • Makefile 3.2%
  • JavaScript 2.7%
  • CSS 1.5%
  • Shell 1.4%
  • Go 1.3%