0

Is it possible to instantiate a deployed contract in js(dapp) using contract address alone? without copying abi data?

1
  • 1
    No. The contract on dapp side is a JS object with methods and attributes. Without the abi, web3.js will not know how to construct this object. Besides, what benefit would you possibly have in such object without any methods or attributes??? Your motivation here is rather unclear. Jul 24 '19 at 12:30
1

If you only have the address of a contract you can only see its bytecode at that address. Without some reverse-engineering you can't know what the contract looks like and how you should interact with it.

If you already know how to interact with the contract you basically have the required ABI and you can interact. If you don't know how to interact with it then you can't interact with it - and what would be the point of interacting with a contract if you have no idea what it's for and how to use it.

If you enter a contract address in a service such as etherscan.io you may see lots of extra information such as source code and from source code you can get the ABI. This however is simply extra service provided by Etherscan and it's not stored on the blockchain. So by using external extra services you may gain the required information.

0

Simple answer :

too difficult to be practical unless you know it follows a standard (hence can imply most of the ABI)

Sometimes answer :

you could query etherscan and similar services that could have the verified contract source. If they do, they also have the ABI available.

https://etherscan.io/apis

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.