@@ -64,15 +64,15 @@ to receive their money - contracts cannot activate themselves.
64
64
/// The function auctionEnd has already been called.
65
65
error AuctionEndAlreadyCalled();
66
66
67
- /// Create a simple auction with `_biddingTime `
67
+ /// Create a simple auction with `biddingTime `
68
68
/// seconds bidding time on behalf of the
69
- /// beneficiary address `_beneficiary `.
69
+ /// beneficiary address `beneficiaryAddress `.
70
70
constructor(
71
- uint _biddingTime ,
72
- address payable _beneficiary
71
+ uint biddingTime ,
72
+ address payable beneficiaryAddress
73
73
) {
74
- beneficiary = _beneficiary ;
75
- auctionEndTime = block.timestamp + _biddingTime ;
74
+ beneficiary = beneficiaryAddress ;
75
+ auctionEndTime = block.timestamp + biddingTime ;
76
76
}
77
77
78
78
/// Bid on the auction with the value sent
@@ -232,26 +232,26 @@ invalid bids.
232
232
// functions. `onlyBefore` is applied to `bid` below:
233
233
// The new function body is the modifier's body where
234
234
// `_` is replaced by the old function body.
235
- modifier onlyBefore(uint _time ) {
236
- if (block.timestamp >= _time ) revert TooLate(_time );
235
+ modifier onlyBefore(uint time ) {
236
+ if (block.timestamp >= time ) revert TooLate(time );
237
237
_;
238
238
}
239
- modifier onlyAfter(uint _time ) {
240
- if (block.timestamp <= _time ) revert TooEarly(_time );
239
+ modifier onlyAfter(uint time ) {
240
+ if (block.timestamp <= time ) revert TooEarly(time );
241
241
_;
242
242
}
243
243
244
244
constructor(
245
- uint _biddingTime ,
246
- uint _revealTime ,
247
- address payable _beneficiary
245
+ uint biddingTime ,
246
+ uint revealTime ,
247
+ address payable beneficiaryAddress
248
248
) {
249
- beneficiary = _beneficiary ;
250
- biddingEnd = block.timestamp + _biddingTime ;
251
- revealEnd = biddingEnd + _revealTime ;
249
+ beneficiary = beneficiaryAddress ;
250
+ biddingEnd = block.timestamp + biddingTime ;
251
+ revealEnd = biddingEnd + revealTime ;
252
252
}
253
253
254
- /// Place a blinded bid with `_blindedBid ` =
254
+ /// Place a blinded bid with `blindedBid ` =
255
255
/// keccak256(abi.encodePacked(value, fake, secret)).
256
256
/// The sent ether is only refunded if the bid is correctly
257
257
/// revealed in the revealing phase. The bid is valid if the
@@ -260,13 +260,13 @@ invalid bids.
260
260
/// not the exact amount are ways to hide the real bid but
261
261
/// still make the required deposit. The same address can
262
262
/// place multiple bids.
263
- function bid(bytes32 _blindedBid )
263
+ function bid(bytes32 blindedBid )
264
264
external
265
265
payable
266
266
onlyBefore(biddingEnd)
267
267
{
268
268
bids[msg.sender].push(Bid({
269
- blindedBid: _blindedBid ,
269
+ blindedBid: blindedBid ,
270
270
deposit: msg.value
271
271
}));
272
272
}
@@ -275,24 +275,24 @@ invalid bids.
275
275
/// correctly blinded invalid bids and for all bids except for
276
276
/// the totally highest.
277
277
function reveal(
278
- uint[] calldata _values ,
279
- bool[] calldata _fake ,
280
- bytes32[] calldata _secret
278
+ uint[] calldata values ,
279
+ bool[] calldata fakes ,
280
+ bytes32[] calldata secrets
281
281
)
282
282
external
283
283
onlyAfter(biddingEnd)
284
284
onlyBefore(revealEnd)
285
285
{
286
286
uint length = bids[msg.sender].length;
287
- require(_values .length == length);
288
- require(_fake .length == length);
289
- require(_secret .length == length);
287
+ require(values .length == length);
288
+ require(fakes .length == length);
289
+ require(secrets .length == length);
290
290
291
291
uint refund;
292
292
for (uint i = 0; i < length; i++) {
293
293
Bid storage bidToCheck = bids[msg.sender][i];
294
294
(uint value, bool fake, bytes32 secret) =
295
- (_values [i], _fake [i], _secret [i]);
295
+ (values [i], fakes [i], secrets [i]);
296
296
if (bidToCheck.blindedBid != keccak256(abi.encodePacked(value, fake, secret))) {
297
297
// Bid was not actually revealed.
298
298
// Do not refund deposit.
0 commit comments