Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Created May 1, 2018 18:40
Show Gist options
  • Save MrCrambo/7b8b56c9b4bf1912df1971fa77b7a31e to your computer and use it in GitHub Desktop.
Save MrCrambo/7b8b56c9b4bf1912df1971fa77b7a31e to your computer and use it in GitHub Desktop.
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