0

Is it possible to get a list of all variables that a smart contract needs to be sent just by knowing the contract's address?

What i want to do:

  1. make a call to the chain and get the required variables
  2. Generate fields out of those variables in a form
  3. Submit the form thus ensuring that all the needed fields exist
1

You would need to know the ABI for the contract. If the contract code is verified on Etherscan, then they provide an API method for that. From https://etherscan.io/apis#contracts:

https://api.etherscan.io/api?module=contract&action=getabi&address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413&apikey=YourApiKeyToken

  • This is the kind of stuff i was looking for (the api call). But unfortunately etherscan is closed source, i want to use this for a private blockchain. any other ideas? I will mark as the accepted answer nevertheless as it wouldsolve my question since i did not specify "a private blockchain" on the original post. – Onitlikesonic Apr 28 '18 at 14:53
  • 1
    All Etherscan is doing is compiling the source code for the contract. You can do the same yourself. You either need to know the ABI or the contract source (so you can produce the ABI yourself). – smarx Apr 28 '18 at 14:55

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.