Sponsored Link:   Buy your 1st Ethereum in 5 minutes. Trusted by more than 100k buyers.
Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 65 txns
Misc
Address Watch Add To Watch List
  Latest 25 txns from a total Of 65 transactions View All

TxHash Age From To Value [TxFee]
0x2099279e85264e9fd3915038da6cd99ed93567c8a82e4e762f084e87d9ea627e26 days 20 mins ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000264233
0x1c40c6d8e6c89966f00da944cb602f14dd73983706460a217752aff43afad72b26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x007016acb4d46c6b1512a25e381647fb3e4a354fe550660a31043599628a51b826 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0xa1b85cafbd1922aa1fe16c20a0f6a7568c20d0ae3d35bf80b6081e8f67f6f58b26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x358ea283021d1ffeb52b207d7533d6cf7f17e0102ee5a0469019c732510b8c6726 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0xc0c106befec2ea9a74b4162f0fd34b728d8435b8db16aac516ba97b3eb6f9d7f26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x49f25adbba751677f119df99aa156459e1dfa88f7dc7107fac695ce72046d66b26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x9dcce72ac608eeb8b0b776dd93e939752108c9de2b1a481d2ff1288ef53396cc26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x53298e8c00293d7cb855fe791d4c4d14108380f433e813d70e45a09d1076d06626 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000724284
0x09c7c9bf879879fe2b8bebd4b50b152502a0eda46f3aa62eb3231a4d40fa15b226 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0xd08e6b9562645fdd127eac77b4b9cdbf01b1c26fec121cc5fe121979420b987d26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0xc757501746daebc57a21b79699c19e364d0f1c95a9f195462591520ea8bdd12c26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x71fb6c591444b0f6f86aa4416272a1a428fb7fb8d01d5079fef6898ddf00303626 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0xf548e8776dfdba08142f6e8160b17f75b7a7a604f4721eff6f121aa4bf4c2f0226 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x544cffb2f3daf3c0bbdfdba922b9cd74409c238fc6e6f117c2d3ef4d6d0fa52326 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x4fe395d5b65782e63468b690c1b6d86d1013f9c6a5ddf1e730106750469902cf26 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x8257eb2b780c306f329aa94ba0b2429cb2fc0043ab5fd937e8384c677e94d6b826 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x1040830a237ab9bd34b364be44a5b2e2ea9ad7511c1116e929986bb06d49930826 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x1db5fbdc0242c271d1a79e204e7648356b5d9d0c523ddd5845de89882efffedb26 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000249928
0x38b5b7ae16994ed71410be76ed578043ef23427b24ecfbbf2daf63863cab402626 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000173973318
0xcdbbeb3bd76647f504f7519ae60073961772bd948ea1155b3bd98b183ed8dee626 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000124964
0xbac5ebbe7ec571970458be64f9a65d973f9d234f78e3a977ea6070e7aeec5aa626 days 9 hrs ago0xb569db9407a7ca3f0b73090d1dc7fe2f4e5ba26e  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e1 Ether0.00085276
0xc74ac5218f5ea977bcb454d5f92821c43c64911170c498c672b6ee4ac080713426 days 10 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000843087
0x7df11e52742c3c7344a445d42a8f1b8ab671fae35c54b4fbb93adfb3663754fc26 days 11 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000804745
0x285e89aefed9400a520dc688276239d6c252997904a35b9d265de830bc244fd726 days 11 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xad4c4ff144e42c73b6333b75af3cee5af901c10e0 Ether0.000786733
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 10 Internal Transactions

ParentTxHash Block Age From To Value
0x2099279e85264e9fd3915038da6cd99ed93567c8a82e4e762f084e87d9ea627e457512226 days 20 mins ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x8b8a571730b631f58e7965d78582eae1b0417ab60 Ether
0x1fa2d58d3b8ad3fb746f557470dff3122d389ac07912a58b0d67e43aacfa5f12457116026 days 15 hrs ago0x1c0a9bbaddb924b42e3145610960dde1197795600xad4c4ff144e42c73b6333b75af3cee5af901c10e0.00121212 Ether
0x556a651c6db2309b776901dea00ade7e13562a8810b08dd58df16259e18f63cf455570029 days 3 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820.0165 Ether
0x26db142329dacc90794cd5580e800f982f9c7e7dad8ff6fc967cb32d1a7ab340455563329 days 3 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0xb569db9407a7ca3f0b73090d1dc7fe2f4e5ba26e0.0035 Ether
0xf228eff6b83e307af08a9b7275c56e6c1e0a32071590f4313b6df57ae5afa29f455562129 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x79b2b9047f5ee28029033f10e8811816eff289010.01 Ether
0xa950c81ca11e8537fb5127ea330551856215ac63def96d719309832b67fdd066455559629 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x5252013df34cfb6e4faa0df410490493044036980.001 Ether
0x49fe2402e7147d97d6b0e3d9a76e20ed7596215e6eb2605ce7669cebf6b0e4b0455552929 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x950c77b394c6b2993cce5158497c32d8c921d7480.002 Ether
0xa63067dc17099dc4de64f02b1de029abe0bb70dcd50f0c5f89faef6fecfe1544455550629 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x3794c5e109ff82e9d1eff80e16011f2633f1510d0.006 Ether
0x4578c9edfc606764e511ad516e62994bfef0047c2ab2ef03eaff885b7dfe3276455544329 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0x26a46318376e68601a98a9b3e2afe02c057a071e0.001 Ether
0xd234dc636e859292d2d34fc2c5e89700c557ad2e30d8d6d044f60a45dd3a2826455542729 days 4 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0xf48ae436e4813c7dcd5cdeb305131d07ca0224690.005 Ether
[ Download CSV Export  ] 
Contract SUICIDE called at TxHash 0x2099279e85264e9fd3915038da6cd99ed93567c8a82e4e762f084e87d9ea627e

Contract Source Code Verified
Contract Name: TokenAuction
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.18;

/**
 *
 * @author  <[email protected]>
 *
 * Version F
 *
 * Overview:
 * This contract implements a blind auction for burnable tokens. Each secret bid consists
 * of a hashed bid-tuple, (`price`, `quantity`, `salt`), where price is the maximum amount
 * of ether (in szabo) a user is willing to pay per token, quantity is the number of tokens
 * the user wants to buy, and salt is an arbitrary value. Together with the hashed bid-tuple,
 * the user includes an encrypted bid tuple, using the public key of the party running the
 * auction, and of course a deposit sufficient to pay for the bid.
 *
 * At the end of the bidding period, the party running the auction sets a 'strike price',
 * thereby signaling the start of the sale period. During this period all bidders must
 * execute their bids. To execute a bid a user reveals their bid-tuple. All bids with a
 * price at least as high as the strike price are filled, and all bids under the strike
 * price are returned. Bids that are exactly equal to the strike price are partially filled,
 * so that the maximum number of tokens generated does not exceed the total supply.
 *
 * Strike Price:
 * The strike price is calculated offchain by the party running the auction. When each
 * secret bid is submitted an event is generated, which includes the sender address, hashed
 * bid-tuple, encrypted bid-tuple and deposit amount. the party running the auction decrypts
 * the encrypted bid-tuple, and regenerates the hash. If the regenerated hash does not match
 * the hash that was submitted with the secret bid, or if the desposited funds are not
 * sufficient to cover the bid, then the bid is disqualified. (presumably disqualifying
 * invalid bids will be cheaper than validating all the valid bids).
 *
 * The auction is structured with a fixed maximum number of tokens. So to raise the maximum
 * funds the bids are sorted, highest to lowest. Starting the strike-price at the highest
 * bid, it is reduced, bid by bid, to include more bids. The quantity of tokens sold increases
 * each time a new bid is included; but the token price is reduced. At each step the total
 * raise (token-price times quantity-of-tokens-sold) is computed. And the process ends
 * whenever the total raise decreases, or when the total number of tokens exceeds the total
 * supply.
 *
 * Notes:
 * The `salt` is included in the bid-tuple to discourage brute-force attacks on the inputs
 * to the secret bid.
 *
 * A user cannot submit multiple bids from the same Ether account.
 *
 * Users are required to execute their bids. If a user fails to execute their bid before the
 * end of the sale period, then they forfeit half of their deposit, and receive no tokens.
 * This rule was adopted (as opposed to refunding un-revealed bids) to prevent users from placing
 * several bids, and only revealing one of them. With this rule, all bids must be executed.
 *
 */


pragma solidity ^0.4.15;

//Burnable Token interface

pragma solidity ^0.4.15;

// Token standard API
// https://github.com/ethereum/EIPs/issues/20

contract iERC20Token {
  function totalSupply() public constant returns (uint supply);
  function balanceOf( address who ) public constant returns (uint value);
  function allowance( address owner, address spender ) public constant returns (uint remaining);

  function transfer( address to, uint value) public returns (bool ok);
  function transferFrom( address from, address to, uint value) public returns (bool ok);
  function approve( address spender, uint value ) public returns (bool ok);

  event Transfer( address indexed from, address indexed to, uint value);
  event Approval( address indexed owner, address indexed spender, uint value);
}

contract iBurnableToken is iERC20Token {
  function burnTokens(uint _burnCount) public;
  function unPaidBurnTokens(uint _burnCount) public;
}

//import './SafeMath.sol';
pragma solidity ^0.4.11;

/*
    Overflow protected math functions
*/
contract SafeMath {
    /**
        constructor
    */
    function SafeMath() public {
    }

    /**
        @dev returns the sum of _x and _y, asserts if the calculation overflows

        @param _x   value 1
        @param _y   value 2

        @return sum
    */
    function safeAdd(uint256 _x, uint256 _y) pure internal returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    /**
        @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number

        @param _x   minuend
        @param _y   subtrahend

        @return difference
    */
    function safeSub(uint256 _x, uint256 _y) pure internal returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    /**
        @dev returns the product of multiplying _x by _y, asserts if the calculation overflows

        @param _x   factor 1
        @param _y   factor 2

        @return product
    */
    function safeMul(uint256 _x, uint256 _y) pure internal returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }
}


contract TokenAuction is SafeMath {

  struct SecretBid {
    bool disqualified;     // flag set if hash does not match encrypted bid
    uint deposit;          // funds deposited by bidder
    uint refund;           // funds to be returned to bidder
    uint tokens;           // structure has been allocated
    bytes32 hash;          // hash of price, quantity, secret
  }
  uint constant  AUCTION_START_EVENT = 0x01;
  uint constant  AUCTION_END_EVENT   = 0x02;
  uint constant  SALE_START_EVENT    = 0x04;
  uint constant  SALE_END_EVENT      = 0x08;

  event SecretBidEvent(uint indexed batch, address indexed bidder, uint deposit, bytes32 hash, bytes message);
  event ExecuteEvent(uint indexed batch, address indexed bidder, uint cost, uint refund);
  event ExpireEvent(uint indexed batch, address indexed bidder, uint cost, uint refund);
  event BizarreEvent(address indexed addr, string message, uint val);
  event StateChangeEvent(uint mask);
  //
  //event MessageEvent(string message);
  //event MessageUintEvent(string message, uint val);
  //event MessageAddrEvent(string message, address val);
  //event MessageBytes32Event(string message, bytes32 val);

  bool public isLocked;
  uint public stateMask;
  address public owner;
  address public developers;
  address public underwriter;
  iBurnableToken public token;
  uint public proceeds;
  uint public strikePrice;
  uint public strikePricePctX10;
  uint public decimalMultiplier;
  uint public developerReserve;
  uint public developerPctX10K;
  uint public purchasedCount;
  uint public secretBidCount;
  uint public executedCount;
  uint public expiredCount;
  uint public saleDuration;
  uint public auctionStart;
  uint public auctionEnd;
  uint public saleEnd;
  mapping (address => SecretBid) public secretBids;

  //
  //tunables
  uint batchSize = 4;
  uint contractSendGas = 100000;

  modifier ownerOnly {
    require(msg.sender == owner);
    _;
  }

  modifier unlockedOnly {
    require(!isLocked);
    _;
  }

  modifier duringAuction {
    require((stateMask & (AUCTION_START_EVENT | AUCTION_END_EVENT)) == AUCTION_START_EVENT);
    _;
  }

  modifier afterAuction {
    require((stateMask & AUCTION_END_EVENT) != 0);
    _;
  }

  modifier duringSale {
    require((stateMask & (SALE_START_EVENT | SALE_END_EVENT)) == SALE_START_EVENT);
    _;
  }

  modifier afterSale {
    require((stateMask & SALE_END_EVENT) != 0);
    _;
  }


  //
  //constructor
  //
  function TokenAuction() public {
    owner = msg.sender;
  }

  function lock() public ownerOnly {
    isLocked = true;
  }

  function setToken(iBurnableToken _token, uint _decimalMultiplier, address _underwriter) public ownerOnly unlockedOnly {
    token = _token;
    decimalMultiplier = _decimalMultiplier;
    underwriter = _underwriter;
  }

  function setAuctionParms(uint _auctionStart, uint _auctionDuration, uint _saleDuration) public ownerOnly unlockedOnly {
    auctionStart = _auctionStart;
    auctionEnd = safeAdd(_auctionStart, _auctionDuration);
    saleDuration = _saleDuration;
    if (stateMask != 0) {
      //handy for debug
      stateMask = 0;
      strikePrice = 0;
      executedCount = 0;
      houseKeep();
    }
  }


  function reserveDeveloperTokens(address _developers, uint _developerPctX10K) public ownerOnly unlockedOnly {
    developers = _developers;
    developerPctX10K = _developerPctX10K;
    uint _tokenCount = token.balanceOf(this);
    developerReserve = safeMul(_tokenCount, developerPctX10K) / 1000000;
  }

  function tune(uint _batchSize, uint _contractSendGas) public ownerOnly {
    batchSize = _batchSize;
    contractSendGas = _contractSendGas;
  }


  //
  //called by owner (or any other concerned party) to generate a SatateChangeEvent
  //
  function houseKeep() public {
    uint _oldMask = stateMask;
    if (now >= auctionStart) {
      stateMask |= AUCTION_START_EVENT;
      if (now >= auctionEnd) {
        stateMask |= AUCTION_END_EVENT;
        if (strikePrice > 0) {
          stateMask |= SALE_START_EVENT;
          if (now >= saleEnd)
            stateMask |= SALE_END_EVENT;
        }
      }
    }
    if (stateMask != _oldMask)
      StateChangeEvent(stateMask);
  }



  //
  // setting the strike price starts the sale period, during which bidders must call executeBid.
  // the strike price should only be set once.... at any rate it cannot be changed once anyone has executed a bid.
  // strikePricePctX10 specifies what percentage (x10) of requested tokens should be awarded to each bidder that
  // bid exactly equal to the strike price.
  //
  // note: strikePrice is the price of whole tokens (in wei)
  //
  function setStrikePrice(uint _strikePrice, uint _strikePricePctX10) public ownerOnly afterAuction {
    require(executedCount == 0);
    strikePrice = _strikePrice;
    strikePricePctX10 = _strikePricePctX10;
    saleEnd = safeAdd(now, saleDuration);
    houseKeep();
  }


  //
  // nobody should be sending funds via this function.... bizarre...
  // the fact that we adjust proceeds here means that this fcn will OOG if called with a send or transfer. that's
  // probably good, cuz it prevents the caller from losing their funds.
  //
  function () public payable {
    proceeds = safeAdd(proceeds, msg.value);
    BizarreEvent(msg.sender, "bizarre payment", msg.value);
  }


  function depositSecretBid(bytes32 _hash, bytes _message) public duringAuction payable {
    //each address can only submit one bid -- and once a bid is submitted it is imutable
    //for testing, an exception is made for the owner -- but only while the contract is unlocked
    if (!(msg.sender == owner && !isLocked) &&
         (_hash == 0 || secretBids[msg.sender].hash != 0) )
        revert();
    secretBids[msg.sender].hash = _hash;
    secretBids[msg.sender].deposit = msg.value;
    secretBidCount += 1;
    uint _batch = secretBidCount / batchSize;
    SecretBidEvent(_batch, msg.sender, msg.value, _hash, _message);
  }


  //
  // the owner may disqualify a bid if it is bogus. for example if the hash does not correspond
  // to the hash that is generated from the encyrpted bid tuple. when a disqualified bid is
  // executed all the deposited funds will be returned to the bidder, as if the bid was below
  // the strike-price.
  //
  function disqualifyBid(address _from) public ownerOnly duringAuction {
    secretBids[_from].disqualified = true;
  }


  //
  // execute a bid.
  // * purchases tokens if the specified price is above the strike price
  // * refunds whatever remains of the deposit
  //
  // call only during the sale period (strikePrice > 0)
  // note: _quantity is the number of whole tokens; that is low-level-tokens * decimalMultiplier
  // similarly _price is the price of whole tokens; that is low-level-token price / decimalMultiplier
  //
  function executeBid(uint256 _secret, uint256 _price, uint256 _quantity) public duringSale {
    executeBidFor(msg.sender, _secret, _price, _quantity);
  }
  function executeBidFor(address _addr, uint256 _secret, uint256 _price, uint256 _quantity) public duringSale {
    bytes32 computedHash = keccak256(_secret, _price, _quantity);
    //MessageBytes32Event("computedHash", computedHash);
    require(secretBids[_addr].hash == computedHash);
    //
    if (secretBids[_addr].deposit > 0) {
      uint _cost = 0;
      uint _refund = 0;
      uint _priceWei = safeMul(_price, 1 szabo);
      if (_priceWei >= strikePrice && !secretBids[_addr].disqualified) {
         //up till now all prices and quantities and referred to whole tokens (including strike price); now that we are about
         //to actually do the transfer, convert to low-level tokens
         uint _lowLevelQuantity = safeMul(_quantity, decimalMultiplier);
         uint _lowLevelPrice = strikePrice / decimalMultiplier;
         uint256 _purchaseCount = (_priceWei > strikePrice) ? _lowLevelQuantity : (safeMul(strikePricePctX10, _lowLevelQuantity) / 1000);
         var _maxPurchase = token.balanceOf(this) - developerReserve;
         if (_purchaseCount > _maxPurchase)
           _purchaseCount = _maxPurchase;
         _cost = safeMul(_purchaseCount, _lowLevelPrice);
         if (secretBids[_addr].deposit >= _cost) {
           secretBids[_addr].deposit -= _cost;
           proceeds = safeAdd(proceeds, _cost);
           secretBids[_addr].tokens += _purchaseCount;
           purchasedCount += _purchaseCount;
           //transfer tokens to this bidder
           if (!token.transfer(_addr, _purchaseCount))
             revert();
         }
      }
      //refund whatever remains
      //use pull here, to prevent any bidder from reverting their purchase
      if (secretBids[_addr].deposit > 0) {
        _refund = secretBids[_addr].deposit;
        secretBids[_addr].refund += _refund;
        secretBids[_addr].deposit = 0;
      }
      executedCount += 1;
      uint _batch = executedCount / batchSize;
      ExecuteEvent(_batch, _addr, _cost, _refund);
    }
  }


  //
  // expireBid
  // if a bid is not executed during the sale period, then the owner can mark the bid as expired. in this case:
  // * the bidder gets a refund of half of his deposit
  // * the bidder forfeits the other half of his deposit
  // * the bidder does not receive an tokens
  //
  function expireBid(address _addr) public ownerOnly afterSale {
    if (secretBids[_addr].deposit > 0) {
      uint _forfeit = secretBids[_addr].deposit / 2;
      proceeds = safeAdd(proceeds, _forfeit);
      //refund whatever remains
      uint _refund = safeSub(secretBids[_addr].deposit, _forfeit);
      //use pull here, to prevent any bidder from reverting the expire
      secretBids[msg.sender].refund += _refund;
      secretBids[_addr].deposit = 0;
      expiredCount += 1;
      uint _batch = expiredCount / batchSize;
      ExpireEvent(_batch, _addr, _forfeit, _refund);
    }
  }


  //
  // bidder withdraw excess funds (or all funds if bid was too low)
  //
  function withdrawRefund() public {
    uint _amount = secretBids[msg.sender].refund;
    secretBids[msg.sender].refund = 0;
    msg.sender.transfer(_amount);
  }


  //
  // grant developer tokens, equal to a percentage of purchased tokens.
  // once called, any remaining tokens will be burned.
  //
  function doDeveloperGrant() public afterSale {
    uint _quantity = safeMul(purchasedCount, developerPctX10K) / 1000000;
    uint _tokensLeft = token.balanceOf(this);
    if (_quantity > _tokensLeft)
      _quantity = _tokensLeft;
    if (_quantity > 0) {
      //transfer pct tokens to developers
      _tokensLeft -= _quantity;
      if (!token.transfer(developers, _quantity))
        revert();
    }
    //and burn everthing that remains
    token.unPaidBurnTokens(_tokensLeft);
  }


  //
  // pay auction proceeds to the underwriter
  // may be called by underwriter or owner (fbo underwriter)
  //
  function payUnderwriter() public {
    require(msg.sender == owner || msg.sender == underwriter);
    uint _amount = proceeds;
    proceeds = 0;
    if (!underwriter.call.gas(contractSendGas).value(_amount)())
      revert();
  }


  //for debug
  //only available before the contract is locked
  function haraKiri() public ownerOnly unlockedOnly {
    selfdestruct(owner);
  }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"purchasedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_secret","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_quantity","type":"uint256"}],"name":"executeBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"}],"name":"disqualifyBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stateMask","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawRefund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_developers","type":"address"},{"name":"_developerPctX10K","type":"uint256"}],"name":"reserveDeveloperTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_auctionStart","type":"uint256"},{"name":"_auctionDuration","type":"uint256"},{"name":"_saleDuration","type":"uint256"}],"name":"setAuctionParms","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"_message","type":"bytes"}],"name":"depositSecretBid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"auctionEnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"developers","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimalMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"saleDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"payUnderwriter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"doDeveloperGrant","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"auctionStart","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proceeds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_batchSize","type":"uint256"},{"name":"_contractSendGas","type":"uint256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"strikePricePctX10","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"developerPctX10K","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_strikePrice","type":"uint256"},{"name":"_strikePricePctX10","type":"uint256"}],"name":"setStrikePrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isLocked","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_secret","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_quantity","type":"uint256"}],"name":"executeBidFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"executedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"saleEnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"haraKiri","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"strikePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"}],"name":"expireBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"secretBids","outputs":[{"name":"disqualified","type":"bool"},{"name":"deposit","type":"uint256"},{"name":"refund","type":"uint256"},{"name":"tokens","type":"uint256"},{"name":"hash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"houseKeep","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"secretBidCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_decimalMultiplier","type":"uint256"},{"name":"_underwriter","type":"address"}],"name":"setToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"expiredCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"underwriter","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"developerReserve","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"lock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"batch","type":"uint256"},{"indexed":true,"name":"bidder","type":"address"},{"indexed":false,"name":"deposit","type":"uint256"},{"indexed":false,"name":"hash","type":"bytes32"},{"indexed":false,"name":"message","type":"bytes"}],"name":"SecretBidEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"batch","type":"uint256"},{"indexed":true,"name":"bidder","type":"address"},{"indexed":false,"name":"cost","type":"uint256"},{"indexed":false,"name":"refund","type":"uint256"}],"name":"ExecuteEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"batch","type":"uint256"},{"indexed":true,"name":"bidder","type":"address"},{"indexed":false,"name":"cost","type":"uint256"},{"indexed":false,"name":"refund","type":"uint256"}],"name":"ExpireEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"},{"indexed":false,"name":"message","type":"string"},{"indexed":false,"name":"val","type":"uint256"}],"name":"BizarreEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"mask","type":"uint256"}],"name":"StateChangeEvent","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526004601555620186a0601655341561001b57600080fd5b60028054600160a060020a03191633600160a060020a03161790556113f7806100456000396000f3006060604052600436106101b25763ffffffff60e060020a6000350416626b1fd1811461023757806302f650961461025c57806309541d481461027a5780630cf85c4c14610299578063110f8874146102ac5780631f6c76f4146102bf5780632134927e146102e157806325ede147146102fd5780632a24f46c146103485780632bc31ca41461035b5780633082538f1461038a5780633711d9fb1461039d5780634bd9d76c146103b05780634c182a95146103c35780634f245ef7146103d657806355b5ec64146103e957806361f17532146103fc5780636797b106146104155780638042b215146104285780638d52a1fc1461043b5780638da5cb5b14610454578063a4e2d63414610467578063a7e86daa1461048e578063bacd2e97146104b6578063c10b9358146104c9578063c4052559146104dc578063c52987cf146104ef578063c6ad5d7c14610502578063c8c89fa514610521578063da00586b14610573578063dd79cc6a14610586578063e6c5201614610599578063eda70f7e146105c2578063f00db260146105d5578063f55c9f60146105e8578063f83d08ba146105fb578063fc0c546a1461060e575b6101be60065434610621565b600655600160a060020a0333167f0ee13c1ef372bf0aa1349495ea8f00b99ded79c910cfa09fa1d60600cb9ebaa53460405160208101919091526040808252600f818301527f62697a61727265207061796d656e74000000000000000000000000000000000060608301526080909101905180910390a2005b341561024257600080fd5b61024a610637565b60405190815260200160405180910390f35b341561026757600080fd5b61027860043560243560443561063d565b005b341561028557600080fd5b610278600160a060020a0360043516610660565b34156102a457600080fd5b61024a6106b0565b34156102b757600080fd5b6102786106b6565b34156102ca57600080fd5b610278600160a060020a0360043516602435610704565b34156102ec57600080fd5b6102786004356024356044356107f4565b610278600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061085595505050505050565b341561035357600080fd5b61024a6109c2565b341561036657600080fd5b61036e6109c8565b604051600160a060020a03909116815260200160405180910390f35b341561039557600080fd5b61024a6109d7565b34156103a857600080fd5b61024a6109dd565b34156103bb57600080fd5b6102786109e3565b34156103ce57600080fd5b610278610a59565b34156103e157600080fd5b61024a610c0a565b34156103f457600080fd5b61024a610c10565b341561040757600080fd5b610278600435602435610c16565b341561042057600080fd5b61024a610c3c565b341561043357600080fd5b61024a610c42565b341561044657600080fd5b610278600435602435610c48565b341561045f57600080fd5b61036e610ca8565b341561047257600080fd5b61047a610cb7565b604051901515815260200160405180910390f35b341561049957600080fd5b610278600160a060020a0360043516602435604435606435610cc0565b34156104c157600080fd5b61024a611079565b34156104d457600080fd5b61024a61107f565b34156104e757600080fd5b610278611085565b34156104fa57600080fd5b61024a6110be565b341561050d57600080fd5b610278600160a060020a03600435166110c4565b341561052c57600080fd5b610540600160a060020a036004351661120d565b604051941515855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b341561057e57600080fd5b610278611240565b341561059157600080fd5b61024a6112cf565b34156105a457600080fd5b610278600160a060020a0360043581169060243590604435166112d5565b34156105cd57600080fd5b61024a611341565b34156105e057600080fd5b61036e611347565b34156105f357600080fd5b61024a611356565b341561060657600080fd5b61027861135c565b341561061957600080fd5b61036e611386565b60008282018381101561063057fe5b9392505050565b600c5481565b600154600c1660041461064f57600080fd5b61065b33848484610cc0565b505050565b60025433600160a060020a0390811691161461067b57600080fd5b600180546003161461068c57600080fd5b600160a060020a03166000908152601460205260409020805460ff19166001179055565b60015481565b600160a060020a033316600081815260146020526040808220600201805492905590919082156108fc0290839051600060405180830381858888f19350505050151561070157600080fd5b50565b60025460009033600160a060020a0390811691161461072257600080fd5b60005460ff161561073257600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385811691909117909155600b839055600554166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107b557600080fd5b6102c65a03f115156107c657600080fd5b505050604051805190509050620f42406107e282600b54611395565b8115156107eb57fe5b04600a55505050565b60025433600160a060020a0390811691161461080f57600080fd5b60005460ff161561081f57600080fd5b601183905561082e8383610621565b60125560108190556001541561065b57600060018190556007819055600e5561065b611240565b6000600160026001176001541614151561086e57600080fd5b60025433600160a060020a03908116911614801561088f575060005460ff16155b1580156108be57508215806108be5750600160a060020a03331660009081526014602052604090206004015415155b156108c857600080fd5b600160a060020a03331660009081526014602052604090206004810184905534600191820155600d8054909101908190556015549081151561090657fe5b04905033600160a060020a0316817fe15b694b705acb702334150b898bb2a2646b7bd2748a22f26c36e6ba7cb89f1c3486866040518381526020810183905260606040820181815290820183818151815260200191508051906020019080838360005b83811015610981578082015183820152602001610969565b50505050905090810190601f1680156109ae5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a3505050565b60125481565b600354600160a060020a031681565b60095481565b60105481565b60025460009033600160a060020a0390811691161480610a11575060045433600160a060020a039081169116145b1515610a1c57600080fd5b50600680546000909155600454601654600160a060020a039091169082604051600060405180830381858888f19350505050151561070157600080fd5b60015460009081906008161515610a6f57600080fd5b620f4240610a81600c54600b54611395565b811515610a8a57fe5b6005549190049250600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610ae857600080fd5b6102c65a03f11515610af957600080fd5b505050604051805191505080821115610b10578091505b6000821115610baa576005546003549183900391600160a060020a039182169163a9059cbb91168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b8457600080fd5b6102c65a03f11515610b9557600080fd5b505050604051805190501515610baa57600080fd5b600554600160a060020a0316631d5f624a8260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610bf257600080fd5b6102c65a03f11515610c0357600080fd5b5050505050565b60115481565b60065481565b60025433600160a060020a03908116911614610c3157600080fd5b601591909155601655565b60085481565b600b5481565b60025433600160a060020a03908116911614610c6357600080fd5b6001546002161515610c7457600080fd5b600e5415610c8157600080fd5b60078290556008819055601054610c99904290610621565b601355610ca4611240565b5050565b600254600160a060020a031681565b60005460ff1681565b60008060008060008060008060006004600860041760015416141515610ce557600080fd5b8b8b8b604051808481526020018381526020018281526020019350505050604051908190039020600160a060020a038e166000908152601460205260409020600401549099508914610d3657600080fd5b600160a060020a038d16600090815260146020526040812060010154111561106a576000975060009650610d6f8b64e8d4a51000611395565b95506007548610158015610d9c5750600160a060020a038d1660009081526014602052604090205460ff16155b15610fb757610dad8a600954611395565b9450600954600754811515610dbe57fe5b0493506007548611610de8576103e8610dd960085487611395565b811515610de257fe5b04610dea565b845b600a5460055491945090600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610e4a57600080fd5b6102c65a03f11515610e5b57600080fd5b5050506040518051905003915081831115610e74578192505b610e7e8385611395565b600160a060020a038e16600090815260146020526040902060010154909850889010610fb757600160a060020a038d16600090815260146020526040902060010180548990039055600654610ed39089610621565b60068190555082601460008f600160a060020a0316600160a060020a031681526020019081526020016000206003016000828254019250508190555082600c60008282540192505081905550600560009054906101000a9004600160a060020a0316600160a060020a031663a9059cbb8e8560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610f9157600080fd5b6102c65a03f11515610fa257600080fd5b505050604051805190501515610fb757600080fd5b600160a060020a038d16600090815260146020526040812060010154111561100957600160a060020a038d16600090815260146020526040812060018101805460029092018054830190559190915596505b600e8054600101908190556015549081151561102157fe5b0490508c600160a060020a0316817ff3f4e84227586e797977952ce09ff57aa48556bbd992e1f611cc2c3f6fb1f7458a8a60405191825260208201526040908101905180910390a35b50505050505050505050505050565b600e5481565b60135481565b60025433600160a060020a039081169116146110a057600080fd5b60005460ff16156110b057600080fd5b600254600160a060020a0316ff5b60075481565b6002546000908190819033600160a060020a039081169116146110e657600080fd5b60015460081615156110f757600080fd5b600160a060020a038416600090815260146020526040812060010154111561120757600160a060020a03841660009081526014602052604090206001015460029004925061114760065484610621565b600655600160a060020a03841660009081526014602052604090206001015461117090846113b9565b600160a060020a033381166000908152601460205260408082206002018054850190559187168152908120600190810191909155600f8054909101908190556015549193508115156111be57fe5b04905083600160a060020a0316817f44cccea75941d95449197a42ac2e10a309a313661b13e669b8bb52c8ccb6f175858560405191825260208201526040908101905180910390a35b50505050565b6014602052600090815260409020805460018201546002830154600384015460049094015460ff90931693919290919085565b600154601154421061128e576001805481179055601254421061128e57600180546002179055600754600090111561128e57600180546004179055601354421061128e576001805460081790555b6001548114610701577fc4d1978aca5dbd557298da69c7a31a5dec628dce416e9a721f6366572286550260015460405190815260200160405180910390a150565b600d5481565b60025433600160a060020a039081169116146112f057600080fd5b60005460ff161561130057600080fd5b60058054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff199182161790915560099290925560048054919093169116179055565b600f5481565b600454600160a060020a031681565b600a5481565b60025433600160a060020a0390811691161461137757600080fd5b6000805460ff19166001179055565b600554600160a060020a031681565b60008282028315806113b157508284828115156113ae57fe5b04145b151561063057fe5b6000818310156113c557fe5b509003905600a165627a7a72305820ba15d56caa83a7fdcf5bbf832c3979beed00ff4b9888ffae9636d8b02d39ac4c0029

   Swarm Source:
bzzr://ba15d56caa83a7fdcf5bbf832c3979beed00ff4b9888ffae9636d8b02d39ac4c

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.