# Advanced: Getting the Current User's Address Dynamically

## $CURRENT\_USER

A common use case for many smart contracts is to return information from a public view method that is associated with the current user. An example would be retrieving the balance of the current users ERC20 token amount. While you could create a normal input field and let a user populate it with their address, for many use cases this would be an inconvenient solution where you might want to show some smart contract state related to the current user on page load.&#x20;

To address this common use case,  we have created the reserved keyword **`$CURRENT_USER`** that can be used inside of inputs for smart contracts.&#x20;

```markup
<input
      data-dh-property-method-id="000"
      data-dh-property-input-name="<<input method argument name>>"
      value="$CURRENT_USER"
/>
```

In this example, the input field's value would be automatically populated with the value of the current users Ethereum address.&#x20;

The `$CURRENT_USER` keyword is particularly useful when the input is hidden. To do this, set the display value of the input to none.&#x20;

```markup
<input
      data-dh-property-method-id="000"
      data-dh-property-input-name="<<input method argument name>>"
      style="display:none;"
      value="$CURRENT_USER"
/>
```


---

# 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://docs.dapphero.io/features/using-smart-contracts/getting-the-current-user.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.
