mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update documentation.
This commit is contained in:
@@ -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."
|
||||
);
|
||||
_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user