This Decentralized Application is an exchange where users can deposit their customer rewards points earned through purchases with specific brands (mock ERC20 Rewards Tokens for Delta, Starbucks, Nike, and BestBuy have been created for the development of this application), and receive our DAPP Loyalty Exchange Token (LET) in exchange. Users can then burn their LET token in order to withdraw any of the brand rewards tokens contained in the DAPP wallet.
Using Python 3.7 Using Solidity 0.5.0 and 0.8.0
- streamlit - For web interface
- Ganache - To Host Local Test Network Blockchain
- MetaMask - For Ethereum Wallets
- Remix IDE - For Smart Contract Interface and Development
- Open Zeppelin ERC20
- Open Zeppelin ERC20 Detailed
- Open Zeppelin IERC20
- Open Zeppelin Address
- Open Zeppelin SafeERC20 - A new one for us!
To run the Loyalty Points Token Exchange application you must first have the following dependencies installed and set up:
pip install streamlit-
- Please follow Github instructions, dependent on for your own machine and preferences)
-
- Follow the link to set up an account, then download the appropriate browser extension
Clone the repository to your local machine:
git clone <paste link here>In order to use the smart contract part of this application:
- Begin a Quickstart session in Ganache
- Add your local Ganache Network to your MetaMask account on your MetaMask Browser Extension
- Import your Ganache wallets into MetaMask
- Compile and deploy all of the brand tokens, specifying a total supply. The entire supply will be sent to the wallet address being used when the contract is deployed
- Compile and deploy the LoyaltyExchange.sol file, entering the contract address for the four brand tokens (Best Buy, Delta, Starbucks, and Nike)
- In order to deposit one of the brand tokens:
- You must be using a wallet that contains the brand tokens
- First you must use the approve function on the brand token contract, enter the Loyalty Exchange contract address and specify how many brand tokens you would like to send to the LoyaltyExchange contract
- Additionally you may need to use the increase allowance function on the brand token contract, enter the LoyaltyExchange contract address and specify how many brand tokens you would like to send to the LoyaltyExchange contract
- Next use the deposit function on the LoyaltyExchange contract (there is one for each brand token so be sure to use the appropriate function), specify how many tokens to deposit and click transact
- After depositing brand tokens, the same amount of Loyalty Exchange Tokens will be minted and sent to your wallet. You are free to send them to whoever you would like or burn them to withdraw a different brand token
- In order to withdraw a brand token
- You must have at least as many Loyalty Exchange Tokens as the amount of brand tokens you would like to withdraw
- The Loyalty Exchange contract balance for the specific brand token must have at least as many tokens as you would like to withdraw
- You can then specify the amount to withdraw using the correct withdraw function and click transact
- The selected amount of brand tokens will be sent to your address
- The selected amount of Loyalty Exchange Tokens will be burnt
Streamlit Part of the Application:
- When a customer makes a purchase at one of the (mock) affiliated corporations (Best Buy, Nike, Starbucks, and Delta). They record the transaction in the streamlit site using the Exchange_app.py. They are then rewarded with the respective reward points as tokens. Their wallet then stores the balance of all these tokens. Or they can exchange those tokens into our Loyalty Exchange tokens to be stored in the exchangeable and central token. From the site, their balances are stored and can be referenced.
- Yuvraj Kabra
- Rebekah Lin
- Jeremy Griffith
- Cole Frederick
- Josh Thompkins
We have no affiliation with the brands named in this project, tokens have been created solely to be used within this project for educational purposes only.
Everyone is free to view and work with this project, you may not alter text unless given explicit permission.


