1

Theres a contract on BSC that isnt verified and I am really keen to get the code behind it. I have both the full bytecode and ABI. Is it possible to obtain readable source code using this?

Thanks!

James
  • 101
  • 2
  • 10

1 Answers1

1

BSCScan has an integrated decompiler that produces pseudocode from the input binary bytecode.

It's not perfect - some of the resulting code performs overly complicated operations that can be written on one line in Solidity, some functions are not able to decompile at all, ... but it can help with manually reconstructing the source code.

There are other decompilers available online as well. Usually it helps to decompile the binary using multiple tools so that you get a better sense of what the source code should do.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
  • Is there any way to use the ABI for decompiling as well to get more accurate source code? Ideally I want it as close as possible to original source – James Dec 30 '21 at 13:53
  • @James I'm not aware of any tool that would allow to input the ABI as well and use it for more precise decompilation. – Petr Hejda Dec 30 '21 at 13:56