Decentralized Autonomous Organizations (DAOs) leverage blockchain technology and smart contracts to enable user-driven decision-making, removing the need for centralized control. By integrating the Ethereum Name Service (ENS), DAOs enhance user-friendliness and establish a clear on-chain identity. Additionally, Snapshot facilitates off-chain voting, improving the governance process by making it more efficient and streamlined. To set up a DAO, key steps include acquiring an ENS name, creating a governance token for voting power, and configuring Snapshot for off-chain voting to ensure effective and decentralized decision-making. For more related to blockchain, smart contracts, and crypto, visit our blockchain app development services.
DAO Development with Snapshot and ENS Integration for On-Chain Governance
Acquire an ENS Domain
The first step in setting up a DAO is acquiring a decentralized identity for your organization via the Ethereum Name Service (ENS). ENS enables the association of human-readable names (e.g., yourdao.eth) with Ethereum addresses, providing both on-chain and off-chain identity for your DAO.
Steps to get your ENS domain:
- Visit the ENS Manager.(https://app.ens.domains/)
- Search for your desired ENS name (e.g., yourdao.eth).
- If available, proceed to purchase the name by paying the associated fees.
- Connect your wallet (e.g., MetaMask) to complete the transaction.
Once you own the ENS name, it can be used for various DAO-related tasks. For example, you can create subdomains like vote.yourdao.eth for voting or docs.yourdao.eth for documentation.
Also, Read | DAOs in Gaming : A New Governance Model
Implement Governance with a Governance Token
The second step is to create a governance token, which will serve as the voting mechanism for your DAO. The number of tokens a user holds determines their voting power on proposals.
Create the Governance Token Contract
Write and deploy a smart contract for the governance token using the ERC-20 standard. Below is an example of a simple governance ERC-20 token:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract GovernanceToken is ERC20 {
constructor(uint256 initialSupply) ERC20("Governance Token", "GOV") {
_mint(msg.sender, initialSupply);
}
}
You can either deploy a new governance token using the provided contract, or use an existing ERC-20 token by integrating it into the governance framework. If using an existing token, simply reference the token's address and use its balance for governance purposes.
You may also like to explore | A Quick Guide to Developing a DAO-enabled NFT Marketplace
Add Governance to Snapshot
Once you have your ENS domain and governance token, the next step is to set up Snapshot, which allows for off-chain voting.
Create Space : Go to Snapshot and sign in with your wallet (MetaMask). After a successful login, create a new space with your ENS domain as the name (e.g., yourdao.eth). You will also need to select the chain.
Set Up Voting Strategies: Specify how the voting power should be calculated by adding one or up to 8 strategies. Snapshot provides a set of strategies on the basis of which users' votes are counted.A voting strategy is a set of conditions used to calculate a user's voting power. Strategies enable Snapshot to calculate the final result of voting on a given proposal. Snapshot provides over 400+ voting strategies. The default strategy is erc20-balance-of — it calculates the balance of a predefined ERC-20 token for each user. We can also create our own strategy. Below is a demonstration of the fields.
{
"strategy": "erc20-balance-of",
"params": {
"address": "0xYourGovernanceTokenAddress", // Governance token contract address
"symbol": "GOV",
"decimals": 18
}
}
Configure Proposals: To specify who can manage the space or create proposals, fill in the appropriate fields with addresses for:
- Admins: Users able to edit the space settings and moderate proposals.
- Authors: Users able to create proposals without any constraints. Make sure that members specified in the authors field are allowed to submit a proposal.
Define who can create proposals, the voting delay, and the voting period. The configuration ensures that only token holders can participate in decision-making and sets how long a proposal will be open for voting.
To validate if someone can post a proposal, you can use the basic validation by default, which takes your voting power with space strategies and checks if you pass a defined threshold.
Voting
The voting delay is the time between the creation of the proposal and when users are allowed to vote.
The voting period is the duration that the proposal is active and votes can be cast. It is counted from the moment the proposal is created.
Quorum is the amount of voting power collectively achieved by voters, which is required for a proposal to pass.
Also, Check | How to Build a DAO | A Quick Explainer
Governance Proposal Workflow
Proposal Creation: Token holders or authorized users can propose changes or decisions within the DAO. For example, a proposal can suggest changes to the protocol or allocate treasury funds.
Voting Process: DAO members with voting tokens vote on the proposal. The proposal is accepted or rejected based on the voting outcome, considering quorum and voting power.
Execution (Optional): Once a proposal is approved, it can be executed either off-chain (through Snapshot) or on-chain (using smart contracts), depending on your DAO's setup.
Conclusion
In this setup, acquiring an ENS domain provides your DAO with a decentralized identity, while the governance token allows members to participate in decision-making. By configuring Snapshot, you can enable efficient off-chain voting, creating a robust governance model for your DAO. If you are looking for trusted blockchain app development, you may connect with our skilled blockchain developers to get started.