-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Currently, to make contract calls in a subgraph mapping, you need to not only include the ABI and the generated code, but also include the ABIs in the data source in the subgraph manifest.
This makes it cumbersome to write a drop-in library for use in other subgraphs, because you'd always need an extra step of including the ABIs in the data source in the subgraph manifest. You can't just import the generate contract stub code, bind to it, and make calls.
What is the expected behavior?
Ideally, I'd like to be able to just codegen from an ABI, import the generated contract classes, bind an address to it, and start making calls right away, without needing to include the ABIs in the subgraph manifest. Basically similar to how we bind to contracts in ethers.js
. This will allow drop-in libraries that encapsulate certain smart contracts or protocols be used easily.