inspector-facet icon indicating copy to clipboard operation
inspector-facet copied to clipboard

Add Hardhat support

Open zomglings opened this issue 2 years ago • 0 comments

Hardhat build artifacts differ from Brownie build artifacts as follows:

  1. Build artifacts are put into the artifacts/ directory instead of the build/ directory. artifacts/contracts/ contains the contract ABIs.
  2. Brownie build/contracts/ has a flat structure. Hardhat artifacts/contracts/ reflects the directory structure of the contracts/ directory containing solidity files.
  3. Hardhat contract JSON files have a contractName field that defines the name of the contract in question. They also have a sourceName question that contains the path to the source (solidity) file from the hardhat project root.

Inspector Facet should support getting ABI side-information from hardhat project directories in addition to brownie project directories.

TODO:

  • [ ] Implement hardhat support.
  • [ ] Open question: Should there be a flag on inspector-facet that the invoker uses to specify whether they want to get ABI information from a brownie project vs. a hardhat project? Or should it be auto-detected?
  • [ ] README should be updated explaining how to use inspector-facet with Hardhat projects. One potential area of confusion is that inspector-facet uses brownie to pull smart contract information and so requires brownie networks setup correctly. This has no bearing on whether it gets side information from a brownie project vs. a hardhat project. We should clarify this in README.

zomglings avatar Apr 18 '22 14:04 zomglings