Readonly
versionComputes the function type for the public accessor corresponding to a state variable
Given to numeric expressions infer a common type to which they can both be implicitly casted.
Infer the data location for the given VariableDeclaration
.
For local vars with solidity <=0.4.26 we infer the location from the RHS.
Determine if the specified type typ
is dynamic or not. Dynamic means
that if we are trying to read typ
at location loc
, in loc
there should be just a
uint256 offset into memory/storage/calldata, where the actual data lives. Otherwise
(if the type is "static"), the direct encoding of the data will start at loc
.
Usually "static" types are just the value types - i.e. anything of statically known size that fits in a uint256. As per https://docs.soliditylang.org/en/latest/abi-spec.html#formal-specification-of-the-encoding there are several exceptions to the rule when encoding types in calldata:
(Dimo):
Returns HEX string containing first 4 bytes of keccak256 hash function applied to the canonical representation of the passed function / event / error / modifier or public state variable getter signature.
NOTE: Empty string will be returned for fallback functions and constructors.
Convert an internal TypeNode to the external TypeNode that would correspond to it
after ABI-encoding with encoder version encoderVersion
. Follows the following rules:
normalizePointers
is set to true
.Computes a TypeNode
equivalent of given astT
,
specialized for location loc
(if applicable).
Given an expression infer its type.
Infer the type of the assignment node
. (In solidity assignments are expressions)
Infer the type of the binary op
Infer the type of a builtin identifier node
.
Infer the type of the builtin 'type' keyword. This is a function from a type name to a struct with fields that depend on whether the argument is a contract, interface, or numeric type. See https://docs.soliditylang.org/en/v0.6.10/units-and-global-variables.html for details.
Given a particular FunctionCall
site, resolve the exact callee,
accounting for potential overloading.
A callsite may come from:
In the case that the callee is a FunctionLikeSetType
, resolve the exact callee
based on the function call arguments. Otherwise return the type of the callee.
Infer the type of the conditional expression
Infer the type of the function call
Infer the type of the identifier
If the MemberAccess
corresponds to a external function or a getter invoked on a contract
return the type of the function/getter.
Infer the type of a call with a new
expression as callee
Given a name
and a ASTNode ctx
, resolve that name
in ctx
and compute
a type for the one (or more) definitions that resolve to name
.
There are 2 cases for contracts (determined by the externalOnly
argument).:
Infer the type of a struct constructor expression
Infer the type of a type cast
Given a VariableDeclaration
node compute the TypeNode
that corresponds to the variable.
This takes into account the storage location of the decl
.
Static
elementaryGiven the name
string of elementary type,
returns corresponding type node.
Consider fixes due to https://github.com/ConsenSys/solc-typed-ast/issues/160
Generated using TypeDoc
Convert a
FunctionDefinition
def
into a function type. IfskipFirstArg
is true, omit the first parameter. This is used for functions bound withusing for
directives.