vyperlang / vyper

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

fix[venom]: fix some sccp evaluations #4028

Closed charles-cooper closed 4 months ago

charles-cooper commented 4 months ago

some sccp operations were not wrapped in wrap_*op, so they could panic on input which is out of range. this commit wraps all the remaining sccp evaluators for well-formedness.

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()

harkal commented 4 months ago

The evaluations on the Venom-scape need to raise static compilation error on out of bounds, etc. I think the solution should be in the form of #4013 (sorry I thought I had those commits pushed :( )

Of course the tests need to start accommodating for the compiler to detect those errors at compile time.

What do you think?

charles-cooper commented 4 months ago

The evaluations on the Venom-scape need to raise static compilation error on out of bounds, etc. I think the solution should be in the form of #4013 (sorry I thought I had those commits pushed :( )

Of course the tests need to start accommodating for the compiler to detect those errors at compile time.

What do you think?

i mean in that case we should be consistent across all the eval functions. but anyway i don't think they necessarily indicate an error, it's totally valid to end up with a -2 as argument to shr for example (and i think it can be generated from the frontend, like if you bitcast a literal -2: int256 to a uint256).