- Description
- Goals
- Data Collection and Preparation
- Development and Technologies
- Instructions
- Video Demo
- Outcome And Summary
- Contributors
- References and Resources
In this project, we aim to create an NFT marketplace decentralized appliccation (dapp) for the auction of digital assets using smart contracts, solidity and streamlit.
In recent years, there has been an ever increasing interest in NFTs - As an example, one NFT which was just an image of a column written in New York Times sold for $560,000 in a matter of days. Observing such keen interest in the demand and sale of NFTs as well as the expanding market for digital assets, we felt it would be a great idea to launch our very own T-GRAM Auction Marketplace.
T-GRAM's goal is to support local and emerging artists and provide them a fast and efficient FinTech platform to register their work and sell them through an auction-based marketplace allowing them to connect with collectors all over the world through a decentralized network.
Our NFT auction marketplace provides:
- A platform that connects artists and collectors through blockchain technology with complete transparency. It holds asset/token/deed that is to be auctioned using ERC721 standards.
- Ability to place bids in auctions, over a decentralized network with following functions and features:
- ability to participate in an English auction whereby bid prices keep increasing over the duration of the auction.
- ability to monitor the auction process (start bid, bid price, highest bidder etc.)
- ability to view the frequency of each bidder
- safe and secure transfer of NFT ownership upon auction completion
- safe and secure transfer of funds upon auction completion
- refund of funds to bidders that did not get not lucky
- Use of Polygon Network provides the users with a method that is lower in cost and more efficient (faster) as compared to transacting directly over the Ethereum Network (Polygon is essentially a "scaling solution" that aims to address the inefficiences of transacting with the high demand ethereum network - it groups multiple transactions into a single block before comitting to the main ethereum network)
- Works with digital assests stored over an established and secure file storage system (IPFS - Pinata)
- T-GRAM does not charge any fees or retain any of the profits from the NFT sales hence providing a free of cost platform for the artists. As opposed to OpenSea, who charge a chunky one-time registration fee to list each NFT as well as recurring fees.
In order to test and demo our application we need to have an inventory of digital artwork. We created some custom ones using Photoshop. In order to generate the IPFS links for the custom artwork, we utilized Pinata.
Our NFT marketplace is build using the following technologies:
- Solidity (smart contracts)
- Remix IDE
- Streamlit (frontend)
- MetaMask (wallet)
- Decentralized Blockchain Network (Polygon TestNet/Ganache)
- Xbox GameBar/Quicktime Player (Demo Video)
- ChainLink (new technology/library - not covered in class)
- Pinata
- Photoshop
- Python
- os
- json
- requests
- eth_account
- eth_typing
- web3
- pathlib
- dotenv
- streamlit
- dataclasses
- typing
- chainlink (AggregatorV3Interface)
- openzeppelin (ERC721, ERC721URIStorage, Ownable, Counters)
Download the following files to help you get started:
- Open MetaMask and select
Settings
- Select
Networks
- Select
Add Network
- Enter Network Name
Matic-Mumbai
- Enter New RPC URL
https://rpc-mumbai.maticvigil.com/
- Enter Chain ID
80001
- Enter Currency Symbol
MATIC
- Enter Block Explorer URL
https://mumbai.polygonscan.com/
- Add MATIC to accounts via https://faucet.polygon.technology/
- Option 1 - Polygon Mumbai Test - Intended Project Blockchain - Create account with https://rpc.maticvigil.com/ and create dapp RPC link for Mumbai Testnet.
- Option 2 - Ganache - Backup Project Blockchain - Simply copy RPC Server from Ganache UI.
- Load
PINATA_API_KEY
andPINATA_SECRET_API_KEY
to .env file for IPFS Hashing and Storage - Load
WEB3_PROVIDER_URI
with RPC Server address. - Load
SMART_CONTRACT_ADDRESS
according to streamlit dapp. NFTRegistry dapp requires theNFTRegistry.sol
contract address when deployed from Remix. Auction dapp requiresauction.sol
contract address when deployed from Remix. - Load wallet's
MNEMONIC
seed phrase.
To run the application, clone the code from this GitHub repository.
-
Compile the
auction.sol
to ensure it compiles without any errors. -
Compile the
AuctionRegistry.sol
to ensure it is compiled successfully. -
Prior to deployment, ensure your MetaMask/wallet is connected and the corresponding item (Injected Web3 for Remix IDE) is selected.
-
Deploy the
auction.sol
and check the deployed contracts to ensure it is there. Copy the address as it would be required for the next step. -
Add the
auction.sol
contract address to the Deploy the AuctionRegistry.sol and proceed to deploy the AuctionRegistry.sol -
In
AuctionRegistry.sol
deployed contract, use the address of the Auction contract in the SetApprovalForAll input field and a value of true to ensure the NFT that will be registered can participate in the Auction. -
In
AuctionRegistry.sol
deployed contract, use the registerNFT fields to provide an address ownner and key NFT details and register it for the Auction. -
To proceed with the auction process on the registered NFT, please follow the steps demonstrated in the Auction Demo (see Videos Demos section).
- Copy deployed
AuctionRegistry.sol
contract address to SMART_CONTRACT_ADDRESS key in .env file in location of AuctionRegistry dapp. Do the same forauction.sol
, but in separate .env file in location of Auction dapp. Locations for each captured in below steps - Open command line interface terminal
- For NFTRegistry dapp, navigate to location Project-3/Final/Streamlit_for_registry, then input command
streamlit run app.py
- For Auction dapp, navigate to location Project-3/Final/Streamlit_for_registry, then input command
streamlit run app.py
Though we aimed to achieve a minimum viable product (MVP) within 2 weeks, we were not fully successful in working out every bug we have encountered. Below is a list of known bugs in the current version of T-GRAM's NFT Auction House and some areas to consider for optimizations:
- Polygon (MATIC) Mumbai Testnet - In Remix, there are no issues deploying to Polygon's Mumbai testnet. However, when running dapp via streamlit, we are unable to successfully load address accounts. Thus, more time would be needed to resolve the dapps operability with Polygon. In order to circumvent the issue with the project as is, loading Ethereum's Ganache testnet is a sufficient solution. Please note, obtaining a MATIC/USD price feed via the
getLatestPrice
call function is only possible when connected to Polygon's Mumbai testnet. Otherwise, this function is not operable when connected to Ganache. - Interoperability of streamlit dapps - The current state of the project has 2 separate dapps. One for registering NFTs only possible via the auction owner and then another one to place bids on NFTs that are registered. However, A programmatic mechanism has 7FB9 not been sufficiently worked out to connect operability of boths dapps seamlessly. Alternatively, considerations may be made to consolidate the dapps into a single frontend platform.
- Smart Contract Bug -
End
Function inauction.sol
contract does not execute when the auction time has run out and thus leaving the auction open without a means to complete the transfer of NFT ownership and the withdrawal of bid funds to their respective accounts. - Streamlit Bugs -
Bid
function does not execute correctly forapp3.py
, i.e. our auction dapp.End
function bug still applies.
Project Team
NFT Sales
NFT Sale Volumes
Gas-Free NFT IPFS
OpenSea Fees
dAPP Auction
What is Polygon?
NFT Auction
NFT Marketplace
NFT Marketplace
ChainLink Price Feed
OpenZeppelin Contracts Wizard
OpenZeppelin ERC721 Docs
Copyright © 2022# Project-3