Giter Site home page Giter Site logo

foundry-nft-f23's Introduction

MoodNft Contract

The MoodNft contract is an Ethereum smart contract that allows users to mint NFTs (Non-Fungible Tokens) representing their mood. Each NFT can be in either a "happy" or "sad" state, and the state can be flipped by the owner of the NFT. The contract is built using the ERC721 standard for NFTs and extends the Ownable contract from OpenZeppelin.

Overview

The MoodNft contract allows users to create and own NFTs that reflect their mood. Each NFT has a mood state, which can be either "happy" or "sad." The mood of an NFT can be flipped by its owner. The contract also provides metadata for each NFT, including an SVG image representing the NFT's mood.

Getting Started

To deploy and interact with the MoodNft contract, you need:

An Ethereum development environment (e.g., Hardhat, Truffle, or Remix). The required dependencies: ERC721 from OpenZeppelin and Base64 utility from OpenZeppelin. Functionality Minting NFTs Users can mint new NFTs using the mintNft function. Each minted NFT starts with a mood state of "happy." The minting process also increments the token counter.

Flipping Mood

NFT owners can change the mood of their NFTs using the flipMood function. If the NFT is in the "happy" state, flipping it changes the mood to "sad," and vice versa. Only the owner of an NFT can change its mood.

Token Metadata

Each NFT's metadata is accessible using the tokenURI function. The metadata includes a JSON object containing the NFT's name, description, moodiness attribute, and an SVG image URI representing the mood.

Usage

Deploy the MoodNft contract to the Ethereum network. Call the mintNft function to mint new NFTs, which will be owned by the caller. Call the flipMood function to change the mood state of an owned NFT. Retrieve NFT metadata using the tokenURI function.

License

This contract is licensed under the MIT License. See LICENSE for more information.

Note: This project is for educational and informational purposes. Always review and test the code before using it in a production environment.

foundry-nft-f23's People

Contributors

sharonphiliplima avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.