franck44 / evm-dis

An EVM bytecode disassembler/assembler
Apache License 2.0
29 stars 6 forks source link

Detect similar segments #21

Open franck44 opened 8 months ago

franck44 commented 8 months ago

In some bytecode (e.g ERC-20, Deposit, wETH), some code segments are similar in the sense that they are the same sequences of instructions but at different addresses.

This code segments could be merged by an optimiser. To do so we just need to

To do

In a first phase we can try to identify the equivalent code segments, and how much code could be saved by merging them.

In a later stage, build an optimiser that: