# Migration to smart contract v2

**Migration Steps**

1. **Enable Version 2 in Quote Requests**
   * In your **quote** endpoint, include the parameter `version=v2`.
   * This ensures that our system utilizes the latest version of the smart contracts.
2. **Update the Unizen Contract Addresses Package**
   * Upgrade to the latest [**Unizen contract addresses package**](https://www.npmjs.com/package/@unizen-io/unizen-contract-addresses) to retrieve the new `unizenRouter` address.
   * This is the **only address** needed for approvals—no more version-specific handling.
3. **Use the Unizen Router for Transaction Execution**
   * When executing a transaction from the user's wallet (for non-gasless trades), use the **Unizen Router address**.
   * The **swap** endpoint will continue to return the correct contract details, including the necessary approval information (if applicable, unless it’s a **Permit2** trade).

#### **That's It!**

With just these simple steps, your integration will be fully compatible with **Version 2** of Unizen’s API. By upgrading, you ensure improved efficiency, reduced costs, and enhanced functionality.


---

# 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://docs.unizen.io/api-introduction/version-2-of-our-smart-contracts/migration-to-smart-contract-v2.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.
