Debugging tools for NEO blockchain development

Tomás Carvalho
Blocksmith
Published in
4 min readMar 29, 2018

This week we wanted to write a bit about some tools that can help you develop smart contracts on NEO. We will cover three tools that we’ve been using, and dig deeper into what they allow for and what still need to improve on.

NEO GUI Developer

NEO GUI Developer is a tool being developed by City of Zion which is built on top of NEO GUI — the official NEO client and wallet. It includes all the features of the official NEO GUI, such as deploying smart contracts and creating NEO wallets, while also adding some very useful features for developers. Like the original NEO GUI it also works as a full node of the network, acting both as a client and as a server. At the time of the writing of this post, it included the following features:

  • Event log — The tool features a tab on the GUI which displays all the logs created by any smart contract in the network calling Runtime.Log() and Runtime.Notify(). Along with the log message, it shows the local time when the event is received, the current block height, event type and the script hash.
  • Smart contract return — This experimental feature allows the user to verify the CheckWitness() function during test invocations by displaying a message pop-up. It also pop-ups a dialog with the result of a smart contract test invocation.
  • Smart contract monitor — After being deployed or looked up, the smart contract script is added to a watch list and its status (successfully deployed or unavailable), script info and script hash are displayed in an information box.
  • Add parameters to smart contract invocation — This feature allows the user to build an array of objects in the GUI with the arguments to be passed during a contract invocation. The tool currently supports Array, ByteArray, Integer, Hash160, Hash256, PublicKey and Signature types, which can be added by selecting them from a drop down list.
  • Simple field validation — Parameters that were set as required when the contract was deployed are marked as required when the user tries to test invoke a contract. Hash160, Hash256 and PublicKey fields are also validated.

Although it provides some useful functionalities, this tool suffers from the same compatibility issues as NEO GUI, being compatible only with Windows 7 (Service Pack 1), Windows 8 and Windows 10. It also has a very minimalist and poor design and lacks documentation.

NEO GUI Developer — Screenshot taken from City of Zion Youtube channel

NEO Debugger Tools

NEO Debugger Tools is a set of tools which aim to help on the development of NEO smart contracts. They were first created by a Portuguese developer, Sérgio Flores (Relfos on github), and were later adopted by CoZ. This tool suit consists of a CLI disassembler and a GUI debugger. At the time of the writting of this post, it implemented the following features:

  • Support of any NEO .avm (NEO Virtual Machine (VM) bytecode) code, regardless of the language or compiler used.
  • Source viewer with syntax highlight.
NEO Debugger — Debugging a Smart Contract (taken from Nikolaj-K youtube channel)
  • Contract debugging with run, step and set breakpoints options.
NEO Debugger —Setting breakpoints (taken from Nikolaj-K youtube channel)
  • Toggling between source code and .avm code.
NEO Debugger — .avm code view (taken from Nikolaj-K youtube channel)
  • Test invocation result and GAS usage.

However, this suit has some limitations, as acknowledged by its creator in his documentation (available on the tool Github repository). For now, although supporting any NEO .avm code, it only works when a .neomap file is generated by the compiler in order to map source code lines with the correspondent .avm code. Smart contract source code is also limited to a single file and it’s not yet possible to inspect variable values. Also, some NEO syscalls and Application Programming Interface (API) calls are not supported yet. Similarly to NEO GUI Developer, it also only compatible with Windows Operating System (OS).

NEO WebDebugger

NEO WebDebugger is a planned port of NEO Debugger Tools for the Web. However, at the time of the writing of this post, this tool was still in development.

Have you used any of these tools before? Perhaps some other one that we did not mention? What did you think about them?

We all know this is a fast-moving area, please feel free to leave some feedback and share your thoughts about all of this!

--

--

Tomás Carvalho
Blocksmith

I'm a Software Engineer with interest in Blockchain technology, Web Development and Internet Security. Working at blocksmith.tech.