PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 28, 2022

[FIXED] How to get ABI of Smart Contract with Nethereum?

 July 28, 2022     azure-blockchain-service, blockchain, nethereum, quorum, solidity     No comments   

Issue

I can access a Blockchain Service based on Quorum, and I'm using Nethereum Library to interact with Smart Contract.

When I deploy a new Smart Contract, Nethereum gives the address and the ABI of SmartContract.

But I can't access the ABI of SmartContract without deploying the process. How can I get ABI based on the address of Smart Contract?


Solution

You can get ABI JSON during compilation of the contract source code. The inputs for compilation are source code and few other values (such as optimizer settings)... The outputs include the ABI JSON and bytecode... So you don't really need to deploy the contract to get the json, just compile it (without deployment).

It's not possible to get ABI JSON purely from a bytecode (or an address that contains just the bytecode).


If the contract has source code published, you can compile the source code to get the ABI JSON.

If if doesn't have the source code published, it's also possible that the contract implements some standard (e.g. ERC-20). If you know whether and what standard it implements, you can use a general ABI JSON that reflects on this standard (e.g. this is ABI JSON of a ERC-20 standard). However, it does not reflect any functions that the contract might have used to extend the standard-defined minimum.



Answered By - Petr Hejda
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing