> 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/callable/callable.get_contract.md).

# Callable.get\_contract()

Returns the parent contract of the function/modifier if exists, otherwise (global functions) returns NoneObject.

`get_contract() →` [`Contract`](/glider-ide/api/contract.md) `| NoneObject`

The function may return NoneObject in cases where it does not belong to any contract and is a global function, as Solidity supports that type of functions.

## Example

```python
from glider import *
def query():
  functions = Functions().without_modifier_names(["onlyOwner"]).exec(100)

  contracts = []
  for function in functions:
    # For each function without an "onlyOwner" modifier, return the contract
    contracts.append(function.get_contract())

  return contracts
```

## Example output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2FQe4EngqoBQ0y5czKqBNv%2Fimage.png?alt=media&amp;token=cda50176-ebbc-46fa-96eb-6bae3da3b7ca" alt=""><figcaption></figcaption></figure>
