acuarica / evm

A Symbolic Ethereum Virtual Machine (EVM) bytecode interpreter, parser and decompiler, along with several other utils for programmatically extracting information from EVM bytecode.
https://acuarica.github.io/evm/
MIT License
46 stars 5 forks source link

Fix `Shl`'s `eval` arithmetic when result is larger than `2^256` #127

Closed acuarica closed 4 days ago

acuarica commented 4 days ago

This PR fixes the eval implementation of Shl which does not honor the Ethereum spec[1]. When the result of the Shl is larger than the word size, the error Val is a not a valid unsigned 256-word is raised. The Shl eval should use mod 2^256 when result is larger than the word size.

image

Related to https://github.com/acuarica/evm/issues/125.


[1] https://ethereum.github.io/yellowpaper/paper.pdf

github-actions[bot] commented 4 days ago

size-limit report 📦

Path Size
dist/sevm.js 17.27 KB (0%)