A smart contract coupled with a printer
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project is composed of a smart contract and a script. The smart contract is deployed on the blockchain, it handle teh NFTs and the blockchain part of the printer. The script is able to listen to the blockchain and send a request to print the photo from Creativehub.
- The users can buy an NFT with multiple tokens
- The users can claim a free print of the photo buy burning the NFT
- The users can mint a certificate for the printed photo
To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- foundry https://book.getfoundry.sh/getting-started/installation
- Creativehub
- Get a free API Key at https://creativehub.io
- Upload your photo to Creativehub
- Set the photo as a product
- Get the product ID buy using the API
-
Get a free API Key for the rpc node at https://alchemy.com
-
Clone the repo
git clone https://github.com/ereynier/NFT-PhotoPrint.git
-
Go to the frontend folder
cd frontend
-
Install NPM packages
npm install
-
Enter the local variables in
.env.local
file based on.env.local.example
-
Go to the backend folder
cd backend
-
Install NPM packages
npm install
-
Enter the local variables in
.env
file based on.env.example
-
Go in blockchain folder
cd blockchain
-
Install NPM packages
npm install
-
Enter the local variables in
.env
file based on.env.example
-
Deploy the smart contract (you can use
ARGS=(--network mumbai)
orARGS=(--network polygon)
to deploy on the public blockchains instead of the local blockchain)make deploy
-
Copy the contract address in the differents
.env
files -
(optional) You can find the command to get the json file to verify the contract on polygonscan in
contract-verify.txt
-
start the backend
cd scripts && node index.js
-
start the frontend
cd frontend && npm next dev
-
Go to http://localhost:3000 (or the port displayed in the terminal)
You can find a detailed arcticle about the smart contract on medium
You can use the testnet website at https://nft-prints.ereynier.me
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Estéban Reynier - @EstebanReynier - esteban@ereynier.com
Project Link: https://github.com/ereynier/NFT-PhotoPrint