After long discussions, we finally enabled a high-level way to use the create2 opcode introduced in Constantinople: When creating a contract, you can specify the salt as a “function call option”: new Contract{salt: 0x1234}(arg1, arg2). We took this opportunity and also extended the use of these function call options to specifying the gas and value options in external function calls: c.f{value: 10, gas: 20000}(arg1, arg2).

Furthermore, interfaces can now inherit from interfaces, making them even more useful for specification purposes.

To allow mutation testing and other uses, you can now export the AST, modify it and re-compile starting from the modified ast using solc import-ast. Note that compiling from a modified AST is not meant for production.

And last but not least, we are now building the javascript compiler solc-js / soljson.js using webassembly which should both provide a performance boost as well as reduce compatibility issues with browsers.

Changelog:

Language Features:

  • Allow accessing external functions via contract and interface names to obtain their selector.
  • Allow interfaces to inherit from other interfaces
  • Allow gas and value to be set in external function calls using c.f{gas: 10000, value: 4 ether}().
  • Allow specifying the salt for contract creations and thus the create2 opcode using new C{salt: 0x1234, value: 1 ether}(arg1, arg2).
  • Inline Assembly: Support literals true and false.

Compiler Features:

  • LLL: The LLL compiler has been removed.
  • General: Raise warning if runtime bytecode exceeds 24576 bytes (a limit introduced in Spurious Dragon).
  • General: Support compiling starting from an imported AST. Among others, this can be used for mutation testing.
  • Yul Optimizer: Apply penalty when trying to rematerialize into loops.

Bugfixes:

  • Commandline interface: Only activate yul optimizer if optimize is given.
  • Fixes internal compiler error on explicitly calling unimplemented base functions.

Build System:

  • Switch to building soljson.js with an embedded base64-encoded wasm binary.

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

Download the new version of Solidity here.