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
fnattribute argument to ink! 5.0 syntax. - Replacing "built-in"
derives ofSCALEcodec traits with ink! 5.0scale_deriveattribute macro equivalents. - Migrating ink! e2e tests including:
- Updating e2e
fnsignatures to include newE2EBackendtrait. - Removing deprecated attribute arguments (i.e.
additional_contractsandkeep_attr). - Using new "builder" APIs and
ContractsBackendtrait forinstantiate,instantiate_dry_run,call,call_dry_run,uploade.t.c. - Using new
ChainBackendtrait forcreate_and_fund_account,balance,runtime_calle.t.c. - Replacing deprecated
build_messagefn,MessageBuildertype, and relatedcallcallback with new API equivalents. - Removing ink! e2e deprecated imports i.e.
build_message,MessageBuildere.t.c.
- Updating e2e
- Migrating cross-contract host function calls to new API equivalents to preserve semantics including:
- Replacing
callfromCallBuilderviabuild_callwithcall_v1. - Adding an
instantiate_v1call before other method calls onCreateBuilders viabuild_create. - Replacing
instantiate_contractandinvoke_contractwithinstantiate_contract_v1andinvoke_contract_v1for direct calls in any function. - Replacing
instantiate_contractandinvoke_contractwithinstantiate_contract_v1andinvoke_contract_v1for indirect calls viaSelf::env()andself.env()in ink! constructors and messages. - Replacing
Callconstructors withCallV1.
- Replacing
- Migrating ink! project
Cargo.tomlto ink! 5.0 (i.e. updatinginkandink_e2edependencies, removingSCALEdependencies 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
fnitems as completions when typingfninsideimplblocks 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.
