Skip to content

imported types cannot be used in call position #3943

@charles-cooper

Description

@charles-cooper

Version Information

  • vyper Version (output of vyper --version): cb94068

What's your issue about?

the following doesn't compile:

# lib1.vy

from ethereum.ercs import IERC20
# main.vy

import lib1

@external
def foo(x: address):
    s: uint256 = staticcall lib1.IERC20(msg.sender).balanceOf(x)

fails with something like the following:

vyper.exceptions.StructureException: interface vyper/builtins/interfaces/IERC20.vyi is not callable

  contract "tmp/main.vy:12", function "foo", line 12:28 
       11 def foo(x: address):
  ---> 12     s: uint256 = staticcall lib1.IERC20(msg.sender).balanceOf(x)
  ------------------------------------^
       13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug - UXa bug related to UXbug - type 0compiler halts or panics instead of generating coderelease - mustrelease blocker

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions