This project repository represents a pay-to-earn promotion where a gas station owner can offer their customers rewards through gasoline purchases. Rewards can be accumulated, exchanged for unique NFT art ("Oil stains”), or donated to a non-profit of their choice. The NFT’s are kept in the IPFS network - Infura. The administrator manages the promotion and the customer decides how to use their rewards.
- Technologies and tools
- App flows
- Project structure
- Installation
- Demonstration of functionality
- Troubleshooting
- Contributors
- License
This project leverages the following tools, API and libraries:
-
Solidity ^0.6.6 - programming language for implementing smart contracts.
-
Remix IDE - Remix IDE allows developing, deploying and administering smart contracts for Ethereum like blockchains.
-
Ganache - a personal Ethereum blockchain.
-
Metamask - is a software cryptocurrency wallet.
-
Infura - IPFS Api - an IPFS network.
-
Streamlit - is an open-source app framework for Machine Learning and Data Science teams.
-
Web3.py - is a Python library for interacting with Ethereum.
-
OpenZepplelin - ERC721 - set of interfaces, contracts, and utilities are all related to the ERC721 Non-Fungible Token Standard.
OpenZeppelin libraries:
ERC721 token:
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.0.0/contracts/token/ERC721/ERC721.sol"
Simple:
Detailed:
contracts/GasPromo.sol - smart contract
contracts/compiled/compiled.json - ABI
Pictures - different pictures
infura.py - Infura API IPFS
random_pic.py - script for generating pictures
app.py - the main application that connects all the components together
SAMPLE.env - file contains description of important variables
LICENSE - MIT license
run.sh - bash script for running app
-
Download and install Metamask crypto wallet.
-
Download and install Ganache.
-
Configure the Ganache network in the Metamask.
Network name: Ganache RPC: http://127.0.0.1:7545 Chain ID: 1337 Currency symbol: ETH
-
Import any account to the Metamask from the Ganache.
-
Copy smart contract (
contracts/GasPromo.sol
) to the Remix IDE. -
Compile (
compiler 0.6.12
), selectInjected Web3
as an environment and deploy the smart contract (confirm with the Metamask) to the Ganache network.
-
Fill out the
SAMPLE.env
:-
provide
Infura
secret keys (you need to be registered herehttps://infura.io
); -
provide address of the deployed smart contract.
INFURA_PROJECT_ID=<your infura project id> INFURA_PROJECT_SECRET=<your infura project secret key> WEB3_PROVIDER_URI=http://127.0.0.1:7545 SMART_CONTRACT_ADDRESS=<deployed smart contract>
-
-
Install Streamlit
pip install streamlit
. -
Install
pip install randimage
-
Run
./run.sh
AttributeError: module ‘click’ has no attribute ‘get_os_args’
Please install:
pip install -U click==8
Glupak Vladislav Linkedin
Magdalena Švimberská Linkedin
Thomas Brierton Linkedin
Siddharth Venkumahanti Linkedin