Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
add depoly contract with nep4 function for neogui (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightszero authored and erikzhang committed Jan 17, 2018
1 parent 309828a commit fbc3c1c
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 85 deletions.
9 changes: 9 additions & 0 deletions neo-gui/UI/DeployContractDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions neo-gui/UI/DeployContractDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ public InvocationTransaction GetTransaction()
byte[] script = textBox8.Text.HexToBytes();
byte[] parameter_list = textBox6.Text.HexToBytes();
ContractParameterType return_type = textBox7.Text.HexToBytes().Select(p => (ContractParameterType?)p).FirstOrDefault() ?? ContractParameterType.Void;
bool need_storage = checkBox1.Checked;
ContractPropertyState properties = ContractPropertyState.NoProperty;
if (checkBox1.Checked) properties |= ContractPropertyState.HasStorage;
if (checkBox2.Checked) properties |= ContractPropertyState.HasDynamicInvoke;
string name = textBox1.Text;
string version = textBox2.Text;
string author = textBox3.Text;
string email = textBox4.Text;
string description = textBox5.Text;
using (ScriptBuilder sb = new ScriptBuilder())
{
sb.EmitSysCall("Neo.Contract.Create", script, parameter_list, return_type, need_storage, name, version, author, email, description);
sb.EmitSysCall("Neo.Contract.Create", script, parameter_list, return_type, properties, name, version, author, email, description);
return new InvocationTransaction
{
Script = sb.ToArray()
Expand Down
Loading

0 comments on commit fbc3c1c

Please sign in to comment.