> For the complete documentation index, see [llms.txt](https://collabrachain.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://collabrachain.gitbook.io/docs/tech-stack/smart-contracts.md).

# 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).
