Created
May 1, 2018 18:40
-
-
Save MrCrambo/7b8b56c9b4bf1912df1971fa77b7a31e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using Neo; | |
using Neo.VM; | |
using Neo.Cryptography; | |
namespace ConsoleApplication1 | |
{ | |
class program | |
{ | |
static void Main(string[] args) | |
{ | |
var engine = new ExecutionEngine(null, Crypto.Default); | |
engine.LoadScript(File.ReadAllBytes(@ "C: \ ... \ YourContractName.avm")); | |
using (ScriptBuilder sb = new ScriptBuilder()) | |
{ | |
sb.EmitPush("doSomething"); | |
engine.LoadScript(sb.ToArray()); | |
} | |
engine.Execute(); // start execution | |
var result = engine.EvaluationStack.Peek().GetBigInteger(); // set the return value here | |
Console.WriteLine($"Execution result {result}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment