> For the complete documentation index, see [llms.txt](https://docs.cork.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cork.tech/developers/contract-reference.md).

# Contract Reference

Cork Phoenix uses a singleton architecture. All pools are managed by a single CorkPoolManager contract. For write operations with slippage protection, use CorkAdapter. For read operations, query CorkPoolManager directly.

## Contract Addresses

All addresses are identical across Ethereum mainnet and supported chains, deployed via deterministic CREATE2.

| Contract              | Address                                      | Purpose                                             |
| --------------------- | -------------------------------------------- | --------------------------------------------------- |
| CorkPoolManager       | `0xccCCcCcCCccCfAE2Ee43F0E727A8c2969d74B9eC` | All pool operations and state queries               |
| CorkAdapter           | `0xCCcCcCCCcccCBaD6F772a511B337d9CCc9570407` | Safe wrappers with slippage and deadline protection |
| DefaultCorkController | `0xcCcCcCccCccbC06627F8aad7aAF13fe3a457f779` | Governance: pool creation, fees, pause control      |
| WhitelistManager      | `0xcCccCcCccCC6e38a2772Eb42D2f408eeB89cb0eE` | Global and per-market access control                |
| ConstraintRateAdapter | `0xCCcCcCcccCccEF378949D1a61ED2283C831AF03A` | Oracle rate protection with daily change limits     |
| SharesFactory         | `0xcCCCccCCCcCc1782617fe14A386AC910a20D4324` | cPT/cST token pair deployment                       |

## Architecture

```
┌─────────────────────────────────┐
│         Your Application        │
└──────────┬──────────────────────┘
           │ write operations          read operations
           ▼                                │
┌─────────────────────┐                     │
│     CorkAdapter     │                     │
│  (slippage/deadline │                     │
│   protection)       │                     │
└──────────┬──────────┘                     │
           │                                │
           ▼                                ▼
┌──────────────────────────────────────────────┐
│              CorkPoolManager                  │
│  (singleton — all pool state and operations)  │
└──────────────────────────────────────────────┘
```

**For integrators:**

* Call **CorkAdapter** for all write operations (deposits, swaps, withdrawals, redeems). It adds slippage protection and deadline checks.
* Call **CorkPoolManager** directly for read operations (swap rate, pool balances, previews, max amounts).

## Detailed References

* [CorkAdapter](/developers/contract-reference/cork-adapter.md) — every safe operation with parameter details, code examples, and error handling
* [CorkPoolManager](/developers/contract-reference/cork-pool-manager.md) — query functions, preview functions, raw operations, and key protocol concepts
* [Admin & Governance](/developers/contract-reference/admin-and-governance.md) — DefaultCorkController, WhitelistManager, ConstraintRateAdapter, SharesFactory, and PoolShare tokens


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cork.tech/developers/contract-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
