Browse Source

заготовка

Rimmon 3 năm trước cách đây
mục cha
commit
257bf0c138
2 tập tin đã thay đổi với 21 bổ sung0 xóa
  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();