Skip to main content

Announcing ink! 5.0 support

ยท 3 min read
David Semakula

ink! v5 cover image

I am happy to announce ink! 5.0 support for ink! analyzer - a collection of modular and reusable libraries and tools for semantic analysis of ink! smart contracts.

If you're new to ink! analyzer (or if you need a refresher ๐Ÿ™‚), you can refer to the introductory blog post for a deep dive into the problem, solution and technical descriptions of each of the architectural components of the project.

What's new?โ€‹

The latest updates introduce support for ink! 5.0 across all ink! analyzer features and components including:

  • Completions for all new ink! 5.0 attribute macros and arguments (e.g. #[ink::event] attribute macro and its optional signature_topic = .. or anonymous arguments, options for the #[ink_e2e::test] macro's new backend argument e.t.c).
  • Diagnostics and quickfixes for ink! 5.0 entities and syntax based on new semantic rules (e.g. improper use of wildcard selectors, missing required extension = .. argument for #[ink::chain_extension] attribute macro, validation that a signature_topic is a 32 byte hex string and not combined with an anonymous argument e.t.c), as well as diagnostics (and quickfixes) for deprecated entities and syntax (e.g. use of the extension attribute argument instead of the new function argument for chain extension functions, use of additional_contracts and keep_attr arguments for the #[ink_e2e::test] attribute macro e.t.c).
  • Updated VS Code command for creating an ink! 5.0 project (i.e. with an ink! 5.0 contract stub/snippet).
  • Code/intent actions for inserting code stubs/snippets for contextually relevant ink! 5.0 entities (e.g. an #[ink::event] annotated struct).
  • Hover content/documentation for ink! 5.0 attribute macros and arguments.
  • Inlay hints and signature help/parameter hints for ink! 5.0 attribute arguments (e.g. u32 | _ | @ for ink! message selectors, u16 for function attribute arguments, node | runtime_only for backend argument for #[ink_e2e::test] attribute macro e.t.c).
  • Leveraging the new #[ink::scale_derive(..)] attribute macro when deriving SCALE codec traits in related diagnostic/quickfixes and code/intent actions (e.g. for chain extension ErrorCode types and related input and output types).

Lastly, the latest updates also maintain ink! 4.x support by intelligently detecting the ink! version for the project!

Conclusionโ€‹

You can learn more about all ink! analyzer components in the introductory blog post (including links to all available project resources in the "Diving Deeper" section), and/or checkout the ink! analyzer organization on GitHub for: installation, development, usage and testing instructions, library documentation, low-level technical and architectural descriptions, access to the source code, and distributable releases of the ink! Language Server and VSIX packages for the VS Code extension (if you prefer not to use the VS Code marketplace) for most of the major platforms/architectures.

Issues, bug reports, PRs and feature requests are welcome at the respective GitHub repositories ๐Ÿ™‚.

Special thanks to the entire Polkadot community for retroactively funding the above updates (i.e. ink! 5.0 support for ink! analyzer) via the Polkadot Treasury. And as always, a big thank you to the Web3 Foundation for previously funding ink! analyzer's initial development via two generous grants.