The construction method of parameters that call contracts.

robbie wang
NewEconoLabs
Published in
3 min readDec 19, 2018

NEL

Before debugging a contract, you need to deploy the contract to the chain and issue a transaction that calls the contract and then debug the contract through the transaction.

The parameters required for the call need to be filled in when calling the contract. The argument is the argument required by the contract entry function. In Neoray 1.0 you need to fill in manually, but in Neoray 2.0 you only need to select the parameters and fill in the values.

When we write a smart contract, the entry function has one and only one main function. Depending on the needs, we may have different entry requirements.

Here are a few common examples:

Main function:public static object Main()

The parameters in Neoray 1.0 are constructed as: []

Enter the following in Neoray 2.0:

Main function:public static object Main(string method)

The parameter in Neoray 1.0 is constructed as: [“(str)#”] # is the parameter you pass into the contract method

Enter the following in Neoray2.0:

The parameter is constructed in Neoray 1.0 as: [“(int)#”] # is the parameter you pass into the contract int

Enter the following in Neoray2.0:

Main function:public static object Main(object[] arr)

The parameters in Neoray 1.0 are constructed as : [[]]

Example:[[“(int)#”]] means arr[0] passed into is a parameter of type int

Enter the following in Neoray2.0:

Main function:public static object Main(string method , object[] arr)

The parameter in Neoray 1.0 is constructed as: [“(str)#”,[]]

Enter the following in Neoray2.0:

Here are some ways to use the number prefixes you need in Neoray 1.0:

The parameter needs to be added with the prefix such as (str) (int) as follows:

The parameter of the String class is added with the prefix (str). E.g:

(str)get ; (str) put

The parameter of the int class is added with the prefix (str). E.g:

(int)10 ; (int) 10000。ps: What needs to be noted here is the smart contract has only integer form.

The wallet address is added with prefix (addr). E.g:

(addr)AeYiwwjiy2nKXoGLDafoTXc1tGvfkTYQcM

betyarray is added with the prefix (bytes)E.g:

(bytes)029020

256-bit hexadecimal large integer is added with the prefix (hex256). E.g:

(hex256)0xef19eb65fe82a009ba005d656251927796255ac86d149135da619319dddfcd77

160-bit hexadecimal large integer is added with the prefix (hex160). E.g:

(hex160)0x212d6dbe3767e2877326e115ad73d3f5788ffc55

--

--