add modifiers
This commit is contained in:
parent
2c85efd319
commit
dd0a9775f7
|
@ -33,4 +33,21 @@ contract ProposalAbstract is InstanceAbstract, Proposal, Controlled {
|
||||||
|
|
||||||
Vote public result;
|
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");
|
||||||
|
_;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue