function settleBet(uint[] combinationParameter, uint reveal) external {

        
        uint commit = uint(keccak256(abi.encodePacked(reveal)));

        
        Bet storage bet = bets[commit];

        
        require (bet.amount != 0);
        require (block.number <= bet.placeBlockNumber.add(BetExpirationBlocks));

        
        bytes32 _entropy = keccak256(
            abi.encodePacked(
                uint(
                    keccak256(
                        abi.encodePacked(
                            uint(
                                keccak256(
                                    abi.encodePacked(
                                        reveal,
                                        blockhash(combinationParameter[uint8(SettleParam.LuckySeed)])
                                    )
                                )
                            ),
                            blockhash(block.number)
                        )
                    )
                ),
                blockhash(block.timestamp)
            )
        );

         uint totalAmount = 0;
         uint totalTokenAmount = 0;
         uint totalJackpotWin = 0;
         (totalAmount,totalTokenAmount,totalJackpotWin) = runRotateTime(combinationParameter,_entropy,keccak256(abi.encodePacked(uint(_entropy), blockhash(combinationParameter[uint8(SettleParam.LuckySeed)]))));

        
        if (totalJackpotWin > 0 && combinationParameter[uint8(SettleParam.CurrencyType)] == 0) {

            emit JackpotBouns(bet.gambler,totalJackpotWin);
            totalAmount = totalAmount.add(totalJackpotWin);
            jackpotSize = uint128(jackpotSize.sub(totalJackpotWin));

        }else if (totalJackpotWin > 0 && combinationParameter[uint8(SettleParam.CurrencyType)] == 1) {

            
            emit TokenJackpotBouns(bet.gambler,totalJackpotWin);
            totalAmount = totalAmount.add(totalJackpotWin);
            tokenJackpotSize = uint128(tokenJackpotSize.sub(totalJackpotWin));
        }

        emit BetRelatedData(bet.gambler,bet.amount,totalAmount,_entropy,keccak256(abi.encodePacked(uint(_entropy), blockhash(combinationParameter[uint8(SettleParam.LuckySeed)]))),uint8(combinationParameter[uint8(SettleParam.Uplimit)]),uint8(combinationParameter[uint8(SettleParam.RotateTime)]));

        if (combinationParameter[uint8(SettleParam.CurrencyType)] == 0) {
             
            if (totalAmount != 0){
                sendFunds(bet.gambler, totalAmount , totalAmount);
            }

            
            if (totalTokenAmount != 0){

                if(ERC20(ERC20ContractAddres).balanceOf(address(this)) > 0){
                    ERC20(ERC20ContractAddres).transfer(bet.gambler, totalTokenAmount);
                    emit TokenPayment(bet.gambler, totalTokenAmount);
                }
            }
        }else if(combinationParameter[uint8(SettleParam.CurrencyType)] == 1){
              

            
            if (totalAmount != 0){
                if(ERC20(ERC20ContractAddres).balanceOf(address(this)) > 0){
                    ERC20(ERC20ContractAddres).transfer(bet.gambler, totalAmount);
                    emit TokenPayment(bet.gambler, totalAmount);
                }
            }
        }

                
        if (combinationParameter[uint8(SettleParam.CurrencyType)] == 0) {
                lockedInBets = lockedInBets.sub(combinationParameter[uint8(SettleParam.PossibleWinAmount)]);
        } else if (combinationParameter[uint8(SettleParam.CurrencyType)] == 1){
                lockedTokenInBets = lockedTokenInBets.sub(combinationParameter[uint8(SettleParam.PossibleWinAmount)]);
        }

        
        bet.amount = 0;

        
        if (uint16(combinationParameter[uint8(SettleParam.CurrencyType)]) == 0) {
            jackpotSize = jackpotSize.add(uint(combinationParameter[uint8(SettleParam.jackpotFee)]));
        }else if (uint16(combinationParameter[uint8(SettleParam.CurrencyType)]) == 1) {
            tokenJackpotSize = tokenJackpotSize.add(uint(combinationParameter[uint8(SettleParam.jackpotFee)]));
        }
    }