Changelog.md
Language Features:
erc7201 formula from ERC-7201.at, error, layout, leave, super, transient, this).basefee, blobbasefee, blobhash, clz, leave, memoryguard, mcopy, prevrandao, tload, tstore).Compiler Features:
--assemble instead of treating it as equivalent to --strict-assembly.--experimental flag required for enabling the experimental mode.--ethdebug and --ethdebug-runtime outputs with the more granular --ethdebug-resources, --ethdebug-compilation, --ethdebug-program and --ethdebug-program-runtime. Producing ethdebug/format/info/resources no longer forces full binary compilation.@future.generic-solidity, lsp, ethdebug, eof, evm, ast-import, evmasm-import, ir-ast, ssa-cfg) to experimental mode.experimental field, which used to indicate only the presence of certain experimental pragmas in the source.settings.experimental setting required for enabling the experimental mode.ethdebug output with ethdebug.resources and ethdebug.compilation. Decouple ethdebug outputs from binary compilation so that requesting the ethdebug/format/info/resources schema artifacts does not trigger bytecode generation.Bugfixes:
require when stripping of revert strings is selected via --revert-strings strip.Important Bugfixes:
Compiler Features:
Bugfixes:
Important Bugfixes:
delete/push()/pop() skipping some or all of the intended storage writes.Bugfixes:
string.concat and bytes.concat with constant arguments not being considered compile-time constant.Language Features:
constant state variables in the base slot expression.memory-safe-assembly.send and transfer functions on instances of address.clz(x) for counting the number of leading zero bits in a 256-bit word.Compiler Features:
osaka.Bugfixes:
--asm-json output between target architectures.Build System:
boost::rational comparison affecting compiler binaries built with GCC<14.0 and Boost<1.75.Compiler Features:
prague.enum values in the AST.Bugfixes:
--model-checker-contracts.Language Features:
Compiler Features:
block.blobbasefee and blobhash.--model-checker-print-query no longer requires --model-checker-solvers smtlib2.Bugfixes:
ecrecover precompile.generatedSources and sourceMap being generated internally even when not requested.optional value.Build system:
glibc.Solc-Js:
Language Features:
Compiler Features:
Bugfixes:
Build system:
USE_LD_GOLD option and default to use the compiler default linker. For custom linkers, CMAKE_CXX_FLAGS can be used.Language Features:
transient data location (parser support only, no code generation yet).require(bool, Error) available when using the legacy pipeline.Compiler Features:
--transient-storage-layout output.--asm-json output option in assembler mode to export EVM assembly of the contracts in JSON format.PUSH0 if supported by the selected evm version.PUSH0, when supported, is duplicated explicitly instead of using DUP1.transientStorageLayout output.--yul in the CLI.Bugfixes:
x._ would get simplified into x..Build System:
Language Features:
require(bool, Error) that allows usage of require functions with custom errors. This feature is available in the via-ir pipeline only.Compiler Features:
Bugfixes:
--yul-optimizations sequence.optimizerSteps sequence.SSATransform being dependent on AST IDs, sometimes resulting in different (but equivalent) bytecode when unrelated files were added to the compilation pipeline.Build System:
Compiler Features:
MCOPY instead of MLOAD/MSTORE loop when copying byte arrays.cancun.tstore.Bugfixes:
--via-ir is used but no output that depends on the IR is requested.--model-checker-solvers eld, even when it is present on the system.Language Features:
block.blobbasefee for retrieving the blob base fee of the current block.blobhash(uint) for retrieving versioned hashes of blobs, akin to the homonymous Yul builtin.blobbasefee() for retrieving the blob base fee of the current block.blobhash() for retrieving versioned hashes of blobs associated with the transaction.mcopy() for cheaply copying data between memory areas.tload() and tstore() for transient storage access.Compiler Features:
bytes.concat except when string literals are passed as arguments.--asm-json.Bugfixes:
let variable declaration.Important Bugfixes:
verbatim instructions to be treated as equivalent and thus collapsed into a single one.Compiler Features:
--yul-optimizations sequence can now be always provided.optimizerSteps sequence can now always be provided.Language Features:
Compiler Features:
for loops when the counter variable cannot overflow.--no-import-callback option that prevents the compiler from loading source files not given explicitly on the CLI or in Standard JSON input.--import-asm-json option that can import EVM assembly in the format used by --asm-json.--error-recovery / settings.parserErrorRecovery).PUSH0 is supported, favor zero literals over storing zero values in variables.Rematerializer and UnusedPruner steps at the end of the default clean-up sequence.Bugfixes:
while or for loops are unrolled before the condition check.Important Bugfixes:
<expression>.selector in the legacy code generation pipeline.FullInliner step (i) not preserving the evaluation order of arguments passed into inlined functions in code that is not in expression-split form (i.e. when using a custom optimizer sequence in which the step not preceded by ExpressionSplitter (x)).Language Features:
Compiler Features:
--ast-compact-json output in assembler mode.--ir-ast-json and --ir-optimized-ast-json outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.--optimize-yul and --no-optimize-yul in compiler mode and accept them in assembler mode as well. --optimize --no-optimize-yul combination now allows enabling EVM assembly optimizer without enabling Yul optimizer.pragma experimental solidity, which will enable an experimental language mode that in particular has no stability guarantees between non-breaking releases and is not suited for production use.--model-checker-print-query CLI option and settings.modelChecker.printQuery JSON option to output the SMTChecker queries in the SMTLIB2 format. This requires using smtlib2 solver only.ast file-level output for Yul input.irAst and irOptimizedAst contract-level outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.ReasoningBasedSimplifier optimization step.Bugfixes:
--stop-after parsing and requesting some of the outputs that require full analysis or compilation.--optimize-yul and --no-optimize-yul at the same time.if and ternary conditionalstatements in the BMC engine.FullInliner step not ignoring code that is not in expression-split form.AST Changes:
experimentalSolidity field to the SourceUnit nodes, which indicate whether the experimental parsing mode has been enabled via pragma experimental solidity.Compiler Features:
push0 for placing 0 on the stack for EVM versions starting from "Shanghai". This decreases the deployment and runtime costs.enum definitions.struct definitions.UnusedAssignEliminator and UnusedStoreEliminator. It can correctly remove some unused assignments in deeply nested loops that were ignored by the old version.--model-checker-bmc-loop-iterations and a JSON option settings.modelChecker.bmcLoopIterations that specify how many loop iterations the BMC engine should unroll. Note that false negatives are possible when unrolling loops. This is due to the possibility that bmc loop iteration setting is less than actual number of iterations needed to complete a loop.--model-checker-show-unsupported and the JSON option settings.modelChecker.showUnsupported can be enabled to show the full list.--model-checker-show-proved-safe and the JSON option settings.modelChecker.showProvedSafe can be enabled to show the full list of safe properties.push0 instead of codesize to produce an arbitrary value on stack in order to create equal stack heights between branches.Bugfixes:
AST Changes:
internalFunctionIDs field to the AST nodes of contracts containing IDs of functions that may be called via the internal dispatch. The field is a map from function AST IDs to internal dispatch function IDs. These IDs are always generated, but they are only used in via-IR code generation.usedEvents field to ContractDefinition which contains the AST IDs of all events emitted by the contract as well as all events defined and inherited by the contract.Language Features:
using {f as +} for T global syntax.Compiler Features:
--model-checker-ext-calls trusted or the JSON field settings.modelChecker.extCalls: "trusted".Bugfixes:
z3 expressions that come from the solver when bitwise operators are used.using for.AST Changes:
function field to UnaryOperation and BinaryOperation AST nodes. functionList in UsingForDirective AST nodes will now contain operator and definition members instead of function when the list entry defines an operator.Language Features:
Compiler Features:
--no-cbor-metadata that skips CBOR metadata from getting appended at the end of the bytecode.2 on uncaught exceptions.block.difficulty and disallow difficulty() in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by EIP-4399.block.prevrandao in Solidity and prevrandao() in inline assembly for EVM versions >= paris.and(shl(X, Y), shl(X, Z)) => shl(X, and(Y, Z)).z3 the default solver for the BMC and CHC engines instead of all solvers.--model-checker-solvers eld. The binary eld must be available in the system.solidity-upgrade tool.settings.metadata.appendCBOR that skips CBOR metadata from getting appended at the end of the bytecode.selfdestruct.:) in the sequence string.keccak256 calls if the value was already calculated by a previous call and can be reused.Bugfixes:
indexed attributes for the same event parameter.indexed attribute for modifier parameters.using for outside of their declaration scope.Important Bugfixes:
Compiler Features:
'file-load-strategy' to 'directly-opened-and-on-import' in LSP settings object).Bugfixes:
.slot member of a mapping through a storage reference in inline assembly.Build System:
-DPEDANTIC=OFF flag is passed to CMake.Important Bugfixes:
Compiler Features:
mod(add(X, Y), A) into addmod(X, Y, A), if A is a power of two.mod(mul(X, Y), A) into mulmod(X, Y, A), if A is a power of two.Bugfixes:
--via-ir,--metadata-literal, --metadata-hash, --model-checker-show-unproved, --model-checker-div-mod-no-slacks, --model-checker-engine, --model-checker-invariants, --model-checker-solvers, --model-checker-timeout, --model-checker-contracts, --model-checker-targets.abi.encodeCall received a tuple expression instead of an inline tuple.abi.encodeCall type checking of free function.Important Bugfixes:
bytes arrays.Language Features:
E.selector for a non-anonymous event E to access the 32-byte selector topic.Compiler Features:
include-paths JSON settings object that can be passed during LSP configuration stage.{project_root}/node_modules to include search paths.bytes that may invalidate references.Bugfixes:
returndatacopy in cases in which it might perform out-of-bounds reads that unconditionally revert as out-of-gas. Previously, any returndatacopy that wrote to memory that was never read from was removed without accounting for the out-of-bounds condition.Important Bugfixes:
calldatasize() in all cases.Compiler Features:
sourceList field.--pretty-json works also with the following options: --abi, --asm-json, --ast-compact-json, --devdoc, --storage-layout, --userdoc.abi.encodeCall taking into account the called selector.Bugfixes:
jumpType field instead of value.using ... global in conjunction with libraries.abi.encodeCall.Important Bugfixes:
abi.encodeCall in place of fixed bytes arguments.Language Features:
using M for Type; is allowed at file level and M can now also be a brace-enclosed list of free functions or library functions.using ... for T global; is allowed at file level where the user-defined type T has been defined, resulting in the effect of the statement being available everywhere T is available.Compiler Features:
--via-ir in place of --experimental-via-ir.pops on terminating control flow.sstore and mstore operations that are never read from.Bugfixes:
type(C).creationCode, resp. the bytecode used for new C(...).Language Features:
ContractName.functionName for abi.encodeCall, in addition to external function pointers.Compiler Features:
--hashes.mstore and sstore operations if the slot already contains the same value.Bugfixes:
yulPath to support .address in function pointers.string calldata to bytes.string.concat now properly takes strings as arguments and returns string memory. It was accidentally introduced as a copy of bytes.concat before.return and the derived contract contains immutable variables.Solc-Js:
Build System:
Language Features:
abi.encodeCall(functionPointer, (arg1, arg2, ...)) that type-checks the arguments and returns the ABI-encoded function call data.Compiler Features:
--lsp option to get solc to act as a Language Server (LSP) communicating over stdio.Bugfixes:
@use-src and compiling from Yul to ewasm.Language Features:
.address and .selector on external function pointers to access their address and function selector.Compiler Features:
--yul-optimizations.--debug-info option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code.--asm, --bin, --ir-optimized, --ewasm and --ewasm-ir output selection options in assembler mode.parsing stage.block.*, msg.* and tx.* variables that are present in the called functions.--model-checker-invariants or the Standard JSON option settings.modelChecker.invariants.settings.optimizer.details.yulDetails.optimizerSteps.settings.debug.debugInfo option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code.Bugfixes:
--error-recovery option outside of the compiler mode.--libraries option. Library names not prefixed with a file name used to match any library with that name.block, msg, tx).Important Bugfixes in Experimental Features:
Build System:
Important Bugfixes:
Bugfixes:
canonicalName for UserDefinedValueTypeDefinition and ContractDefinition.Language Features:
override specifier.type(E).min and type(E).max for enums.Compiler Features:
--include-path option for specifying extra directories that may contain importable code (e.g. packaged third-party libraries).address(this).balance and msg.value.call as external calls to unknown code.value option for external function calls.Bugfixes:
--experimental-via-ir option in Standard JSON, Assembler and Linker modes.--allowed-paths or implicitly due to base path, remappings and files being compiled. Correctly handle paths that do not match imports exactly due to being relative, non-normalized or empty.import {AliasedName} from "a.sol" it would use the original name of the symbol and not the aliased one.push on storage array references returned by internal functions.abi.*, cryptographic functions and constants..slot or .offset not valid when actually .length was used.keccak256 has particular non-identifier arguments.Language Features:
block.basefee for retrieving the base fee of the current block.basefee() for retrieving the base fee of the current block.Compiler Features:
--pretty-json works also with --standard--json.--model-checker-show-unproved or the JSON option settings.modelChecker.showUnproved.--model-checker-div-mod-slacks and the JSON option is settings.modelChecker.divModWithSlacks.Bugfixes:
bytes.concat().bytes.concat() by disallowing such literals.--optimizer-runs option in assembly / yul mode.--standard-json.--standard-json gets - as a file name.if statements.Language Features:
".metadata" data object in Yul object.Bugfixes:
solcjs without the --optimize flag, use settings.optimizer.enabled=false in Standard JSON instead of omitting the key.settings.optimizer.enabled was not equivalent to setting it to false. It meant disabling also the peephole optimizer and jumpdest remover which by default still run with enabled=false.Language Features:
bytes and bytes slices to bytes1/.../bytes32.verbatim builtin function to inject arbitrary bytecode.Compiler Features:
custom:smtchecker abstract-function-nondet to be abstracted by a nondeterministic value when called.keccak256(a, c), when the value at memory location a is known at compile time and c is a constant <= 32.Bugfixes:
@return tags on public state variable documentation.bytes to fixed bytes.inliner setting under settings.optimizer.details.AST Changes:
hexValue for Yul string and hex literals.Important Bugfixes:
abi.decode can depend on data elsewhere in memory. Calldata decoding is not affected.Language Features:
bytes.concat with variable number of bytes and bytesNN arguments which behaves as a restricted version of abi.encodePacked with a more descriptive name.error keyword and introduce the revert statement.Compiler Features:
--model-checker-targets also accepts outOfBounds.--model-checker-contracts allows users to select which contracts should be analyzed as the most derived.@notice tag on non-public state variables and local variable declarations. The documentation will only be part of the AST, under the field documentation.pragma experimental SMTChecker; and set default model checker engine to none.settings.modelChecker.targets also accepts outOfBounds.settings.modelChecker.targets takes an array of string targets instead of string of comma separated targets.settings.modelChecker.contracts allows users to select which contracts should be analyzed as the most derived.Bugfixes:
kind field of ModifierInvocation for base constructor calls.--base-path or file:// prefix in imports.@returns documentation for a public state variable overriding a function.push as LHS of a compound assignment.AST Changes:
ContractDefinition nodes: usedErrors lists AST IDs of all errors used by the contract (even if defined outside).Important Bugfixes:
Compiler Features:
--machine evm15.and with constant inside or to improve storage writes of small types.Bugfixes:
array.pop nested inside 1-tuple.FixedBytes constant initialized with string literal.string casted to bytes.AST Changes:
kind field which can be modifierInvocation or baseConstructorSpecifier.Compiler Features:
@custom:.Bugfixes:
referencedDeclaration for enum members..address in some situations.AST Changes:
nameLocation to declarations to represent the exact location of the symbolic name.documentation to hold NatSpec comments above each statement.Language Features:
catch Panic(uint code) to catch a panic failure from an external call.Compiler Features:
<address>.code.length by using extcodesize directly.= as separator between library name and address in --libraries commandline option.--model-checker-targets allows specifying which targets should be checked. The valid options are all, constantCondition, underflow, overflow, divByZero, balance, assert, popEmptyArray, where the default is all. Multiple targets can be chosen at the same time, separated by a comma without spaces: underflow,overflow,assert.0x in --libraries commandline option.iszero(sub(x,y)) by eq(x,y).msg.value in counterexample transaction traces when greater than 0.unchecked blocks.modelCheckerSettings.targets allows specifying which targets should be checked. The valid options are all, constantCondition, underflow, overflow, divByZero, balance, assert, popEmptyArray, where the default is all. Multiple targets can be chosen at the same time, separated by a comma without spaces: underflow,overflow,assert.Bugfixes:
block.chainid.bytes array.uintN to intM when M > N, and by extension, explicit conversion between the same types is also disallowed.Build System:
Breaking Changes:
unchecked { ... }.revert with error signature Panic(uint256) and error codes instead of invalid opcode on failing assertions.abi, devdoc, userdoc and storage-layout are now sub-objects rather than strings.--old-reporter option.--ast-json option. Only the --ast-compact-json option is supported now.log0, log1, log2, log3 and log4.a**b**c is parsed as a**(b**c).\b, \f, and \v escape sequences.legacyAST option.this, super and _ are disallowed, with the exception of public functions and events.msg.data in receive() function.type(super).type(uint160).max to address type.byte type. It was an alias to bytes1.address type always returns a non-payable address type. In particular, address(u), address(b), address(c) and address(this) have the type address instead of address payable (Here u, b, and c are arbitrary variables of type uint160, bytes20 and contract type respectively.)address(...).code to retrieve the code as bytes memory. The size can be obtained via address(...).code.length, but it will currently always include copying the code.block.chainid for retrieving the current chain id.address(...).codehash to retrieve the codehash of an account.tx.origin and msg.sender have type address instead of address payable.chainid as view.assignimmutable builtin in the "EVM with objects" dialect takes the base offset of the code to modify as an additional argument.Language Features:
M.C(123).Bugfixes:
AST Changes:
IdentifierPath replacing in many places the UserDefinedTypeName.UncheckedBlock used for unchecked { ... }.Language Features:
calldata argument (equaling msg.data) and return bytes memory (which will not be ABI-encoded but returned as-is).i32.select and i64.select instructions.Compiler Features:
modelCheckerSettings key to settings.modelChecker.Bugfixes:
bytes.push() is used as the LHS of an assignment.super is not available in libraries.bytes000032), but allow them to be treated as identifiers.Language Features:
pragma abicoder v1 and pragma abicoder v2..offset and .length for calldata variables of dynamic array type to access their calldata offset and length (number of elements). Both of them can also be assigned to.Compiler Features:
--experimental-via-ir allows switching compilation process to go through the Yul intermediate representation. This is highly experimental and is used for development purposes.--model-checker-timeout sets a timeout in milliseconds for each individual query performed by the SMTChecker.--standard-json mode.this.selector for expressions with value known at compile-time.modelCheckerSettings.timeout sets a timeout in milliseconds for each individual query performed by the SMTChecker.settings.viaIR allows the same switch as --experimental-via-ir on the commandline.Bugfixes:
--output-dir ends with a slash.--libraries option instead of arbitrarily choosing one.array.push() is used as the LHS of an assignment.libraries being used for linking even if the file names do not match.AST Changes:
suffix for inline assembly identifiers. Currently supported values are "slot", "offset" and "length" to access the components of a Solidity variable.Important Bugfixes:
Language Features:
Compiler Features:
--model-checker-engine allows to choose a specific SMTChecker engine. Options are all (default), bmc, chc and none.keccak256, sha256, ripemd160 and ecrecover in the CHC engine.block, msg and tx in the CHC engine.modelCheckerSettings.engine allows to choose a specific SMTChecker engine. Options are all (default), bmc, chc and none.Bugfixes:
ABIEncoderV2 pragma from the current module affecting inherited functions and applied modifiers.abi.decode.Important Bugfixes:
Compiler Features:
solc --stop-after parsingexp when base is -1.addmod and mulmod.Bugfixes:
new expression.--ast-json on a function with memory arguments in ABIEncoderV2 contracts..push(<arg>) for a storage array with a nested mapping.Important Bugfixes:
Compiler Features:
exp when base is 0, 1 or 2..length property properly.address type conversion with literals, e.g. address(0).revert().type(T).min, type(T).max, and type(I).interfaceId.new bytes(123).bytesNN type.unicode"" literals.Bugfixes:
RETURNDATACOPY.virtual for modifiers in libraries.super.Language Features:
Compiler Features:
datasize(), dataoffset(), linkersymbol(), loadimmutable(), setimmutable().Bugfixes:
null member values also when the compiler is used in standard-json-mode.type(Contract).name for abstract contracts and interfaces.x in byte(a, shr(b, x)) even if the constants a and b would make the expression zero unconditionally. This optimizer rule is very hard if not impossible to trigger in a way that it can result in invalid code, though.-> token (e.g. function f() - > x {} becomes invalid in inline assembly and Yul).pop.using for directive inside interfaces.Breaking changes:
. in user-defined function and variable names.x are accessed via x.slot and x.offset instead of x_slot and x_offset.kind: "hexString".null value from JSON output.gwei as identifier.value and gas.unicode"😃".finney and szabo denominations.now (replaced by block.timestamp).using A for B only affects the contract it is mentioned in and not all derived contractsvirtual for library functions.uint256 or int256 as a type.pc().Language Features:
view can override nonpayable and pure can override view.Compiler Features:
var keyword are not recognized anymore.Bugfixes:
pure functions.pure functions.Language Features:
@inheritdoc to copy documentation from a specific base contract.i32.ctz, i64.ctz, i32.popcnt, and i64.popcnt.Compiler Features:
keccak256 of string literals at compile-time.Bugfixes:
push().push()).{value: ...}.Build System:
Language Features:
gweilinkersymbol builtin in standalone assembly mode to refer to library addresses.Compiler Features:
kind and version to the JSON output.a := sload(x) / a := mload(x).Bugfixes:
//// and /*** as NatSpec comments.calldata data location.using for applied to non-libraries.i32.drop and i64.drop, and remove drop.Important Bugfixes:
calldata parameters called via using for.Compiler Features:
--error-codes.Bugfixes:
using for is applied to explicit reference types.Language Features:
pc() is marked deprecated and will be removed in the next breaking release.Compiler Features:
--base-path PATH to use the given path as the root of the source tree (defaults to the root of the filesystem).length.push and pop.and operator.Bugfixes:
--assemble or --yul options with --machine ewasm but without specifying --yul-dialect.mapping.Important Bugfixes:
Language Features:
type(T).min and type(T).max for every integer type T that returns the smallest and largest value representable by the type.Compiler Features:
--yul-optimizations in assembly mode.br and br_if.Bugfixes:
private or internal constructors.@return tag when no other developer-documentation tags were present.** operation is too large or fractional.runtimeCode for contract types that contain immutable state variables.Language Features:
type(I).interfaceId.Compiler Features:
file:// in the field urls.--yul-optimizations in the commandline interface or optimizer.details.yulDetails.optimizerSteps in standard-json.Bugfixes:
virtual and override for constructors.Build System:
SOLIDITY_BUILD_DIR is no longer relative to REPO_ROOT to allow for build directories outside of the source tree.Important Bugfixes:
Bugfixes:
immutable property in the field mutability.Important Bugfixes:
Language Features:
immutable which causes them to be read-only, but assignable in the constructor. The value will be stored directly in the code.Compiler Features:
--storage-layout.Bugfixes:
Language Features:
value(...) and gas(...) in favor of {value: ...} and {gas: ...}_slot of local storage variable pointers.Compiler Features:
--ir-optimized.Bugfixes:
Language Features:
Compiler Features:
calldatacopy instead of codecopy to zero out memory past input.--revert-strings option or the settings.debug.revertStrings setting on debug mode.Bugfixes:
source field to legacy assembly json output to complete the source reference.abstract without contract.Language Features:
c.f{gas: 10000, value: 4 ether}().salt for contract creations and thus the create2 opcode using new C{salt: 0x1234, value: 1 ether}(arg1, arg2).true and false.Compiler Features:
Bugfixes:
--optimize is given.Build System:
Bugfixes:
Breaking changes:
constant and payable fields.type field is now required and no longer specified to default to function.libsolc): Introduce context parameter to both solidity_compile and the callback.libsolc): The provided callback now takes two parameters, kind and data. The callback can then be used for multiple purposes, such has file imports and SMT queries.libsolc): solidity_free was renamed to solidity_reset. Functions solidity_alloc and solidity_free were added.libsolc): solidity_compile now returns a string that must be explicitly freed via solidity_free()--ast).--old-reporter falls back to the deprecated old error reporter.address and add a member called address to them as replacement.override, receive, and virtual.private cannot be used together with virtual.fallback() and receive().superFunction attribute by baseFunctions.@return statements in @dev documentation and enforce named return parameters to be mentioned documentation.push(element) for dynamic storage arrays do not return the new length anymore.abstract keyword.length member of arrays is now always read-only, even for storage arrays.Language Features:
address to address payable via payable(...).try and catch.push() for dynamic storage arrays. It returns a reference to the newly allocated element, if applicable.virtual and override keywords.push(element) for dynamic storage arrays such that it does not return the new length anymore.leave statement that exits the current function.Compiler Features:
--revert-strings option or the settings.debug.revertStrings setting.Bugfixes:
Backported Bugfixes:
Bugfixes:
Language Features:
.selector.Compiler Features:
solc --yul --yul-dialect evm --machine ewasmBugfixes:
abi.decode.^0 should match 0.5.0, but no prerelease.Build System:
Language Features:
address(LibraryName).Compiler Features:
address(this).balance if using Istanbul EVM.--ewasm and as documented in standard-json.storageLayout is requested.Bugfixes:
super to a different typeLanguage Features:
Compiler Features:
Bugfixes:
Language Features:
Compiler Features:
internalType.--ewasm in the commandline interface or output selection of ewasm.wast in standard-json.bzzr0 to bzzr1 and urls to use bzz-raw://.--error-recovery commandline switch or StandardCompiler settings.parserErrorRecovery is true.Bugfixes:
msize was used in the program.Important Bugfixes:
Compiler Features:
--error-recovery commandline switch or StandardCompiler settings.parserErrorRecovery boolean.SUB(~0, X) to NOT(X).Bugfixes:
gas and value to pure (while their return type inherits state mutability from the function type).Build System:
Language Features:
callvalue() instruction does not require payable anymore.Compiler Features:
msize() and the Yul optimizer.delete.this.for loops to if statements.msize() if msize() is used.Bugfixes:
Important Bugfixes:
Language Features:
Compiler Features:
contract type.this as address."useLiteralContent" setting from the compilation input.. as part of identifiers.Bugfixes:
this or super.Build System:
--test / -t to isoltest which takes a string that allows filtering unit tests.SOLIDITY_BUILD_DIR to specify build folder and add --help usage.Important Bugfixes:
Language Features:
Compiler Features:
callvalue() inside nonpayable function (in the same way that msg.value already does).yulDetails).Bugfixes:
type(Contract).name to multiples of 32.Build System:
Important Bugfixes:
Language Features:
Compiler Features:
lt-comparisons with constants.iszero before jumpi.pop(expression).Bugfixes:
Build System:
Language Features:
string or bytes key types.type(C).name.Compiler Features:
petersburg as evmVersion and set as default.-optimize-yul.extcodehash as part of Constantinople.SafeMath.LT, GT, AND and BYTE.CREATE and CREATE2 as they are guaranteed to return an address or 0.Bugfixes:
Build System:
Language Features:
Compiler Features:
libsolc / raw soljson.js): Introduce solidity_free method which releases all internal buffers to save memory.--new-reporter for improved diagnostics formatting
along with --color and --no-color for colorized output to be forced (or explicitly disabled).Bugfixes:
storage.Build System:
Language Features:
type(C).creationCode / type(C).runtimeCode.Compiler Features:
Bugfixes:
UnimplementedFeatureError.dataoffset and datasize are literals at parse time and properly take this into account in the optimizer.Build System:
Language Features:
Compiler Features:
--optimize-runs.datasize, dataoffset and datacopy in standalone assembly mode.Bugfixes:
Build System:
Language Features:
Compiler Features:
--optimize option for assembly mode (--strict-assembly and --yul).msg, tx and block member variables.gasleft() and blockhash() functions.--assemble, --strict-assembly and --yul commandline options.Bugfixes:
--ast on empty runtime code.sha3 and suicide also without a function call.super when base contract function is not implemented.Build System:
-DLLL=ON.Solc-Js:
How to update your code:
.call() to a .call("") and every .call(signature, a, b, c) to use .call(abi.encodeWithSignature(signature, a, b, c)) (the last one only works for value types).keccak256(a, b, c) to keccak256(abi.encodePacked(a, b, c)).public to every function and external to every fallback or interface function that does not specify its visibility already.external.uint[] x = m_x to uint[] storage x = m_x. Note that external functions require parameters with a data location of calldata.address member. Example: if c is a contract, change c.transfer(...) to address(c).transfer(...).address payable, if you want to call transfer on them.Breaking Changes:
msg.data and external function parameters). Use abi.encodePacked for unpadded encoding.libsolc / raw soljson.js): Removed the version, license, compileSingle, compileJSON, compileJSONCallback methods
and replaced them with the solidity_license, solidity_version and solidity_compile methods.ABI decoder and therefore also applies to abi.decode().STATICCALL for pure and view functions. This was already the case in the experimental 0.5.0 mode.--formal option.--julia option to --yul.- if standard input is used as source.continue in a do...while loop jumps to the condition (it used to jump to the loop body). Warning: this may silently change the semantics of existing code.callcode (was already deprecated in 0.4.12). It is still possible to use it via inline assembly.var keyword.sha3 and suicide aliases.throw statement. This was already the case in the experimental 0.5.0 mode.years unit denomination (was already deprecated in 0.4.24)emit as a keyword instead of parsing it as identifier.calldata and constructoralias, apply, auto, copyof, define, immutable,
implements, macro, mutable, override, partial, promise, reference, sealed,
sizeof, supports, typedef and unchecked.sha3 and suicide0x1e wei). This was already the case in the experimental 0.5.0 mode.constant and payable fields (the information is encoded in the stateMutability field).isConstructor field by a new kind field, which can be constructor, fallback or function.--clone-bin and --combined-json clone-bin commandline options are not available anymore.PUSH1 0 NOT AND sequence.constant as function state mutability modifier.bytesX and uintY of different size.address can still achieve it.bytes type for .call() (and family), keccak256(), sha256() and ripemd160().address member from a contract.bytesXX types.bytesXX types of different size.msg.value in (or introducing it via a modifier to) a non-payable function.std directory from the Solidity repository. This means accessing https://github.com/ethereum/solidity/blob/develop/std/*.sol (or https://github.com/ethereum/solidity/std/*.sol in Remix) will not be possible.+. This was already the case in the experimental 0.5.0 mode.Language Features:
staticcall to address.calldata keyword to types, to explicitly specify data location for arguments of external functions.pop() for storage arrays.enums in interfaces.mapping storage pointers as arguments and return values in all internal functions.structs in interfaces.abi.decode(bytes memory data, (...)).address payable type during parsing.Compiler Features:
CREATE2 instruction has been updated to match EIP1014 (aka "Skinny CREATE2"). It also is accepted as part of Constantinople.EXTCODEHASH instruction has been added based on EIP1052.pragma experimental "v0.5.0";.Bugfixes:
-DUSE_CVC4=OFF or -DUSE_Z3=OFF.@notice and @dev tags on contract definitions._slot and _offset suffixes on their own.storage as data location for mappings._slot and _offset.0, such as -1e-100.Important Bugfixes:
Bugfixes:
Note: The above changes are not included in 0.5.0, because they were backported.
Important Bugfixes:
/** / as unterminated multi-line comment.Language Features:
(uint a, uint b) = ....constant as function state modifier from documentation and tests (but still leave it as a valid feature).years unit denomination and raise a warning for it (or an error as experimental 0.5.0 feature).keccak256, sha256 and ripemd160 are not used with a single bytes argument (suggest to use abi.encodePacked(...)). This will turn into an error with version 0.5.0.Compiler Features:
ADDRESS, CALLER, ORIGIN and COINBASE).Bugfixes:
revert with reason coming from a state or local string variable.emit a non-event.Features:
Bugfixes:
bytesXX to contract is properly disallowed.Features:
msize().x.push(...)--ignore-missing flag.abi.encodePacked, abi.encode, abi.encodeWithSelector and abi.encodeWithSignature.gasleft() and deprecate msg.gas.blockhash(uint) and deprecate block.hash(uint).revert() and require().constructor keyword as experimental 0.5.0 feature.SHL and SHR only involving constants (Constantinople only).SWAP1 instruction preceding a commutative instruction (such as ADD, MUL, etc).LT, GT, etc) with opposites if preceded by SWAP1, e.g. SWAP1 LT is replaced with GT.mload if msize() is not used.address.Bugfixes:
block.blockhash without being called.--evm-version constantinople properly.var declaration without identifier.constantinople as evmVersion properly.Features:
k != 0 for mulmod(a, b, k) and addmod(a, b, k) as experimental 0.5.0 feature.STATICCALL opcode for calling view and pure functions as experimental 0.5.0 feature.emit EventName(); to call events explicitly.pragma experimental "v0.5.0" and do not set the experimental flag in the bytecode for this.throw as an error as experimental 0.5.0 feature.address on contract instances.Bugfixes:
_offset and _slot for constants in inline assembly.Features:
--strict-assembly switch.x % 2**i by x & (2**i-1).var keyword (and mark it an error as experimental 0.5.0 feature).this.f.selector to be a pure expression.public visibility for interface functions.Bugfixes:
sourceLocation field in the error list.structs as function parameters
(instead of an internal compiler error).Features:
pragma experimental ABIEncoderV2;).if statement.outputSelection field for selective compilation of target artifacts.callcode into an error as experimental 0.5.0 feature.Bugfixes:
Features:
outputSelection field for selective compilation of supplied sources.+ is now a syntax error as experimental 0.5.0 feature.address to contracts as experimental 0.5.0 feature.storage or memory keyword for local variables as experimental 0.5.0 feature.Bugfixes:
gas in view functions.address in a contract
(such as balance, transfer, etc.)Features:
x, y := f()).structs as arguments and return parameters (requires pragma experimental ABIEncoderV2; for now).pragma experimental "v0.5.0"; to activate upcoming breaking changes..selector member on external function types to retrieve their signature.JUMPDESTs.sha3 and suicide
(replaced by keccak256 and selfdestruct, introduced in 0.4.2 and 0.2.0, respectively).keccak256, sha3, sha256 and ripemd160.view and pure.view / constant with error as experimental 0.5.0 feature.external as experimental 0.5.0 feature.Bugfixes:
Features:
stateMutability with values pure, view,
nonpayable and payable.libsolutil, libevmasm, libsolidity
and liblll) are no longer produced during the build process.pure and view keyword for functions,
constant remains an alias for view and pureness is not enforced yet,
so use with care.pragma experimental <feature>; to turn on
experimental features.Bugfixes:
using.new statement.Features:
Bugfixes:
.delegatecall() should always return execution outcome.callcode and delegatecall..gas() modifier on ecrecover, sha256 and ripemd160.Features:
jsonCompiler): Export the license method.this in a constructor.Bugfixes:
Features:
storage.Bugfixes:
Features:
CREATE2 (EIP86), STATICCALL (EIP214), RETURNDATASIZE and RETURNDATACOPY (EIP211) instructions.SHA3 to KECCAK256.jsonCompiler): Use the Standard JSON I/O internally.for and switch statements.keccak256 as an opcode. sha3 is still a valid alias.jumps.callcode.Bugfixes:
MLOAD to have side effects in the optimiser.REVERT instead of INVALID for generated input validation routines.MLOAD because it changes MSIZE.Features:
interface contracts.jsonCompiler): Add the compileStandard() method to process a Standard JSON I/O.--standard-json parameter to process a Standard JSON I/O.--allow-paths to define trusted import paths. Note: the
path(s) of the supplied source file(s) is always trusted._slot and _offset suffixes.Bugfixes:
Features:
assert(condition), which throws if condition is false (meant for internal errors).require(condition), which throws if condition is false (meant for invalid input)..transfer(value) for sending Ether.revert() to abort with rolling back, but not consuming all gas.revert (EIP140) as an opcode.2e8 and 200e-2).Bugfixes:
/, : and . with _).. and ...var declaration with empty tuple type.Features:
file: prefix to make them unique.invalid (EIP141) as an opcode.Bugfixes:
@param parsing and whitespace.Features:
Bugfixes:
import ".dir/a" is not a relative path. Relative paths begin with directory . or ...Features:
msg.value is used in non-payable function.Bugfixes:
VariableDefinitionStatement nodes with VariableDeclarationStatementElementaryTypeNameExpressionpublic field with visibility in the function definition nodesBugfixes:
Features:
do <block> while (<expr>); control structureinvalidJumpLabel as a jump label.Bugfixes:
Bugfixes:
Features:
suicide and selfdestruct opcodes
(note: suicide is deprecated).keccak256() as an alias to sha3().Bugfixes:
solc.enum definitions.super.x does not look up x in the current contract.super as an expression.L.Foo for enum Foo defined in library L.enum definitions.address opcode.this, super, etc.)
are properly detected as unusable.Bugfixes:
This release deliberately breaks backwards compatibility mostly to
enforce some safety features. The most important change is that you have
to explicitly specify if functions can receive ether via the payable
modifier. Furthermore, more situations cause exceptions to be thrown.
Minimal changes to be made for upgrade:
payable to all functions that want to receive Ether
(including the constructor and the fallback function)._ to _; in modifiers.pragma solidity ^0.4.0;Breaking Changes:
pragma solidity ^0.4.0; or
pragma solidity >=0.4.0 <0.4.8;payable modifier (otherwise they throw).payable
modifier. Contracts now throw if no payable fallback
function is defined and no function matches the signature._ (use if (false) _ as a workaround if needed)._._ in modifier now requires explicit ;.ecrecover now returns zero if the input is malformed (it previously returned garbage).constant keyword cannot be used for constructors or the fallback function.--interface (Solidity interface) output optionsrcmap-runtime renamed to srcmapRuntime.import "std"; or import owned; do not work anymore).after was removed.abstract, hex, interface, payable, pure, static, view.Features:
hex"ab1248fe"- as filename allows reading from stdin.Bugfixes:
sha3() was used on unsupported types..send(0).Lots of changes to the documentation mainly by voluntary external contributors.
Features:
Bugfixes:
Features:
Bugfixes:
No change outside documentation.
solc without arguments on a terminal will print help.byte opcode was unusableBREAKING CHANGES:
assembly, foreign, fixed, ufixed, fixedNxM, ufixedNxM (for various values of M and N), timestamp1 / 2 != 1, but 1 / 2 == 0.5).msg.value and msg.sender).<address>.delegatecall as a low-level calling interfaceBugfixes:
bytes1, ..., bytes32 (only read access for now).var y = [1,x,f()]; if there is a common type for 1, x and f(). Note that the result is always a fixed-length memory array and conversion to dynamic-length memory arrays is not yet possible.import "abc.sol" as d and import {x, y} from "abc.sol").x ? y : z(x) = 7.uint176 was not available.new ContractName.value(10)() has to be written as (new ContractName).value(10)()selfdestruct as an alias for suicide.new.using x for yaddmod and mulmod (modular addition and modular multiplication with arbitrary intermediate precision)bytes or string overwrite others..push() for dynamic storage arrays.(1,2,3) or return (1,2,3);)var (x,y,) = (1,2,3,4,5); or var (x,y) = f();)(x,y,) = (1,2,3))Library.structType a at statement level...new automatically.throw statement.bytes and string.bytesXX types. (#2087)string and bytes state variables.