Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'upsert(tuple,bool)' #2560

Open
ghost opened this issue Jun 9, 2022 · 0 comments
Open

KeyError: 'upsert(tuple,bool)' #2560

ghost opened this issue Jun 9, 2022 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 9, 2022

Summary of the problem

Manticore can't load correctly ABI by signature self._function_abi_items_by_signature[sig] probably miscounts signature for methods with struct

Manticore version

0.3.7

Python version

3.8

OS / Environment

MacOS

Dependencies

manticore==0.3.7
slither-analyzer==0.8.3

Step to reproduce the behavior

interface IMigrate {
    struct Deposit {
        bool exists;
        bool withdrawn;
        uint8 networkId; // Only for ethereum and bsc
        uint256 lockId;
        uint256 amount;
        uint256 lockUntil;
        address withdrawalAddress;
        string packageKey;
    }

    function upsert(Deposit memory, bool) external returns (bool);
}

contract Migrate {
    function upsert(Deposit memory deposit, bool update) external onlyOwner returns (bool) {
       ...
    }
}

Expected behavior

I should get full output of audit

Actual behavior

I get error:

Traceback (most recent call last):
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/core/worker.py", line 137, in run
    current_state.execute()
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/ethereum/state.py", line 8, in execute
    return self._platform.execute()
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/platforms/evm.py", line 3102, in execute
    self._process_pending_transaction()
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/platforms/evm.py", line 3394, in _process_pending_transaction
    self._open_transaction(sort, address, price, data, caller, value, gas=gas)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/platforms/evm.py", line 2660, in _open_transaction
    self._publish("will_open_transaction", tx)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/utils/event.py", line 148, in _publish
    self._publish_impl(_name, *args, **kwargs)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/utils/event.py", line 175, in _publish_impl
    sink._publish_impl(_name, *args, **kwargs)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/utils/event.py", line 173, in _publish_impl
    sink._publish_impl(_name, self, *args, **kwargs)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/utils/event.py", line 166, in _publish_impl
    callback(robj(), *new_args, **kwargs)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/core/plugin.py", line 25, in g
    return f(self, *args, **kwargs)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/ethereum/plugins.py", line 71, in will_open_transaction_callback
    abi = md.get_abi(func_hsh)
  File "/Users/dante/.venv/oyente/lib/python3.9/site-packages/manticore/ethereum/solidity.py", line 226, in get_abi
    return dict(self._function_abi_items_by_signature[sig])
KeyError: 'upsert(tuple,bool)'

@ghost ghost added the bug label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants