givecup-algorand / dynamic-nfts

A Dynamic NFT implementation built on top of Algorand.

Home Page:https://givecup.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamic-nfts

πŸ“œ About

This smart contract is designed to enhance the NFT experience on the Algorand blockchain by enabling dynamic interactions between NFTs.

It allows users to personalize and upgrade their digital assets through a unique integration of Accessories and Cup NFTs, utilizing Algorand Standard Assets (ASAs) for these interactions.

Additionally, it introduces a unique feature involving Case NFTs, which users can "open" to receive Cup NFTs based on rarity.

πŸ”— Key Features

  1. Accessory Integration: Users can send an Accessory NFT from their collection to the smart contract, which will then attach this accessory to their main Cup NFT.

  2. Dynamic NFT Creation: Upon integrating an accessory, the user receives a new, upgraded Cup NFT, representing the enhanced version of their original NFT.

  3. Case NFTs: Special Case NFTs can be opened by sending them to the smart contract. Based on the rarity of the Case, users will receive a Cup NFT with characteristics influenced by the Case's rarity.

πŸ”§ Implementation Details

  • Using ASAs: The contract utilizes Algorand Standard Assets to manage the properties and transferability of both the Cup and Accessory NFTs, ensuring secure and efficient transactions.
  • Dynamic Asset Creation: The contract dynamically generates new NFTs with updated attributes when Accessories are added or Cases are opened, showcasing the flexibility of ASAs in creating and managing NFTs.

πŸ— Setup

Initial setup

  1. Clone this repository locally
  2. Install pre-requisites:
    • Make sure to have Docker installed and running on your machine.
    • Install AlgoKit - Link: The minimum required version is 1.1. Ensure you can execute algokit --version and get 1.1 or later.
    • Bootstrap your local environment; run algokit bootstrap all within this folder, which will:
      • Install Poetry - Link: The minimum required version is 1.2. Ensure you can execute poetry -V and get 1.2+
      • Run poetry install in the root directory, which will set up a .venv folder with a Python virtual environment and also install all Python dependencies
      • Copy .env.template to .env
    • Run algokit localnet start to start a local Algorand network in Docker. If you are using VS Code launch configurations provided by the template, this will be done automatically for you.
  3. Open the project and start debugging / developing via:
    • VS Code
      1. Open the repository root in VS Code
      2. Install recommended extensions
      3. Hit F5 (or whatever you have debug mapped to) and it should start running with breakpoint debugging.

        Note If using Windows: Before running for the first time you will need to select the Python Interpreter.

        1. Open the command palette (Ctrl/Cmd + Shift + P)
        2. Search for Python: Select Interpreter
        3. Select ./.venv/Scripts/python.exe
    • JetBrains IDEs (please note, this setup is primarily optimized for PyCharm Community Edition)
      1. Open the repository root in the IDE
      2. It should automatically detect it's a Poetry project and set up a Python interpreter and virtual environment.
      3. Hit Shift+F10|Ctrl+R (or whatever you have debug mapped to) and it should start running with breakpoint debugging. Please note, JetBrains IDEs on Windows have a known bug that in some cases may prevent executing shell scripts as pre-launch tasks, for workarounds refer to JetBrains forums.
    • Other
      1. Open the repository root in your text editor of choice
      2. In a terminal run poetry shell
      3. Run python -m smart_contracts through your debugger of choice

Subsequently

  1. If you update to the latest source code and there are new dependencies you will need to run algokit bootstrap all again
  2. Follow step 3 above

For guidance on smart_contracts folder and adding new contracts to the project please see README on the respective folder.

πŸ›  Tools

This project makes use of Python to build Algorand smart contracts. The following tools are in use:

  • Algorand - Layer 1 Blockchain; Developer portal, Why Algorand?
  • AlgoKit - One-stop shop tool for developers building on the Algorand network; docs, intro tutorial
  • Beaker - Smart contract development framework for PyTeal; docs, examples
  • PyTEAL - Python language binding for Algorand smart contracts; docs
  • AlgoKit Utils - A set of core Algorand utilities that make it easier to build solutions on Algorand.
  • Poetry: Python packaging and dependency management.- Black: A Python code formatter.
  • pytest: Automated testing.
  • pip-audit: Tool for scanning Python environments for packages with known vulnerabilities. It has also been configured to have a productive dev experience out of the box in VS Code, see the .vscode folder.

About

A Dynamic NFT implementation built on top of Algorand.

https://givecup.io


Languages

Language:Python 93.8%Language:Jinja 6.2%