Skip to content

Releases: Consensys/solc-typed-ast

v11.0.2

23 Nov 14:56
Compare
Choose a tag to compare

In version 1.2.0 of axios (one of our dependencies) there is the following bug which causes a crash in Scribble/solc-typed-ast when downloading compiler version metadata. To avoid this in this patch we fix axios to version 1.1.3 temporarily.

v11.0.1

23 Nov 10:35
Compare
Choose a tag to compare

This release exposes helper functions for evaluation of constant expressions.

Features

  • Expose constant expression evaluator logic and tweak getTypeForCompilerVersion() (#174)

Following functions are now exposed:

  • evalLiteralImpl()
  • evalUnaryImpl()
  • evalBinaryImpl()

v11.0.0

22 Nov 13:01
954ef00
Compare
Choose a tag to compare

This release removes deprecated functionality and introduces replacements where possible.

Features

Following functions and class methods are now provided by the package:

  • InferType.typeOfElementaryTypeNameExpression()
  • InferType.elementaryTypeNameStringToTypeNode()
  • inferCommonVisiblity()
  • mergeFunTypes()
  • stripSingletonParens()
  • isFunctionCallExternal()

Maintenance

Following changes are considered as "breaking" in this release (as part of #159):

  1. Dropped functions getNodeType() and getNodeTypeInCtx(). TypeString parser is now used for testing purposes only.
  2. Function resolveAny() now requires an instance of InferType instead of compiler version string.
  3. Functions resolve(), resolveEvent() and resolveCallable() are not requiring an instance of InferType as an additional argument.
  4. Dropped method interfaceId() of ContractDefinition in favor of InferType.interfaceId().
  5. Dropped methods canonicalSignature() and canonicalSignatureHash() of ErrorDefinition, EventDefinition, FunctionDefinition and ModifierDefinition in favor of InferType.signature() and of InferType.signatureHash().
  6. Dropped EventDefinition.eventTopic() - there was no much use of it, also it's behaviour considered unobvious.
  7. Dropped method referencedCanonicalSignature() and referencedCanonicalSignatureHash() of FunctionCall. This there was no much use of those methods.
  8. Reintroduced functions toABIEncodedType(), typeNameToTypeNode(), typeNameToSpecializedTypeNode() as methods of InferType class.
  9. Dropped methods canonicalSignatureType(), getterFunType(), getterArgsAndReturn() of VariableDeclaration in favor of InferType.getterFunType() and InferType.getterArgsAndReturn().
  10. Classes InaccessibleDynamicType and``ModuleType are no longer shipped with a package. It is used only for internal testing purposes.
  11. Builtin struct typeContract no logner contains interfaceId field. It is only a part of builtin struct typeInterface.
  12. Variables binaryOperatorGroups and subdenominationMultipliers renamed to BINARY_OPERATOR_GROUPS and SUBDENOMINATION_MULTIPLIERS respectfully.

Following functions and class methods are reintroduced as part of InferType:

  • InferType.typeNameToTypeNode() (former standalone typeNameToTypeNode() function)
  • InferType.typeNameToSpecializedTypeNode() (former standalone typeNameToSpecializedTypeNode() function)
  • InferType.toABIEncodedType() (former standalone toABIEncodedType() function)
  • InferType.signature() (former canonicalSignature() methods of several declaration AST nodes)
  • InferType.signatureHash() (former canonicalSignatureHash() methods of several declaration AST nodes)
  • InferType.interfaceId() (former interfaceId() method of ContractDefinition)

Additional changes:

  • Fixed typo (#162)
  • Fix incorrect block scoping rules for legacy code (#165)

We want to thank all of the external contributors that made this release possible:

Henry Blanchette, Dillon Kellar.

v10.3.0

12 Oct 19:37
803a2f8
Compare
Choose a tag to compare

This release brings several bug-fixes to the new InferType functionality, bringing down the failures when compared to the typeString parser to statistical noise (several rare edge cases on old 0.4.x compilers). At this point we consider InferType stable. Also we mark several older type functions/utilities as deprecated, in preparation to remove them in the next major release.

Bugfixes

We fixed multiple errors in InferType behavior after comparing its results to the compiler provided type strings on ~75K contracts. After this run the only remaining known edge case where InferType fails to produce a correct type are:

  • #155
  • #156
  • We don't support the fixed type, since its also not properly supported in Solidity either yet.

There are several cases (<128) where the typeString parser or node processors fail. Those are covered by the following issues:

Maintenance

We are marking the following functions as deprecated. These will be removed in the next major release. In near future we would introduce equivalents via corresponding methods on InferType or other helper functions.

  • canonicalSignature() method of ErrorDefinition, EventDefinition, FunctionDefinition and ModifierDefinition nodes
  • canonicalSignatureHash() method of ErrorDefinition, EventDefinition, FunctionDefinition and ModifierDefinition nodes
  • canonicalSignatureType(), getterArgsAndReturn(), getterFunType(), getterCanonicalSignature() and getterCanonicalSignatureHash() methods of VariableDeclaration node
  • referencedCanonicalSignature() and referencedCanonicalSignatureHash() methods of FunctionCall node
  • typeNameToTypeNode() function
  • typeNameToSpecializedTypeNode() function
  • inferVariableDeclLocation() function
  • getNodeType() function
  • getNodeTypeInCtx() function

v10.2.0

04 Oct 08:14
dfc8199
Compare
Choose a tag to compare

This release introduces support for Solidity 0.8.16 and 0.8.17, and new InferType component to infer type, based on AST node subtree instead of parsing typeStrings (whenever possible). The InferType functionality is considered experimental. Some older type inference functions and classes are marked as deprecated (inferVariableDeclLocation(), variableDeclarationToTypeNode(), ModuleType). The transition window over a month or two for dependent packages and ecourage to make necessary updates.

Features

  • Alternative type inference (#142, experimental)
  • Support for Solidity 0.8.16 (#146)
  • Support for Solidity 0.8.17 (#149)

Maintenance

  • Tune TypeString parser to support more visibility keywords for FunctionType (#150)

v10.1.6

10 Aug 07:30
9dee6b4
Compare
Choose a tag to compare

This release fixes a small issue with writing out some string literals.

v10.1.5

29 Jul 03:34
a3ebbf7
Compare
Choose a tag to compare

Features

  • Tweak eq() to do an early return if a and b are strictly equal (#138)

v10.1.4

22 Jul 03:30
cb28ba9
Compare
Choose a tag to compare

Features

  • Fix FunctionDefinition.kind for fallback functions (legacy 0.4 compiler series) (#133)

Maintenance

  • Move CI to GitHub Actions (#130)
  • Fix GitHub Actions to correctly publish docs and package (#129)

v10.1.3

07 Jul 05:05
0b38ee0
Compare
Choose a tag to compare

Features

  • Support for Solidity 0.8.15 (#126)

v10.1.2

27 May 05:36
3ce30d1
Compare
Choose a tag to compare

Features

  • Support for Solidity 0.8.14 (#123)