0

How can I get a contract source code and contract ABI code using Nethereum? For example like here: https://api.bscscan.com/api?module=contract&action=getsourcecode&address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82

1 Answer 1

0

Sadly not. This isn't possible as there are many different source codes that can generate the same bytecode. BSCScan / Etherscan / etc all rely on users uploading the source code. Whilst an approximation of the source code that would generate the same bytecode is possible, there's no saying how accurate it would be. All of those blockchain scanner services have APIs so you may wish to look into using one of those.

1
  • This is only partially correct: the main issue is not collision risk (which would be super low) but rather having hidden zero-day exploit (ie the human-readable code is not what has been deployed), hence the formal verification process - see this amazing example of an (old) 0d on etherscan: coinyuppie.com/… May 16, 2022 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.