COZ has announced the release of neo-boa v0.7.0, a compiler for Neo smart contracts written in Python. The update brings with it two new features designed to let Python developers benefit from the new tools available in NGD Seattle’s Neo Blockchain Toolkit for VS Code.

Most notably, the implementation allows Python contracts to make use of the new Neo debugger, a key component of the Neo Blockchain Toolkit. The debugger operates through the use of a special debug info file, created during compilation by compilers that support the format.

The format works by associating every opcode from the compiled AVM script to a Method object, storing details such as the type information for parameters, variables, and return values. Opcode addresses are also mapped back to the source code, which coupled with the upcoming disassembler will give developers the ability to step through the code from both perspectives.

Integration of the debug format into neo-boa was proposed and implemented by NGD Seattle’s Harry Pierson, who also headed up development of the new time-travel debugging capabilities recently announced at Consensus: Distributed.

ABI generation

The Visual DevTracker is a GUI for creating and running neo-express instances, wallets, and deploying or interacting with Neo contracts on a private test network. It was created for inclusion as part of the Neo Blockchain Toolkit for VS Code, the first tool built by NGD Seattle.

Some of its features, such as the contract invocation UI, are powered by a separate abi.json file, initially only generated by the core Neon compiler for C# contracts. Following the new update, Python contracts compiled by neo-boa will also emit the abi file, making it convenient to access more of the tools available in the Toolkit.

The file format specification may be found here.

In order to specify the methods for inclusion in the abi file, Python developers can now use one of two decorators to identify the entry point and individual methods. The decorators are also used to declare the parameter and return types for each function.

In addition to its use for contract invocation through the DevTracker, the abi.json file is also used to provide contract metadata. In the current implementation, support for automatically populating these fields is not included in neo-boa.

However, the DevTracker will detect when metadata has not been provided while attempting to deploy a contract, and will prompt the user to add this information if desired in the deploy UI.