aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-21 00:06:45 +0800
committerGitHub <noreply@github.com>2017-10-21 00:06:45 +0800
commit4f30582db429e0135f9eecbb3ef57cf551d23b63 (patch)
tree1ef8cf4966a60d81a0fe6afd5436561d42201c93
parent90b0a6efb9ad07444be6e1de0394c8b1d0e70187 (diff)
parentd05b24162f8d88d15601af8f5b3fdb713f3755b4 (diff)
downloaddexon-solidity-4f30582db429e0135f9eecbb3ef57cf551d23b63.tar.gz
dexon-solidity-4f30582db429e0135f9eecbb3ef57cf551d23b63.tar.zst
dexon-solidity-4f30582db429e0135f9eecbb3ef57cf551d23b63.zip
Merge pull request #3053 from wjmelements/nit-examples
Replace biddingTime with auctionEnd in auction example
-rw-r--r--docs/solidity-by-example.rst12
1 files changed, 4 insertions, 8 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index 139c8a42..59ab7962 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -221,8 +221,7 @@ activate themselves.
// absolute unix timestamps (seconds since 1970-01-01)
// or time periods in seconds.
address public beneficiary;
- uint public auctionStart;
- uint public biddingTime;
+ uint public auctionEnd;
// Current state of the auction.
address public highestBidder;
@@ -251,8 +250,7 @@ activate themselves.
address _beneficiary
) {
beneficiary = _beneficiary;
- auctionStart = now;
- biddingTime = _biddingTime;
+ auctionEnd = now + _biddingTime;
}
/// Bid on the auction with the value sent
@@ -268,7 +266,7 @@ activate themselves.
// Revert the call if the bidding
// period is over.
- require(now <= (auctionStart + biddingTime));
+ require(now <= auctionEnd);
// If the bid is not higher, send the
// money back.
@@ -322,7 +320,7 @@ activate themselves.
// external contracts.
// 1. Conditions
- require(now >= (auctionStart + biddingTime)); // auction did not yet end
+ require(now >= auctionEnd); // auction did not yet end
require(!ended); // this function has already been called
// 2. Effects
@@ -382,7 +380,6 @@ high or low invalid bids.
}
address public beneficiary;
- uint public auctionStart;
uint public biddingEnd;
uint public revealEnd;
bool public ended;
@@ -410,7 +407,6 @@ high or low invalid bids.
address _beneficiary
) {
beneficiary = _beneficiary;
- auctionStart = now;
biddingEnd = now + _biddingTime;
revealEnd = biddingEnd + _revealTime;
}