Skip to content

Releases: tronprotocol/solidity

0.8.0_Plato_v4.2

02 Jul 10:43
Compare
Choose a tag to compare

TRON Solidity compiler 0.8.0 is fully compatible with Ethereum Solidity 0.8.0.

Breaking Changes

  • Code Generator: All arithmetic is checked by default. These checks can be disabled using unchecked { ... }.
  • Code Generator: Cause a panic if a byte array in storage is accessed whose length is encoded incorrectly.
  • Code Generator: Use revert with error signature Panic(uint256) and error codes instead of invalid opcode on failing assertions.
  • General: Enable ABI coder v2 by default.
  • General: Remove global functions log0, log1, log2, log3 and log4.
  • Parser: Exponentiation is right associative. a**b**c is parsed as a**(b**c).
  • Type Checker: Function call options can only be given once.
  • Type System: Declarations with the name this, super and _ are disallowed, with the exception of public functions and events.
  • Type System: Disallow msg.data in receive() function.
  • Type System: Disallow type(super).
  • Type System: Disallow enums with more than 256 members.
  • Type System: Disallow explicit conversions from negative literals and literals larger than type(uint160).max to address type.
  • Type System: Disallow the byte type. It was an alias to bytes1.
  • Type System: Explicit conversion to 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.)
  • Type System: Explicit conversions between two types are disallowed if it changes more than one of sign, width or kind at the same time.
  • Type System: Explicit conversions from literals to enums are only allowed if the value fits in the enum.
  • Type System: Explicit conversions from literals to integer type is as strict as implicit conversions.
    Type System: Introduce 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.
  • Type System: Introduce block.chainid for retrieving the current chain id.
  • Type System: Support address(...).codehash to retrieve the codehash of an account.
  • Type System: The global variables tx.origin and msg.sender have type address instead of address payable.
  • Type System: Unary negation can only be used on signed integers, not on unsigned integers.
  • View Pure Checker: Mark chainid as view.

New Features

  • Inheritance: Allow overrides to have stricter state mutability: view can override nonpayable and pure can override view.
  • Parser: Deprecate visibility for constructors.
  • State mutability: Do not issue recommendation for stricter mutability for virtual functions but do issue it for functions that override.

Language Feature

  • Super constructors can now be called using the member notation e.g. M.C(123).

Bugfix

  • Type Checker: Perform proper truncating integer arithmetic when using constants in array length expressions.

0.7.6_Plato_v4.2

25 Jun 06:43
Compare
Choose a tag to compare

TRON Solidity compiler 0.7.6 is fully compatible with Ethereum Solidity 0.7.6.

New Features

  • Code generator: Support conversion from calldata slices to memory and storage arrays.
  • Code generator: Support copying dynamically encoded structs from calldata to memory.
  • Code generator: Support copying of nested arrays from calldata to memory.
  • The fallback function can now also have a single calldata argument (equaling msg.data) and return bytes memory (which will not be ABI-encoded but returned as-is).

Compiler Features

  • Build System: Optionally support dynamic loading of Z3 and use that mechanism for Linux release builds.
  • Code Generator: Avoid memory allocation for default value if it is not used.

Bugfixes

  • Code generator: Do not pad empty string literals with a single 32-byte zero field in the ABI coder v1.
  • Type Checker: super is not available in libraries.
  • Type Checker: Disallow leading zeroes in sized-types (e.g. bytes000032), but allow them to be treated as identifiers.

0.7.0_Plato_v4.2

03 Jun 02:55
Compare
Choose a tag to compare

TRON Solidity compiler 0.7.0 is fully compatible with Ethereum Solidity 0.7.0.

Breaking Changes

  • Inline Assembly: Disallow . in user-defined function and variable names.
  • Inline Assembly: Slot and offset of storage pointer variable x are accessed via x.slot and x.offset instead of x_slot and x_offset.
  • Parser: Disallow dot syntax for value and gas.
  • Parser: Remove the identifier now (replaced by block.timestamp).
  • Reference Resolver: using A for B only affects the contract it is mentioned in and not all derived contracts.
  • Type Checker: Disallow virtual for library functions.
  • Type Checker: Disallow assignments to state variables that contain nested mappings.
  • Type checker: Disallow events with same name and parameter types in inheritance hierarchy.
  • Type Checker: Disallow shifts by signed types.
  • Type Checker: Disallow structs and arrays in memory or calldata if they contain nested mappings.
  • Type Checker: Exponentiation and shifts of literals by non-literals will always use uint256 or int256 as a type.

New Features

  • Inheritance: Allow overrides to have stricter state mutability: view can override nonpayable and pure can override view.
  • Parser: Deprecate visibility for constructors.
  • State mutability: Do not issue recommendation for stricter mutability for virtual functions but do issue it for functions that override.

Compiler Feature

  • Variable declarations using the var keyword are not recognized anymore.

Bugfixes

  • Inheritance: Disallow public state variables overwriting pure functions.
  • State Mutability: Constant public state variables are considered pure functions.
  • Type Checker: Fixing deduction issues on function types when function call has named arguments.

0.6.12_Plato_v4.2

27 May 08:32
Compare
Choose a tag to compare

TRON Solidity compiler 0.6.12 is fully compatible with Ethereum Solidity 0.6.12.
Note the binary size of the solc-js increase because of the Z3 SMT solver built-in.

New Feature

  • Permit calldata location for all variables.

Important Bugfix

  • Fixed a bug related to internal library functions with calldata parameters called via using for.

Compiler Features

  • Build system: Update the soljson.js build to emscripten 1.39.15 and boost 1.73.0 and include Z3 for integrated SMTChecker support without the callback mechanism.
  • Build system: Switch the emscripten build from the fastcomp backend to the upstream backend.

Bugfixes

  • Type Checker: Disallow constructor parameters with calldata data location.
  • Type Checker: Do not disallow assigning to calldata variables.
  • Type Checker: Fix internal error related to using for applied to non-libraries.
  • Type Checker: Fix overload resolution in combination with {value: ...}.
  • Type Checker: Disallow assignments to storage variables of type mapping.
  • Type Checker: Disallow usage of override with non-public state variables.
  • Type Checker: Fix wrong compiler error when referencing an overridden function without calling it.

0.6.8_Plato_v4.2

17 May 10:23
f8ac115
Compare
Choose a tag to compare

TRON Solidity compiler 0.6.8 is fully compatible with Ethereum Solidity 0.6.8.

New Features

  • Implemented type(T).min and type(T).max for every integer type T that returns the smallest and largest value representable by the type.
  • Allow using abi encoding functions for calldata array slices without explicit casts.
  • Add support for TIP 165 interface identifiers with type(I).interfaceId.
  • Allow virtual modifiers inside abstract contracts to have empty body.
  • Allow local storage variables to be declared without initialization, as long as they are assigned before they are accessed.
  • State variables can be marked immutable which causes them to be read-only, but assignable in the constructor. The value will be stored directly in the code.
  • Deprecated value(...) and gas(...) in favor of {value: ...} and {gas: ...}
  • Inline Assembly: Allow assigning to _slot of local storage variable pointers.

Important Bugfixes

  • Add missing callvalue check to the creation code of a contract that does not define a constructor but has a base that does define a constructor.
  • Disallow array slices of arrays with dynamically encoded base types.
  • String literals containing backslash characters can no longer cause incorrect code to be generated when passed directly to function calls or encoding functions when ABIEncoderV2 is active.
  • Fix tuple assignments with components occupying multiple stack slots and different stack size on left- and right-hand-side.
  • Restrict the length of dynamic memory arrays to 64 bits during creation at runtime fixing a possible overflow.

Bugfix

  • Type Checker: Disallow accessing runtimeCode for contract types that contain immutable state variables.

0.6.2_Plato_v4.2

06 May 03:38
e3d402b
Compare
Choose a tag to compare

TRON Solidity compiler 0.6.2 already supports Ethereum Solidity 0.6.2.
This release supports three new instructions introduced in TIP-157.

Requirements

  • Developers can only use these new instructions after proposal TIP-157 has been approved in TRON mainnet.
  • Developers can use other feature before proposal TIP-157 has been approved in TRON mainnet.

New Features

  • Add FREEZE instruction: Smart contract can freeze balance to get resources or delegate resources for others.
  • Add UNFREEZE instruction: Smart contract can unfreeze balance.
  • Add FREEZEEXPIRETIME instruction: Smart contract can get freeze expire time, return in seconds.
  • 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 trx}().
  • Allow specifying the salt for contract creations and thus the create2 opcode using new C{salt: 0x1234, value: 1 trx}(arg1, arg2).
  • Inline Assembly: Support literals true and false.

Important 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.

0.5.17_Plato_v4.2

27 Apr 03:51
44338cd
Compare
Choose a tag to compare

TRON Solidity compiler 0.5.17 already supports Ethereum Solidity 0.5.17, which fixes a bug that a private function can be overridden in a derived contract by a private function of the same name and types.

This release also supports three new instructions introduced in TIP-157. These instructions will be supported in >=0.6.2.

Requirements

  • Developers can only use these new instructions after proposal TIP-157 has been approved in TRON mainnet.
  • Developers can use other feature before proposal TIP-157 has been approved in TRON mainnet.

New Features

  • Add FREEZE instruction: Smart contract can freeze balance to get resources or delegate resources for others.
  • Add UNFREEZE instruction: Smart contract can unfreeze balance.
  • Add FREEZEEXPIRETIME instruction: Smart contract can get freeze expire time, return in seconds.

Important Bugfix

  • Type Checker: Disallow overriding of private functions.

0.5.16_GreatVoyage_v4.1.2

08 Mar 06:22
Compare
Choose a tag to compare

New Feature

  • Update to version 0.5.16 TIP-241.

Important Bugfix

  • Yul Optimizer: Fix bug in redundant assignment remover in combination with break and continue statements.

0.6.0_GreatVoyage_v4.1.2

19 Jan 15:10
5d5a877
Compare
Choose a tag to compare

New Features

  • Update to version 0.6.0 in TVM TIP-209.
  • New reserved keywords: virtual, override and receive.
  • Introduce virtual and override keywords and private cannot be used together with virtual.
  • Abstract contracts need to be marked explicitly as abstract by using the abstract keyword.
  • Split unnamed fallback functions into two cases defined using fallback() and receive().
  • Introduce try/catch-statement (revert and require can be caught now, others will be supported soon).
  • Introduce push() for dynamic storage arrays. It returns a reference to the newly allocated element, if applicable.
  • Allow explicit conversions from address to address payable via payable(...).
  • Disallow explicit conversions from external function types to address and add a member called address to them as replacement.

Changes

  • ABI: Remove the deprecated constant and payable fields.
  • ABI: The type field is now required and no longer specified to default to function.
  • Modify push(element) for dynamic storage arrays such that it does not return the new length anymore.
  • length member of arrays is now always read-only, even for storage arrays.
  • Enable Yul optimizer as part of standard optimization.

Compiler Features:

  • Allow revert strings to be stripped from the binary using the --revert-strings option or the settings.debug.revertStrings setting.
  • Do not warn about enabled ABIEncoderV2 anymore (the pragma is still needed, though).

0.5.15_GreatVoyage_v4.1

14 Dec 07:23
ed412d1
Compare
Choose a tag to compare

New Feature

  • Update to version 0.5.15.

Important Bugfix

  • Yul Optimizer: Fix incorrect redundant load optimization crossing user-defined functions that contain for-loops with memory / storage writes.