graph-tooling
graph-tooling copied to clipboard
On the init command, scaffold the subgraph with the contracts names of the ABIs
Currently the execution of graph init
generates ABI's with the name Contract because of this https://github.com/graphprotocol/graph-cli/blob/3a9a5a972795029b63843761171fd7687e12fd8f/src/commands/init.js#L190
Could be good to apply take as name the filename of the ABI instead of Contract, or even introduce another cli option on graph init
to control that.
I'm not aware of any ABI files that contain the contract name, although there may be some. I agree a --contract-name
or --abi-name
CLI flag could work.
This could be a neat little thing to hack on for anyone looking to get their feet wet in the CLI codebase.
I have no problem to submit a PR if you want @Jannis
@ernesto-usal That would be awesome! 😄
We could add support for Hardhat (and others?) artifacts where the contract name and abi are in one file. Example of such a file is:
{
"_format": "hh-sol-artifact-1",
"contractName": "MyNFT",
"sourceName": "contracts/MyNFT.sol",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
// ...
Is anyone working on the issue?