Constructors

Properties

version: string

Methods

  • Convert a FunctionDefinition def into a function type. If skipFirstArg is true, omit the first parameter. This is used for functions bound with using for directives.

    Parameters

    Returns FunctionType

  • Given two types a and b infer the common type that they are both implicitly casted to, when appearing in a binary op/conditional. Its currently usually a or b

    Parameters

    Returns TypeNode

  • 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:

    1. Fixed size arrays with fixed-sized element types
    2. Tuples where all the tuple elements are fixed-size

    Parameters

    Returns boolean

    Todo

    (Dimo):

    1. Check again that its not possible for tuples in internal calls to somehow get encoded on the stack
    2. What happens with return tuples? Are they always in memory?
  • Convert an internal TypeNode to the external TypeNode that would correspond to it after ABI-encoding with encoder version encoderVersion. Follows the following rules:

    1. Contract definitions turned to address.
    2. Enum definitions turned to uint of minimal fitting size.
    3. Storage pointer types are converted to memory pointer types when normalizePointers is set to true.
    4. Throw an error on any nested mapping types.
    5. Fixed-size arrays with fixed-sized element types are encoded as inlined tuples
    6. Structs with fixed-sized elements are encoded as inlined tuples

    Parameters

    Returns TypeNode

  • 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).:

    1. MemberAccess on contract pointer (e.g. this.foo). Only external public functions and public getters returned
    2. MemberAccess on a contract type name (e.g. ContractName.foo). All functions, state variables, and type defs in that contract are now visible.

    Parameters

    Returns undefined | TypeNode

Generated using TypeDoc