> 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/callables/methodprop/methodprop.is_constructor.md).

# MethodProp.IS\_CONSTRUCTOR

A constructor function in a smart contract is called when the smart contract is instantiated, and can be used to set initial values of state variables within the contract

An example of a smart contract with a constructor is:

```solidity
contract Example {
    
    constructor(){
    	owner = msg.sender;
    }
    
 }
```

An example of a query which will select constructor functions is:

```python
from glider import *
def query():
  props_included = [MethodProp.IS_CONSTRUCTOR]
  functions = Functions()\
      .with_all_properties(props_included)\
      .exec(5)

  return functions
```

## Output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2F3CCEuTlCaYd9GgPbKm1u%2Fimage.png?alt=media&amp;token=9ba9b26e-e4bb-4045-ae85-19b253e965f5" alt=""><figcaption></figcaption></figure>
