add modifiers

This commit is contained in:
Ricardo Guilherme Schmidt 2019-03-23 06:16:41 -03:00
parent 2c85efd319
commit dd0a9775f7
No known key found for this signature in database
GPG Key ID: BFB3F5C8ED618A94
1 changed files with 17 additions and 0 deletions

View File

@ -33,4 +33,21 @@ contract ProposalAbstract is InstanceAbstract, Proposal, Controlled {
Vote public result;
modifier votingPeriod {
require(block.number >= blockStart, "Voting not started");
require(block.number <= voteBlockEnd, "Voting ended");
_;
}
modifier tabulationPeriod {
require(block.number > voteBlockEnd, "Voting not ended");
require(result == Vote.Null, "Tabulation ended");
_;
}
modifier tabulationFinished {
require(lastTabulationBlock != 0, "Tabulation not started");
require(lastTabulationBlock + tabulationBlockDelay < block.number, "Tabulation not ended");
_;
}
}