Giter Site home page Giter Site logo

Comments (3)

montyly avatar montyly commented on May 14, 2024 1

Hi @kmbarry1, thank you for reporting this

My best guess is that the function dispatcher heuristic is not robust for contracts compiled with Solidity >0.5. We will take a closer look in the upcoming days

from evm_cfg_builder.

montyly avatar montyly commented on May 14, 2024

Hi @Pindapinda
Thank you for reporting this. We will look into it as soon as possible

from evm_cfg_builder.

kmbarry1 avatar kmbarry1 commented on May 14, 2024

I'm running into the same issue--I pulled the bytecode for the DAI token:

0x6B175474E89094C44Da98b954EedeAC495271d0F

And ran it through the following script:

import pprint
import sys
from evm_cfg_builder.cfg import CFG

if len(sys.argv) != 2:
    print('Usage python print_function_selectors.py contract.evm')
    exit(-1)

with open(sys.argv[1]) as f:
    runtime_bytecode = f.read()

cfg = CFG(runtime_bytecode)

for function in sorted(cfg.functions, key=lambda x: x.start_addr):
    print('{} : {}'.format(function.hash_id, function.name))

obtaining the following output:

-2 : _dispatcher
2835717307 : transfer(address,uint256)
2127478272 : nonces(address)
-1 : _fallback
2835717307 : transfer(address,uint256)
3075713420 : push(address,uint256)
3140843579 : move(address,address,uint256)
3207937467 : 0xbf353dbb
3714247998 : allowance(address,address)
4074100075 : pull(address,uint256)

which doesn't even include transferFrom(address,address,uint256) (which has a function selector of 0x23b872dd, so it's not the one without a name match).

from evm_cfg_builder.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.