Skip to content

Generated types are broken if contract function names clash with ethers built-ins #886

@jfschwarz

Description

@jfschwarz

Example: This contract has a target property. The ethers v6 type generated by TypeChain looks like this:

/*
 * Interface 'Module' incorrectly extends interface 'BaseContract'.
 *  Types of property 'target' are incompatible.
 *   Type 'TypedContractMethod<[], [string], "view">' is not assignable to type 'string | Addressable'.ts(2430)                  
 */
export interface Module extends BaseContract {
  //             ~~~~~~ 
  // ...
  target: TypedContractMethod<[], [string], "view">;
  // ...
 }

Expected behavior: TypeChain should probably skip over functions that clash with ethers built-ins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions