If you’ve been following the development process of Ethereum’s ecosystem, including Web3 apps, and DeFi (decentralized finance) projects, then you’re probably familiar with the term “DAO”. Furthermore, by creating a DAO where network participants can vote freely, you would take your project closer to what blockchain technology is all about – decentralization. Therefore, for any blockchain developer who’d like to be successful, learning how to create a DAO will prove to be highly beneficial. Moreover, by using Moralis’ Web3 platform, you can accomplish this quickly and create a DAO in as little as ten minutes.
A DAO, or decentralized autonomous organization, is a blockchain-based organization that rewrites the rules on leadership and governance. It uses smart contracts to replace hierarchical structures. Moreover, it allows independent members of a community to vote on relevant issues, usually with the use of native tokens.
Today, there are already several DAOs in existence, and they’re mostly based on Ethereum smart contracts. The rules of smart contracts determine the behaviors and limits within the DAO. Moreover, the first DAO was built on Ethereum in 2016. It failed because of an exploit, but since then, the developer community has learned a lot from it. Hence, Ethereum and blockchain are far more robust since that first attempt to create a DAO.
DAOs have many different purposes and functions. For example, they can be used for the governance of Ethereum dApps. They can also be used to propose and decide on changes on any decentralized platform. Thus, they avoid centralized control among developers or owners. Moreover, DAOs also have a use case in gaming. The metaverse, with its vast gaming and interactive possibilities, has numerous opportunities for deploying DAOs. Therefore, it is important for anyone who is into blockchain development to know how to create a DAO.
Build a DAO Quickly with Moralis
While the idea of learning how to create a DAO seems rather daunting and complicated, DAOs today have become simple to build. Thanks to the ultimate Web3 development suite, Moralis, DAO-building has become a quicker and more streamlined process.
If you want to jump straight into a video tutorial, check out this easy-to-follow guide from the Moralis YouTube channel:
What is a DAO?
Before you learn to create a DAO, you must first understand what a DAO is. As mentioned, a DAO is an organization governed through Ethereum smart contracts. It allows network participants to vote freely from anywhere in the world on pertinent issues affecting the organization. A DAO eliminates traditional forms of governance, which are usually structures that encourage high levels of centralization and concentration of power.
Hence, you can say that a DAO is the blockchain-driven equivalent of democracy. Moreover, it upholds this democratic structure on the internet by allowing participants to decide on more granular issues. Today, even the ones considered too “minute” or insignificant to be community-decided in the past can be regularly discussed and decided in forums. Moreover, in a DAO, big or small adjustments to the protocol can be decided by all participants.
Often, such decision-making capabilities are powered by a native token. However, why a token? A native token supports the running of the platform, encourages skin in the game, is a quick way to raise funds for the organization, governs incentives, and creates transparency. Tokens follow different standards, but the ERC-20 token standard remains a widely popular choice. Users vote on a poll by signing a transaction on a Web3 wallet like MetaMask.
Snapshot of Uniswap DAO Governance
Tokens also dictate the weight of your vote(s). For example, if one token is equivalent to one voting share, then those who hold more voting shares have more influence on the decision. There are many ways to gauge the weight of one’s vote based on tokens. Furthermore, all of these votes are voluntary. One may choose to participate or not in certain polls.
Therefore, another advantage that DAOs confer is transparency. As such, the transactions can be freely viewed on the blockchain. Thus, it is difficult to lie or conceal the decision-making process.
Simply put, you can allow your dApp’s users to run a part of the whole organization when you create a DAO.
Why Create a DAO?
Why would someone want to create a DAO? How is it relevant to dApps or blockchain development projects? There are many reasons why you should create a DAO. DAOs can be applied to many different situations, scenarios, and protocols. In DeFi, for example, DAOs can help build trust by letting the users participate in their protocol updates. Developers can propose new changes to the protocol, but to earn trust, users can vote on whether changes should be implemented or not.
Examples of DeFi DAO applications are lending platforms, yield-earning dApps, and decentralized exchanges (DEXs). If you want to learn how to create a DEX, visit the Moralis blog for an easy five-step guide.
Today’s DAO landscape is much more dynamic than that of the past. It is made up of protocol DAOs, investment DAOs, service DAOs, and social DAOs. Furthermore, you can also find several DAO operations systems that greatly influence the ecosystem, such as Aragon, Syndicate, Orca, and DaoStack. Moreover, there are grants DAOs and media DAOs. Collector DAOs are relevant if you are into NFT dApps or NFT platforms.
As a blockchain developer, learning how to create a DAO can enrich any project that you hope to build. Whether you’re interested in finance or in how to launch an NFT marketplace, DAOs have utility. Furthermore, if you want to build a DEX, DeFi protocol, gaming dApp, or a dApp in the metaverse, you can create a DAO to complement your project.
Create a DAO in the Metaverse
The “metaverse” buzzword has been making the rounds these days, and it’s exciting. The good news is, DAOs extend their relevance to the metaverse as well. Examples of platforms that already use, or plan to use, a DAO in their governance are The Sandbox and Decentraland. Moreover, The Sandbox has set a timeline to implement a DAO. However, Decentraland, a full 3D ecosystem, has already established its DAO. Through the Decentraland DAO, its members can vote on proposed game updates.
Examples of DAO Tokens
DAO tokens are an important part of DAO design and an essential part when you create a DAO ecosystem. Some of the biggest DAO tokens in the blockchain space today are:
- Aave – Aave (AAVE) tokens are used in the world’s third-largest dApp and Ethereum’s second-largest lending protocol. It facilitates lending and borrowing on the Aave platform, which already boasts having a TVL of $13 billion.
- Maker – Maker (MKR) is used in MakerDAO, DeFi’s largest lending platform. It allows users to vote on MakerDAO’s parameters, including business logic and risk management systems.
- Uniswap – The Uniswap (UNI) token and DEX are widely popular. This platform has about $10 billion in TVL currently and is the second-largest DEX on Ethereum. Users holding the UNI token can vote on new proposals. However, developers still have a significant say on Uniswap decisions, making it less decentralized than others.
Create a DAO App in Record Time
Furthermore, with Moralis, you can rapidly build powerful tools that add functionality to your DAO.
This tutorial lets you build a DAO app or widget that lets users do one of the most important actions in a DAO – sign a vote in a poll using a Web3 wallet like MetaMask.
Step 1 – Sign Up with Moralis
The first thing you need to do if you want to create a DAO quickly is to sign up with Moralis. Moralis is simply the best Web3 developer’s toolkit around, and it offers many competitive advantages that add up to you launching your dApps in no time.
Moreover, this step is crucial to perform the following steps when you create a DAO app.
Step 2 – Get the Moralis Poll Codebase
Go to the GitHub repo for the Moralis poll. The Moralis poll codebase is is a fork, or a clone, from the Web3 social network boilerplate. This step saves you a lot of time because it takes care of many required functionalities regarding the user and connecting to Web3. Instead of writing the code from scratch, you can use this as your base boilerplate.
So, clone the Moralis poll code. Then, copy the link to the GitHub repo, as shown below. Moreover, another option is to fork it for yourself.
Go to Visual Studio Code (VSC). Visit your terminal, type in “git clone”, and paste the link to the repository. This clones it down to a local development environment.
So, now you can add the folder to your workspace in VSC.
Step 3 – Link the dApp Codebase to a Moralis Server Instance
Go to your Moralis account. Then, create a new server by clicking on the upper-right button, “Create a new Server”, and select the testnet option.
Name your project, select your region and choose any of the chains you want to work on. For this tutorial, we are using the Polygon Mumbai chain. Now, click on “Add Instance”, found on the bottom-right of the pop-up window.
Once the server is set up, click on “View Details” to obtain the necessary information.
You’ll need your Moralis server URL and application ID. As such, copy those to your clipboard.
Now, go back to VSC, and look for the “.env” file in the codebase. On it, post your server URL and application ID, as provided by Moralis.
Step 4 – Create a DAO – Test Your dApp
After clicking on save, you need to test your new dApp. To do so, watch the tutorial details on how to test your dApp, which start at 3:23 of the video.
Moreover, when testing, you need to remember that the dApp lets you create a poll instantly and sign your vote on MetaMask using MATIC tokens.
Of course, the token type we are using here is a testnet crypto token, which you can obtain via a faucet. Furthermore, your widget will be checking whether you have enough tokens in your wallet to be able to vote in the poll. Otherwise, the poll won’t show on your screen. A demonstration of this starts at 4:40 in the video.
Upon testing, the DAO app or widget should appear like the following, with your testnet MATIC tokens allowing you to participate and vote.
If you want to learn more about how to launch Web3 apps with MetaMask, simply read up further regarding that topic on the Moralis blog.
Note that no additional code is required for this to work, as the features are already contained in the cloned codebase. In addition, the boilerplate also contains all the functionality for user authentication via MetaMask or a Web3 wallet. Hence, you don’t need to code anything to access the Web3 functionality to manage the user.
This widget is a node module called “react-polls”. It’s one of the dependencies that save you time when building a frontend to create a DAO app.
Furthermore, all of this is done seamlessly with Moralis, which allows you to create a new server and choose your test chain at the convenience of a click. Moreover, you can connect to the blockchain without doing any heavy lifting on the backend.
Verify on Moralis
To check whether your dApp is connected to your Moralis server instance, go to the Moralis dashboard. To do so, simply click on the button as shown here:
On your dashboard, go to “Polls”. There, you’ll be able to see and review all data connected to your poll, including all addresses that have signed their vote. Moreover, under “Options Array”, you can see the number of times each option in your poll has been voted for.
With this working, you can be assured that your dApp is indeed running and connected to the Moralis server.
Create a DAO – Dive into the Code
To delve deeper into how you can create a DAO app and how the Web3 social network boilerplate code was adapted to build a poll component, simply view the rest of the guide. This section starts at 6:45 of the video.
Furthermore, it shows how the default component was customized to create a “polls” component. The polls component (“polls.js”) piggybacks off of the boilerplate, so it’s ready to plug into any React app that then uses “react-moralis” or “react-polls”.
Moreover, “react-moralis” contains all of the Moralis functionalities. This means that it holds the user component, native balance, and wallet checking functions. In this case, Moralis checks the Polygon Mumbai testnet for information on token balances.
For the rest of the code breakdown, make sure to watch the video tutorial.
Create a DAO in 10 Minutes – Summary
With decentralization becoming the thrust of governance systems today, any developer would benefit from learning how to create a DAO. Apart from understanding the use cases for Solidity smart contracts, you can now apply them to create further decentralization of your new dApp.
DAO creation would typically take a much longer time, considering the backend requirements of setting up your blockchain servers. However, Moralis provides you with excellent features to cut development time to as short as ten minutes when you make use of its instant server creation features and its other exciting functionalities that allow you to connect to various blockchains.
Testing your new DAO becomes as simple as a few clicks. Moreover, with exciting resources as provided by Moralis Academy, you can further supercharge your dApp creation. For example, the Ethereum Smart Contract Programming 101 course can bring you up to speed on what’s happening right now in the world of DAOs and decentralized apps.
With your backend handled, and your frontend simplified to a few steps, you can see how Moralis gives you an edge in all of your Web3 and dApp projects. Simply register on the site, review the content as posted above, and you’re on your way to building your very own DAO!