# Load ABI

You have to reference two things in the code editor to load and access a smart contract:

* The contract address

```
// SYNTAX
address(name, address).

// EXAMPLE
address(hyperdapp, '0x87A852A30f778E2837283B09E49f03200110e865').
address(hyper_dapp, '0x87A852A30f778E2837283B09E49f03200110e865').
```

* The contract ABI

```
// SYNTAX
abi(name, [...ABI_FUNCTIONS]).

// EXAMPLE
abi(hyperdapp, [...]).
abi(hyper_dapp, [...]).
```

{% hint style="danger" %}
The contract `name` must be:

* in *snake\_case* **OR** *camelCase*
* the same for both the `address()`and the `abi()`
  {% endhint %}

{% hint style="info" %}
The dot at the end of the line is very important in Prolog. It marks the end of a statement.
{% endhint %}

The syntax for writing the `ABI_FUNCTIONS` is the following:

```
// SYNTAX
funtion_name(...input_types): output_type / state_mutability

// EXAMPLES
// View Methods
balanceOf(address, uint256): uint256 / view
name: string / view

// Pure Methods
contractType: bytes32 / pure

// Payable Method
claim(address, uint256): payable

// Non-Payable Method
setContractURI(string)
```

{% hint style="info" %}
In Solidity, there are three different **`stateMutability`** for a function: pure/view/payable/nonpayable. With HyperDapp, you need to reference it only when it is pure/view/payable.

<https://docs.soliditylang.org/en/v0.8.13/abi-spec.html#json>
{% endhint %}

If the function name is ***not camelCase***, it must be surrounded by single quotes:

```
'DEFAULT_ADMIN_ROLE': bytes32 / view
```

## Load Multiple ABIs

You can load multiple ABIs by using the same syntax as described above. You just need to choose unique smart contract names.

```
address(hyperdapp, '0x87A852A30f778E2837283B09E49f03200110e865').
abi(hyperdapp, [...]).

address(weth, '0xc778417E063141139Fce010982780140Aa0cD5Ab').
abi(weth, [...]).
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hyperdapp.gitbook.io/code-editor/guides/load-abi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
