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

possibly confusing semantics for self.codesize in constructor #2750

Open
Tracked by #2758
charles-cooper opened this issue Apr 5, 2022 · 1 comment
Open
Tracked by #2758
Labels
documentation Documentation

Comments

@charles-cooper
Copy link
Member

Version Information

  • vyper Version (output of vyper --version): 63c7677
  • Python Version (output of python --version): 3.8.10

What's your issue about?

self.codesize issues a CODESIZE instruction but you can convince vyper to issue an EXTCODESIZE instruction with the below code. these have differing semantics in deploy code (h/t https://twitter.com/sw0nt/status/1510720576054251520).

x: address = convert(convert(self, bytes32), address)  # confuse the constant folder
return x.codesize  # issues EXTCODESIZE instruction

How can it be fixed?

not sure if we need to change the behavior but we should at least note it in the docs because the behavior is not obvious.

@charles-cooper charles-cooper added bug Bug that shouldn't change language semantics when fixed. documentation Documentation labels Apr 5, 2022
@charles-cooper charles-cooper mentioned this issue Apr 7, 2022
5 tasks
@charles-cooper
Copy link
Member Author

meeting notes: document this.

@charles-cooper charles-cooper removed the bug Bug that shouldn't change language semantics when fixed. label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation
Projects
None yet
Development

No branches or pull requests

1 participant