Skip to content

Commit fbc3c1c

Browse files
lightszeroerikzhang
authored andcommitted
add depoly contract with nep4 function for neogui (neo-project#124)
1 parent 309828a commit fbc3c1c

File tree

4 files changed

+135
-85
lines changed

4 files changed

+135
-85
lines changed

neo-gui/UI/DeployContractDialog.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

neo-gui/UI/DeployContractDialog.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ public InvocationTransaction GetTransaction()
2020
byte[] script = textBox8.Text.HexToBytes();
2121
byte[] parameter_list = textBox6.Text.HexToBytes();
2222
ContractParameterType return_type = textBox7.Text.HexToBytes().Select(p => (ContractParameterType?)p).FirstOrDefault() ?? ContractParameterType.Void;
23-
bool need_storage = checkBox1.Checked;
23+
ContractPropertyState properties = ContractPropertyState.NoProperty;
24+
if (checkBox1.Checked) properties |= ContractPropertyState.HasStorage;
25+
if (checkBox2.Checked) properties |= ContractPropertyState.HasDynamicInvoke;
2426
string name = textBox1.Text;
2527
string version = textBox2.Text;
2628
string author = textBox3.Text;
2729
string email = textBox4.Text;
2830
string description = textBox5.Text;
2931
using (ScriptBuilder sb = new ScriptBuilder())
3032
{
31-
sb.EmitSysCall("Neo.Contract.Create", script, parameter_list, return_type, need_storage, name, version, author, email, description);
33+
sb.EmitSysCall("Neo.Contract.Create", script, parameter_list, return_type, properties, name, version, author, email, description);
3234
return new InvocationTransaction
3335
{
3436
Script = sb.ToArray()

0 commit comments

Comments
 (0)