{ skip to content }

Solidity 0.8.11 Release Announcement

Posted by Solidity Team on December 20, 2021

Releases

Solidity v0.8.11 adds a first implementation of a Language Server, allows a safer way to perform ABI-encoding and fixes several bugs.

Notable New Features

Language Server Preview

Language Server Protocol is an initiative that allows better interoperability between IDEs and compilers, or more generally, language diagnostics tools. The idea is that instead of writing a different plugin for each combination of IDEs and languages, every IDE implements a single client and every compiler implements a single server and since both of them use the same protocol, you can combine all of them with each other.

Solidity 0.8.11 contains a first release of an integrated language server, which means every IDE that has Language Server support will support Solidity out of the box.

Since we first want to focus on getting the interface right, this release contains a minimal set of features: It can only report errors and warnings.

Having said that, we expect future features to be finished quickly. In the first quarter of 2022 we expect to add "jump to definition", "rename", "find all references", "show documentation on hover", "semantic highlighting" and more.

Unfortunately, one feature that will take more effort is likely the one you were looking forward to the most: autocomplete. This feature is more complicated because autocomplete requires the compiler to perform symbol lookup and type resolution inside broken (because it is incomplete) code. We have a prototype that can handle incomplete code, but we do not yet know how useful it is.

How to Use the LSP

How to hook your IDE up with the Solidity LSP depends on your IDE. The LSP is currently only implemented for the native binary of Solidity (i.e. it does not work if you install Solidity via javascript / npm). You need to download the binary and provide the path to your IDE, plus the option --lsp.

QtCreator: Choose Tools → Options → Language Client. Click on "Add" and provide the path to the solc executable and --lsp as options.

vim / neovim: You need the coc plugin and add the following to the coc-settings.json file:

{
    // ...
    "languageserver": {
        // ...
        "solidity": {
            "command": "/path/to/solc",
            "args": [ "--lsp" ],
            "rootPatterns": [".git/"],
            "filetypes": ["solidity"]
        }
    }
}

VSCode: Ironically, the IDE that started the LSP project does not have a generic plugin that can be combined with an arbitrary language server. We expect LSP functionality to be added to the existing Solidity plugins for VSCode soon. Until then, you can try out the plugin created by Christian Parpart to showcase our LSP.

Please Provide Feedback!

We are happy to ship this first preview of the Solidity Language Server and are curious to hear your thoughts on it. Please let us know what you think!

  • Which of the future features would you find most important?
  • Does the LSP work for you?
  • Is it easy to install?
  • Are you working on a plugin or an IDE that would profit from the Language Server?

You can get in touch with us via Matrix or one of the other ways linked in our readme header.

abi.encodeCall

It is a common pattern to use abi.encodeWithSelector to create the call data for a function call which is then performed only later on, for example in multi-signature wallets or more complex delegate contracts.

The problem with abi.encodeWithSelector is that the compiler does not check whether the supplied values actually match the types expected by the called function.

Because of that, we added abi.encodeCall which is similar to abi.encodeWithSelector, just that it does perform these type checks:

abi.encodeCall(contractName.functionName, (arg1, arg2, arg3)) is the same as abi.encodeWithSelector(contractName.functionName.selector, arg1, arg2, arg3), with the difference that the compiler checks that the types of arg1, arg2, arg3 are compatible with a call of the form contractName.functionName(arg1, arg2, arg3).

Full Changelog

Language Features:

  • General: New builtin function abi.encodeCall(functionPointer, (arg1, arg2, ...)) that type-checks the arguments and returns the ABI-encoded function call data.

Compiler Features:

  • Commandline Interface: Add --lsp option to get solc to act as a Language Server (LSP) communicating over stdio.

Bugfixes:

  • Code Generator: Fix a crash when using @use-src and compiling from Yul to ewasm.
  • SMTChecker: Fix internal error when an unsafe target is solved more than once and the counterexample messages are different.
  • SMTChecker: Fix soundness of assigned storage/memory local pointers that were not erasing enough knowledge.
  • Fix internal error when a function has a calldata struct argument with an internal type inside.
  • IR Generator: Fix IR syntax error when copying storage arrays of functions.

A big thank you to all contributors who helped make this release possible!

Download the new version of Solidity here.

Previous post

Next post

Get involved

GitHub

Twitter

Mastodon

Matrix

Discover more

BlogDocumentationUse casesContributeAboutForum

2024 Solidity Team

Security Policy

Code of Conduct