Use voting tokens to upvote Merchants and exchange them for rewards
- Consumer: Upvotes an order, gets rewards for submitted upvotes
- Merchant: Receives upvotes for an order, gets rewards for received upvotes
- Admin: Sets the smart contract variabes
- Consumer places an order and receives a unique upvote link
- Consumer submits upvotes for the merchant
- Merchant receives Rm BIST after Um upvotes
- Consumer receives Rc BIST after Uv upvotes
- Reward balance of contract needs to be monitored
- run
npm install
to install web3, openzeppelin and truffle libraries
In order to use the truffle-config.js file:
- create .infura file containing infura project ID for using Infura Web3 api
- create .secret file containing mnemonics for creating a specific token owner account
- create .etherscan file etherscan key
open a terminal window run ganache cli with custom config in this terminal window
./start-ganache.sh
run ganache cli open a terminal window Run test script:
truffle test ./test/BistrooToken.js
truffle test ./test/BistrooUpvote.js
Known issue with older Truffle version and Babel: npm install -g babel-runtime
npm run migrate-ganache
Deploy only the contract on Rinkeby:
npm run migrate-rinkeby-update
Deploy both contracts on Rinkeby:
npm run migrate-rinkeby