vyperlang / vyper

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

floordiv error reported as variable not declared #4382

Open AlbertoCentonze opened 10 hours ago

AlbertoCentonze commented 10 hours ago

What's your issue about?

MAX_TICKS: constant(int256) = 50

struct UserTicks:
    ticks: uint256[MAX_TICKS/2]

fails with the following error:

vyper.exceptions.UndeclaredDefinition: 'MAX_TICKS' has not been declared.

  contract "contracts/amm_original.vy:84", line 84:19 
       83 struct UserTicks:
  ---> 84     ticks: uint256[MAX_TICKS/2]
  ---------------------------^
       85

While the problem is that / should be replaced by //