From 06f1c47e6fa25009fab5f76b2c7fe28283022662 Mon Sep 17 00:00:00 2001 From: mokrzesa <60874181+mokrzesa@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:27:20 +0200 Subject: [PATCH 1/2] docs: update smart contract access details --- .../en/developing/assemblyscript-api.mdx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/website/pages/en/developing/assemblyscript-api.mdx b/website/pages/en/developing/assemblyscript-api.mdx index 787a1350f676..052909c464fb 100644 --- a/website/pages/en/developing/assemblyscript-api.mdx +++ b/website/pages/en/developing/assemblyscript-api.mdx @@ -462,7 +462,25 @@ export function handleTransfer(event: TransferEvent) { 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. -Any other contract that is part of the subgraph can be imported from the generated code and can be bound to a valid address. +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: + +- extend `subgraph.yaml` file with desired ABI file: + +```yaml +mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - Gravatar + abis: + - name: Gravity + file: ./abis/Gravity.json + - name: OtherContract + file: ./abis/OtherContract.json +``` + +- import and bind to the contract using its address. #### Handling Reverted Calls From 0f2fd66d39eb918c368ec6abf908071e8460452c Mon Sep 17 00:00:00 2001 From: mokrzesa <60874181+mokrzesa@users.noreply.github.com> Date: Tue, 9 May 2023 12:22:39 +0200 Subject: [PATCH 2/2] Update website/pages/en/developing/assemblyscript-api.mdx Co-authored-by: Dimitri POSTOLOV --- .../en/developing/assemblyscript-api.mdx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website/pages/en/developing/assemblyscript-api.mdx b/website/pages/en/developing/assemblyscript-api.mdx index 052909c464fb..ab298a9284cd 100644 --- a/website/pages/en/developing/assemblyscript-api.mdx +++ b/website/pages/en/developing/assemblyscript-api.mdx @@ -468,16 +468,16 @@ Any other contract that is part of the subgraph can be imported from the generat ```yaml mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - Gravatar - abis: - - name: Gravity - file: ./abis/Gravity.json - - name: OtherContract - file: ./abis/OtherContract.json + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - Gravatar + abis: + - name: Gravity + file: ./abis/Gravity.json + - name: OtherContract + file: ./abis/OtherContract.json ``` - import and bind to the contract using its address.