Skip to content

More convenient way to make contract calls in subgraph mappings #3423

@this-username-is-taken

Description

@this-username-is-taken

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions