Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Updated votingDeadline variable to minExecutionDate #818

Merged
merged 2 commits into from
Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions solidity/dao-congress.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract Congress is owned, tokenRecipient {
address recipient;
uint amount;
string description;
uint votingDeadline;
uint minExecutionDate;
bool executed;
bool proposalPassed;
uint numberOfVotes;
Expand Down Expand Up @@ -182,7 +182,7 @@ contract Congress is owned, tokenRecipient {
p.amount = weiAmount;
p.description = jobDescription;
p.proposalHash = keccak256(beneficiary, weiAmount, transactionBytecode);
p.votingDeadline = now + debatingPeriodInMinutes * 1 minutes;
p.minExecutionDate = now + debatingPeriodInMinutes * 1 minutes;
p.executed = false;
p.proposalPassed = false;
p.numberOfVotes = 0;
Expand Down Expand Up @@ -253,8 +253,8 @@ contract Congress is owned, tokenRecipient {
onlyMembers public
returns (uint voteID)
{
Proposal storage p = proposals[proposalNumber]; // Get the proposal
require(!p.voted[msg.sender]); // If has already voted, cancel
Proposal storage p = proposals[proposalNumber]; // Get the proposal
require(!p.voted[msg.sender]); // If has already voted, cancel
p.voted[msg.sender] = true; // Set this voter as having voted
p.numberOfVotes++; // Increase the number of votes
if (supportsProposal) { // If they support the proposal
Expand All @@ -279,7 +279,7 @@ contract Congress is owned, tokenRecipient {
function executeProposal(uint proposalNumber, bytes transactionBytecode) public {
Proposal storage p = proposals[proposalNumber];

require(now > p.votingDeadline // If it is past the voting deadline
require(now > p.minExecutionDate // If it is past the voting deadline
&& !p.executed // and it has not already been executed
&& p.proposalHash == keccak256(p.recipient, p.amount, transactionBytecode) // and the supplied code matches the proposal
&& p.numberOfVotes >= minimumQuorum); // and a minimum quorum has been reached...
Expand Down