Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (highestBidder != 0) {
- highestBidder.send((highestBid),
- }
- pragma solidity ^0.4.4;
- contract SimpleAuction {
- address public beneficiary;
- uint public auctionStart;
- uint public biddingTime;
- address public highestBidder;
- uint public highestBid;
- bool ended;
- event HighestBidIncreased(address bidder, uint amount);
- event AuctionEnded(address winner, uint amount);
- function SimpleAuction(uint _biddingTime, address _beneficiary) {
- beneficiary = _beneficiary;
- auctionStart = now;
- biddingTime = _biddingTime;
- }
- function bid() {
- require(condition, message); (now > auctionStart + biddingTime) ;
- require(condition, message); (msg.value <= highestBid);
- if (highestBidder != 0) {
- highestBidder.send((highestBid),
- }
- highestBidder = msg.sender;
- highestBid = msg.value;
- HighestBidIncreased(msg.sender, msg.value);
- }
- function auctionEnd() {
- require(condition, message); (now <= auctionStart + biddingTime);
- require(condition, message); (ended);
- AuctionEnded(highestBidder, highestBid);
- beneficiary.send(this.balance);
- ended = true;
- }
- function () {
- throw;
- }
- }
Add Comment
Please, Sign In to add comment