Example #1
0
        //[{"type":"Hash160","value":"0xf621168b1fce3a89c33a5f6bcf7e774b4657031c"},{"type":"PublicKey","value":"0222d8515184c7d62ffa99b829aeb4938c4704ecb0dd7e340e842e9df121826343"}]
        public static void NeoCall(UInt160 account, ECPoint publicKey)
        {
            OnNotify(NEO.Name);

            OnNotify(NEO.Symbol);

            OnNotify(NEO.Decimals);

            OnNotify(NEO.TotalSupply());

            OnNotify(NEO.BalanceOf(account));

            OnNotify(NEO.UnclaimedGas(account, Blockchain.GetHeight()));

            OnNotify(NEO.GetCandidates());

            OnNotify(NEO.GetCommittee());

            OnNotify(NEO.GetNextBlockValidators());

            OnNotify(NEO.RegisterCandidate(publicKey));

            OnNotify(NEO.UnregisterCandidate(publicKey));

            OnNotify(NEO.Vote(account, publicKey));

            OnNotify(NEO.Transfer((UInt160)account, Owner, 1000));

            OnNotify(NEO.GetGasPerBlock());

            OnNotify(NEO.SetGasPerBlock(300000000));

            OnNotify(NEO.GetGasPerBlock());
        }
Example #2
0
        private static bool CheckCommittee()
        {
            ECPoint[] committees            = NEO.GetCommittee();
            UInt160   committeeMultiSigAddr = Contract.CreateMultisigAccount(committees.Length - (committees.Length - 1) / 2, committees);

            return(Runtime.CheckWitness(committeeMultiSigAddr));
        }
Example #3
0
        public static void Run()
        {
            while (true)
            {
                try
                {
                    //BTC.Do();
                    BCH.Do();
                    ETH.Do();
                    ETC.Do();
                    LTC.Do();

                    EOS.Do();
                    XRP.Do();
                    OMG.Do();
                    DASH.Do();
                    ZEC.Do();
                    Thread.Sleep(1000 * 5);

                    // 创新
                    ITC.Do();
                    NAS.Do();
                    RUFF.Do();
                    ZIL.Do();
                    DTA.Do();
                    Thread.Sleep(1000 * 5);

                    LET.Do();
                    HT.Do();
                    THETA.Do();
                    HSR.Do();
                    QTUM.Do();
                    Thread.Sleep(1000 * 5);

                    SNT.Do();
                    IOST.Do();
                    NEO.Do();
                    STORJ.Do();
                    GNT.Do();
                    Thread.Sleep(1000 * 5);

                    CVC.Do();
                    SMT.Do();
                    VEN.Do();
                    ELF.Do();
                    XEM.Do();
                    Thread.Sleep(1000 * 5);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Example #4
0
        protected override void OnPersist(ApplicationEngine engine)
        {
            base.OnPersist(engine);
            foreach (Transaction tx in engine.Snapshot.PersistingBlock.Transactions)
            {
                Burn(engine, tx.Sender, tx.SystemFee + tx.NetworkFee);
            }
            ECPoint[] validators = NEO.GetNextBlockValidators(engine.Snapshot);
            UInt160   primary    = Contract.CreateSignatureRedeemScript(validators[engine.Snapshot.PersistingBlock.ConsensusData.PrimaryIndex]).ToScriptHash();

            Mint(engine, primary, engine.Snapshot.PersistingBlock.Transactions.Sum(p => p.NetworkFee));
        }
Example #5
0
 internal override async ContractTask OnPersist(ApplicationEngine engine)
 {
     long totalNetworkFee = 0;
     foreach (Transaction tx in engine.PersistingBlock.Transactions)
     {
         await Burn(engine, tx.Sender, tx.SystemFee + tx.NetworkFee);
         totalNetworkFee += tx.NetworkFee;
     }
     ECPoint[] validators = NEO.GetNextBlockValidators(engine.Snapshot, engine.ProtocolSettings.ValidatorsCount);
     UInt160 primary = Contract.CreateSignatureRedeemScript(validators[engine.PersistingBlock.PrimaryIndex]).ToScriptHash();
     await Mint(engine, primary, totalNetworkFee, false);
 }
Example #6
0
        internal override void OnPersist(ApplicationEngine engine)
        {
            long totalNetworkFee = 0;

            foreach (Transaction tx in engine.PersistingBlock.Transactions)
            {
                Burn(engine, tx.Sender, tx.SystemFee + tx.NetworkFee);
                totalNetworkFee += tx.NetworkFee;
            }
            ECPoint[] validators = NEO.GetNextBlockValidators(engine.Snapshot);
            UInt160   primary    = Contract.CreateSignatureRedeemScript(validators[engine.PersistingBlock.ConsensusData.PrimaryIndex]).ToScriptHash();

            Mint(engine, primary, totalNetworkFee, false);
        }
Example #7
0
        protected override bool OnPersist(ApplicationEngine engine)
        {
            if (!base.OnPersist(engine))
            {
                return(false);
            }
            foreach (Transaction tx in engine.Snapshot.PersistingBlock.Transactions)
            {
                Burn(engine, tx.Sender, tx.SystemFee + tx.NetworkFee);
            }
            ECPoint[] validators = NEO.GetNextBlockValidators(engine.Snapshot);
            UInt160   primary    = Contract.CreateSignatureRedeemScript(validators[engine.Snapshot.PersistingBlock.ConsensusData.PrimaryIndex]).ToScriptHash();

            Mint(engine, primary, engine.Snapshot.PersistingBlock.Transactions.Sum(p => p.NetworkFee));
            BigInteger sys_fee = GetSysFeeAmount(engine.Snapshot, engine.Snapshot.PersistingBlock.Index - 1) + engine.Snapshot.PersistingBlock.Transactions.Sum(p => p.SystemFee);
            StorageKey key     = CreateStorageKey(Prefix_SystemFeeAmount, BitConverter.GetBytes(engine.Snapshot.PersistingBlock.Index));

            engine.Snapshot.Storages.Add(key, new StorageItem
            {
                Value      = sys_fee.ToByteArrayStandard(),
                IsConstant = true
            });
            return(true);
        }
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            var neos = await Data.Data.GetNEOs();

            var minDistance = neos.Min(neo => neo.CloseApproaches.First().MissDistance.Kilometers);
            var maxDistance = neos.Max(neo => neo.CloseApproaches.First().MissDistance.Kilometers);

            var minDiameter = neos.Min(neo => neo.EstimatedDiameter.Kilometers.EstimatedDiameterMin);
            var maxDiameter = neos.Max(neo => neo.EstimatedDiameter.Kilometers.EstimatedDiameterMax);

            foreach (var item in neos)
            {
                var neo = new NEO()
                {
                    Distance = (item.CloseApproaches.First().MissDistance.Kilometers - minDistance) / (maxDistance - minDistance),
                    Diameter = (item.EstimatedDiameter.Kilometers.EstimatedDiameterMin - minDiameter) / (maxDiameter - minDiameter),
                    Label    = item.Name,
                    Item     = item
                };
                Items.Add(neo);
            }

            Visualizer.ItemsSource = Items;
        }
 public static bool NEO_Transfer(UInt160 from, UInt160 to, BigInteger amount)
 {
     return(NEO.Transfer(from, to, amount, null));
 }
Example #10
0
        protected bool CheckCommittee(ApplicationEngine engine)
        {
            UInt160 committeeMultiSigAddr = NEO.GetCommitteeAddress(engine.Snapshot);

            return(engine.CheckWitnessInternal(committeeMultiSigAddr));
        }
 public static BigInteger NEO_UnclaimedGas(UInt160 account, uint end)
 {
     return(NEO.UnclaimedGas(account, end));
 }
Example #12
0
 public static BigInteger NEO_BalanceOf(byte[] account)
 {
     return(NEO.BalanceOf(account));
 }
Example #13
0
 public static string NEO_Name()
 {
     return(NEO.Name());
 }
Example #14
0
 public static int NEO_Decimals()
 {
     return((int)NEO.Decimals());
 }
 public static BigInteger NEO_BalanceOf(UInt160 account)
 {
     return(NEO.BalanceOf(account));
 }
Example #16
0
 public static string[] NEO_GetValidators()
 {
     return(NEO.GetValidators());
 }
 public static BigInteger NEO_GetGasPerBlock()
 {
     return(NEO.GetGasPerBlock());
 }
Example #18
0
 public static bool NEO_RegisterCandidate(byte[] pubkey)
 {
     return(NEO.RegisterCandidate(pubkey));
 }
 public static bool NEO_RegisterCandidate(ECPoint pubkey)
 {
     return(NEO.RegisterCandidate(pubkey));
 }
Example #20
0
 public static object NEO_GetAccountState(UInt160 account)
 {
     return(NEO.GetAccountState(account));
 }