36 lines
685 B
Plaintext
36 lines
685 B
Plaintext
|
|
|
|
contract auction
|
|
(address _beneficiary
|
|
,uint256 _bidding_time
|
|
,address => bool _bids
|
|
,uint256 _highest_bid)
|
|
{
|
|
default
|
|
{
|
|
if (now(block) > _bidding_time)
|
|
return then become auction_done(_beneficiary, _bids, _highest_bid);
|
|
if (value(msg) < _highest_bid)
|
|
abort;
|
|
bid new_bid =
|
|
deploy bid(sender(msg), value(msg), this) with value(msg)
|
|
reentrance { abort; }; // failure throws.
|
|
_bids[sender(msg)] = true;
|
|
return then become
|
|
auction(_beneficiary, _bidding_time, _bids, value(msg));
|
|
}
|
|
}
|
|
contract auction_done
|
|
(address _bene,
|
|
address => bool _bids,
|
|
uint256 _highest_bid)
|
|
{
|
|
}
|
|
contract bid
|
|
(address _sender
|
|
,uint256 _value
|
|
,address _auction
|
|
)
|
|
{
|
|
}
|