Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions primitives/dao.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Decentralized Autonomous Organizations
icon: landmark
description: "Learn about Decentralized Autonomous Organizations (DAOs) on NEAR - self-organized groups that coordinate membership, decision-making, and funding through smart contract voting."

Check warning on line 4 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L4

Did you really mean 'DAOs'?
---

import { TryOutOnLantstool } from "/snippets/try-out-on-lantstool.jsx";

Decentralized Autonomous Organizations (DAOs) are self-organized groups that form around common purposes. Membership, decision-making, and funding are coordinated by publicly voting on proposals through a smart contract.

Check warning on line 9 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L9

Did you really mean 'DAOs'?

![dao](/assets/docs/primitives/dao.png)

Check warning on line 11 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L11

Did you really mean 'dao'?

In contrast with [FT](./ft/ft) and [NFT](./nft/nft), DAO contract's are not standardized. Because of this, on this page we will use as
reference the [sputnik dao contract](https://github.com/near-daos/sputnik-dao-contract). The main concepts covered here should
Expand All @@ -17,7 +17,9 @@
<Tip>
The simplest way to create and interact with a DAO is to go through the
[AstraDAO
UI](https://near.social/astraplusplus.ndctools.near/widget/home?page=daos).
UI](https://near.social/astraplusplus.ndctools.near/widget/home?page=daos)
(mainnet only). The examples below use `testnet` so you can try them safely

Check warning on line 21 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L21

Did you really mean 'mainnet'?
without spending real funds.
</Tip>

---
Expand All @@ -32,7 +34,7 @@
```js
import { useNearWallet } from "near-connect-hooks";

const DAO_FACTORY_CONTRACT_ADDRESS = 'sputnik-dao.near';
const DAO_FACTORY_CONTRACT_ADDRESS = 'sputnikv2.testnet';

const { callFunction } = useNearWallet();

Expand All @@ -47,7 +49,7 @@
purpose: 'Building primitives on NEAR',
metadata: '',
},
policy: ['bob.near'],
policy: ['your-account.testnet'],
}),
},
gas: 300000000000000,
Expand All @@ -64,10 +66,10 @@
<Tab title="🖥️ CLI">

```bash
export COUNCIL='["bob.near"]'
export COUNCIL='["your-account.testnet"]'
export ARGS=`echo '{"config": {"name": "Primitives", "purpose": "Building primitives on NEAR", "metadata":""}, "policy": '$COUNCIL'}' | base64`

near call sputnikv2.testnet create "{\"name\": \"primitives\", \"args\": \"$ARGS\"}" --useAccount bob.near --amount 6 --gas 150000000000000
near call sputnikv2.testnet create "{\"name\": \"primitives\", \"args\": \"$ARGS\"}" --useAccount your-account.testnet --amount 6 --gas 150000000000000
```

<Note>
Expand Down Expand Up @@ -122,11 +124,12 @@
</Tab>
</Tabs>

<Tip>
The simplest way to create and interact with a DAO is to go through the
[AstraDAO
UI](https://near.social/astraplusplus.ndctools.near/widget/home?page=daos).
</Tip>
<Warning>
Replace `your-account.testnet` in the `policy` with an account you control.
The accounts in the policy become the DAO's council — if you leave a

Check warning on line 129 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L129

Did you really mean 'DAO's'?
placeholder (or someone else's account), you won't be able to control the DAO

Check warning on line 130 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L130

Did you really mean 'else's'?
you create, and any funds sent to it could become inaccessible.
</Warning>

<hr className="subsection" />

Expand Down Expand Up @@ -167,16 +170,16 @@

<Note>
Deploying by **hash** creates an immutable contract that never changes.
Deploying by **account ID** creates an updatable contract that changes when

Check warning on line 173 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L173

Did you really mean 'updatable'?
the referenced account's contract is updated. Choose based on whether you want
your FT contract to be updatable or permanent.

Check warning on line 175 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L175

Did you really mean 'updatable'?
</Note>

<hr className="subsection" />

### Voting policy

Currently, DAOs support two different types of [voting policies](https://github.com/near-daos/sputnik-dao-contract#voting-policy): `TokenWeight`, and `RoleWeight`.

Check warning on line 182 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L182

Did you really mean 'DAOs'?

When the vote policy is `TokenWeight`, the council votes using [tokens](./ft/ft). The weigh of a vote is the proportion of tokens used for voting over the token's total supply.

Expand All @@ -191,9 +194,9 @@

---

## List of DAOs

Check warning on line 197 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L197

Did you really mean 'DAOs'?

Query the list of DAOs existing in Sputnik Dao.

Check warning on line 199 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L199

Did you really mean 'DAOs'?

<Tabs>
<Tab title="🌐 WebApp">
Expand Down Expand Up @@ -394,7 +397,7 @@
```js
import { useNearWallet } from "near-connect-hooks";

const DAO_CONTRACT_ADDRESS = 'primitives.sputnik-dao.near';
const DAO_CONTRACT_ADDRESS = 'primitives.sputnikv2.testnet';

const { callFunction } = useNearWallet();

Expand All @@ -407,7 +410,7 @@
kind: {
Transfer: {
token_id: '',
receiver_id: 'bob.near',
receiver_id: 'your-account.testnet',
amount: '10000000000000000000000000',
},
},
Expand All @@ -424,7 +427,7 @@
<Tab title="🖥️ CLI">

```bash
near call primitives.sputnik-dao.near add_proposal '{"proposal": {"description": "My first proposal", "kind": { "Transfer": {"token_id": "", "receiver_id": "bob.near", "amount": "10000000000000000000000000"}}}}' --deposit 0.1 --gas 300000000000000 --useAccount bob.near
near call primitives.sputnikv2.testnet add_proposal '{"proposal": {"description": "My first proposal", "kind": { "Transfer": {"token_id": "", "receiver_id": "your-account.testnet", "amount": "10000000000000000000000000"}}}}' --deposit 0.1 --gas 300000000000000 --useAccount your-account.testnet
```
</Tab>
<Tab title="Lantstool" icon="/assets/docs/tools/lantstool-logo-circle.svg">
Expand Down Expand Up @@ -686,6 +689,14 @@
By default, only **council members** can create proposals.
</Info>

<Warning>
The attached `deposit` must match the DAO's `proposal_bond` exactly, or the
call fails with `ERR_MIN_BOND`. The bond is set per DAO in its policy (the
Sputnik DAO default is `0.1` NEAR, but many DAOs use a different value, e.g.

Check warning on line 695 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L695

Did you really mean 'DAOs'?
`1` NEAR). Check the DAO's policy with `near view <dao> get_policy` and use

Check warning on line 696 in primitives/dao.mdx

View check run for this annotation

Mintlify / Mintlify Validation (neardocs) - vale-spellcheck

primitives/dao.mdx#L696

Did you really mean 'DAO's'?
that `proposal_bond` as the deposit.
</Warning>

---

## Vote for proposal
Expand All @@ -698,7 +709,7 @@
```js
import { useNearWallet } from "near-connect-hooks";

const DAO_CONTRACT_ADDRESS = 'primitives.sputnik-dao.near';
const DAO_CONTRACT_ADDRESS = 'primitives.sputnikv2.testnet';

const { callFunction } = useNearWallet();

Expand All @@ -718,7 +729,7 @@
<Tab title="🖥️ CLI">

```bash
near call primitives.sputnik-dao.near act_proposal '{"id": 0, "action": "VoteApprove"}' --gas 300000000000000 --useAccount bob.near
near call primitives.sputnikv2.testnet act_proposal '{"id": 0, "action": "VoteApprove"}' --gas 300000000000000 --useAccount your-account.testnet
```
<Note>
Available vote options: `VoteApprove`, `VoteReject`, `VoteRemove`.
Expand Down