Try to save DAI 9.90 every week for one year. Earn more interest by inviting friends. If you drop out in the middle you lose your interest and it is distributed to everyone who make it to the end.
The game makes saving viral.
-
Each friend you refer gives you 10% of their interest
-
Each friend of a friend gives you 1% of their interest
-
Any deposited DAI is converted to interest earning aDAI on Aave Protocol
-
All interested is hold by the viral bank smart contract
-
Interested is distributed to the players who make it at the end of the game
-
You get extra interest bonus for friend referrals who you brought to the game
-
Any players who drop out in the middle of game lose their interest and it is distributed to the players who make it to the end
You need to have a referral from somebody to get in the game on the first round.
User needs to do the following to start the game
-
Have 9.90 DAI balance in their wallet
-
Have referring player address
-
approve()
theViralBank
contract forDAI
token transfers -
Do a transaction to
startGame()
One week is one round.
Every week the user has to
-
Have 9.90 DAI in their wallet
-
Do a transaction to
buyInToRound()
-
getGameState()
tells you what is the current state of the game -
getPlayerState(address)
tells if an address is playing, dropped out or successfully finished the game -
getTotalAccuredInterest()
tells the total DAI prize pot at the moment
There is vDAI
faux ERC-20 token.
-
Add
ViralBank
address as a token in your wallet -
Token balance shows your accrued interest balance
Install Truffle.
npm install -g truffle
Install Ganache for having a local dev Ethereum network.
npm install -g ganache ganache-cli
Compile contracts
truffle compile
This will pull Solidity compiled 0.5 from DockerHub and compile the smart contracts using Dockerized compiler.
Start dev env in one terminal
truffle develop
Then install and start the React app.
cd app
npm start
First setup .env file:
KOVAN_MNEMONIC="xxx yyy"
KOVAN_PROVIDER_URL=https://kovan.infura.io/v3/your_key
MAINNET_MNEMONIC="xxx yyy"
MAINNET_PROVIDER_URL=https://mainnet.infura.io/v3/your_key
MAINNET_GAS_PRICE=3000000000
# you can get this from etherscan website
ETHERSCAN_API_KEY=your_key
To deploy and verify the code
$ npx truffle --network kovan exec scripts/deploy.js
Using network 'kovan'.
network: kovan
ViralBank.new: started
ViralBank.new: done, gas used 0x2713e2, gas price 20 Gwei
bank address 0x9Eb6a33451643A564049f6D65b077E3308717b54
$ npx truffle run --network kovan etherscan ViralBank@0x9Eb6a33451643A564049f6D65b077E3308717b54
Verifying ViralBank@0x9Eb6a33451643A564049f6D65b077E3308717b54
Pass - Verified: https://kovan.etherscan.io/address/0x9Eb6a33451643A564049f6D65b077E3308717b54#contracts
Successfully verified 1 contract(s).
master $ npx truffle --network kovan exec scripts/mint-tokens.js
Using network 'kovan'.
network: kovan
token.mint 100: started
token.mint 100: done, gas used 50436, gas price 20 Gwei
Kovan
- DAI: https://kovan.etherscan.io/address/0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD
- aDAI: https://kovan.etherscan.io/address/0x58AD4cB396411B691A9AAb6F74545b2C5217FE6a
- ViralBank: https://kovan.etherscan.io/address/0x9Eb6a33451643A564049f6D65b077E3308717b54#code
- Patient 0: 0xd66E40b0c30595bEc72153B502aC1E0c4785991B