Releases: tronprotocol/solidity
0.8.25_Kant_v4.8.0
TRON Solidity compiler 0.8.25 is fully compatible with Ethereum Solidity 0.8.25.
New Features from TRON
Compiler Features:
- IR Generator: Support for all TRON features (experimental).
- Compilation via Yul IR is now re-marked as experimental.
- Commandline Interface: Using the
--via-irwill now trigger a error and terminate the compilation, use--experimental-via-irinstead.
Bugfixes:
- IR Generator: When compiling
non-payablemethods, verification code forcalltokenidandcalltokenvalueis now automatically generated by default. - Code Generator: The
verifyMintProofandverifyTransferProofprecompiled contracts will now remove redundant duplicate return elements.
Major changelog from Ethereum
Compiler Features:
- Code Generator: Use
MCOPYinstead ofMLOAD/MSTOREloop when copying byte arrays. - EVM: Set default EVM version to
cancun. - Yul Analyzer: Emit transient storage warning only for the first occurrence of
tstore.
Bugfixes:
- Assembler: Prevent incorrect calculation of tag sizes.
- Commandline Interface: Do not run IR pipeline when
--via-iris used but no output that depends on the IR is requested. - EVM Assembly Import: Fix handling of missing source locations during import.
- SMTChecker: Ensure query is properly flushed to a file before calling solver when using SMT-LIB interface.
- SMTChecker: Fix internal error caused by not respecting the sign of an integer type when constructing zero-value SMT expressions.
- SMTChecker: Run Eldarica only when explicitly requested with
--model-checker-solvers eld, even when it is present on the system.
0.8.24_Kant_v4.8.0
TRON Solidity compiler 0.8.24 is fully compatible with Ethereum Solidity 0.8.24.
IMPORTANT NOTE: The default target VM version for this compiler is still "Shanghai". TRON provides support for "Cancun" network upgrade in the GreatVoyage-v4.8.0 (Kant) network upgrade. Please make sure that your TRON network is enabled to support the "Cancun" upgrade when you use the compiler. The 83th network parameter getAllowTvmCancun will support MCOPY, TLOAD and TSTORE opcodes, and the 89th network parameter getAllowTvmBlob will support BLOBHASH and BLOBBASEFEE opcodes.
Major changelog from Ethereum
Introducing the newest version of the Solidity Compiler!
We are excited to announce the release of the Solidity Compiler Solidity v0.8.24. This newest version of the compiler brings readiness for the "Cancun" network upgrade, including support for transient storage (EIP-1153), shard blob transactions (EIP-4844), & more. The release binaries for macOS are now also compatible with Apple Silicon chips.
Notable Features
- Support for transient storage for inline assembly (EIP-1153)
- Support for BLOBBASEFEE (EIP-7516)
- Support for MCOPY (EIP-5656)
- Changes in SELFDESTRUCT Behavior (EIP-6780)
- Support for Apple Silicon
Changelog
Language Features
- Introduce global
block.blobbasefeefor retrieving the blob base fee of the current block. - Introduce global function
blobhash(uint)for retrieving versioned hashes of blobs, akin to the homonymous Yul builtin. - Yul: Introduce builtin
blobbasefee()for retrieving the blob base fee of the current block. - Yul: Introduce builtin
blobhash()for retrieving versioned hashes of blobs associated with the transaction. - Yul: Introduce builtin
mcopy()for cheaply copying data between memory areas. - Yul: Introduce builtins
tload()andtstore()for transient storage access.
Compiler Features
- EVM: Support for the EVM Version "Cancun".
- SMTChecker: Support
bytes.concatexcept when string literals are passed as arguments. - Standard JSON Interface: Add experimental support to import EVM assembly in the format used by
--asm-json. - TypeChecker: Comparison of internal function pointers now yields a warning, as it can produce unexpected results with the legacy pipeline enabled.
Bugfixes:
- AST import: Fix bug when importing inline assembly with empty
letvariable declaration.
0.8.23_Epicurus_v4.7.7
TRON Solidity compiler 0.8.23 is fully compatible with Ethereum Solidity 0.8.23.
Major changelog from Ethereum
Changelog
Important Bugfixes:
- Optimizer: Fix block deduplicator bug which led to blocks which are identical apart from the contents of
verbatiminstructions to be treated as equivalent and thus collapsed into a single one.
Compiler Features:
- Commandline Interface: An empty
--yul-optimizationssequence can now be always provided. - Standard JSON Interface: An empty
optimizerStepssequence can now always be provided.
0.8.22_Anaximander_v4.7.6
TRON Solidity compiler 0.8.22 is fully compatible with Ethereum Solidity 0.8.22.
Major changelog from Ethereum
IMPORTANT NOTE:
This release deprecates support for EVM versions older than Constantinople for the reason of ruling out the need to maintain multiple complex code paths or workarounds for ancient EVM versions. In case you rely on the support for such EVM versions, please reach out to us.
Notable Features:
- Unchecked loop increments
- Adding support for importing EVM Assembly JSON (experimental)
- Adjusting Yul optimizer to rematerialize zero literals
Changelog
Language Features:
- Allow defining events at file level.
Compiler Features:
- Code Generator: Remove redundant overflow checks of certain
forloops when the counter variable cannot overflow. - Commandline Interface: Add
--no-import-callbackoption that prevents the compiler from loading source files not given explicitly on the CLI or in Standard JSON input. - Commandline Interface: Add an experimental
--import-asm-jsonoption that can import EVM assembly in the format used by--asm-json. - Commandline Interface: Use proper severity and coloring also for error messages produced outside of the compilation pipeline.
- EVM: Deprecate support for "homestead", "tangerineWhistle", "spuriousDragon" and "byzantium" EVM versions.
- Parser: Remove the experimental error recovery mode (
--error-recovery/settings.parserErrorRecovery). - SMTChecker: Support user-defined operators.
- Yul Optimizer: If
PUSH0is supported, favor zero literals over storing zero values in variables. - Yul Optimizer: Run the
RematerializerandUnusedPrunersteps at the end of the default clean-up sequence.
Bugfixes:
- Code Generator: Fix output from via-IR code generator being dependent on which files were discovered by import callback. In some cases, a different AST ID assignment would alter the order of functions in internal dispatch, resulting in superficially different but semantically equivalent bytecode.
- NatSpec: Fix internal error when requesting
userdocordevdocfor a contract that emits an event defined in a foreign contract or interface. - SMTChecker: Fix encoding error that causes loops to unroll after completion.
- SMTChecker: Fix inconsistency on constant condition checks when
whileorforloops are unrolled before the condition check. - Yul Optimizer: Fix replacement decisions during CSE being affected by Yul variable names generated by the compiler, resulting in different (but equivalent) bytecode in some situations.
AST Changes:
- AST: Fix wrong initial ID for Yul nodes in the AST.
0.8.21_Anaximander_v4.7.6
TRON Solidity compiler 0.8.21 is fully compatible with Ethereum Solidity 0.8.21.
Major changelog from Ethereum
Important Bugfixes:
- Code Generator: Always generate code for the expression in
<expression>.selectorin the legacy code generation pipeline. - Yul Optimizer: Fix
FullInlinerstep (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 byExpressionSplitter(x)).
Language Features:
- Allow qualified access to events from other contracts.
- Relax restrictions on initialization of immutable variables. Reads and writes may now happen at any point at construction time outside of functions and modifiers. Explicit initialization is no longer mandatory.
Compiler Features:
- Commandline Interface: Add
--ast-compact-jsonoutput in assembler mode. - Commandline Interface: Add
--ir-ast-jsonand--ir-optimized-ast-jsonoutputs for Solidity input, providing AST in compact JSON format for IR and optimized IR. - Commandline Interface: Respect
--optimize-yuland--no-optimize-yulin compiler mode and accept them in assembler mode as well.--optimize --no-optimize-yulcombination now allows enabling EVM assembly optimizer without enabling Yul optimizer. - EWasm: Remove EWasm backend.
- Parser: Introduce
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. - SMTChecker: Add
--model-checker-print-queryCLI option andsettings.modelChecker.printQueryJSON option to output the SMTChecker queries in the SMTLIB2 format. This requires usingsmtlib2solver only. - Standard JSON Interface: Add
astfile-level output for Yul input. - Standard JSON Interface: Add
irAstandirOptimizedAstcontract-level outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR. - Yul Optimizer: Remove experimental
ReasoningBasedSimplifieroptimization step. - Yul Optimizer: Stack-to-memory mover is now enabled by default whenever possible for via IR code generation and pure Yul compilation.
Bugfixes:
- Code Generator: Disallow complex expressions whose results are types, built-ins, modules or some unassignable functions. The legacy code generation pipeline would not actually evaluate them, discarding any side effects they might have.
- Code Generator: Fix not entirely deterministic order of functions in unoptimized Yul output. The choice of C++ compiler in some cases would result in different (but equivalent) bytecode (especially from native binaries vs emscripten binaries).
- Commandline Interface: Fix internal error when using
--stop-after parsingand requesting some of the outputs that require full analysis or compilation. - Commandline Interface: It is no longer possible to specify both
--optimize-yuland--no-optimize-yulat the same time. - SMTChecker: Fix encoding of side-effects inside
ifandternary conditionalstatements in the BMC engine. - SMTChecker: Fix false negative when a verification target can be violated only by a trusted external call from another public function.
- SMTChecker: Fix generation of invalid SMT-LIB2 scripts in BMC engine with trusted mode for external calls when CHC engine times out.
- SMTChecker: Fix internal error caused by incorrectly classifying external function call using function pointer as a public getter.
- SMTChecker: Fix internal error caused by using external identifier to encode member access to functions that take an internal function as a parameter.
- Standard JSON Interface: Fix an incomplete AST being returned when analysis is interrupted by certain kinds of fatal errors.
- Type Checker: Disallow using certain unassignable function types in complex expressions.
- Type Checker: Function declaration types referring to different declarations are no longer convertible to each other.
- Yul Optimizer: Ensure that the assignment of memory slots for variables moved to memory does not depend on AST IDs that may depend on whether additional files are included during compilation.
- Yul Optimizer: Fix
FullInlinerstep not ignoring code that is not in expression-split form. - Yul Optimizer: Fix optimized IR being unnecessarily passed through the Yul optimizer again before bytecode generation.
AST Changes:
- AST: Add the
experimentalSolidityfield to theSourceUnitnodes, which indicates whether the experimental parsing mode has been enabled viapragma experimental solidity.
0.8.20_Periander_v4.7.2
TRON Solidity compiler 0.8.20 is fully compatible with Ethereum Solidity 0.8.20.
IMPORTANT NOTE: This compiler switches the default target VM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate VM version in case you intend to deploy on mainnet or testnet that may not yet support PUSH0, otherwise deployment of your contracts will fail. You can verify that the network supports the PUSH0 by checking that the 76th network parameter allowTvmShanghai is on.
Major changelog from Ethereum
Language Features:
- Allow defining custom operators for user-defined value types via
using {f as +} for T globalsyntax.
Compiler Features:
- SMTChecker: New trusted mode that assumes that any compile-time available code is the actual used code, even in external calls. This can be used via the CLI option
--model-checker-ext-calls trustedor the JSON fieldsettings.modelChecker.extCalls: "trusted". - Assembler: Use
push0for placing0on the stack for EVM versions starting from "Shanghai". This decreases the deployment and runtime costs. - EVM: Set default EVM version to "Shanghai".
- EVM: Support for the EVM Version "Shanghai".
- SMTChecker: Group all messages about unsupported language features in a single warning. The CLI option
--model-checker-show-unsupportedand the JSON optionsettings.modelChecker.showUnsupportedcan be enabled to show the full list. - SMTChecker: Properties that are proved safe are now reported explicitly at the end of analysis. By default, only the number of safe properties is shown. The CLI option
--model-checker-show-proved-safeand the JSON optionsettings.modelChecker.showProvedSafecan be enabled to show the full list of safe properties. - Yul EVM Code Transform: If available, use
push0instead ofcodesizeto produce an arbitrary value on stack in order to create equal stack heights between branches.
Bugfixes:
- Assembler: Avoid duplicating subassembly bytecode where possible.
- Code Generator: Avoid including references to the deployed label of referenced functions if they are called right away.
- ContractLevelChecker: Properly distinguish the case of missing base constructor arguments from having an unimplemented base function.
- SMTChecker: Fix internal error caused by unhandled
z3expressions that come from the solver when bitwise operators are used. - SMTChecker: Fix internal error when using the custom NatSpec annotation to abstract free functions.
- TypeChecker: Also allow external library functions in
using for. - ABI: Include events in the ABI that are emitted by a contract but defined outside of it.
- Immutables: Disallow initialization of immutables in try/catch statements.
- SMTChecker: Fix false positives in ternary operators that contain verification targets in its branches, directly or indirectly.
Integrity Check
All binaries in this release are signed via this GPG key:
- PUB: 1254 F859 D2B1 BD9F 66E7 107D F859 BCB4 4A28 290B
- UID: [email protected]
From the download listings below you should see links to the downloadable binaries as well as sig signature files. To verify the authenticity of any binary, grab the binary and sig files with the same prefix name and then execute the verification process: GPG signature verification
0.8.18_Sartre_4.7.1
TRON Compiler Solidity v0.8.18 is fully compatible with Ethereum Solidity Compiler v0.8.18.
In addition, this release supports new instructions and precompile contracts introduced in TIP-467.
Please see the Solidity example to use.
Requirement
- Developers can only use these new instructions and precompile contracts after the related proposal has been approved on TRON mainnet.
New Features from TRON:
- TVM: Introduce
freezebalancev2(uint256,uint256)in Solidity. - TVM: Introduce
unfreezebalancev2(uint256,uint256)in Solidity. - TVM: Introduce
cancelallunfreezev2()in Solidity. - TVM: Introduce
withdrawexpireunfreeze()in Solidity. - TVM: Introduce
<address payable>.delegateResource(uint256,uint256)in Solidity. - TVM: Introduce
<address payable>.unDelegateResource(uint256,uint256)in Solidity. - TVM: Introduce new magic type
chainin Solidity and the parameters that can be queried includechain.totalNetLimit,chain.totalNetWeight,chain.totalEnergyCurrentLimit,chain.totalEnergyWeightandchain.unfreezeDelayDays. - TVM: Introduce
<address>.availableUnfreezeV2Size()in Solidity. - TVM: Introduce
<address>.unfreezableBalanceV2(uint256)in Solidity. - TVM: Introduce
<address>.expireUnfreezeBalanceV2(uint256)in Solidity. - TVM: Introduce
<address>.delegatableResource(uint256)in Solidity. - TVM: Introduce
<address>.resourceV2(address,uint256)in Solidity. - TVM: Introduce
<address>.checkUnDelegateResource(address,uint256)in Solidity. - TVM: Introduce
<address>.resourceUsage(uint256)in Solidity. - TVM: Introduce
<address>.totalResource(uint256)in Solidity. - TVM: Introduce
<address>.totalDelegatedResource(uint256)in Solidity. - TVM: Introduce
<address>.totalAcquiredResource(uint256)in Solidity.
Important Bugfixes:
- Code Generator: Correctly encode literals used in
abi.encodeCallin place of fixed bytes arguments. - ABI Encoder: When ABI-encoding values from calldata that contain nested arrays, correctly validate the nested array length against
calldatasize()in all cases. - Override Checker: Allow changing data location for parameters only when overriding external functions.
- Code Generation: Avoid writing dirty bytes to storage when copying
bytesarrays. - Yul Optimizer: Keep all memory side-effects of inline assembly blocks.
- Code Generation: Fix data corruption that affected ABI-encoding of calldata values represented by tuples: structs at any nesting level; argument lists of external functions, events and errors; return value lists of external functions. The 32 leading bytes of the first dynamically-encoded value in the tuple would get zeroed when the last component contained a statically-encoded array.
- Yul Optimizer: Prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call.
Language Features:
- General: Add equality-comparison operators for external function types.
- General: Support
ContractName.functionNameforabi.encodeCall, in addition to external function pointers. - General: Allow annotating inline assembly as memory-safe to allow optimizations and stack limit evasion that rely on respecting Solidity's memory model.
- General:
using M for Type;is allowed at file level andMcan now also be a brace-enclosed list of free functions or library functions. - General:
using ... for T global;is allowed at file level where the user-defined typeThas been defined, resulting in the effect of the statement being available everywhereTis available. - Add
E.selectorfor a non-anonymous eventEto access the 32-byte selector topic. - Support using library constants in initializers of other constants.
- Allow named parameters in mapping types.
Compiler Features:
- EVM: Deprecate
block.difficultyand disallowdifficulty()in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by EIP-4399. - EVM: Introduce
block.prevrandaoin Solidity andprevrandao()in inline assembly for EVM versions >= paris. - EVM: Set the default EVM version to "Paris".
- EVM: Support for the EVM version "Paris".
- TypeChecker: Warn when using deprecated builtin
selfdestruct.
Build System:
- Emscripten builds store the embedded WebAssembly binary in LZ4 compressed format and transparently decompress on loading.
- Allow disabling pedantic warnings and do not treat warnings as errors during compiler build when
-DPEDANTIC=OFFflag is passed to CMake. - Update emscripten to version 3.1.19.
0.8.11_Rousseau_v4.4
TRON Solidity compiler 0.8.11 is fully compatible with Ethereum Solidity 0.8.11.
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
--lspoption to getsolcto act as a Language Server (LSP) communicating over stdio.
Bugfixes:
- Code Generator: Fix a crash when using
@use-srcand compiling from Yul to ewasm. - 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.
0.8.7_Rousseau_v4.4
TRON Solidity compiler 0.8.7 is fully compatible with Ethereum Solidity 0.8.7.
Language Features:
- Introduce global
block.basefeefor retrieving the base fee of the current block. - Yul: Introduce builtin
basefee()for retrieving the base fee of the current block.
Compiler Features:
- AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
- Commandline Interface: option
--pretty-jsonworks also with--standard--json. - EVM: Set the default EVM version to "London".
Bugfixes:
- Code Generator: Fix crash when passing an empty string literal to
bytes.concat(). - Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays.
- Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to
bytes.concat()by disallowing such literals. - Commandline Interface: Apply
--optimizer-runsoption in assembly / yul mode.
0.8.6_Bacon_v4.3
TRON Solidity_v0.8.6 is fully compatible with Ethereum Solidity_v0.8.6.
In addition, this release supports two new instructions and six precompile contracts introduced in TIP-271.
Please see the usage-example to use.
Requirement
- Developers can only use these new instructions and precompile contracts after proposal TIP-271 has been approved in TRON mainnet.
New Features from TRON
- Add
VOTEWITNESSinstruction: Smart contract can vote for witness and get reward from the system. - Add
WITHDRAWREWARDinstruction: Smart contract can withdraw allowance and reward to it's balance. - Add
RewardBalanceprecompile contract: Smart contract can query it's own allowance and reward. - Add
IsSrCandidateprecompile contract: Smart contract can judge whether the address is a candidate address. - Add
VoteCountprecompile contract: Smart contract can query the vote count offrom addressvotes forto address. - Add
UsedVoteCountprecompile contract: Smart contract can query account's used vote count. - Add
ReceivedVoteCountprecompile contract: Smart contract can query account's recevied vote count. - Add
TotalVoteCountprecompile contract: Smart contract can query account's total vote count.
New Features from Ethereum Solidity 0.8.6
- Possibility to use
catch Panic(uint code)to catch a panic failure from an external call. - Code Generator: Reduce the cost of
<address>.code.lengthby usingextcodesizedirectly. - Allowing conversion from
bytesandbytesslices tobytes1...bytes32.
Important Bugfixes
- Optimizer: Fix bug on incorrect caching of Keccak-256 hashes.
- ABI Decoder V2: For two-dimensional arrays and specially crafted data in memory, the result of
abi.decodecan depend on data elsewhere in memory. Calldata decoding is not affected.
Build System
- Update the soljson.js build to emscripten 2.0.12 and boost 1.75.0.