vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.87k stars 799 forks source link

Constants not fully supported in `.vyi` files #4176

Open AlbertoCentonze opened 3 months ago

AlbertoCentonze commented 3 months ago

What's your issue about?

Given the interface below foo.vyi it is currently possible to declare constants:

bar: constant(uint256)

However, compilation fails when importing the interface in a contract file and trying to use the constant above.

import foo

@external
def some_function() -> uint256:
    return foo.bar

How can it be fixed?

Either allow constants to be imported successfully from interfaces (I would prefer this option) or remove the possibility to declare constants in vyi files

trocher commented 3 months ago

linking https://github.com/vyperlang/vyper/issues/3991 as they are dup