# Contract Operations

The AI Agent SDK simplifies smart contract interactions by allowing developers to fetch Contract ABI (Application Binary Interface) by providing a contract address. This feature enables seamless integration with smart contracts on Cronos Chains, making it easier to interact with deployed contracts and build powerful blockchain applications.

To learn more about the underlying Developer Platform functionalities, please visit [Developer Platform Client SDK Contract Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/contract-module.md).

#### 5.1 Get contract ABI

Retrieve the ABI for a specified smart contract using the Crypto.com developer platform.

{% tabs %}
{% tab title="Query" %}

* Arguments

  ```python
  contract_address (str): The address of the smart contract.
  ```
* Example Query

  ```
  "Get contract ABI of <example-contract-address>"
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```python
  str: A formatted string containing the ABI of the smart contract.
  ```
* Example Response

  ````
  The ABI for the contract at address <example-contract-address> is as follows:
  ```json
  <example-abi>
  ```
  This ABI includes the contract's constructor, events, and functions, providing the necessary information to interact with the contract on the blockchain.
  ````

{% endtab %}
{% endtabs %}

Example Code

```python
from crypto_com_agent_client import Agent

agent = Agent.init(
    llm_config={
        "provider": "OpenAI",
        "model": "gpt-4",
        "provider-api-key": "sk-proj-example-key",
        "temperature": "float-controlling-output-randomness",
    },
    blockchain_config={
        "api-key": "your-crypto.com-developer-platform-api-key",
        "private-key": "your-private-key",
        "sso-wallet-url": "your-sso-wallet-url",
        "timeout": "timeout-in-seconds-for-API-calls-default-20s")
    },
)
response = agent.interact("Get contract ABI of <example-contract-address>")
print(response)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai-agent-sdk-docs.crypto.com/outdated-contents/contract-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
