|
@@ -60,9 +60,25 @@ namespace HyperCube.Models
|
|
|
public SmartContract()
|
|
|
{ }
|
|
|
|
|
|
- public Task Run(string weiValue = "0x0")
|
|
|
+ public async Task<string> Run(AccountModel initiator, string weiValue = "0x0")
|
|
|
{
|
|
|
- return null;
|
|
|
+ var bc = Blockchain.Find(blockchainId);
|
|
|
+ if (bc != null)
|
|
|
+ {
|
|
|
+ var initiator_address = await initiator.GetOrCreateActualAddress(bc);
|
|
|
+ initiator_address = Blockchain.zerofill(initiator_address, 64, true);
|
|
|
+
|
|
|
+ //Console.WriteLine($"VerifyContract params article_value {article_value} edits {edits} verifier {AccountModel.Current.Name} verifier_address: {verifier_address} initiator {initiator.Name} initiator_address: {initiator_address}");
|
|
|
+ //function verify( address payable verifier, address payable initiator, int article_value, int verify_complexity) public returns (uint vReward, uint iReward)
|
|
|
+ var paramstring = "0x" + functionCompiledHeader;
|
|
|
+ //Console.WriteLine($"VerifyContract Run {initiator.Name} params {paramstring}");
|
|
|
+ var res = await bc.RunContractWrite(Address, $"{paramstring}", Gas, "0x100");
|
|
|
+ //Console.WriteLine($"VerifyContract transactionId res {res}");
|
|
|
+ var receipt = await bc.GetReceipt(res);
|
|
|
+ //Console.WriteLine("VerifyContract receipt " + receipt);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return "none";
|
|
|
}
|
|
|
|
|
|
public SmartContract(string name, string code, string bytecode, int blockchain_id, string gas)
|