I have some vyper code as such:

# SPDX-License-Identifier: MIT
# @version ^0.3.3

supply: uint256
decimals: uint256

def updateSupply(_supply: uint256):
    self.supply = _supply

def __init__():
    self.decimals = 18

But on compile, I get an error:

vyper.exceptions.FunctionDeclarationException: Function does not exist or has not been declared yet (reminder: functions cannot call functions later in code than themselves)
  contract "MyContract.vy", function "__init__", line 34:4 
       33     self.decimals = 18
  ---> 34     self.updateSupply(1000000000000000000)

Why can't I call this function inside my constructor?

1 Answer 1


I was compiling with an older version of vyper. This feature was introduced in May of 2022


  • 1
    for ref: introduced in v0.3.4
    – gosuto
    Commented Dec 3, 2022 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.