1

Its not working for me

const byteCode = await provider.getCode(address); const AABBI = ethers.utils.Interface.parse(byteCode).abi; console.log("AAABBBIII", AABBI);

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 11, 2023 at 16:30

1 Answer 1

1

normally you can not extract the ABI from the bytecode as for instance the bytecode only includes function signatures.

If the contract has been verified, you can query the ABI on etherscan like this

https://api.etherscan.io/api?module=contract&action=getabi&address=CONTRACT_ADDRESS&apikey=API_KEY

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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