static byte[] CreateSignatureRedeemScript(DevWalletAccount account) { var key = account.GetKey(); if (key == null) { throw new Exception("DevWalletAccount missing key"); } using var sb = new Neo.VM.ScriptBuilder(); sb.EmitPush(key.PublicKey.EncodePoint(true)); sb.Emit(Neo.VM.OpCode.CHECKSIG); return(sb.ToArray()); }
/// <summary> /// Generate scripts to call a specific method from a specific contract. /// </summary> /// <param name="scriptHash">contract script hash</param> /// <param name="operation">contract operation</param> /// <param name="args">operation arguments</param> /// <returns></returns> public static byte[] MakeScript(this UInt160 scriptHash, string operation, params object[] args) { using ScriptBuilder sb = new ScriptBuilder(); sb.EmitDynamicCall(scriptHash, operation, args); return(sb.ToArray()); }