Skip to content

Slice (address).code disallowed with constant #4360

@Philogy

Description

@Philogy

Version Information

  • vyper Version (output of vyper --version): 0.4.0+commit.e9db8d9
  • OS: osx
  • Python Version (output of python --version): 3.12.4

What's your issue about?

I cannot do slice(address.code, offset, SOME_CONSTANT) if SOME_CONSTANT is defined as SOME_CONSTANT: constant(uint256) giving me the error:

Error: Compiler run failed:
Location: src/periphery/ControllerV1.vy
(address).code is only allowed inside of a slice function with a constant length

  contract "src/periphery/ControllerV1.vy:155", function "_get_partial_key", line 155:8 
       154     section: Bytes[CONFIG_ENTRY_SIZE] = slice(
  ---> 155         store.code,
  -----------------^
       156         STORE_HEADER_SIZE + index * CONFIG_ENTRY_SIZE,

Metadata

Metadata

Labels

bug - UXa bug related to UXbug - type 0compiler halts or panics instead of generating code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions