vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.83k stars 789 forks source link

HashMap index checks when the subscript is folded #3984

Closed charles-cooper closed 3 months ago

charles-cooper commented 3 months ago

per @Leminkay

Version Information

vyper Version (output of vyper --version): 6f09e2966b8096d8d36a85ad8745d56691dd25c4

Issue description and/or POC

m: HashMap[uint256, uint256]

@external
def foo():
   self.m[0-1] = 2

Successfully compiles

introduced in https://github.com/vyperlang/vyper/pull/3669, related bug was fixed in https://github.com/vyperlang/vyper/pull/3924 (but this bug was not fixed)