Files
openzeppelin-contracts/contracts/examples/PullPaymentBid.sol
2016-08-16 12:26:25 -03:00

17 lines
365 B
Solidity

import '../PullPaymentCapable.sol';
contract PullPaymentBid is PullPaymentCapable {
address public highestBidder;
uint public highestBid;
function bid() external {
if (msg.value <= highestBid) throw;
if (highestBidder != 0) {
asyncSend(highestBidder, highestBid);
}
highestBidder = msg.sender;
highestBid = msg.value;
}
}