# Smart Contracts

The smart contracts are the core of CollabraChain, acting as the autonomous, on-chain backend. Deployed on the Base mainnet, they enforce the rules of every agreement, manage funds, and issue credentials without the need for a central intermediary.

#### **Core Contract Architecture**

Our on-chain logic is divided into three main contracts:

**1. Project Factory (`CollabraChainProjectFactory.sol`)**

This contract acts as a central registry and deployment engine. Its sole purpose is to create new, unique `Project` contracts for each collaboration. This pattern ensures that each project's logic and funds are securely isolated from one another.

* **Address (Base Mainnet):** [`0xfB250Bf4c8F9E80fEE15FF978ad1a6289dED9C2f`](https://www.google.com/search?q=%5Bhttps://basescan.org/address/0xfB250Bf4c8F9E80fEE15FF978ad1a6289dED9C2f%5D\(https://basescan.org/address/0xfB250Bf4c8F9E80fEE15FF978ad1a6289dED9C2f\))

**2. Project Contract (`CollabraChainProject.sol`)**

Each time a new project is created, the Factory deploys a unique instance of this contract. This is the contract that manages the entire lifecycle of a single project.

* **Holds funds securely** in an escrow.
* **Tracks the status** of each milestone (e.g., `Active`, `Pending Approval`, `Complete`).
* **Processes payments** by releasing funds to collaborators upon approval.
* **Calls the Reputation contract** to mint credentials upon final completion.
* **Example Address:** [`0x257957567894af9D43272efAEb2E9538133077D1`](https://www.google.com/search?q=%5Bhttps://basescan.org/address/0x257957567894af9D43272efAEb2E9538133077D1%5D\(https://basescan.org/address/0x257957567894af9D43272efAEb2E9538133077D1\))

**3. Reputation Contract (`CollabraChainReputation.sol`)**

This contract is responsible for creating the on-chain record of achievement. It's an ERC-721 contract that mints Soul-Bound Tokens (SBTs)—a special type of non-transferable NFT. Each SBT represents a successfully completed project for a collaborator.

* **Address (Base Mainnet):** [`0x87cC4d1516898D331699364DB756De3a17271C3a`](https://www.google.com/search?q=%5Bhttps://basescan.org/address/0x87cC4d1516898D331699364DB756De3a17271C3a%5D\(https://basescan.org/address/0x87cC4d1516898D331699364DB756De3a17271C3a\))

#### **Example On-Chain Transactions**

* **Creating a Project:** [View on Basescan](https://www.google.com/search?q=https://basescan.org/tx/0x...)
* **Approving a Milestone:** [View on Basescan](https://www.google.com/search?q=https://basescan.org/tx/0x...)

For a complete look at the code, please visit the [Smart Contracts repository](https://github.com/CollabraChain/smart-contract).


---

# 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://collabrachain.gitbook.io/docs/tech-stack/smart-contracts.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.
