From f9b0f3b94d182a4f38d0d3d61146bf9aab170ebb Mon Sep 17 00:00:00 2001 From: George Spasov Date: Wed, 3 Jul 2019 13:09:57 +0300 Subject: [PATCH] Discover updated to the working version --- contracts/Discover.sol | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contracts/Discover.sol b/contracts/Discover.sol index 63080c2..36acbfa 100644 --- a/contracts/Discover.sol +++ b/contracts/Discover.sol @@ -21,9 +21,6 @@ contract Discover is ApproveAndCallFallBack, BancorFormula { // The max amount of tokens it is possible to stake, as a percentage of the total in circulation uint public max; - // Need to multiply by 10^18 because tokens on Ethereum... - uint public maxCheck; - // Decimal precision for this contract uint public decimals; @@ -60,7 +57,7 @@ contract Discover is ApproveAndCallFallBack, BancorFormula { ceiling = 292; // See here for more: https://observablehq.com/@andytudhope/dapp-store-snt-curation-mechanism - decimals = 1000000; // 4 decimal points for %, 2 because we only use 1/100th of total in existence + decimals = 1000000; // 4 decimal points for %, 2 because we only use 1/100th of total in circulation max = total.mul(ceiling).div(decimals); @@ -227,7 +224,7 @@ contract Discover is ApproveAndCallFallBack, BancorFormula { */ function upvoteEffect(bytes32 _id, uint _amount) external view returns(uint effect) { Data memory d = _getDAppById(_id); - require(d.balance.add(_amount) <= maxCheck, "You cannot upvote by this much, try with a lower amount"); + require(d.balance.add(_amount) <= safeMax, "You cannot upvote by this much, try with a lower amount"); // Special case - no downvotes yet cast if (d.votesCast == 0) {