{ skip to content }

Solidity 0.7.4 Release Announcement

Posted by Solidity Team on October 19, 2020

Releases

Solidity v0.7.4 fixes a storage corruption bug of medium severity. To learn more about the bug and to check if your contract is vulnerable please read this post with further details about the bug. The bug has been reported by John Toman of the Certora development team.

Additionally, v0.7.4 adds constants at file-level.

Important Bugfixes

  • Code Generator: Fix data corruption bug when copying empty byte arrays from memory or calldata to storage. Read more here.

Notable New Features

Constants at File-Level

In order to make functions at file-level more useful, Solidity now also allows to define constant variables at file-level:

uint constant EXPONENT = 10;
uint constant MULTIPLIER = 2**EXPONENT;

struct Fixed { uint value; }

function toFixed(uint x) pure returns (Fixed memory ret) {
    ret.value = x * MULTIPLIER;
}

Such constants have to follow the same rules as constants at contract-level. This means, for example, the value has to be fixed at compile-time and only some types are supported.

You can import constants from other source files like you import any other identifier:

import {MyConstant, MyStruct} from "myHelper.sol";

Full Changelog

Language Features:

  • Constants can be defined at file level.

Compiler Features:

  • Command Line Interface: New option --model-checker-engine allows to choose a specific SMTChecker engine. Options are all (default), bmc, chc and none.
  • Control Flow Graph: Print warning for non-empty functions with unnamed return parameters that are not assigned a value in all code paths.
  • SMTChecker: Support keccak256, sha256, ripemd160 and ecrecover in the CHC engine.
  • SMTChecker: Support inline arrays.
  • SMTChecker: Support variables block, msg and tx in the CHC engine.
  • Standard JSON: New option modelCheckerSettings.engine allows to choose a specific SMTChecker engine. Options are all (default), bmc, chc and none.

Bugfixes:

  • Code generator: Fix ABIEncoderV2 pragma from the current module affecting inherited functions and applied modifiers.
  • Code generator: Fix internal compiler error when referencing members via module name but not using the reference.
  • Code generator: Fix internal error on returning structs containing mappings from library function.
  • Code generator: Use revert instead of invalid opcode for out-of-bounds array index access in getter.
  • Contract Level Checker: Add missing check against inheriting functions with ABIEncoderV2 return types in ABIEncoderV1 contracts.
  • Name Resolver: Fix shadowing/same-name warnings for later declarations.
  • Type Checker: Allow arrays of contract types as type expressions and as arguments for abi.decode.
  • Type Checker: Disallow invalid use of library names as type name.
  • Type Checker: Fix internal compiler error caused by storage parameters with nested mappings in libraries.

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

2023 Solidity Team

Security Policy

Code of Conduct