Update documentation.

This commit is contained in:
chriseth
2018-04-12 13:09:38 +02:00
parent aa715f8759
commit 344a388d44
8 changed files with 92 additions and 35 deletions
+16 -4
View File
@@ -147,7 +147,10 @@ restrictions highly readable.
// a certain address.
modifier onlyBy(address _account)
{
require(msg.sender == _account);
require(
msg.sender == _account,
"Sender not authorized."
);
// Do not forget the "_;"! It will
// be replaced by the actual function
// body when the modifier is used.
@@ -164,7 +167,10 @@ restrictions highly readable.
}
modifier onlyAfter(uint _time) {
require(now >= _time);
require(
now >= _time,
"Function called too early."
);
_;
}
@@ -186,7 +192,10 @@ restrictions highly readable.
// This was dangerous before Solidity version 0.4.0,
// where it was possible to skip the part after `_;`.
modifier costs(uint _amount) {
require(msg.value >= _amount);
require(
msg.value >= _amount,
"Not enough Ether provided."
);
_;
if (msg.value > _amount)
msg.sender.send(msg.value - _amount);
@@ -290,7 +299,10 @@ function finishes.
uint public creationTime = now;
modifier atStage(Stages _stage) {
require(stage == _stage);
require(
stage == _stage,
"Function cannot be called at this time."
);
_;
}