# Home Base DAO

BaseDAO is a generic smart contract framework enabling DAO deployments on Tezos. This document aims to describe the **baseDAO** tool and its features.

## Description of the tool

The framework contains 3 customizable FA2 compliant DAO smart contract templates:

* TrivialDAO: a simple template to get familiar with DAOs.
* RegistryDAO: an arbitrary data key-value storage. It can also hold XTZ and FA2 tokens with a how-to spend logic.
* TreasuryDAO: a DAO that holds XTZ and FA2 tokens with a how-to spend logic.

### Features

**baseDAO** is a turnkey solution which contains a set of tools to compile and deploy DAO smart contracts on the Tezos blockchain.

In order to use **baseDAO**, the **tezos-client** must be set up with the matching node and wallet configuration.

### Ledger

Every address that is stored in the ledger is associated with its unfrozen token balance and frozen token balance. When unfrozen tokens are transferred, the balance of the *from\_* addresses is decreased and the balance of the *to\_* addresses is increased according to the transferred values.

### Life cycle of the DAO smart contract

The contract constantly cycles between two stages, a *proposing\_stage* and a *voting\_stage*. Both have the same length, *voting\_period* and alternate between each other, starting from \\"voting\\" for period number 0. Tokens can be frozen in any period, but they can only be used for voting, proposing and unfreezing starting from the following one and onwards.

#### Proposals

Everyone can make a new proposal, however, you have to freeze some tokens for that. The proposer specifies how many frozen tokens they want to stake and this value is checked by the contract according to its compile-time configuration. This can only be performed in a proposing stage period, meaning one that's **odd-numbered** and the proposer must have frozen his tokens in one of the preceding periods. Proposals are identified by a key which is a byte value computed via **Blake2B** hashing function of a pair of proposed *entrypoint,* *parameters* and the *proposer address*.

#### Voting

Once a proposal is submitted, everyone can vote on it as long as they have enough frozen tokens to stake. One frozen token is required for one vote. A vote can only be cast in a voting stage period, meaning one that's **even numbered**. Moreover the proposal vote on must have been submitted in the proposing period immediately preceding and the voter must have frozen his tokens in one of the preceding periods. Voting period is specified for the whole smart contract and can be updated by the administrator; on update, the existing proposals are also affected. It's possible to vote positively or negatively. After the voting ends, the contract is "flushed" by calling a dedicated *entrypoint*.

![Source: https://medium.com/tezos-weekly-spotlight/exploring-homebase-a-dao-framework-for-tezos-with-gregory-rocco-7b7c0ba2ca20](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-Meemac_Ul0g9B3J2gij%2Flifecycle.png?alt=media\&token=f8d07663-92ee-42d1-8661-28802bfdb5c9)

## Deploying your DAO

### Configuration and deployment with CLI

In this example we will use the TreasuryDAO smart contract on Edo2net using the **baseDAO** CLI. We need to specify our admin address and the name of our DAO:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemVHYck1V0zUrVL6e%2Fcommanddeploy.png?alt=media\&token=acb82fae-5a91-4eca-86eb-7f2532c11135)

Result:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemWVZgk-5-o0ftkZx%2FdeployTreasury.png?alt=media\&token=3205cba6-e0bc-4af3-b494-f2c47931782f)

The deployed version of the DAO smart contract can be found here : <https://better-call.dev/edo2net/KT1CBJDRLQdK7hUDgWDDx6eCp76xBSLGLCED/operations>

#### baseDO Typescript API

A TypeScript API is also provided to facilitate the interactions with the deployed DAO smart contract : <https://github.com/tqtezos/baseDAO/tree/master/typescript/baseDAO>

### Homebase UI

#### Presentation

Homebase is a platform designed to let users create and manage DAOs on the Tezos blockchain. There is a live deployed version of Homebase DAO available here : <https://tezos-homebase.herokuapp.com/explorer/daos> This version is connected to Edo2net.

It is based on the **baseDAO** smart contracts. To be able to let users directly deploy smart contracts from its UI, Homebase embeds the compiled Michelson versions of the **Treasury** and **Registry** DAOs of **baseDAO**.

#### Deployment

To match the CLI deployment we did, we will also deploy the Treasury DAO, using the Homebase UI. Let's start by clicking on **CREATE DAO**:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemaclNDN6mnaZz4Z6%2Fhombase0.png?alt=media\&token=9cd1b00e-40c9-4c30-b7b6-934eebf2d4fd)

Here, we have two choices, either the Treasury or the Registry DAO, we select the Treasury template and name our DAO token *MTD*:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacksbM_5bGI3snF%2Fhombase1.png?alt=media\&token=087d22c5-b936-4793-8142-1054f6fa27fa)

We now need to specify our DAO logic, by customizing the proposal & voting processes:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacjCt8AQLCJ5odE%2Fhombase2.png?alt=media\&token=8e87d081-1808-48e7-ab75-7ca547039ba0)

We decide of the initial distribution of the DAO tokens, and give ourselves 10 MTD:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemachOiGaOmTqVyvU%2Fhombase4.png?alt=media\&token=26221e39-274d-4bd7-ae72-e666ffe55e75)

You can find below the review of our DAO submission:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacgOmvd9gk5MaRF%2Fhombase5.png?alt=media\&token=e3913a0f-6efb-4962-8468-1875347b9d99)

Let's now deploy our DAO smart contract using the Temple Wallet:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacdOTkDyjGvbLUC%2Fhombase8.png?alt=media\&token=25b6a6ce-d1a6-4444-881e-8caf355175f7)

Our contract is now originated and available here: <https://better-call.dev/edo2net/KT1TfWzLTD3DjqyJxwb9JMp93i8WiWwruDrZ/operations>

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacbJ8hcuniJkFUp%2Fhombase10.png?alt=media\&token=2e1d3978-72e9-495a-9bcc-0cdfdd9dd0de)

In the screenshot below, you will be able to find the dashboard of our DAO. On the top right corner of the UI, We can see our MTD balance of 10 MTD:

![](https://2844416659-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Meeg1UVEGFWXkuXBJ17%2F-MeelKC13N6nACC05LWH%2F-MeemacarG-XTyEdo4_E%2Fhombase11.png?alt=media\&token=3b2290cf-eac6-4926-9387-bc087eab0ff7)

The Homebase DAO UI offers several other features such as:

* Creating proposals
* Voting for proposals
* Checking past and current proposals
* View locked tokens
* View token holders
* ...

## Limitations

* With **baseDAO**, users need to be familiar with command-line tools, Tezos client, and Ligo language
* **baseDAO** depends on the package **morley-large-originator** which is heavy to build
* With **Homebase DAO**, there are currently only two available templates

## Other Tezos DAO initiatives

* StakerDAO: <https://www.stakerdao.com/>
* DAOBaker: <https://github.com/DAObaker>

## Sources

* Base DAO repository: <https://github.com/tqtezos/baseDAO>&#x20;
* Homebase DAO repository: <https://github.com/dOrgTech/homebase-app>&#x20;
* Homebase DAO live web application: <https://tezos-homebase.herokuapp.com/explorer/daos>&#x20;
* Tezos DAO Medium article: <https://medium.com/tezos-weekly-spotlight/exploring-homebase-a-dao-framework-for-tezos-with-gregory-rocco-7b7c0ba2ca20>
