The Graph.

Пост

Поделитесь своими знаниями.

TheGraph Mod QST.
Mar 30, 2024
Экспертные Вопросы и Ответы

Issue with indexing UUPS events with `graph init --studio`

I am currently working with an Upgradable contract using UUPS from OpenZeppelin. When I run graph init --studio with my proxy address, it only indexes the UUPS smart contract events instead of the corresponding smart contract events. Is there a specific parameter I need to use or should I run it with the origin smart contract? I would appreciate any guidance on this matter.

  • The Graph
  • Query
  • GraphQL
  • Indexers
  • Subgraph
  • Subgraph Studio
0
1
Поделиться
Комментарии
.

Ответы

1
TheGraph Mod ANS.
Mar 30 2024, 00:07

To update the abi in the subgraph.yaml file to the implementation ABI, follow these steps:

  1. Open the subgraph.yaml file in a text editor.
  2. Locate the dataSources section in the file.
  3. Find the specific abi field that you want to update.
  4. Replace the existing ABI with the implementation ABI.

Here is an example of how the updated subgraph.yaml file might look:

dataSources:
  - kind: ethereum/contract
    name: MyContract
    network: mainnet
    source:
      address: "0x123456789abcdef"
      abi: |
        [
          {
            "constant": true,
            "inputs": [],
            "name": "myFunction",
            "outputs": [
              {
                "name": "",
                "type": "uint256"
              }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
          }
        ]

Make sure to save the changes to the subgraph.yaml file after updating the abi.

0
Официальный ответ
Комментарии
.

Знаете ответ?

Пожалуйста, войдите в систему и поделитесь им.

The Graph is a decentralized protocol for indexing and querying blockchain data. The Graph makes it possible to query data that is difficult to query directly.

259Посты259Ответы
Sui.X.Peera.

Заработай свою долю из 1000 Sui

Зарабатывай очки репутации и получай награды за помощь в развитии сообщества Sui.