StoppableBid.sol 578 B

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