franck44 / evm-dis

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

Add information about Segment Gas cost #37

Open franck44 opened 8 months ago

franck44 commented 8 months ago

As we have the gas costs of each instruction we can add the gas cost information to each segment. If the segment does not use memory/storage-size-dependent instructions (e.g. MSTORE, MLOAD, CALLDATACOPY, etc) we get an exact value for the segment. Otherwise we get a lower bound (memory expansion adds cost).

To do

Add computation of lower bound gas cost for segments. Add it to the info (tooltip) for the segment. If gas cost can be computed exactly, display something like gas == val and otherwise gas >= val.