Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/dOrgTech/homebase-app in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
fabiolalombardim committed Feb 7, 2023
2 parents 10436dd + 23b4698 commit d6a0e2c
Show file tree
Hide file tree
Showing 9 changed files with 318 additions and 225 deletions.
127 changes: 58 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
# Tezos Homebase

[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)

Homebase is a platform designed to let users create and manage DAOs on the Tezos blockchain.

# Prerequisites

The following dependencies are required to run homebase-app:

| Dependency | Version |
| ---------- | ------------------- |
| Node | `v12.18.4` or above |
| Node | `v16.16.0` or above |
| Yarn | `v1.22.*` or above |

# Third Party Services

The following third party services are being used by Homebase:

## [Better Call Dev API](https://better-call.dev/docs)
### Base URL: https://api.better-call.dev/v1

| Endpoint | URL | METHOD |
| ------------------- | -------------------------------------------------------------------- | ------ |
| BigMap Keys | /bigmap/{network}/{number}/keys | GET |
| Contract | /contract/{network}/{address} | GET |
| Contract Operations | /contract/{network}/{address}/operations?size=10000&entrypoints=vote | GET |
| Contract Storage | /contract/{network}/{address}/storage | GET |

## [Pinata IPFS](https://pinata.cloud/)
### Base URL: https://api.pinata.cloud

| Endpoint | URL | METHOD |
| ------------- | --------------------------- | ------ |
| Pin to IPFS | /pinning/pinJSONToIPFS | POST |
| Pin List | /data/pinList?status=pinned | GET |
| Hash Metadata | /pinning/hashMetadata | PUT |

## [TZKT API](https://api.tzkt.io/)

### Base URL: https://api.tzkt.io/

| Endpoint | URL | METHOD |
| ---------- | ---------------------------------- | ------ |
| Operations | /v1/accounts/${address}/operations | GET |

## [Taquito Beacon Wallet](https://docs.walletbeacon.io/)

### Version: 13.0.1

## [Airgap's Beacon SDK](https://github.com/airgap-it/beacon-sdk)
### Version: 2.2.1
# Using Homebase

## Creating a DAO

1. Go to https://tezos-homebase.netlify.app/
1. Go to https://tezos-homebase.io/
2. Click on the `Create a DAO` button

You will be taken to the DAO Creator, from which you will be asked to choose on the currently supported DAO templates.
Expand All @@ -58,25 +43,25 @@ You will be taken to the DAO Creator, from which you will be asked to choose on

**DAO Settings**:

* DAO Name: this will also be the name of the DAO's token.
* Token Symbol
* Description
- DAO Name: this will also be the name of the DAO's token.
- Token Symbol
- Description

**Proposals and Voting**:

* **`Voting period duration`**
* **`Required stake to propose`**: required amount of DAO tokens to stake at the time of proposing. Currently follows the formula: `b + proposalSize`. Where:
- Proposal size is autocalculated based on the amount of transfers/registry updates (will get outdated soon on the contracts side)
- B is a constant amount of tokens
* **`Returned stake after proposal rejection`**
* **`Transfer amounts`** **(Treasury only)**: maximum and minimum amounts that can be transferred in a treasury proposal transfer. Currently only supports `XTZ`
* **`Quorum threshold`**: currently a natural number representing the total amount of votes required for a proposal to pass. Each token staked in a vote operation represents a vote. Therefore, with a quorum threshold of 500, a vote that stakes 500 tokens would make the proposal pass.
* **`Maximum proposal size`**
- **`Voting period duration`**
- **`Required stake to propose`**: required amount of DAO tokens to stake at the time of proposing. Currently follows the formula: `b + proposalSize`. Where:
- Proposal size is autocalculated based on the amount of transfers/registry updates (will get outdated soon on the contracts side)
- B is a constant amount of tokens
- **`Returned stake after proposal rejection`**
- **`Transfer amounts`** **(Treasury only)**: maximum and minimum amounts that can be transferred in a treasury proposal transfer. Currently only supports `XTZ`
- **`Quorum threshold`**: currently a natural number representing the total amount of votes required for a proposal to pass. Each token staked in a vote operation represents a vote. Therefore, with a quorum threshold of 500, a vote that stakes 500 tokens would make the proposal pass.
- **`Maximum proposal size`**

**Distribution Settings**:

* **`TokenHolders`**: initial token holder addresses and their initial balances. At least 1 is required.
* **`Administrator`**
- **`TokenHolders`**: initial token holder addresses and their initial balances. At least 1 is required.
- **`Administrator`**

5. You will then be taken to the review page. From here, click the `LAUNCH` button on the bottom right corner.
6. You will be redirected to the Launch screen. Do not close your browser tab until the whole process is complete (you are able to see and track progress by looking at the progress bar of this screen). You will be asked to connect your wallet if you haven't already, and then will be asked for 2 signatures: the first one originates the `Metadata Carrier` contract and the second one originates the actual `DAO contract`. When the originations are complete you will see a success message and a `Go to my DAO` button
Expand All @@ -88,45 +73,48 @@ There is a searchbar available, however, note that searches done using this bar

Specific DAOs can be explored by clicking on them in the home screen or by URL:

`https://tezos-homebase.herokuapp.com/explorer/dao/${DAO_ADDRESS}`
`https://tezos-homebase.io/explorer/dao/${DAO_ADDRESS}`

## Managing a DAO

All DAOs, regardless of their template, have:

**DAO page**: contains all general DAO information. Here you can see:
* Current cycle
* Time left to vote
* DAO name and description
* DAO template type
* Token holders and their balances
* Active proposals
* Frozen tokens
* Voting addresses
* `Execute` button

- Current cycle
- Time left to vote
- DAO name and description
- DAO template type
- Token holders and their balances
- Active proposals
- Frozen tokens
- Voting addresses
- `Execute` button

**Proposals page**: contains all proposals related information and related actions. Here you can see:
* DAO name
* `New Proposal` button and creation modal
* `Execute` button
* Active proposals
* Frozen tokens
* Voting addresses
* Tables with all proposals, passed proposals and active proposals. Each proposal item contains:
* Title
* Hash
* Creation date and cycle
* Quorum reached vs quorum threshold
* For/Against votes vs total votes

- DAO name
- `New Proposal` button and creation modal
- `Execute` button
- Active proposals
- Frozen tokens
- Voting addresses
- Tables with all proposals, passed proposals and active proposals. Each proposal item contains:
- Title
- Hash
- Creation date and cycle
- Quorum reached vs quorum threshold
- For/Against votes vs total votes

**Proposal detail page**: contains all specific information about a proposal and vote actions. Here you can see:
* Breakdown of the proposal's details (transfers to execute, registry items to update, among others)
* Proposal title and description
* Status badge and history
* Quorum reached vs quorum threshold
* Proposer
* For and against votes, each with a detailed modal
* Vote for and against buttons and modals. Only enabled if proposal is active

- Breakdown of the proposal's details (transfers to execute, registry items to update, among others)
- Proposal title and description
- Status badge and history
- Quorum reached vs quorum threshold
- Proposer
- For and against votes, each with a detailed modal
- Vote for and against buttons and modals. Only enabled if proposal is active

**Proposal creation modal**: all proposal creation modals support multiple operations batched in the same proposal and also allow the user to batch upload transactions with a JSON file. This JSON should follow a specific signature, based on the template type of the DAO. See [proposal JSON signatures for each template](#dao-template-specific-pages-and-details)

Expand Down Expand Up @@ -179,6 +167,7 @@ At a contract level, there is no such distinction, but in the UI it exists to le
```

# Contributing

## Developer Docs

- [Tezos Homebase Docs](https://docs.google.com/document/d/1zZwcvX0jNE8PycOMNSULy2i-mcjg1LJ9FFYbGP4m9TM/edit?usp=sharing)
Expand All @@ -197,8 +186,8 @@ To run the project:

# Glossary

* **Execute (Flush)**: execute all passed proposals from periods previous to the last one. If the proposal is rejected or did not meet the quorum threshold, then the Execute operation removes it from the proposals list.
- **Execute (Flush)**: execute all passed proposals from periods previous to the last one. If the proposal is rejected or did not meet the quorum threshold, then the Execute operation removes it from the proposals list.

* **Administrator**: address with permissions to mint, burn and transfer tokens in the DAO without a proposal. It is configured by the DAO creator and can be another contract (like a multisig)
- **Administrator**: address with permissions to mint, burn and transfer tokens in the DAO without a proposal. It is configured by the DAO creator and can be another contract (like a multisig)

* **Proposal size**: metric that describes the size, in packed bytes, of a proposal's metadata. Therefore, the bigger the proposal arguments are (more transfers or more registry updates), the bigger the proposal size is.
- **Proposal size**: metric that describes the size, in packed bytes, of a proposal's metadata. Therefore, the bigger the proposal arguments are (more transfers or more registry updates), the bigger the proposal size is.
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ const App: React.FC = () => {
<DAOCreate />
</ThemeProvider>
</CreatorProvider>
<WarningFooter
{/* <WarningFooter
text={
"The Homebase contract can't transfer FA1.2 tokens. Please make sure any and all tokens you send to the DAO treasury are implementing the FA2 standard."
}
/>
/> */}
</Route>
<Route path="/explorer">
<TZKTSubscriptionsProvider>
<DAOExplorerRouter />
</TZKTSubscriptionsProvider>
<WarningFooter
{/* <WarningFooter
text={
"The Homebase contract can't transfer FA1.2 tokens. Please make sure any and all tokens you send to the DAO treasury are implementing the FA2 standard."
}
/>
/> */}
<Footer></Footer>
</Route>
<Route path="/faq">
Expand Down
9 changes: 5 additions & 4 deletions src/modules/explorer/components/ProposalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,17 @@ export const ProposalFormContainer: React.FC<Props> = ({ open, handleClose, defa

const mappedTransfers = [...values.transferForm.transfers, ...values.nftTransferForm.transfers]
.filter(transfer => !!transfer.amount && !!transfer.asset && !!transfer.recipient)
.map(transfer =>
(transfer.asset as Asset).symbol === "XTZ"
.map(transfer => {
const type = (transfer.asset as Token).standard === "fa2" ? "FA2" : "FA1.2"
return (transfer.asset as Asset).symbol === "XTZ"
? { ...transfer, amount: transfer.amount, type: "XTZ" as const }
: {
...transfer,
amount: transfer.amount,
asset: transfer.asset as Token,
type: "FA2" as const
type: type
}
)
})

const mappedList = values.registryUpdateForm.list.filter(item => !!item.key && !!item.value)

Expand Down
4 changes: 2 additions & 2 deletions src/services/bakingBad/tokenBalances/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getDAOBalances = async (
offset = 0,
balances: DAOBalance[] = []
): Promise<DAOBalance[]> => {
const url = `https://api.${networkNameMap[network]}.tzkt.io/v1/tokens/balances?account=${daoId}&limit=${ELEMENTS_PER_REQUEST}&offset=${offset}&token.metadata.artifactUri.null=true&token.standard=fa2`
const url = `https://api.${networkNameMap[network]}.tzkt.io/v1/tokens/balances?account=${daoId}&limit=${ELEMENTS_PER_REQUEST}&offset=${offset}&token.metadata.artifactUri.null=true`
const response = await fetch(url)

if (!response.ok) {
Expand Down Expand Up @@ -83,7 +83,7 @@ export const getDAONFTBalances = async (
offset = 0,
balances: DAOBalance[] = []
): Promise<DAOBalance[]> => {
const url = `https://api.${networkNameMap[network]}.tzkt.io/v1/tokens/balances?account=${daoId}&limit=${ELEMENTS_PER_REQUEST}&offset=${offset}&token.metadata.artifactUri.null=false&token.standard=fa2`
const url = `https://api.${networkNameMap[network]}.tzkt.io/v1/tokens/balances?account=${daoId}&limit=${ELEMENTS_PER_REQUEST}&offset=${offset}&token.metadata.artifactUri.null=false`
const response = await fetch(url)

if (!response.ok) {
Expand Down
Loading

0 comments on commit d6a0e2c

Please sign in to comment.