Jelajahi Sumber

заготовка

Rimmon 3 tahun lalu
induk
melakukan
257bf0c138
2 mengubah file dengan 21 tambahan dan 0 penghapusan
  1. 12 0
      Models/Blockchain.cs
  2. 9 0
      Models/SmartContract.cs

+ 12 - 0
Models/Blockchain.cs

@@ -144,6 +144,18 @@ namespace HyperCube.Models
             return $"{name} {url}:{port}";
         }
 
+        public async Task ChangeOwner(string ERC20Address, string contractAddress)            
+        {
+            TransactionObject transObj = new TransactionObject();
+            transObj.from = address;
+            transObj.to = ERC20Address;// "0xe5D682717955d6C35d465A3485625C64655a04f4";
+            transObj.gas = "9000";
+            transObj.value = contractAddress;
+            transObj.data = await compileFunction($"function transferOwnership(address newOwner)");
+            var answer = await RunFunction2("eth_sendTransaction", transObj);
+        }
+
+
         public async Task<string> Verify(AccountModel verifier, ArticleModel article)
         {
             Console.WriteLine($"Verify starting");

+ 9 - 0
Models/SmartContract.cs

@@ -140,6 +140,15 @@ namespace HyperCube.Models
                 var article_value = newArticle.CalcPValue();
                 article_value *= verifier.GetRatingExpert()*initiator.GetRatingProspector();
 
+                //calc expert reward
+                //calc initiator reward
+                //calc comission
+                //init add transaction 2 contract
+                //add transaction 2db
+                //init notifications
+
+
+
                 var article_value_hex = article_value.ToString("X64");
                 //Console.WriteLine($"article_value {article_value} hex {article_value_hex}");
                 var edits = await newArticle.GetEditsCount();