> 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()

`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="/files/FGHbOCucCeqwU7CgwFRj" alt=""><figcaption></figcaption></figure>
