Overview
Implementation
Games
Verify
Games

Games

Case opening

Hashes of the concatenated server seed, client seed and nonce are used to generate an integer number between 1 and 10000000. The generated number is then compared with every item inside the case to find one which tickets range matches the generated value.

const maxTicket = 10000000;
const serverSeed = '';
const clientSeed = '';
const nonce = 1;

function roll() {
  const float = getFloats(serverSeed, clientSeed, nonce, 1)[0];
  
  // from 1 to 10000000
  return Math.floor(float * 10000000 + 1);
}

Case battles

Hashes of the concatenated server seed, eos block hash and round number with player's slot are used to generate an integer number between 1 and 10000000. The generated number is then compared with every item inside the case to find one which tickets range matches the generated value.

const serverSeed = '';
// we use mined eos block hash as our client seed
const eosBlockHash = '';
// first round is 1
const roundNum = 1;

// first slot is 0
function roll(slot: number) {
  const float = getFloats(serverSeed, eosBlockHash, `${roundNum}:${slot}`, 1)[0];
  
  // from 1 to 10000000
  return Math.floor(float * 10000000 + 1);
}

If two or more winning players at the end of the game have the same amount of items value, a tie happens and each of the gets assigned a unique number. The player with the highest tiebreaker number wins the battle with the exception of crazy mode where the lowest number is the winning one. In case of a team battle, a sum of individual player rolls is compared to determine the winning team.

const serverSeed = '';
// we use mined eos block hash as our client seed
const eosBlockHash = '';
// first round is 1, we use the last round number to generate the roll
const lastRoundNum = 1;

// first slot is 0
function roll(slot: number) {
  const float = getFloats(serverSeed, eosBlockHash, `${lastRoundNum}:${slot}:tie`, 1)[0];
  
  // from 1000 to 9999
  return Math.floor(float * (9999 - 1000 + 1) + 1000);
}

Upgrader

Hashes of the concatenated server seed, client seed and nonce are used to generate an integer number between 1 and 10000. The generated number is then used as the winning ticket.

const maxTicket = 10000;
const serverSeed = '';
const clientSeed = '';
const nonce = 1;

function roll() {
  const float = getFloats(serverSeed, clientSeed, nonce, 1)[0];
  
  // from 1 to 10000
  return Math.floor(float * 10000 + 1);
}

Double

Hashes of the concatenated server seed, public seed and round number are used to generate an integer number between 0 and 14. The generated number is then converted into the appropriate double symbol.

const betTypeRanges = {
  [DoubleBetTypeEnum.GREEN]: [0, 0],
  [DoubleBetTypeEnum.RED]: [1, 7],
  [DoubleBetTypeEnum.BLACK]: [8, 14],
  [DoubleBetTypeEnum.BAITBET_RED]: [3, 3],
  [DoubleBetTypeEnum.BAITBET_BLACK]: [12, 12],
};
const serverSeed = '';
const publicSeed = '';
const roundNumber = 1;

function roll() {
  const float = getFloats(serverSeed, publicSeed, roundNumber, 1)[0];
  
  // from 0 to 14
  return Math.floor(float * 15);
}

Table showing past 10 server seeds used for double. Then entry marked with red color is the current hashed server seed which will be unhashed only when the new one is generated.

Created at
Server seed
Rounds