sidebar_label | sidebar_position |
---|---|
'Deploying and invoking contract' | 4 |
Deploying and invoking contract
In the previous section we have compiled an NEP17 contract file (NEP17.nef) and contract descriptive file (NEP17.manifest.json), next we will move on to deployment and invocation of the contract with Neo-CLI.
Deploying contract
In Neo-CLI, input the deploy command deploy <nefFilePath> [manifestFile]
, for example:
Or
After the command is executed, the NEP17 contract is deployed and the related fee is charged by the system automatically.
For more information, refer to Deploying Smart Contracts .
Invoking contract
Now we can invoke the contract using the Neo-CLI command invoke
:
For example:
After executed successfully, the following information is printed:
Where:
-
VM State:
HALT
indicates the vm executed successfully;FAULT
indicates the vm exited during execution due to an exception. -
Evaluation Stack: the result of contract execution, where the value is encoded with Base64 when it is a string or ByteArray.
-
You can do the data format conversion here
VG9rZW5TeW1ib2w=
=>TokenSymbol
For more information, refer to Invoking Smart Contracts .