Cashback is an e-commerce platform that allows users to purchase items for a payback in the form of HRC20. Each product will have a corresponding payback rate. After being reimbursed in HRC20 form, users can staking that amount of HRC20 to be able to Yield Farming to generate a corresponding ONE, after each day 2% of the HRC20 is converted to ONE. Users can withdraw the converted ONE at any time they want, however when withdrawing the HRC20 amount will be burned corresponding to the percentage of ONE withdrawn.
-
Users buy the product and get a 8.6% payback of the product value, which is created in the form of a Sun token. After each day, the amount of ONE newly created will be equal to 2% of the amount of Sun tokens the user is holding. This amount of One, users can withdraw to MathWallet at any time.
-
Users withdraw ONE interest generated from staking Sun. After ONE withdrawal, the amount of Sun tokens will be destroyed corresponding to the percentage of One withdrawn. Example: There are 20 ONE and 1000 Sun tokens, withdraw 10 ONE to the wallet, users will only have 500 Sun tokens. From there the interest per day will be calculated based on the remaining Sun tokens
- Aiming at the converting needs of buyers. We have integrated Chainlink blockchain technology to fetch the price of ONE and convert the price of the product from ONE to USD. This makes it easy for people to know how much the product is worth in USD.
- First,we are building a cross-chain protocol with cosmos - this product will be like a the bridge between Harmony and ETH - from which users can buy and sell products on the Cashback floor with existing tokens.
- Next we want to make Cashback a marketplace where people can sell their products at their own rates of return (the competition benefits the buyers). Successful transactions will be charged and this fee will be used to pay bonuses to those who are staking HRC20 cash back when buying items.
Cashback is built on 2 smart contracts, Market and Point. Market is used to coordinate activities on exchanges such as buying, selling, withdrawing money, ... Contract Point is a temporarily customized HRC20 contract that cannot be transferred between accounts, but will only play the role is staking and to calculate the amount of daily ONE that a user will be paid for by staking.
On the client side, we use vuejs to build, combined with harmony-sdk to help users interact with the application through MathWallet.Users buy and sell as well as keep HRC20 cash back through mathWallet
Users will have 2 main streams to interact with Cashback
- Buy item activity :
- Withdraw interest activity:
- Landing page:
- Market - Where you can choose product to buy:
- Select item:
- You must sign in before buying and sign transaction:
- Transaction successful:
- Show purchased products:
- Interest will be increased daily based on the amount of Sun coin you hold:
- You can withdraw the interest at any time but the sun coin will be burned:
- Load dependencies:
cd contract
yarn install
- Copy .env file:
//LOCAL
//Local uses account one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7 on Shard 0
LOCAL_PRIVATE_KEY='45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e'
LOCAL_MNEMONIC='urge clog right example dish drill card maximum mix bachelor section select'
LOCAL_0_URL='http://localhost:9500'
//TESTNET
//Account: one18t4yj4fuutj83uwqckkvxp9gfa0568uc48ggj7
TESTNET_PRIVATE_KEY='01F903CE0C960FF3A9E68E80FF5FFC344358D80CE1C221C3F9711AF07F83A3BD'
TESTNET_ADDRESS = 'one18t4yj4fuutj83uwqckkvxp9gfa0568uc48ggj7'
TESTNET_MNEMONIC='urge clog right example dish drill card maximum mix bachelor section select'
TESTNET_0_URL='https://api.s0.b.hmny.io'
TESTNET_1_URL='https://api.s1.b.hmny.io'
//MAINNET
//Please replace MAINNET_PRIVATE_KEY and MAINNET_MNEMONIC with your own!
//Account: one18t4yj4fuutj83uwqckkvxp9gfa0568uc48ggj7
MAINNET_PRIVATE_KEY='01F903CE0C960FF3A9E68E80FF5FFC344358D80CE1C221C3F9711AF07F83A3BD'
MAINNET_MNEMONIC='urge clog right example dish drill card maximum mix bachelor section select'
MAINNET_0_URL='https://api.s0.t.hmny.io'
GAS_LIMIT=3321900
GAS_PRICE=1000000000
- Deploy contract:
Note: Config in contract/scripts/* to deploy in TESTNET
- You must change network ChainID.HmyMainnet -> ChainID.HmyTestnet
- MAINNET_PRIVATE_KEY -> TESTNET_PRIVATE_KEY
- MAINNET_0_URL -> TESTNET_0_URL
yarn all
- Load dependencies:
cd client
yarn install
- Run
yarn serve