Skip to content

Commit

Permalink
Added (up|down)votes counter
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored Jul 19, 2018
1 parent c8994fd commit 7789d21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/DAppStore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ contract DAppStore {
uint256 SNTBalance;
uint256 effectiveBalance;
uint256 prevMinted;

Vote[] votes;
uint256 up;
uint256 down;
}

Dapp[] public dapps;
Expand Down Expand Up @@ -110,6 +113,7 @@ contract DAppStore {

uint256 dappvotes = numVotesToMint(d, _amount);
mint(d, dappvotes, true);
d.up += dappvotes;

require(SNT.allowance(msg.sender, d.developer) >= _amount);
require(SNT.transferFrom(msg.sender, d.developer, _amount));
Expand All @@ -124,6 +128,7 @@ contract DAppStore {

uint dappvotes = numVotesToMint(d, _amount);
mint(d, dappvotes, false);
d.down += dappvotes;

require(SNT.allowance(msg.sender, d.developer) >= _amount);
require(SNT.transferFrom(msg.sender, d.developer, _amount));
Expand Down

0 comments on commit 7789d21

Please sign in to comment.