The Simple Open Auction from the Solidity documentation, opened for 1000 seconds with the deployer as beneficiary.
Context
Deployed 27 December 2015, during the Frontier era.
Key Facts
Description
The SimpleAuction example from the Solidity documentation. bid throws once the bidding period is over or if the value sent does not beat the standing bid, refunds the previous leader with send, and records the new one. auctionEnd throws before the deadline and on a second call, emits AuctionEnded and forwards the whole contract balance to the beneficiary. The fallback throws, so plain ether sent without data is rejected rather than kept. The refund inside bid uses send and ignores its return value, which is the documented weakness of this example: a leader whose refund fails loses the money to the beneficiary, since auctionEnd sends the entire balance rather than the winning bid. The constructor arguments set a bidding time of 1000 seconds and name the deployer 0xa46fcc88d1e03f79e264ec48bcf05094401a6962 as beneficiary.
Source Verified
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract SimpleAuction {
// Parameters of the auction. Times are either
// absolute unix timestamps (seconds since 1970-01-01)
// or time periods in seconds.
address public beneficiary;
uint public auctionStart;
uint public biddingTime;
// Current state of the auction.
address public highestBidder;
uint public highestBid;
// Set to true at the end, disallows any change
bool ended;
// Events that will be fired on changes.
event HighestBidIncreased(address bidder, uint amount);
event AuctionEnded(address winner, uint amount);
// The following is a so-called natspec comment,
// recognizable by the three slashes.
// It will be shown when the user is asked to
// confirm a transaction.
/// Create a simple auction with `_biddingTime`
/// seconds bidding time on behalf of the
/// beneficiary address `_beneficiary`.
function SimpleAuction(
uint _biddingTime,
address _beneficiary
) {
beneficiary = _beneficiary;
auctionStart = now;
biddingTime = _biddingTime;
}
/// Bid on the auction with the value sent
/// together with this transaction.
/// The value will only be refunded if the
/// auction is not won.
function bid() {
// No arguments are necessary, all
// information is already part of
// the transaction.
if (now > auctionStart + biddingTime) {
// Revert the call if the bidding
// period is over.
throw;
}
if (msg.value <= highestBid) {
// If the bid is not higher, send the
// money back.
throw;
}
if (highestBidder != 0) {
highestBidder.send(highestBid);
}
highestBidder = msg.sender;
highestBid = msg.value;
HighestBidIncreased(msg.sender, msg.value);
}
/// End the auction and send the highest bid
/// to the beneficiary.
function auctionEnd() {
if (now <= auctionStart + biddingTime)
throw; // auction did not yet end
if (ended)
throw; // this function has already been called
AuctionEnded(highestBidder, highestBid);
// We send all the money we have, because some
// of the refunds might have failed.
beneficiary.send(this.balance);
ended = true;
}
function () {
// This function gets executed if a
// transaction with invalid data is sent to
// the contract or just ether without data.
// We revert the send so that no-one
// accidentally loses money when using the
// contract.
throw;
}
}External Links
Related contracts
StateMachine
Same deployerThe State Machine example from the Solidity documentation's common patterns page, deployed as written with its empty function bodies.
0xd7ee2f...125b00December 27, 2015myKwh
Same deployerIdentical-runtime sibling. The ethereum.org 'advanced' MyToken (Homestead, Mar 2016): an issuer-minted token with mintToken, freezeAccount/FrozenFunds and the s
0x3cf9b4...9626c9February 10, 2016windKwh
Same deployerTwenty five indivisible units standing for kilowatt hours of wind generation.
0xcb9df5...7341e0February 14, 2016