Releases: Consensys/solc-typed-ast
v11.0.2
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
v11.0.0
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):
- Dropped functions
getNodeType()
andgetNodeTypeInCtx()
. TypeString parser is now used for testing purposes only. - Function
resolveAny()
now requires an instance ofInferType
instead of compiler version string. - Functions
resolve()
,resolveEvent()
andresolveCallable()
are not requiring an instance ofInferType
as an additional argument. - Dropped method
interfaceId()
ofContractDefinition
in favor ofInferType.interfaceId()
. - Dropped methods
canonicalSignature()
andcanonicalSignatureHash()
ofErrorDefinition
,EventDefinition
,FunctionDefinition
andModifierDefinition
in favor ofInferType.signature()
and ofInferType.signatureHash()
. - Dropped
EventDefinition.eventTopic()
- there was no much use of it, also it's behaviour considered unobvious. - Dropped method
referencedCanonicalSignature()
andreferencedCanonicalSignatureHash()
ofFunctionCall
. This there was no much use of those methods. - Reintroduced functions
toABIEncodedType()
,typeNameToTypeNode()
,typeNameToSpecializedTypeNode()
as methods ofInferType
class. - Dropped methods
canonicalSignatureType()
,getterFunType()
,getterArgsAndReturn()
ofVariableDeclaration
in favor ofInferType.getterFunType()
andInferType.getterArgsAndReturn()
. - Classes
InaccessibleDynamicType
and``ModuleType are no longer shipped with a package. It is used only for internal testing purposes. - Builtin struct
typeContract
no logner containsinterfaceId
field. It is only a part of builtin structtypeInterface
. - Variables
binaryOperatorGroups
andsubdenominationMultipliers
renamed toBINARY_OPERATOR_GROUPS
andSUBDENOMINATION_MULTIPLIERS
respectfully.
Following functions and class methods are reintroduced as part of InferType
:
InferType.typeNameToTypeNode()
(former standalonetypeNameToTypeNode()
function)InferType.typeNameToSpecializedTypeNode()
(former standalonetypeNameToSpecializedTypeNode()
function)InferType.toABIEncodedType()
(former standalonetoABIEncodedType()
function)InferType.signature()
(formercanonicalSignature()
methods of several declaration AST nodes)InferType.signatureHash()
(formercanonicalSignatureHash()
methods of several declaration AST nodes)InferType.interfaceId()
(formerinterfaceId()
method ofContractDefinition
)
Additional changes:
We want to thank all of the external contributors that made this release possible:
Henry Blanchette, Dillon Kellar.
v10.3.0
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 ofErrorDefinition
,EventDefinition
,FunctionDefinition
andModifierDefinition
nodescanonicalSignatureHash()
method ofErrorDefinition
,EventDefinition
,FunctionDefinition
andModifierDefinition
nodescanonicalSignatureType()
,getterArgsAndReturn()
,getterFunType()
,getterCanonicalSignature()
andgetterCanonicalSignatureHash()
methods ofVariableDeclaration
nodereferencedCanonicalSignature()
andreferencedCanonicalSignatureHash()
methods ofFunctionCall
nodetypeNameToTypeNode()
functiontypeNameToSpecializedTypeNode()
functioninferVariableDeclLocation()
functiongetNodeType()
functiongetNodeTypeInCtx()
function
v10.2.0
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 typeString
s (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)