Binary Market Smart Contract Module in Bunzz

The BinayMarket module for a Binary Game product allows players to bet on the price changes of a certain token in the given timeframe and win the reward.

You can access this Module and the code here: https://bit.ly/43BJ5Zx

How to Use Binary Market Contract

  1. Deploy the smart contract via Bunzz. When deploying, the deployer must set default values of the oracle, vault, marketName, timeframes, adminAddress, operatorAddress and minBetAmount.
  2. Admin can call setOracle, setName, setOperator, setTimeframes, setMinBetAmount and setAdmin functions to update those configuration variables of the Game.
  3. Operator can call genesisStartRound, genesisLockRound, executeRound and setPause functions to update those configuration variables.
  4. Users can call openPosition, claim and claimBatch functions to bet and receive the rewards of the game.
  5. Users can call getExecutableTimeframes, getUserRounds, getCurrentUserRoundNumber, isBettable, getUnderlyingToken, refundable, isClaimable and isNecessaryToExecute to query the current status of the game.

Functions

#WRITE

  • claim
  • claimBatch
  • executeRound
  • genesisLockRound
  • genesisStartRound
  • openPosition
  • setAdmin
  • setMinBetAmount
  • setName
  • setOperator
  • setOracle
  • setPause
  • setTimeframes

#READ

  • timeframes
  • underlyingToken
  • userRounds
  • vault
  • adminAddress
  • currentEpochs
  • genesisLockOnces
  • genesisStartBlockNumber
  • genesisStartBlockTimestamp
  • genesisStartOnce
  • getCurrentUserRoundNumber
  • getExecutableTimeframes
  • getUnderlyingToken
  • getUserRounds
  • isBettable
  • isClaimable
  • isNecessaryToExecute
  • ledger
  • marketName
  • minBetAmount
  • operatorAddress
  • oracle
  • oracleLatestRoundId
  • paused
  • refundable
  • rounds

You can access this Module and the code here: https://bit.ly/43BJ5Zx

If you still haven’t signed up to Bunzz, what are you waiting for?

Sign up here https://app.bunzz.dev/signup and get your smart contracts deployed in 5 minutes through our great GUI.

Share this article: