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

[Question]: Can you generate an accurate solidity contract from bytecode if you already have the ABI? #98

Open
2 tasks done
0xfuje opened this issue Jun 2, 2023 · 2 comments

Comments

@0xfuje
Copy link

0xfuje commented Jun 2, 2023

Version

0.4.5

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

Linux

Ask your question here

Can you generate a more accurate solidity contract if you already have the ABI (and the bytecode)? My problem is I want to decompile a few contracts, I already have the ABI (+bytecode) for them, but don't have access to the contracts. Maybe this could be a potential new feature if not implemented, perhaps by adding an --abi flag with an abi input to the heimdall compile command.

Thank you for your time and for the awesome tool!

@Jon-Becker
Copy link
Owner

Hey! Thanks for opening this!

Would heimdall only use the provided abi to resolve signatures (i.e. skipping lookups)?

I suppose it would be more accurate this way and wouldn't have to inherit argument types from bytecode, which would improve overall decompilation.

Very interesting! I'll take a crack at it this weekend.

@Jon-Becker
Copy link
Owner

Just to follow up here, will likely include in 0.5.0 or 0.5.1, (next 1 or 2 builds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants