Skip to content

docs: update smart contract access details #340

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion website/pages/en/developing/assemblyscript-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down