I am happy to announce new features for migrating ink! 4.x projects to ink! 5.0, along with other major improvements, 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.
- Semantic Analyzer (source code, crates.io, docs.rs).
- Language Server (source code, binary/executable releases, crates.io, docs.rs).
- Visual Studio Code Extension (source code, VS Code Marketplace listing, VSIX releases).
What's new?โ
The latest updates introduce features for migrating ink! 4.x projects to ink! 5.0, along with other major improvements, across all ink! analyzer components including:
- Command and code action for migrating ink! 4.x projects to ink! 5.0 including:
- Migrating ink! events to "2.0" syntax.
- Migrating ink! chain extension attribute macro and associated
fn
attribute argument to ink! 5.0 syntax. - Replacing "built-in"
derive
s ofSCALE
codec traits with ink! 5.0scale_derive
attribute macro equivalents. - Migrating ink! e2e tests including:
- Updating e2e
fn
signatures to include newE2EBackend
trait. - Removing deprecated attribute arguments (i.e.
additional_contracts
andkeep_attr
). - Using new "builder" APIs and
ContractsBackend
trait forinstantiate
,instantiate_dry_run
,call
,call_dry_run
,upload
e.t.c. - Using new
ChainBackend
trait forcreate_and_fund_account
,balance
,runtime_call
e.t.c. - Replacing deprecated
build_message
fn,MessageBuilder
type, and relatedcall
callback with new API equivalents. - Removing ink! e2e deprecated imports i.e.
build_message
,MessageBuilder
e.t.c.
- Updating e2e
- Migrating cross-contract host function calls to new API equivalents to preserve semantics including:
- Replacing
call
fromCallBuilder
viabuild_call
withcall_v1
. - Adding an
instantiate_v1
call before other method calls onCreateBuilder
s viabuild_create
. - Replacing
instantiate_contract
andinvoke_contract
withinstantiate_contract_v1
andinvoke_contract_v1
for direct calls in any function. - Replacing
instantiate_contract
andinvoke_contract
withinstantiate_contract_v1
andinvoke_contract_v1
for indirect calls viaSelf::env()
andself.env()
in ink! constructors and messages. - Replacing
Call
constructors withCallV1
.
- Replacing
- Migrating ink! project
Cargo.toml
to ink! 5.0 (i.e. updatingink
andink_e2e
dependencies, removingSCALE
dependencies and related features e.t.c).
- Completions for full ink! entities (i.e. inserting full Rust items not just ink! attribute macros and arguments
e.g. ink! constructor and message
fn
items as completions when typingfn
insideimpl
blocks e.t.c). - Command and code action for extracting ink! events into standalone packages (only for ink! v5 projects).
- Completions and code actions for
ink::combine_extensions!
declarative macro. - Support for ink! workspace dependencies.
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 ๐.