Skip to content

Commit dbc69e5

Browse files
committed
pr#340
1 parent ade4910 commit dbc69e5

File tree

1 file changed

+18
-1
lines changed
  • website/src/pages/en/subgraphs/developing/creating/graph-ts

1 file changed

+18
-1
lines changed

website/src/pages/en/subgraphs/developing/creating/graph-ts/api.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,24 @@ export function handleTransfer(event: TransferEvent) {
500500

501501
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.
502502

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.
504521
505522
#### Handling Reverted Calls
506523

0 commit comments

Comments
 (0)