enzymefinance / oyente

An Analysis Tool for Smart Contracts
GNU General Public License v3.0
1.32k stars 309 forks source link

fix: set default crytic-compile version #431

Open yagol2020 opened 2 years ago

yagol2020 commented 2 years ago

new version of crytic-compile change something, resulting in errors in _extract_bin_obj of input_helper.py. Specified crytic-compile version in setup.py (0.1.8)

yagol2020 commented 2 years ago

evm 1.10.15 use hex as the operand, like

00000: PUSH1 0x80 00002: PUSH1 0x40 00004: MSTORE 00005: PUSH1 0x04 00007: CALLDATASIZE 00008: LT 00009: PUSH1 0x3f 0000b: JUMPI 0000c: PUSH1 0x00 0000e: CALLDATALOAD

i adapted hex in symExec.py

riordant commented 2 years ago

I tried your branch and it fixed the mentioned error, but getting something else:

Traceback (most recent call last):
  File "oyente.py", line 232, in <module>
    main()
  File "oyente.py", line 227, in main
    exit_code = analyze_solidity()
  File "oyente.py", line 109, in analyze_solidity
    inputs = helper.get_inputs(global_params.TARGET_CONTRACTS)
  File "//oyente/oyente/input_helper.py", line 79, in get_inputs
    source_map = SourceMap(contract, self.source, 'solidity', self.root_path, self.remap,
  File "/oyente/oyente/source_map.py", line 51, in __init__
    self.positions = self._get_positions()
  File "/oyente/oyente/source_map.py", line 187, in _get_positions
    asm = SourceMap.position_groups[self.cname]['asm']['.data']['0']
KeyError: '/oyente/oyente/Reentrancy.sol:Reentrance'

Any idea? thanks