vyper
vyper copied to clipboard
possibly confusing semantics for `self.codesize` in constructor
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.
meeting notes: document this.