# Testing

The recommended way to test Klima protocol contracts or smart contracts utilizing the [Klima Retirement Aggregator](/developers/guides/retirement-aggregator-v1-contract-guide.md) is using a forked blockchain testing environment. Popular smart contract development tools such as Foundry or Hardhat allow you to fork the current state of the Polygon blockchain using an RPC. This allows you or your locally deployed contracts to interact with existing contracts as if you were actually on the Polygon mainnet.

* [Foundry Forge Forked Testing docs](https://book.getfoundry.sh/forge/fork-testing)
* [Hardhat Forking docs](https://hardhat.org/hardhat-network/docs/guides/forking-other-networks)

Once you've forked the Polygon mainnet, review existing [contract deployment addresses](/developers/deployment-addresses.md).

If you prefer to make use of the Mumbai Testnet, see [this constants file](https://github.com/KlimaDAO/klimadao/blob/441bb1931a937d263829ca831fa157c652330aea/lib/constants/index.ts#L24) in our public frontend repository for a complete listing of the testnet contract addresses.


---

# 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.klimadao.finance/developers/testing.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.
