-
-
Notifications
You must be signed in to change notification settings - Fork 887
Slice (address).code disallowed with constant #4360
Copy link
Copy link
Closed
Labels
bug - UXa bug related to UXa bug related to UXbug - type 0compiler halts or panics instead of generating codecompiler halts or panics instead of generating code
Description
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,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug - UXa bug related to UXa bug related to UXbug - type 0compiler halts or panics instead of generating codecompiler halts or panics instead of generating code