Guest User

Untitled

a guest
Jul 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. if (highestBidder != 0) {
  2. highestBidder.send((highestBid),
  3. }
  4.  
  5. pragma solidity ^0.4.4;
  6. contract SimpleAuction {
  7.  
  8. address public beneficiary;
  9. uint public auctionStart;
  10. uint public biddingTime;
  11.  
  12.  
  13. address public highestBidder;
  14.  
  15. uint public highestBid;
  16.  
  17.  
  18. bool ended;
  19.  
  20.  
  21. event HighestBidIncreased(address bidder, uint amount);
  22.  
  23. event AuctionEnded(address winner, uint amount);
  24.  
  25.  
  26. function SimpleAuction(uint _biddingTime, address _beneficiary) {
  27. beneficiary = _beneficiary;
  28. auctionStart = now;
  29. biddingTime = _biddingTime;
  30. }
  31.  
  32.  
  33. function bid() {
  34.  
  35. require(condition, message); (now > auctionStart + biddingTime) ;
  36.  
  37.  
  38. require(condition, message); (msg.value <= highestBid);
  39.  
  40.  
  41.  
  42. if (highestBidder != 0) {
  43. highestBidder.send((highestBid),
  44. }
  45. highestBidder = msg.sender;
  46. highestBid = msg.value;
  47. HighestBidIncreased(msg.sender, msg.value);
  48. }
  49.  
  50. function auctionEnd() {
  51. require(condition, message); (now <= auctionStart + biddingTime);
  52. require(condition, message); (ended);
  53. AuctionEnded(highestBidder, highestBid);
  54.  
  55. beneficiary.send(this.balance);
  56. ended = true;
  57. }
  58.  
  59. function () {
  60. throw;
  61. }
  62. }
Add Comment
Please, Sign In to add comment