Skip to main content
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. DAO Structure In contrast with FT and NFT, DAO contracts are not standardized. On this page, we use the Sputnik DAO contract as reference. The main concepts covered here should be easily generalizable to other DAO implementations.
The simplest way to create and interact with a DAO is through the AstraDAO UI.

Create a DAO

You can create a DAO by interacting with the sputnik-dao factory contract:
export COUNCIL='["bob.near"]'
export ARGS=`echo '{"config": {"name": "Primitives", "purpose": "Building primitives on NEAR", "metadata":""}, "policy": '$COUNCIL'}' | base64`

near call sputnikv2.testnet create "{\"name\": \"primitives\", \"args\": \"$ARGS\"}" --accountId bob.near --amount 6 --gas 150000000000000
Find the full list of roles and permissions here.

Voting Policy

DAOs support two voting policies: TokenWeight and RoleWeight. TokenWeight: Council votes using tokens. The weight of a vote is the proportion of tokens used for voting over the token’s total supply. RoleWeight(role): Vote weight is computed as “one over the total number of people with the role”. Both policies include a threshold for passing a proposal, which can be a ratio or a fixed number.

List of DAOs

Query the list of DAOs existing in Sputnik DAO:
near view sputnik-dao.near get_dao_list '{}'

Query Existing Proposals

Query the proposals existing in a particular DAO:
near view nearweek-news-contribution.sputnik-dao.near get_proposals '{"from_index": 9262, "limit": 2}'
Example response:
[
  {
    "id": 9262,
    "proposer": "pasternag.near",
    "description": "NEAR integration announcement",
    "kind": {
      "Transfer": {
        "token_id": "",
        "receiver_id": "pasternag.near",
        "amount": "500000000000000000000000"
      }
    },
    "status": "Approved",
    "vote_counts": { "council": [1, 0, 0] },
    "votes": { "brzk-93444.near": "Approve" }
  }
]

Create Proposal

Create a proposal so other users can vote in favor or against it:
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 --accountId bob.near
By default, only council members can create proposals.

Vote for Proposal

Cast a vote for a proposal of a particular DAO:
near call primitives.sputnik-dao.near act_proposal '{
  "id": 0,
  "action": "VoteApprove"
}' --gas 300000000000000 --accountId bob.near
Available vote options: VoteApprove, VoteReject, VoteRemove.

Additional Resources

Build docs developers (and LLMs) love