Interface (ABI)

Copied!

Function Signatures

bb235d67: INVALID_RESULT_INDEX()
8aa14e43: QTUM_PERCENTAGE()
3381fc18: betFromOracle(address,uint8)
11f2a04d: calculateWinnings()
74513913: centralizedOracleSetResult(address,uint8,uint256)
4529fd93: decentralizedOracleFinalizeResult()
dee84d7e: decentralizedOracleSetResult(uint8,uint256)
1707490f: didWithdraw(address)
fe499d6e: eventName(uint256)
5979c6c5: eventResults(uint256)
871169b9: getBetBalances()
3c6e5310: getFinalResult()
a3cb679d: getTotalBets()
9a0e7d66: getTotalVotes()
95d3382a: getVoteBalances()
ca381d2e: numOfResults()
5b69a7d8: oracles(uint256)
8da5cb5b: owner()
0d4e8aed: resultIndex()
200d2ed2: status()
07e1df56: totalBotValue()
8030b87e: totalQtumValue()
f2fde38b: transferOwnership(address)
54fd4d50: version()
006a8a32: voteFromOracle(uint8,address,uint256)
cc42e83a: withdrawWinnings()

Event Hashes

event FinalResultSet(uint16 indexed _version, address indexed _eventAddress, uint8 _finalResultIndex)
14959b24f45a8f41b814b331ae09533db9d7e7962ca200e484f849a1fd1955aa

event WinningsWithdrawn(uint16 indexed _version, address indexed _winner, uint256 _qtumTokenWon, uint256 _botTokenWon)
2b37430897e8d659983fc8ae7ab83ad5b3be5a7db7ea0add5706731c2395f550

withdrawWinnings()

Winners of the event are allow to withdraw when finalizeResult() is called from the last DecentralizedOracle. This will withdraw both BOT and QTUM tokens to the Sender Address.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on SendTo sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to withdrawWinnings(cc42e83a)

  5. Set the Sender Address as the address withdrawing

  6. Click Send To Contract button

  7. Wait for the transaction to be mined

numOfResults()

Returns the number of Event results.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to numOfResults(ca381d2e)
  5. Click Call Contract button
  6. Returns:
    • uint8 is the number of Event results

status()

Returns the index of the current status of the Event.

0: Betting - first round of betting with QTUM
1: OracleVoting - subsequent rounds of voting with BOT
2: Collection - event is finished and winners can withdraw winnings
  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to status(200d2ed2)
  5. Click Call Contract button
  6. Returns:
    • uint8 is the index of the status

oracles()

Returns address of the Oracle and true/false indicating if the Oracle is finished.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to oracles(5b69a7d8)
  5. Set the uint256 of the index to get the the Oracle info
  6. Click Call Contract button
  7. Returns:
    • bool didSetResult is the flag indicating if it is finished
    • address oracleAddress is the Oracle's address

getBetBalances()

Returns an array of QTUM bet balances placed by the sender. Shows 10 values and each index is the total bet amount for that result index.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to getBetBalances(871169b9)
  5. Set the Sender Address of the address to get the balances of
  6. Click Call Contract button
  7. Returns:
    • uint256[10] is the array of QTUM bet balances shown in Satoshi

getVoteBalances()

Returns an array of BOT vote balances placed by the sender. Shows 10 values and each index is the total vote amount for that result index.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to getVoteBalances(95d3382a)
  5. Set the Sender Address of the address to get the balances of
  6. Click Call Contract button
  7. Returns:
    • uint256[10] is the array of BOT vote balances shown in Botoshi

totalQtumValue()

Returns the total QTUM value (in Satoshi) bet for all the results.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to totalQtumValue(8030b87e)
  5. Click Call Contract button
  6. Returns:
    • uint256 is the total Satoshi of the Event contract

totalBotValue()

Returns the total BOT value (in Botoshi) voted in all the Oracles.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to totalBotValue(07e1df56)
  5. Click Call Contract button
  6. Returns:
    • uint256 is the total Botoshi of the Event contract

calculateWinnings()

Returns the total BOT and QTUM you will receive. If the status is not in the collection state, it will return 0.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to calculateWinnings(11f2a04d)
  5. Set the Sender Address of the address to calculate
  6. Click Call Contract button
  7. Returns:
    • uint256 is the Botoshi you will receive when withdrawing
    • uint256 is the Satoshi you will receive when withdrawing

resultIndex()

Returns the current result index. If it returns 255, then none of the Oracles have set the result.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to resultIndex(0d4e8aed)
  5. Click Call Contract button
  6. Returns:
    • uint8 is the result index

getFinalResult()

Returns the final result index and true/false indicating if the result is finalized.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to getFinalResult(3c6e5310)
  5. Click Call Contract button
  6. Returns:
    • uint8 is the final result index
    • bool is the flag indicating the final result is valid

didWithdraw()

Returns true or false if the address has withdrew their winnings from the Event.

  1. Launch QT Wallet
  2. Click on Smart Contract tab, then click on Call sub tab
  3. Set the Contract Address and Interface (ABI)
  4. Set the Function to didWithdraw(1707490f)
  5. Set the hex address of the address you want to check in the address field
  6. Click Call Contract button
  7. Returns:
    • bool is the true/false indicating if that address has already withdrawn