SHARE
TWEET

Untitled

a guest Sep 17th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function bet(uint stake, uint spinUnder)external notOwner returns (uint spinUnderInput, uint stakeInput, uint prize, uint payout, uint previousBalance){
  2.         require(stake >= minBet && maxBet >= stake , 'stake is outside allowed limits');
  3.         require(spinUnder >= MIN_ROLL_UNDER && spinUnder <= MAX_ROLL_UNDER, 'spinUnder must be between or equal to 11 and 91');
  4.         require(balances[msg.sender] >= stake, 'insufficient balance to cover stake');
  5.         (payout, prize) = getPrizeAndPayout(stake, spinUnder);
  6.         require(balances[owner] >=  (prize.sub(stake)), 'insufficient contract balance to cover the prize');
  7.         previousBalance = balances[msg.sender];
  8.         subtractAmountFromUser(stake);
  9.         uint QUERY_EXECUTION_DELAY = 0;
  10.         uint GAS_FOR_CALLBACK = 200000;
  11.         bytes32 queryId = provable_newRandomDSQuery(
  12.             QUERY_EXECUTION_DELAY,
  13.             NUM_RANDOM_BYTES_REQUESTED,
  14.             GAS_FOR_CALLBACK
  15.         );
  16.         ongoingBets[queryId] = Bet(spinUnder, stake, prize, payout, msg.sender);
  17.         emit logBetStarted(msg.sender, spinUnder, stake, prize, payout, previousBalance);
  18.         return (spinUnder, stake, prize, payout, previousBalance);
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top