Referral rewards for Bistroo consumers referring new consumers or merchants (referrals). We have visualised the process in the schematic and applications design below.
- Referrer: Consumer who refers a referral to activate a Bistroo account
- Referral: A potential new consumer or merchant
- The referrer gets and shares a referrer link with a referral
- The referral clicks on the link and registers the reference by signing a message
- The referral activates the reward by performing a required activity:
- A referral consumer registers and pays for an order
- A referral merchant activates a store
- The referrer receives a referrer reward
- 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/BistrooReward.js
Known issue with older Truffle version and Babel: npm install -g babel-runtime
npm run migrate-ganache
Deploy only the escrow contract on Rinkeby:
npm run migrate-rinkeby-update
Deploy both contracts on Rinkeby:
npm run migrate-rinkeby