How to set up a DAO on ICON?

Staky.io
Staky.io
Published in
5 min readFeb 13, 2023

Hello ICONist,

This tutorial will cover how to set up a DAO on the ICON blockchain thanks to Agora.

Agora is a smart contract system aiming to provide a governance framework to token holders. It allows any community of holders to set up community votes and make decisions in a decentralized way.

The governance decisions are yes/no questions only, and are a good fit to validate team decisions, product updates, treasury unlocks, etc.

You can browse to https://daos.staky.io, a website listing current ICON DAOs and providing an easy deployment process.

You can click on the “launch your DAO” button and select the appropriate network. We suggest picking “Lisbon” to test out everything since deploying a contract cost around 30 ICX.

Step 1 (optional): Deploy your token

You can skip this step if you have a live token already or if you know how to deploy one. For this guide, we’ll deploy a Soulbound NFT (non-transferable IRC-31 token) that will hold the governance power of our DAO.

Deploy the token:

Once you have selected the network, you can click on “I don’t have a token contract”

During the next step, you’ll be able to select the kind of token you want for your DAO. You can pick “Soulbounds NFT” and proceed with the deployment, you will be prompted to log in with a wallet, and you can pick either Hana or Ledger. Make sure you have at least 100 ICX in your wallet before doing so.

Mint tokens to DAO members:

Once it’s good you can copy the address of the deployed smart contract and open a new tab and go to this page: http://www.hub.craft.network/ (please keep the deploy UI opened).

You’ll need to pick the right network on the upper right section of your screen, login to the authentication tab, paste the token address in the contract field, and hit refresh.

Your contract methods will appear and the last step is to mint a soulbound NFT to each of your members. Your soulbound token should share the same id (pick 1 if you don’t need to have a specific one) and a URI. The URI is an ipfs hash that will hold metadata for your NFT, you can set it up as a general NFT and generate one on Craft deploy UI.

And that’s it! You can mint more tokens to new DAO members in the future and each token will account for one voice in governance decisions.

Step 2: Deploy and set Agora

This step will allow you to deploy and set your Agora contract, you can either click on “I have a token ready” or go back to the deploy UI if you followed step 1.

You can hit the “Deploy Agora” button and approve the deploy tx. Once it’s done, you’ll need to customize the Agora contract to read your token contract.

The first step is to select the token type. If the token balance can be accessible thanks to a balanceOf(Address) you can pick IRC2 token. If your token need to be accessed through balanceOf(Addres, BigInteger)` which is the case of Soulbounds NFT or staked Balanced LP, you can pick the other options. If you pick the latter option, a new field will appear to specify the tokenId to query. For our example it would be 1 as the Soulbound NFTs share the tokenID 1.

If you deployed a token already, the “Token Address” field should be filled already, otherwise, please paste your token contract.

Once all fields are set, you can click on “Set agora”, follow the process and you’re done! Your Agora contracts are ready to go.

Save the address displayed for later it will be useful.

Step 3: Deploy the UI on Netlify

We have prepared a ready-to-deploy user interface for your Agora contracts, you can definitely build your own if you want but for this tutorial, we’ll show you how to deploy the UI on Netlify.

Fork the repository

Sign up/in on a Github account and fork this repository: github.com/Staky-io/agora.

Prepare the environment

The only thing you’ll need to do to deploy the Agora UI is to prepare the following elements:

APP_URL: The URL of your application project.

APP_COLOR: The primary color of your project. It should be in [a hexadecimal form](https://en.wikipedia.org/wiki/Web_colors#Shorthand_hexadecimal_form).

APP_NAME: The name of your project.

APP_SCORE_ADDRESS: The address of your Agora contract.

APP_DECIMALS: The amount of decimals of your voting token (usually 18 for fungible, 0 for NFTs)

APP_SYMBOL: The symbol of the token.

APP_ICON_NETWORK: The network of your contract.

APP_LOGO_HASH: The IPFS hash of your logo (png,jpg).

APP_TWITTER: The Twitter username of your project or the full link.

APP_DISCORD: The Discord ID of your Discord invitation link or the full link.

APP_GITHUB: The GitHub username of your project or the full link.

APP_DECIMALS: The amount of decimals of your token, usually 18 for IRC2 and 0 for NFT

Please note that Twitter, Discord, and Github are optional. Here is an example of customized variables:

Save the variables for later and head to Netlify: https://www.netlify.com/. sign up, create a new site and pick “import an existing template”

Pick GitHub as a provider, find your Agora instance and before deploying click on “Show Advanced”

For each environment variable, create a new variable on Netlify and fill it as defined above:

The last step is to hit “Deploy Site” and you’re done! Your DAO is ready to be used. You can set more settings such as the minimum voting threshold (minimum amount of token to be held in order to create a governance proposal) in the ICON hub linked above.

Feel free to reach out on Discord if you have troubles in setting up your DAO.

--

--

Staky.io
Staky.io

Staky is a platform that offers you a staking service on Proof-of-Stake coins. Through this system of delegation, you keep the full possession of your cryptos.