vyper
vyper copied to clipboard
Unknown type error for interface in contract dependency
Version Information
- vyper Version (output of
vyper --version
): 0.3.3
What's your issue about?
Source codes:
C.vy:
import C1 as C1
@internal
def t1(a: address) -> address:
return a
@external
def test(_c1: address) -> (address, address):
c: address = create_forwarder_to(_c1)
C1(_c1).init_(convert(9, address))
x: address = C1(c).bla()
y: address = self.t1(convert(7, address))
return x, y
@external
def t2() -> address:
return convert(9, address)
C1.vy
interface C1:
def bla() -> address: nonpayable
def init_(x: address): nonpayable
bla: public(C1)
@external
def init_(x: address):
self.bla = C1(x)
When I try to compile C.vy, I get the next error:
vyper.exceptions.UnknownType: No builtin or user-defined type named 'C1'.
contract "C1", line 5:12
4
---> 5 bla: public(C1)
-------------------^
6
[15205] Failed to execute script 'vyper_compile' due to unhandled exception!