StoppableBid.sol 582 B

12345678910111213141516171819202122232425262728
  1. pragma solidity ^0.4.0;
  2. import '../PullPayment.sol';
  3. import '../Stoppable.sol';
  4. contract StoppableBid is Stoppable, PullPayment {
  5. address public highestBidder;
  6. uint public highestBid;
  7. function StoppableBid(address _curator)
  8. Stoppable(_curator)
  9. PullPayment() {}
  10. function bid() external stopInEmergency {
  11. if (msg.value <= highestBid) throw;
  12. if (highestBidder != 0) {
  13. asyncSend(highestBidder, highestBid);
  14. }
  15. highestBidder = msg.sender;
  16. highestBid = msg.value;
  17. }
  18. function withdraw() onlyInEmergency {
  19. suicide(curator);
  20. }
  21. }