# Smart Contracts

Built By DAO operates on 20 smart contracts deployed on Base (Ethereum L2). This section provides technical documentation for each contract.

***

{% hint style="info" %}

### 📜 Contract System

{% endhint %}

|   ⛓️ Network  | 📜 Contracts | 🔧 Solidity | 🆔 Chain ID |
| :-----------: | :----------: | :---------: | :---------: |
| **Base (L2)** |    **20**    |  **0.8.33** |   **8453**  |

{% hint style="info" %}
**🎯 Standards:** ERC-20, ERC-721, OpenZeppelin UUPS, Role-based Access Control
{% endhint %}

***

{% tabs %}
{% tab title="🪙 Token Contracts" %}

### 🪙 Token Contracts

| Contract                                             | Type            | Description                                     |
| ---------------------------------------------------- | --------------- | ----------------------------------------------- |
| [BLTBYToken](/developers/contracts/bltby-token.md)   | ERC-20          | External speculation/trading token              |
| [EQTBLTToken](/developers/contracts/eqtblt-token.md) | Modified ERC-20 | Internal work-based currency (non-transferable) |
| {% endtab %}                                         |                 |                                                 |

{% tab title="🎫 NFT Contracts" %}

### 🎫 NFT Contracts

| Contract                                                    | Type               | Description                               |
| ----------------------------------------------------------- | ------------------ | ----------------------------------------- |
| [DAOMembershipNFT](/developers/contracts/membership-nft.md) | Soul-bound ERC-721 | Member identity with 14 progressive ranks |
| [AngelNFT](/developers/contracts/angel-nft.md)              | Soul-bound ERC-721 | Individual investor tier ($10k-$250k)     |
| [VentureOneNFT](/developers/contracts/ventureone-nft.md)    | Soul-bound ERC-721 | Fund investor tier ($500k-$5M)            |
| [TrustNFT](/developers/contracts/trust-nft.md)              | Soul-bound ERC-721 | Institutional investor tier ($5M-$100M+)  |
| {% endtab %}                                                |                    |                                           |

{% tab title="💰 Financial Contracts" %}

### 💰 Financial Contracts

| Contract                                                                                                                  | Type        | Description                         |
| ------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------------------------------- |
| [Treasury](/developers/contracts/treasury.md)                                                                             | Upgradeable | Multi-token vault with safety rails |
| [BLTBYBank](/developers/contracts/bltby-bank.md)                                                                          | Standard    | Public BLTBY token sales            |
| [InvestorMintContract](/developers/contracts/investor-mint.md)                                                            | Standard    | Discounted BLTBY for investors      |
| [OperatingBudgetVault](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/operating-budget.md) | Upgradeable | Project/fund spending vault         |
| [FounderFund](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/founder-fund.md)              | Upgradeable | Founder operational spending vault  |
| {% endtab %}                                                                                                              |             |                                     |

{% tab title="🏢 Business Contracts" %}

### 🏢 Business Contracts

| Contract                                                                                                          | Type        | Description                            |
| ----------------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------- |
| [DAOBusiness](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/dao-business.md)      | Upgradeable | Business operations, receipts, refunds |
| [RentalAndRebate](/developers/contracts/rental-rebate.md)                                                         | Upgradeable | Rent-to-EQTBLT conversion with bonuses |
| [RedemptionContract](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/redemption.md) | Upgradeable | EQTBLT redemption for DAO services     |
| {% endtab %}                                                                                                      |             |                                        |

{% tab title="🏛️ Governance Contracts" %}

### 🏛️ Governance Contracts

| Contract                                                                                                                     | Type             | Description                            |
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------- |
| [Governance](/developers/contracts/governance.md)                                                                            | Upgradeable UUPS | V2.1 governance with QV and 4× ceiling |
| [RankVotingWeightRegistry](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/voting-registry.md) | Upgradeable      | Voting weights per rank (basis points) |
| [AccessControlContract](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/access-control.md)     | Upgradeable      | NFT-based tiered service access        |
| {% endtab %}                                                                                                                 |                  |                                        |

{% tab title="⏱️ Tracking & Vesting" %}

### ⏱️ Tracking & Vesting

| Contract                                                                                                                   | Type        | Description                              |
| -------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------- |
| [EQTBLTActivityTracker](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/activity-tracker.md) | Upgradeable | 30/90/180 day rolling activity windows   |
| [TokenVesting](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/contracts/token-vesting.md)             | Standard    | Token vesting schedules (cliff + linear) |
| {% endtab %}                                                                                                               |             |                                          |
| {% endtabs %}                                                                                                              |             |                                          |

***

<details>

<summary>🔐 Common Patterns</summary>

#### Founder → Multisig Transition

All contracts implement a one-way transition from founder control to multisig governance:

```solidity
function enableMultisig(address _multisig) external onlyFounder {
    if (multisigEnabled) revert MultisigAlreadyEnabled();
    multisigWallet = _multisig;
    multisigEnabled = true;
}
```

**Key characteristics:**

* Irreversible once enabled
* Transfers admin control to DAO multisig
* Designed for progressive decentralization

***

#### Soul-Bound NFTs

NFT contracts override `_update()` to prevent transfers:

```solidity
function _update(address to, uint256 tokenId, address auth) internal override {
    address from = _ownerOf(tokenId);
    if (from == address(0)) return super._update(to, tokenId, auth); // Allow mint
    if (to == address(0)) return super._update(to, tokenId, auth);   // Allow burn
    if (whitelistedAddresses[to]) return super._update(to, tokenId, auth); // Emergency
    revert TransferNotAllowed();
}
```

**Transfer rules:**

| Action                                 | Allowed |
| -------------------------------------- | ------- |
| 🟢 Minting                             | Yes     |
| 🟢 Burning                             | Yes     |
| 🟡 Transfer to whitelisted (emergency) | Yes     |
| 🔴 Transfer between users              | No      |

***

#### Multi-Stablecoin Support

Financial contracts normalize across different decimal standards:

```solidity
function _normalizeToUsd(address token, uint256 amount) internal view returns (uint256) {
    uint8 tokenDecimals = stablecoinDecimals[token];
    if (tokenDecimals == 6) return amount;
    if (tokenDecimals > 6) return amount / (10 ** (tokenDecimals - 6));
    return amount * (10 ** (6 - tokenDecimals));
}
```

**Supported stablecoins:**

| Token | Decimals |
| ----- | -------- |
| USDC  | 6        |
| USDT  | 6        |
| DAI   | 18       |
| PYUSD | 6        |

</details>

***

<details>

<summary>🔑 Role Reference</summary>

| Role                    | Description                  | Used In                       |
| ----------------------- | ---------------------------- | ----------------------------- |
| `DEFAULT_ADMIN_ROLE`    | Can grant/revoke all roles   | All contracts                 |
| `ADMIN_ROLE`            | Administrative functions     | Most contracts                |
| `MINTER_ROLE`           | Mint tokens/NFTs             | BLTBYToken, EQTBLTToken, NFTs |
| `MANAGER_ROLE`          | Operational management       | Bank, Investor, NFTs          |
| `GOVERNANCE_ROLE`       | Execute governance decisions | Governance, Treasury          |
| `REVENUE_SOURCE_ROLE`   | Record revenue               | Treasury                      |
| `SERVICE_MANAGER_ROLE`  | Manage services              | AccessControl, Redemption     |
| `FULFILLMENT_ROLE`      | Fulfill redemptions          | RedemptionContract            |
| `PROPERTY_MANAGER_ROLE` | Manage properties/leases     | RentalAndRebate               |
| `RECORDER_ROLE`         | Record activity              | ActivityTracker               |
| `SNAPSHOT_ROLE`         | Submit voter snapshots       | Governance                    |

</details>

***

{% hint style="success" %}

### 🔗 Development Resources

* 📜 [Full Contract Index](/developers/contracts/index.md)
* 🏗️ [Architecture Deep Dive](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/architecture.md)
* 🏛️ [Governance V2.1 Spec](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/governance-v2.md)
* 🔐 [Security Analysis](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/security.md)
* 🧪 [Test Results](https://github.com/urbanarray/builtbydocs/blob/main/docs/developers/testing.md)
  {% endhint %}

***

## 🔗 Related Pages

{% content-ref url="/pages/DE5T7PakaRq9xaiiY3yW" %}
[BLTBYToken](/developers/contracts/bltby-token.md)
{% endcontent-ref %}

{% content-ref url="/pages/KcIsXCXLxhFnSYmWXXYc" %}
[EQTBLTToken](/developers/contracts/eqtblt-token.md)
{% endcontent-ref %}

{% content-ref url="/pages/1NcBXr6cSk4UwHgDo09l" %}
[DAOMembershipNFT](/developers/contracts/membership-nft.md)
{% endcontent-ref %}

{% content-ref url="/pages/bnZ7LGns2GHcaGozmfFV" %}
[Governance](/developers/contracts/governance.md)
{% endcontent-ref %}

{% content-ref url="/pages/lIZWw3j7ehy0rqQhF8IA" %}
[Treasury](/developers/contracts/treasury.md)
{% endcontent-ref %}


---

# 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.builtbydao.com/developers/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.
