Contract Overview
ETH Balance: 3.5755 Ether ($146.24)
Mined:  0
No Of Transactions: 828 txns + 242 internalTxns
  Latest 25 txns from a total Of 828 transactions View All

TxHash Block Age From To Value [TxFee]
0x6311d59c801d18ff075d8d91ae28ef5e2bf7736f7fdf7304c997e181f2c078ab340069711 hrs 47 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.0011165
0x3eca93b1bfbd2af5f6a565a1a1e0ed53ecbf5266316e6a48627954a41be7ad79340069311 hrs 48 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338338
0x9b7e1c5b55dd662d42846cb2d58050d36c91419fb441e309418efe7dca6e3c9c340068711 hrs 49 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0x9e585a8eb4f0922f7e18e09eaee8ff694927c3848f23e7125018004c37542f53340068311 hrs 50 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0x767ff866383cc5db1c77525adb0014f18d3b7a9783309e50286b67fa59b059ea340017913 hrs 47 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0xf90e3cb4d372e407f59341352b96cf1d497a5a28f2f9005627d3fcf5a4dadd11340017513 hrs 48 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.0011256
0xd3963845515d6245cd5c397d2f56d0bd2a9b7cebea1ea59c53ada699470a15f7340016913 hrs 49 mins ago0x6b57b1328e332b36e2273a31142ef989bfbec11d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338338
0x55bbc5cf7bc992498ef4f5d538f8472e641607d1e31dbca12ecac925065bdeb4340000214 hrs 30 mins ago0x9603a0350abf17cf08bb27ba4b38219c6b5c8f6b  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.00084068
0xa4bfdf0bd94a1dec53a5a011d5d516b1f32af11b52704d6d66f3259074b26891339850220 hrs 18 mins ago0x740710a34eb775351a97f5287c2a5dffdb08fa4d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338478
0x5797e733e0c3b8cd0adcded4808b0d7bd83e255817978e592371e769b243070d339849320 hrs 19 mins ago0x740710a34eb775351a97f5287c2a5dffdb08fa4d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338478
0xb1cb2655778dd16a67015623b864b43b0149a52de76c12f7ab0b9698f962aad4339849120 hrs 21 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.00112481
0xbe48725afdd7bd98545bbb79135105277a129c7dd96ad28c7db44d8e9ea81ee1339848720 hrs 21 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.005 Ether0.00338478
0x00c56b8b50f76a2ae09d8e605a6c43471553a99eaff2a69d61d35836c9a88a8c339848720 hrs 21 mins ago0x740710a34eb775351a97f5287c2a5dffdb08fa4d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.00401737
0xd5c416183ef7f6343c04d3ab93cf22f06a1e36b27930043b7eff7ac08923252d339847920 hrs 23 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.005 Ether0.00338478
0x95e17c6889c48307293f330fb8818433e6879fbcad2952749ae163f0af283b56339847720 hrs 24 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.00401548
0x7470678770cb5e9bf25800fc717ed7ac8e497bb200cc026cf18f8c77f9214ff4339847320 hrs 25 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0x5f3424c902a82afb8ffc8de94cddb87fec71441f56824f45876bfc40d3d4f3a3339846920 hrs 26 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0xa1ffc0af46b5d3f16c307dc30d408d33e54cebe159f225cd8bfc2e7f2cab54f5339846020 hrs 28 mins ago0x740710a34eb775351a97f5287c2a5dffdb08fa4d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338478
0x85ea4fd14a583c08baaad0e44b23c15c7b583c654ba161b061e6e7eaa115a901339846020 hrs 28 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0xd9c6d723b49cb83bbb456b6173cb5b1eeb8d71eb5d291583cb45908167584a11339845620 hrs 29 mins ago0x083578693315741b46295cc38f7ff219e1e3693c  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.001 Ether0.00338478
0x7bb858a0a40e8f2f1820f97f72fca0c048e51cdaecea6de5c1337c87a1bc8f71339844820 hrs 30 mins ago0x740710a34eb775351a97f5287c2a5dffdb08fa4d  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338478
0x08066a9f570d407bcae4a7681ff58567a40d00820112f3416f1afea21d93b254339780923 hrs 12 mins ago0x4f907e108d385fa11fd12ab4157bf178d8fda2d0  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670 Ether0.00400032
0xf2747182295cb3e298b307849c57cdf46d09e4899a320ba5def10c675fa4e8e1339780623 hrs 14 mins ago0x4f907e108d385fa11fd12ab4157bf178d8fda2d0  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338478
0xe4db349b56bc0b0ac11ce3df943b906d633246c86db611d969d2410e4fd694a833967681 day 3 hrs ago0xf46dcf63b73b1ac4d4ed98939ea1b348cdb6f3b0  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.01 Ether0.00338338
0xe8825b8574567d7989ff60e3d4d5841aa3fe292ae3b7e288f0e30deffd0a4b4933967501 day 3 hrs ago0xf46dcf63b73b1ac4d4ed98939ea1b348cdb6f3b0  IN   0x1cce39da85ff2d5ceae92a810447b52df13f92670.0002 Ether0.00338478

[Download: CSV Export ]    
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns from a total of 242 View All
ParentTxHash Block Age From To Value
0x6311d59c801d18ff075d8d91ae28ef5e2bf7736f7fdf7304c997e181f2c078ab340069711 hrs 47 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x6b57b1328e332b36e2273a31142ef989bfbec11d0.0025 Ether
0xf90e3cb4d372e407f59341352b96cf1d497a5a28f2f9005627d3fcf5a4dadd11340017513 hrs 48 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x6b57b1328e332b36e2273a31142ef989bfbec11d0.001 Ether
0xb1cb2655778dd16a67015623b864b43b0149a52de76c12f7ab0b9698f962aad4339849120 hrs 21 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x083578693315741b46295cc38f7ff219e1e3693c0.01 Ether
0x00c56b8b50f76a2ae09d8e605a6c43471553a99eaff2a69d61d35836c9a88a8c339848720 hrs 21 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x740710a34eb775351a97f5287c2a5dffdb08fa4d0.01 Ether
0x95e17c6889c48307293f330fb8818433e6879fbcad2952749ae163f0af283b56339847720 hrs 24 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x083578693315741b46295cc38f7ff219e1e3693c0.001 Ether
0x08066a9f570d407bcae4a7681ff58567a40d00820112f3416f1afea21d93b254339780923 hrs 12 mins ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x4f907e108d385fa11fd12ab4157bf178d8fda2d00.01 Ether
0x68bced5889542da72f7f4f46090a90283fdd7ec2983c7f67769474af2d6ee48333967481 day 3 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670xf46dcf63b73b1ac4d4ed98939ea1b348cdb6f3b00.0002 Ether
0x09a4f28b994582b238fb3c599de515882d71c0f48b5ba85e7f6a7c8e45ab276933967421 day 3 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670xf46dcf63b73b1ac4d4ed98939ea1b348cdb6f3b00.0001 Ether
0x447acde774bea89b8a38b4d545ec6d8185578e2e18c9c17d918d77d1bdf5376633948811 day 10 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0x277483e20daffa6470101790511c17627bfbf19668898f8bb56d03ba869a918433948741 day 10 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x3aaf4324f83f5e0e802feb7dfbefae0ddc688e4db32d8c18642f42ef00dc79ff33948531 day 10 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x028f44c311bcd034560180bb2cd9a957ba19f982eef826252188a9dde7e3398333948451 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x1b948ba42305daf73ae5fc21c7da5213e66af04288cb63b5a83c8c849e68051d33948331 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x5d0e35d21279bfbca4aa6db878c625dd00294a293ae82648f8126cfb4b2e4dab33948001 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0xe631624a9ad2bf02af12c6ba56682e3107100fcab74febd050ae1b21cb6f163733947431 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0x520e6025d8838c97adc54f4866335ecd54e9f877fe81dcba87018f7041b7b74133947231 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0xba1970c4b3611e286fb3a44ddf138bbbaaae7a3122b1565ecd1e4b0b86feb51733947141 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0xd7fef9f396eb590e506b83b9ed42e46f687623a10f868b18d00b2f88ecb9aa5433947111 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x672e678c22240d953bede0787527e7d6b6448574be073de8e2a2d30570f5120733946921 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.02 Ether
0xf35fe9c9fa392562c43a29fdbb49256e52c250a1530662939c1b61b77e901af333946681 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x45d7eba2bf39597f864cb6a3eeb4a6ed177601b417b02d2604941eed1923d52733946551 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.015 Ether
0x914c662b1b64db09ec8dcc1d1788bca7c4e479c0208d51be370693af04747d8133946451 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x834ac25342ba1e8885a7f5f41fe10e1eccc76cf8b80b3d96a4ffc578ede91bf333946231 day 11 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670x94f816b6997b37be22fe7c543b7eb6585cfb41f10.01 Ether
0x5c78b08c5ccc6ffb155866d9f8bebe5c970c95ccc3754047f34ca5c5aea4d0ad33943691 day 12 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670xbe630f4a2361ea414bfa1c900ff7bf9d9e6192a30.005 Ether
0x5eda6067cc4f52804b8d250df43b465affea9323aeee3477821fa1b7e77fb14633943581 day 12 hrs ago0x1cce39da85ff2d5ceae92a810447b52df13f92670xbe630f4a2361ea414bfa1c900ff7bf9d9e6192a30.005 Ether
Contract Source Code Verified
Contract Name: blackjack
Compiler Version: v0.4.10+commit.f0d539ae
Optimization Enabled: Yes
Online Solidity Editor:  Click To View



  Contract Source Code   Find Similiar Contracts
/**
 * Early prototype of the Edgeless Black Jack contract. 
 * Allows an user to initialize a round of black jack, withdraw the win in case he won or both on the same time,
 * while verifying the game data.
 * author: Julia Altenried
 **/
pragma solidity ^0.4.10;

contract owned {
  address public owner; 
  modifier onlyOwner {
      if (msg.sender != owner)
          throw;
      _;
  }
  function owned() { owner = msg.sender; }
  function changeOwner(address newOwner) onlyOwner{
    owner = newOwner;
  }
}

contract mortal is owned{
  function close() onlyOwner {
        selfdestruct(owner);
    }
}
contract blackjack is mortal {
  struct Game {
    /** the game id is used to reference the game **/
    uint id;
    /** the hash of the (partial) deck **/
    bytes32 deck;
    /** the hash of the casino seed used for randomness generation and deck-hashing**/
    bytes32 seed;
    /** the player address **/
    address player;
    /** the bet **/
    uint bet;
    /** the timestamp of the start of the game, game ends automatically after certain time interval passed **/
    uint start;
  }

  /** the value of the cards: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K . Ace can be 1 or 11, of course. 
   *   the value of a card can be determined by looking up cardValues[cardId%13]**/
  uint8[13] cardValues = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10];

  /** use the game id to reference the games **/
  mapping(uint => Game) games;
  /** the minimum bet**/
  uint public minimumBet;
  /** the maximum bet **/
  uint public maximumBet;
  /** the address which signs the number of cards dealt **/
  address public signer;
  
  /** notify listeners that a new round of blackjack started **/
  event NewGame(uint indexed id, bytes32 deck, bytes32 srvSeed, bytes32 cSeed, address player, uint bet);
  /** notify listeners of the game outcome **/
  event Result(uint indexed id, address player, uint win);
  /** notify listeners that an error occurred**/
  event Error(uint errorCode);

  /** constructur. initialize the contract with a minimum bet and a signer address. **/
  function blackjack(uint minBet, uint maxBet, address signerAddress) payable{
    minimumBet = minBet;
    maximumBet = maxBet;
    signer = signerAddress;
  }

  /** 
   *   initializes a round of blackjack with an id, the hash of the (partial) deck and the hash of the server seed. 
   *   accepts the bet.
   *   throws an exception if the bet is too low or a game with the given id already exists.
   **/
  function initGame(uint id, bytes32 deck, bytes32 srvSeed, bytes32 cSeed) payable {
    //throw if bet is too low or too high
    if (msg.value < minimumBet || msg.value > maximumBet) throw;
    //throw if user could not be paiud out in case of suited blackjack
    if (msg.value * 3 > address(this).balance) throw;
    _initGame(id, deck, srvSeed, cSeed, msg.value);
  }

  /** 
   * first checks if deck and the player's number of cards are correct, then checks if the player won and if so, sends the win.
   **/
  function stand(uint gameId, uint8[] deck, bytes32 seed, uint8 numCards, uint8 v, bytes32 r, bytes32 s) {
    uint win = _stand(gameId,deck,seed,numCards,v,r,s, true);
  }
  
  /**
  *   first stands, then inits a new game with only one transaction
  **/
  function standAndRebet(uint oldGameId, uint8[] oldDeck, bytes32 oldSeed, uint8 numCards, uint8 v, bytes32 r, bytes32 s, uint newGameId, bytes32 newDeck, bytes32 newSrvSeed, bytes32 newCSeed){
    uint win = _stand(oldGameId,oldDeck,oldSeed,numCards,v,r,s, false);
    uint bet = games[oldGameId].bet;
    if(win >= bet){
      _initGame(newGameId, newDeck, newSrvSeed, newCSeed, bet);
      win-=bet;
    }
    if(win>0 && !msg.sender.send(win)){//pay the rest
      throw;
    }
  }
  
  /** 
   *   internal function to initialize a round of blackjack with an id, the hash of the (partial) deck, 
   *   the hash of the server seed and the bet. 
   **/
  function _initGame(uint id, bytes32 deck, bytes32 srvSeed, bytes32 cSeed, uint bet) internal{
    //throw if game with id already exists. later maybe throw only if game with id is still running
    if (games[id].player != 0x0) throw;
    games[id] = Game(id, deck, srvSeed, msg.sender, bet, now);
    NewGame(id, deck, srvSeed, cSeed, msg.sender, bet);
  }
  
  /**
  * first checks if deck and the player's number of cards are correct, then checks if the player won and if so, calculates the win.
  **/
  function _stand(uint gameId, uint8[] deck, bytes32 seed, uint8 numCards, uint8 v, bytes32 r, bytes32 s, bool payout) internal returns(uint win){
    Game game = games[gameId];
    uint start = game.start;
    game.start = 0; //make sure outcome isn't determined a second time while win payment is still pending -> prevent double payout
    if(msg.sender!=game.player){
      Error(1);
      return 0;
    }
    if(!checkDeck(gameId, deck, seed)){
      Error(2);
      return 0;
    }
    if(!checkNumCards(gameId, numCards, v, r, s)){
      Error(3);
      return 0;
    }
    if(start + 1 hours < now){
      Error(4);
      return 0;
    }
    
    win = determineOutcome(gameId, deck, numCards);
    if (payout && win > 0 && !msg.sender.send(win)){
      Error(5);
      game.start = start;
      return 0;
    }
    Result(gameId, msg.sender, win);
  }
  
  /**
  * check if deck and casino seed are correct.
  **/
  function checkDeck(uint gameId, uint8[] deck, bytes32 seed) constant returns (bool correct){
    if(sha3(seed) != games[gameId].seed) return false;
    if(sha3(convertToBytes(deck), seed) != games[gameId].deck) return false;
    return true;
  }
  
  function convertToBytes(uint8[] byteArray) returns (bytes b){
    b = new bytes(byteArray.length);
    for(uint8 i = 0; i < byteArray.length; i++)
      b[i] = byte(byteArray[i]);
  }
  
  /**
  * check if user and casino agree on the number of cards
  **/
  function checkNumCards(uint gameId, uint8 numCards, uint8 v, bytes32 r, bytes32 s) constant returns (bool correct){
    bytes32 msgHash = sha3(gameId,numCards);
    return ecrecover(msgHash, v, r, s) == signer;
  }

  /**
   * determines the outcome of a game and returns the win. 
   * in case of a loss, win is 0.
   **/
  function determineOutcome(uint gameId, uint8[] cards, uint8 numCards) constant returns(uint win) {
    uint8 playerValue = getPlayerValue(cards, numCards);
    //bust if value > 21
    if (playerValue > 21) return 0;

    var (dealerValue, dealerBJ) = getDealerValue(cards, numCards);

    //player wins
    if (playerValue == 21 && numCards == 2 && !dealerBJ){ //player blackjack but no dealer blackjack
      if(isSuited(cards[0], cards[2]))
        return games[gameId].bet * 3; //pay 2 to 1
      else
        return games[gameId].bet * 5 / 2; 
    }
    else if(playerValue == 21 && numCards == 5) //automatic win on 5-card 21
      return games[gameId].bet * 2;
    else if (playerValue > dealerValue || dealerValue > 21)
      return games[gameId].bet * 2;
    //tie
    else if (playerValue == dealerValue)
      return games[gameId].bet;
    //player loses
    else
      return 0;

  }

  /**
   *   calculates the value of a player's hand.
   *   cards: holds the (partial) deck.
   *   numCards: the number of cards the player holds
   **/
  function getPlayerValue(uint8[] cards, uint8 numCards) constant internal returns(uint8 playerValue) {
    //player receives first and third card and  all further cards after the 4. until he stands 
    //determine value of the player's hand
    uint8 numAces;
    uint8 card;
    for (uint8 i = 0; i < numCards + 2; i++) {
      if (i != 1 && i != 3) { //1 and 3 are dealer cards
        card = cards[i] %13;
        playerValue += cardValues[card];
        if (card == 0) numAces++;
      }

    }
    while (numAces > 0 && playerValue > 21) {
      playerValue -= 10;
      numAces--;
    }
  }


  /**
   *   calculates the value of a dealer's hand.
   *   cards: holds the (partial) deck.
   *   numCards: the number of cards the player holds
   **/
  function getDealerValue(uint8[] cards, uint8 numCards) constant internal returns(uint8 dealerValue, bool bj) {
    
    //dealer always receives second and forth card
    uint8 card  = cards[1] % 13;
    uint8 card2 = cards[3] % 13;
    dealerValue = cardValues[card] + cardValues[card2];
    uint8 numAces;
    if (card == 0) numAces++;
    if (card2 == 0) numAces++;
    if (dealerValue > 21) { //2 aces,count as 12
      dealerValue -= 10;
      numAces--;
    }
    else if(dealerValue==21){
      return (21, true);
    }
    //take cards until value reaches 17 or more. 
    uint8 i;
    while (dealerValue < 17) {
      card = cards[numCards + i + 2] % 13 ;
      dealerValue += cardValues[card];
      if (card == 0) numAces++;
      if (dealerValue > 21 && numAces > 0) {
        dealerValue -= 10;
        numAces--;
      }
      i++;
    }
  }
  
  /** determines if two cards have the same color **/
  function isSuited(uint8 card1, uint8 card2) internal returns(bool){
    return card1/13 == card2/13;
  }
  
  /** the fallback function can be used to send ether to increase the casino bankroll **/
  function() payable onlyOwner{
  }
  
  /** allows the owner to withdraw funds **/
  function withdraw(uint amount) onlyOwner{
    if(amount < address(this).balance)
      if(!owner.send(amount))
        Error(6);
  }
  
  /** allows the owner to change the signer address **/
  function setSigner(address signerAddress) onlyOwner{
    signer = signerAddress;
  }
  
  /** allows the owner to change the minimum bet **/
  function setMinimumBet(uint newMin) onlyOwner{
    minimumBet = newMin;
  }
  
  /** allows the owner to change the mximum **/
  function setMaximumBet(uint newMax) onlyOwner{
    minimumBet = newMax;
  }
}

  Contract ABI  
[{"constant":false,"inputs":[{"name":"gameId","type":"uint256"},{"name":"deck","type":"uint8[]"},{"name":"seed","type":"bytes32"},{"name":"numCards","type":"uint8"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"stand","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"deck","type":"bytes32"},{"name":"srvSeed","type":"bytes32"},{"name":"cSeed","type":"bytes32"}],"name":"initGame","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"newMax","type":"uint256"}],"name":"setMaximumBet","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maximumBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"signer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"byteArray","type":"uint8[]"}],"name":"convertToBytes","outputs":[{"name":"b","type":"bytes"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"oldGameId","type":"uint256"},{"name":"oldDeck","type":"uint8[]"},{"name":"oldSeed","type":"bytes32"},{"name":"numCards","type":"uint8"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"},{"name":"newGameId","type":"uint256"},{"name":"newDeck","type":"bytes32"},{"name":"newSrvSeed","type":"bytes32"},{"name":"newCSeed","type":"bytes32"}],"name":"standAndRebet","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"close","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"signerAddress","type":"address"}],"name":"setSigner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newMin","type":"uint256"}],"name":"setMinimumBet","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"gameId","type":"uint256"},{"name":"cards","type":"uint8[]"},{"name":"numCards","type":"uint8"}],"name":"determineOutcome","outputs":[{"name":"win","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minimumBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"gameId","type":"uint256"},{"name":"numCards","type":"uint8"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"checkNumCards","outputs":[{"name":"correct","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"gameId","type":"uint256"},{"name":"deck","type":"uint8[]"},{"name":"seed","type":"bytes32"}],"name":"checkDeck","outputs":[{"name":"correct","type":"bool"}],"payable":false,"type":"function"},{"inputs":[{"name":"minBet","type":"uint256"},{"name":"maxBet","type":"uint256"},{"name":"signerAddress","type":"address"}],"payable":true,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"deck","type":"bytes32"},{"indexed":false,"name":"srvSeed","type":"bytes32"},{"indexed":false,"name":"cSeed","type":"bytes32"},{"indexed":false,"name":"player","type":"address"},{"indexed":false,"name":"bet","type":"uint256"}],"name":"NewGame","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"player","type":"address"},{"indexed":false,"name":"win","type":"uint256"}],"name":"Result","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"errorCode","type":"uint256"}],"name":"Error","type":"event"}]

  Contract Creation Code Switch To Opcodes View
610200604052600b60609081526002608052600360a052600460c052600560e052600661010052600761012052600861014052600961016052600a6101808190526101a08190526101c08190526101e05261005e90600190600d6100ca565b50604051606080620013878339810160409081528151602083015191909201515b5b60008054600160a060020a03191633600160a060020a03161790555b6003839055600482905560058054600160a060020a031916600160a060020a0383161790555b505050610182565b60018301918390821561014d5791602002820160005b8382111561011e57835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026100e0565b801561014b5782816101000a81549060ff021916905560010160208160000104928301926001030261011e565b505b5061015992915061015d565b5090565b61017f91905b8082111561015957805460ff19168155600101610163565b5090565b90565b6111f580620001926000396000f300606060405236156100d55763ffffffff60e060020a6000350416630140e35981146100fb57806311d87c4e1461016b57806320ae205914610181578063227cade514610196578063238ac933146101b85780632dab7ee2146101e45780632e1a7d4d146102b7578063306ae57b146102cc57806343d726d6146103545780636c19e783146103665780638772ae3c146101815780638da5cb5b146103995780639ddae7f5146103c5578063a6f9dae11461042d578063c38a8afd1461044b578063cc87ed821461046d578063ec9c677d146104a6575b6100f95b60005433600160a060020a039081169116146100f55760006000fd5b5b5b565b005b341561010357fe5b6040805160248035600481810135602081810286810182019097528186526100f9968335969395604495019291829190850190849080828437509496505084359460ff60208201358116955060408201351693506060810135925060800135905061050d565b005b6100f960043560243560443560643561052d565b005b341561018957fe5b6100f9600435610578565b005b341561019e57fe5b6101a661059e565b60408051918252519081900360200190f35b34156101c057fe5b6101c86105a4565b60408051600160a060020a039092168252519081900360200190f35b34156101ec57fe5b6102376004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506105b395505050505050565b60408051602080825283518183015283519192839290830191850190808383821561027d575b80518252602083111561027d57601f19909201916020918201910161025d565b505050905090810190601f1680156102a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102bf57fe5b6100f9600435610663565b005b34156102d457fe5b6040805160248035600481810135602081810286810182019097528186526100f9968335969395604495019291829190850190849080828437509496505084359460ff6020820135811695506040820135169350606081013592506080810135915060a08101359060c08101359060e08101359061010001356106e8565b005b341561035c57fe5b6100f961077b565b005b341561036e57fe5b6100f9600160a060020a03600435166107a8565b005b341561018957fe5b6100f9600435610578565b005b34156103a157fe5b6101c8610817565b60408051600160a060020a039092168252519081900360200190f35b34156103cd57fe5b6040805160248035600481810135602081810286810182019097528186526101a6968335969395604495019291829190850190849080828437509496505050923560ff169250610826915050565b60408051918252519081900360200190f35b341561043557fe5b6100f9600160a060020a03600435166109ae565b005b341561045357fe5b6101a66109f7565b60408051918252519081900360200190f35b341561047557fe5b61049260043560ff602435811690604435166064356084356109fd565b604080519115158252519081900360200190f35b34156104ae57fe5b604080516024803560048181013560208181028681018201909752818652610492968335969395604495019291829190850190849080828437509496505093359350610aad92505050565b604080519115158252519081900360200190f35b6000610520888888888888886001610b75565b90505b5050505050505050565b60035434108061053e575060045434115b156105495760006000fd5b30600160a060020a0316313460030211156105645760006000fd5b6105718484848434610d52565b5b50505050565b60005433600160a060020a039081169116146105945760006000fd5b60038190555b5b50565b60045481565b600554600160a060020a031681565b6105bb611197565b600082516040518059106105cc5750595b908082528060200260200182016040525b509150600090505b82518160ff16101561065c57828160ff1681518110151561060257fe5b9060200190602002015160f860020a02828260ff1681518110151561062357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b6001016105e5565b5b50919050565b60005433600160a060020a0390811691161461067f5760006000fd5b30600160a060020a03163181101561059a5760008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050151561059a57604080516006815290516000805160206111aa8339815191529181900360200190a15b5b5b5b50565b600060006106fd8d8d8d8d8d8d8d6000610b75565b60008e815260026020526040902060040154909250905080821061072e576107288686868685610d52565b80820391505b6000821180156107605750604051600160a060020a0333169083156108fc029084906000818181858888f19350505050155b1561076b5760006000fd5b5b50505050505050505050505050565b60005433600160a060020a039081169116146107975760006000fd5b600054600160a060020a0316ff5b5b565b60005433600160a060020a039081169116146107c45760006000fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a039081169116146105945760006000fd5b60038190555b5b50565b600054600160a060020a031681565b60006000600060006108388686610ec2565b925060158360ff16111561084f57600093506109a0565b6108598686610fa3565b915091508260ff16601514801561087357508460ff166002145b801561087d575080155b15610903576108bc86600081518110151561089457fe5b906020019060200201518760028151811015156108ad57fe5b9060200190602002015161116d565b156108dd5760008781526002602052604090206004015460030293506109a0565b6000878152600260208190526040909120600401546005025b0493506109a0565b6109a0565b8260ff16601514801561091957508460ff166005145b1561093b576000878152600260208190526040909120600401540293506109a0565b8160ff168360ff161180610952575060158260ff16115b15610974576000878152600260208190526040909120600401540293506109a0565b8160ff168360ff16141561099b5760008781526002602052604090206004015493506109a0565b600093505b5b5b5b5b5050509392505050565b60005433600160a060020a039081169116146109ca5760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60035481565b6040805186815260f860020a60ff8088169190910260208084019190915283519283900360210183206005546000858152858401875294860185905285518281529389168484015283860188905260608401879052945193949093600160a060020a03909116926001926080808301939192601f19830192908190039091019088866161da5a03f11515610a8d57fe5b505060206040510351600160a060020a03161491505b5095945050505050565b600083815260026020818152604080842090920154825185815292519283900390910190912014610ae057506000610b6e565b600084815260026020526040902060010154610afb846105b3565b836040518083805190602001908083835b60208310610b2b5780518252601f199092019160209182019101610b0c565b51815160209384036101000a60001901801990921691161790529201938452506040519283900301909120929092149150610b6a905057506000610b6e565b5060015b9392505050565b600088815260026020526040812060058101805490839055600382015433600160a060020a03908116911614610bd057604080516001815290516000805160206111aa8339815191529181900360200190a160009250610d44565b610bdb8b8b8b610aad565b1515610c0c57604080516002815290516000805160206111aa8339815191529181900360200190a160009250610d44565b610c198b898989896109fd565b1515610c4a57604080516003815290516000805160206111aa8339815191529181900360200190a160009250610d44565b4281610e10011015610c8157604080516004815290516000805160206111aa8339815191529181900360200190a160009250610d44565b610c8c8b8b8a610826565b9250838015610c9b5750600083115b8015610cc95750604051600160a060020a0333169084156108fc029085906000818181858888f19350505050155b15610d0057604080516005815290516000805160206111aa8339815191529181900360200190a16005820181905560009250610d44565b60408051600160a060020a03331681526020810185905281518d927f8179c2b3f821111bf4c1ddac0be4fccdfff2e27c0ccf99a67d130888bd0e55df928290030190a25b505098975050505050505050565b600085815260026020526040902060030154600160a060020a031615610d785760006000fd5b60c060405190810160405280868152602001856000191681526020018460001916815260200133600160a060020a03168152602001828152602001428152506002600087815260200190815260200160002060008201518160000155602082015181600101906000191690556040820151816002019060001916905560608201518160030160006101000a815481600160a060020a030219169083600160a060020a031602179055506080820151816004015560a08201518160050155905050847f1e9d2d28c1d972d03a7b3e86ea362077ec7c228f102930285148990e16226d4c85858533866040518086600019166000191681526020018560001916600019168152602001846000191660001916815260200183600160a060020a0316600160a060020a031681526020018281526020019550505050505060405180910390a25b5050505050565b60008080805b8460020160ff168160ff161015610f6a578060ff16600114158015610ef157508060ff16600314155b15610f6057600d868260ff16815181101515610f0957fe5b9060200190602002015160ff16811515610f1f57fe5b069150600160ff8316600d8110610f3257fe5b602091828204019190065b9054906101000a900460ff16840193508160ff1660001415610f60576001909201915b5b5b600101610ec8565b5b60008360ff16118015610f81575060158460ff16115b15610f99576009199093019260001990920191610f6b565b5b50505092915050565b600060006000600060006000600d886001815181101515610fc057fe5b9060200190602002015160ff16811515610fd657fe5b069350600d886003815181101515610fea57fe5b9060200190602002015160ff1681151561100057fe5b069250600160ff8416600d811061101357fe5b602091828204019190065b9054906101000a900460ff1660018560ff16600d8110151561103c57fe5b602091828204019190065b9054906101000a900460ff160195508360ff1660001415611069576001909101905b60ff8316151561107a576001909101905b60158660ff1611156110995760091990950194600019909101906110b2565b8560ff16601514156110b2576015955060019450611161565b5b5b60118660ff16101561116157600d8882890160020160ff168151811015156110d857fe5b9060200190602002015160ff168115156110ee57fe5b069350600160ff8516600d811061110157fe5b602091828204019190065b9054906101000a900460ff16860195508360ff166000141561112f576001909101905b60158660ff16118015611145575060008260ff16115b156111595760091990950194600019909101905b6001016110b2565b5b505050509250929050565b6000600d60ff83165b0460ff16600d8460ff1681151561118957fe5b0460ff161490505b92915050565b6040805160208101909152600081529056002e36a7093f25f22bd4cbdeb6040174c3ba4c5fe8f1abc04e7c3c48f26c7413e0a165627a7a72305820cac2632f28f82ceb5df1285bdf6adaaec264400abb90ffe53371898a2f8576bb002900000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000655f6b94c85872383e669d976991bebba2066ecf

    Constructor Arguments (ABI-encoded and appended to the ByteCode above)
00000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000655f6b94c85872383e669d976991bebba2066ecf

-----Decoded View---------------
Found 3 constructor arguments :
Arg [0] : 00000000000000000000000000000000000000000000000000005af3107a4000
Arg [1] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [2] : 000000000000000000000000655f6b94c85872383e669d976991bebba2066ecf


   Swarm Source:
bzzr://cac2632f28f82ceb5df1285bdf6adaaec264400abb90ffe53371898a2f8576bb
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward