You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/developing/creating/graph-ts/api.mdx
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -500,7 +500,24 @@ export function handleTransfer(event: TransferEvent) {
500
500
501
501
As long as the `ERC20Contract` on Ethereum has a public read-only function called `symbol`, it can be called with `.symbol()`. For public state variables a method with the same name is created automatically.
502
502
503
-
Any other contract that is part of the Subgraph can be imported from the generated code and can be bound to a valid address.
503
+
Any other contract that is part of the subgraph can be imported from the generated code and can be bound to a valid address. Example of that is presented within the steps below:
504
+
505
+
- extend `subgraph.yaml` file with desired ABI file:
506
+
507
+
```yaml
508
+
mapping:
509
+
kind: ethereum/events
510
+
apiVersion: 0.0.6
511
+
language: wasm/assemblyscript
512
+
entities:
513
+
- Gravatar
514
+
abis:
515
+
- name: Gravity
516
+
file: ./abis/Gravity.json
517
+
- name: OtherContract
518
+
file: ./abis/OtherContract.json
519
+
```
520
+
- import and bind to the contract using its address.
0 commit comments