version 1.1
Blockchain tips service is a simple example of how one can use ERC20 and DEX smart contracts in order to obtain a decentralized blockchain solution for tips payment and ledgering. This repository contains Flask-based backend and some frontend interfaces as well as original Solidity code for smart contracts.
The current version is designed for demonstration and should be run locally with Ganache blockchain.
The server implements a ERC20 token, DEX exchanger and a payment system, described in a picture:
The service allows to register a profile for some personal role (to receive tips). After the registration the person is provided with a personal page and unique QR code which leads to a tip-payment page. Profile contains some personal info (name, surname, blockchain address, photo) as well as account balances. Personal can sell their tokens to the DEX contract in order to get ethereum.
For a person who wants to pay tips the service provide an option to enter Blockchain address, or read QR code (currently not possible). After finding a profile page of a selected staff person, the payer is able to choose amount of ethers to be translated into tokens and payed.
From all the paid tokens, 1% is going to a special address (common
in TIPtoken.sol
) (e.g. restaurant wallet), this provides an opportunity for a company to benefit from our service integration.
- Python 3.6.2
- Flask and some extensions (see
requirements.txt
) - Web3.py
- Pony ORM
- Solidity
- Download or clone this template.
- Start Ganache node
- Connect to the blockchain using Remix IDE
- Deploy and setup smart-contracts
- Set
address private common = 0xA4c339CC8259a6B271c12799D5284235B4F33a73;
inTIPtoken.sol
to the restorant address to send there 1% of tips - Upload
TIPtoken.sol
- Deploy ERC20Tip contract
- Deploy DEX contract, stating the addres of ERC20Tip contract
- Transact some ethereum to the DEX contract
- Send all the tokens to the DEX contract
- Set
- [Optional] If you changed the contracts logics, put ABI from contract compilation to files
static/assets/abi.txt
for ERC20Tip contract andstatic/assets/abi_dex.txt
for DEX contract (file pathes could be changed in.env
) - Set your contract addresses in
.env
- Run
python3 -m blockchain-tips
from parent directory - Visit website via url provided by terminal
Skoltech "Intro to Blockchain" 2021 course team
- Yuriy Yanovich
- Yash Madhwal
Project team
- Valentin Samokhin
- Pavel Burnishev
- Georgiy Kozhevnikov