-
Notifications
You must be signed in to change notification settings - Fork 0
/
Auction.sol
38 lines (27 loc) · 899 Bytes
/
Auction.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pragma solidity >=0.4.22 <0.7.0;
contract Auction {
uint public reservePrice;
address payable seller;
address payable auctioneer = msg.sender;
address payable highestBidder;
uint public highestBid;
event LogPhaseTransition(string);
event LogAuctionStarting(uint, uint);
event LogHighestBid(address, uint, uint);
event LogUnsold();
event LogSold(address, uint);
event LogEscrowCreated(address);
bool debug;
modifier costs(uint cost) {
require(msg.value == cost); _;
}
modifier onlyDebugging() {
require(debug, "Function allowed only during debug"); _;
}
modifier notTheSeller() {
require(seller != msg.sender, "Seller cannot commit a bid"); _;
}
modifier notTheAuctioneer() {
require(auctioneer != msg.sender, "Auctioneer cannot commit a bid"); _;
}
}