Created
July 20, 2016 01:30
-
-
Save warner/c9b661b1e0263488630f9f53ba6eecf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /Users/warner/stuff/crypto/ethereum/dao.out 2016-07-19 18:18:44.000000000 -0700 | |
+++ /tmp/1.out 2016-07-19 18:27:56.000000000 -0700 | |
@@ -1,7 +1,4 @@ | |
/* | |
- | |
-- Bytecode Verification performed was compared on second iteration - | |
- | |
This file is part of the DAO. | |
The DAO is free software: you can redistribute it and/or modify | |
@@ -133,8 +130,6 @@ | |
return allowed[_owner][_spender]; | |
} | |
} | |
- | |
- | |
/* | |
This file is part of the DAO. | |
@@ -226,6 +221,8 @@ | |
* Token Creation parameters | |
*/ | |
+import "./Token.sol"; | |
+import "./ManagedAccount.sol"; | |
contract TokenCreationInterface { | |
@@ -365,6 +362,8 @@ | |
to automate organizational governance and decision-making. | |
*/ | |
+import "./TokenCreation.sol"; | |
+import "./ManagedAccount.sol"; | |
contract DAOInterface { | |
@@ -392,7 +391,7 @@ | |
// totalSupply / minQuorumDivisor | |
uint public minQuorumDivisor; | |
// The unix time of the last time quorum was reached on a proposal | |
- uint public lastTimeMinQuorumMet; | |
+ uint public lastTimeMinQuorumMet; | |
// Address of the curator | |
address public curator; | |
@@ -773,6 +772,10 @@ | |
if (msg.sender == address(this)) | |
throw; | |
+ // to prevent curator from halving quorum before first proposal | |
+ if (proposals.length == 1) // initial length is 1 (see constructor) | |
+ lastTimeMinQuorumMet = now; | |
+ | |
_proposalID = proposals.length++; | |
Proposal p = proposals[_proposalID]; | |
p.recipient = _recipient; | |
@@ -1038,6 +1041,9 @@ | |
uint reward = | |
(rewardToken[msg.sender] * DAOrewardAccount.accumulatedInput()) / | |
totalRewardToken - DAOpaidOut[msg.sender]; | |
+ | |
+ reward = DAOrewardAccount.balance < reward ? DAOrewardAccount.balance : reward; | |
+ | |
if(_toMembers) { | |
if (!DAOrewardAccount.payOut(dao.rewardAccount(), reward)) | |
throw; | |
@@ -1061,6 +1067,9 @@ | |
uint reward = | |
(balanceOf(_account) * rewardAccount.accumulatedInput()) / totalSupply - paidOut[_account]; | |
+ | |
+ reward = rewardAccount.balance < reward ? rewardAccount.balance : reward; | |
+ | |
if (!rewardAccount.payOut(_account, reward)) | |
throw; | |
paidOut[_account] += reward; | |
@@ -1173,10 +1182,13 @@ | |
function halveMinQuorum() returns (bool _success) { | |
- // this can only be called after `quorumHalvingPeriod` has passed or at anytime | |
- // by the curator with a delay of at least `minProposalDebatePeriod` between the calls | |
+ // this can only be called after `quorumHalvingPeriod` has passed or at anytime after | |
+ // fueling by the curator with a delay of at least `minProposalDebatePeriod` | |
+ // between the calls | |
if ((lastTimeMinQuorumMet < (now - quorumHalvingPeriod) || msg.sender == curator) | |
- && lastTimeMinQuorumMet < (now - minProposalDebatePeriod)) { | |
+ && lastTimeMinQuorumMet < (now - minProposalDebatePeriod) | |
+ && now >= closingTime | |
+ && proposals.length > 1) { | |
lastTimeMinQuorumMet = now; | |
minQuorumDivisor *= 2; | |
return true; | |
@@ -1233,4 +1245,4 @@ | |
msg.sender | |
); | |
} | |
-} | |
\ No newline at end of file | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment