# ContractGetInfo

## ContractGetInfoQuery

Get information about a smart contract instance. This includes the account that it uses, the file containing its bytecode, and the time when it will expire.

| Field        | Type                                        | Description                                                                                                                                         |
| ------------ | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `header`     | [QueryHeader](../miscellaneous/queryheader) | standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). |
| `contractID` | [ContractID](../basic-types/contractid)     | the contract for which information is requested                                                                                                     |

## ContractGetInfoResponse

Response when the client sends the node ContractGetInfoQuery

| Field          | Type                                                                          | Description                                                                                                      |
| -------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `header`       | [ResponseHeader](../miscellaneous/responseheader)                             | standard response from node to client, including the requested fields: cost, or state proof, or both, or neither |
| `contractInfo` | [ContractGetInfoResponse.ContractInfo](#contractgetinforesponse-contractinfo) | the information about this contract instance (a state proof can be generated for this)                           |

## ContractGetInfoResponse.ContractInfo

Response when the client sends the node ContractGetInfoQuery

| Field                | Type                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contractID`         | [ContractID](../basic-types/contractid)                        | ID of the contract instance, in the format used in transactions                                                                                                                                                                                                                                                                                                                                                                                                 |
| `accountID`          | [AccountID](../basic-types/accountid)                          | ID of the cryptocurrency account owned by the contract instance, in the format used in transactions                                                                                                                                                                                                                                                                                                                                                             |
| `contractAccountID`  | String                                                         | ID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity                                                                                                                                                                                                                                                                                                                                  |
| `adminKey`           | [Key](../basic-types/key)                                      | The state of the instance and its fields can be modified arbitrarily if this key signs a transaction to modify it. If this is null, then such modifications are not possible, and there is no administrator that can override the normal operation of this smart contract instance. Note that if it is created with no admin keys, then there is no administrator to authorize changing the admin keys, so there can never be any admin keys for that instance. |
| `expirationTime`     | [Timestamp](../miscellaneous/timestamp)                        | The current time at which this contract instance (and its account) is set to expire                                                                                                                                                                                                                                                                                                                                                                             |
| `autoRenewPeriod`    | [Duration](../miscellaneous/duration)                          | The expiration time will extend every this many seconds. If there are insufficient funds, then it extends as long as possible. If the account is empty when it expires, then it is deleted.                                                                                                                                                                                                                                                                     |
| `storage`            | uint64                                                         | Number of bytes of storage being used by this instance (which affects the cost to extend the expiration time)                                                                                                                                                                                                                                                                                                                                                   |
| `memo`               | String                                                         | The memo associated with the contract (max 100 bytes)                                                                                                                                                                                                                                                                                                                                                                                                           |
| `balance`            | uint64                                                         | The current balance, in tinybars                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `deleted`            | bool                                                           | Whether the contract has been deleted                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `tokenRelationships` | repeated [TokenRelationship](../basic-types/tokenrelationship) | The tokens associated to the contract                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `ledger_id`          | bytes                                                          | The ledger ID the response was returned from; please see [HIP-198](https://hips.hedera.com/hip/hip-198) for the network-specific IDs                                                                                                                                                                                                                                                                                                                            |
