vyper icon indicating copy to clipboard operation
vyper copied to clipboard

possibly confusing semantics for `self.codesize` in constructor

Open charles-cooper opened this issue 2 years ago • 1 comments

Version Information

  • vyper Version (output of vyper --version): 63c76775cd49148e93acdab043c621ee857bc65c
  • 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 avatar Apr 05 '22 13:04 charles-cooper

meeting notes: document this.

charles-cooper avatar Apr 18 '22 20:04 charles-cooper