Its not working for me
const byteCode = await provider.getCode(address); const AABBI = ethers.utils.Interface.parse(byteCode).abi; console.log("AAABBBIII", AABBI);
Its not working for me
const byteCode = await provider.getCode(address); const AABBI = ethers.utils.Interface.parse(byteCode).abi; console.log("AAABBBIII", AABBI);
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!