Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal and pure functions allow to be payable #3099

Open
pcaversaccio opened this issue Sep 13, 2022 · 1 comment
Open

internal and pure functions allow to be payable #3099

pcaversaccio opened this issue Sep 13, 2022 · 1 comment

Comments

@pcaversaccio
Copy link
Collaborator

pcaversaccio commented Sep 13, 2022

Version Information

  • vyper Version (output of vyper --version): 0.3.6+commit.4a2124d
  • OS: win
  • Python Version (output of python --version): 3.9.2

What's your issue about?

The current Vyper version allows for functions decorated via the internal or pure modifier to be payable. In such situations, the compiler should throw an error.

To reproduce this behaviour, you can compile:

@external
def foo() -> Bytes[32]:
    self.bar()
    return b"\x01"

@internal
@payable
def bar() -> uint256:
    return 1

How can it be fixed?

The compiler should throw a type error in such circumstances.

@charles-cooper
Copy link
Member

see #3123 (comment) for an alternative way to address this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants