Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing two smart contracts with the same tag throws an error #1722

Open
marcusrein opened this issue Aug 30, 2024 · 0 comments
Open

Indexing two smart contracts with the same tag throws an error #1722

marcusrein opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@marcusrein
Copy link
Member

marcusrein commented Aug 30, 2024

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

I am attempting to index two smart contracts on iotex-testnet.

0x0A7e595C7889dF3652A19aF52C18377bF17e027D
(https://testnet.iotexscan.io/address/io1pfl9jhrc380nv54pnt6jcxph00chuqna9llsac#code)

0x45Ce3E6f526e597628c73B731a3e9Af7Fc32f5b7
(https://testnet.iotexscan.io/address/io1gh8rum6jdevhv2x88de350567l7r9adhket5q0#code)

They both have the same smart contract tag of TransparentUpgradeableProxy.

The first smart contract is added without issue. After adding the second smart contract address into the CLI, this error is thrown:

✔ Ethereum network · iotex-testnet
✔ Contract address · 0x0A7e595C7889dF3652A19aF52C18377bF17e027D
✔ Fetching ABI from Etherscan
✔ Fetching Start Block
✔ Fetching Contract Name
✔ Start Block · 27278816
✔ Contract Name · ioID Registry
✔ Index contract events as entities (Y/n) · true
  Generate subgraph
  Write subgraph to directory
✔ Create subgraph scaffold
✔ Initialize networks config
✔ Initialize subgraph repository
✔ Install dependencies with yarn
✔ Generate ABI and schema types with yarn codegen
Add another contract? (y/n):
Contract address: 0x45Ce3E6f526e597628c73B731a3e9Af7Fc32f5b7
✔ Fetching ABI from Etherscan
✔ Fetching Start Block
✔ Fetching Contract Name
✖ Failed to run codegen: Command failed: yarn codegen
- Apply migrations
  Skip migration: Bump mapping apiVersion from 0.0.1 to 0.0.2
- Apply migrations
  Skip migration: Bump mapping apiVersion from 0.0.2 to 0.0.3
- Apply migrations
  Skip migration: Bump mapping apiVersion from 0.0.3 to 0.0.4
- Apply migrations
  Skip migration: Bump mapping apiVersion from 0.0.4 to 0.0.5
- Apply migrations
  Skip migration: Bump mapping apiVersion from 0.0.5 to 0.0.6
- Apply migrations
  Skip migration: Bump manifest specVersion from 0.0.1 to 0.0.2
- Apply migrations
  Skip migration: Bump manifest specVersion from 0.0.2 to 0.0.4
- Apply migrations
✔ Apply migrations
- Load subgraph from subgraph.yaml
✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:

  Path: dataSources > 1 > name
  More than one data source named 'TransparentUpgradeableProxy', data source names must be unique.
error Command failed with exit code 1.

    Error: Command failed: yarn codegen
    - Apply migrations
      Skip migration: Bump mapping apiVersion from 0.0.1 to 0.0.2
    - Apply migrations
      Skip migration: Bump mapping apiVersion from 0.0.2 to 0.0.3
    - Apply migrations
      Skip migration: Bump mapping apiVersion from 0.0.3 to 0.0.4
    - Apply migrations
      Skip migration: Bump mapping apiVersion from 0.0.4 to 0.0.5
    - Apply migrations
      Skip migration: Bump mapping apiVersion from 0.0.5 to 0.0.6
    - Apply migrations
      Skip migration: Bump manifest specVersion from 0.0.1 to 0.0.2
    - Apply migrations
      Skip migration: Bump manifest specVersion from 0.0.2 to 0.0.4
    - Apply migrations
    ✔ Apply migrations
    - Load subgraph from subgraph.yaml
    ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:

      Path: dataSources > 1 > name
      More than one data source named 'TransparentUpgradeableProxy', data
    source names must be unique.
    error Command failed with exit code 1.

    Code: 1
marcusmbpro@MarcussWorkMBP iotex-subgraph

Reproduction

www.thegraph.com/studio

Steps to Reproduce the Bug or Issue

See above description ⏫

Expected behavior

Both smart contracts should be able to be added to the subgraph.

Screenshots or Videos

Screenshot 2024-08-30 at 11 31 57 AM

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • NodeJS: [e.g. 18.5.0]
  • @graphprotocol/* version(s): [e.g. 2.6.2]

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

@marcusrein marcusrein added the bug Something isn't working label Aug 30, 2024
@marcusrein marcusrein changed the title Indexing two smart contracts with the same name throws an error Indexing two smart contracts with the same tag throws an error Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bug
Development

No branches or pull requests

1 participant