Example #1
0
        public IEnumerator selectWinners(List <byte[]> submissions, List <BigInteger> distribution, BigInteger action, BigInteger start, BigInteger duration, BigInteger review, BigInteger bounty, Async.EventDelegate onComplete = null)
        {
            WinnersData wData = new WinnersData()
            {
                Submissions = submissions, Distribution = distribution, Action = action
            };

            MatryxRound.RoundDetails rDetails = new MatryxRound.RoundDetails()
            {
                Start = start, Duration = duration, Review = review, Bounty = bounty
            };

            var transactionRequest = new TransactionSignedUnityRequest(NetworkSettings.infuraProvider, NetworkSettings.currentPrivateKey);

            yield return(transactionRequest.SignAndSendTransaction <SelectWinnersFunction>(new SelectWinnersFunction()
            {
                WData = wData, RDetails = rDetails, Gas = NetworkSettings.txGas, GasPrice = NetworkSettings.txGasPrice
            }, address));

            yield return(Utils.GetTransactionStatus(transactionRequest, "selectWinners", null));


            var getTransactionStatus = new Utils.CoroutineWithData <bool>(MatryxCortex.Instance, Utils.GetTransactionStatus(transactionRequest, "selectWinners", null));

            yield return(getTransactionStatus);

            yield return(getTransactionStatus.result);

            onComplete?.Invoke(getTransactionStatus.result);
        }
Example #2
0
        public IEnumerator updateNextRound(MatryxRound.RoundDetails newDetails, Async.EventDelegate onComplete = null)
        {
            var transactionRequest = new TransactionSignedUnityRequest(NetworkSettings.infuraProvider, NetworkSettings.currentPrivateKey);

            yield return(transactionRequest.SignAndSendTransaction <UpdateNextRoundFunction>(new UpdateNextRoundFunction()
            {
                RDetails = newDetails, Gas = NetworkSettings.txGas, GasPrice = NetworkSettings.txGasPrice
            }, address));

            var getTransactionStatus = new Utils.CoroutineWithData <bool>(MatryxCortex.Instance, Utils.GetTransactionStatus(transactionRequest, "updateNextRound", null));

            yield return(getTransactionStatus);

            yield return(getTransactionStatus.result);

            onComplete?.Invoke(getTransactionStatus.result);
        }
Example #3
0
        public MatryxTournament(string title, string description, string file, string category, BigInteger bounty, BigInteger entryFee, MatryxRound.RoundDetails roundDetails)
        {
            this.title       = title;
            this.description = description;
            this.file        = file;
            this.category    = category;
            this.bounty      = bounty;
            this.entryFee    = entryFee;

            rounds = new List <MatryxRound>();
            rounds.Add(new MatryxRound());
            rounds[0].Details = roundDetails;
        }