graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Return information about contract

Open alex-pakalniskis opened this issue 1 year ago • 0 comments

User request

Add a Graph CLI command to return information about a smart contract in human-readable format. Include data such as:

  • start block
  • ABI, if available
  • source code, if available
  • all chains where this contract is deployed, if available
  • Is it a proxy?
  • list events & event signatures from smart contract
  • history of upgrades

By default, return data in terminal but enable users to save data to file.

Example commands

graph contract <0x...> <network> # returns start block, ABI, source code, & chains list
graph contract <0x...> <network> --save-abi abiFile.json # save ABI to file
graph contract <0x...> <network> --save-code Contract.sol # save source code to file
graph contract <0x...> <network> --save-chains chains.json # save list of chains where contract is deployed
graph contract <0x...> <network> --save # save ABI, source code, and chains list to file

alex-pakalniskis avatar Dec 12 '24 18:12 alex-pakalniskis