|
@@ -114,6 +114,17 @@ namespace HyperCube.Models
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public async Task<string> GetEstimatedGas(SmartContract contract)
|
|
|
+ {
|
|
|
+ if (contract != null)
|
|
|
+ {
|
|
|
+ var ret = await RunFunction("eth_estimateGas", $"{{\"from\":\"{address}\",\"data\":\"{contract.ByteCode}\"}}");
|
|
|
+ Console.WriteLine("GetEstimatedGas " + ret);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
public static async Task<string> GetSHA3(string code)
|
|
|
{
|
|
|
var hex = bin2hex(code);
|