Skip to content

0.8.18_Sartre_4.7.1

Compare
Choose a tag to compare
@yanghang8612 yanghang8612 released this 01 Mar 09:36
· 352 commits to develop since this release
f18bedf

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 chain in Solidity and the parameters that can be queried include chain.totalNetLimit, chain.totalNetWeight, chain.totalEnergyCurrentLimit, chain.totalEnergyWeight and chain.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.encodeCall in 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 bytes arrays.
  • 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.functionName for abi.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 and M can 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 type T has been defined, resulting in the effect of the statement being available everywhere T is available.
  • Add E.selector for a non-anonymous event E to 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.difficulty and disallow difficulty() in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by EIP-4399.
  • EVM: Introduce block.prevrandao in Solidity and prevrandao() 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=OFF flag is passed to CMake.
  • Update emscripten to version 3.1.19.