> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/contract/contract.state_variables.md).

# Contract.state\_variables()

Returns the list of all state variables of the contract.

`state_variables() →` [`StateVariables`](/glider-ide/api/statevariables.md)

Returns a StateVariables object for the state variables of the contract.

## Example query

```python
from glider import *

def query():
  contracts = Contracts().exec(1)

  state_variables = contracts[0].state_variables().exec()
  for state_variable in state_variables:
    print(state_variable.source_code())

  return contracts
```

## Example output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2FFl2dgLCSErir8KVKOETs%2Fimage.png?alt=media&amp;token=317dca8b-637b-4d3a-b2fa-d69621030e65" alt=""><figcaption></figcaption></figure>
