Inspiration

With HashStrat DAO my goal was to fully decentralize HashStrat, a DeFi protocol for self-sovereign investing.

I wanted the users of the protocol to become members of the DAO, participate in governance decisions and receive protocol "dividends", that is the share of protocol revenues distributed to DAO token holders.

The HashStrat DAO is inspired by Compound and MakerDAO. These protocols represent major milestones in DeFi also because they have been able to create successful communities around their DAOs and DAO tokens. For HashStrat, I aimed to create a DAO that is fair and safe to its members, where all protocol changes must be voted and executed on-chain.

For the success of the DAO, a fair distribution of the DAO tokens is key. When designing the distribution mechanics of the HashStrat DAO token (HST), I've been inspired by the bitcoin distribution schedule. The bitcoin halvening cycles provide certainly on the maximum amount of bitcoin that will ever be in circulation (the well renowned 21 million coins) but also provided a big incentive to early adopters.

The distribution of the HashStrat DAO tokens (HST) follows a similar approach, with a distribution rate that halves every year (rather than every 4 years) and it's fair because there is no pre-mine and the entire DAO token supply gets distributed to users of the protocol.

What it does

For this Hackathon I built the entire DAO functionality, which is now deployed to the Polygon network. This includes:

  • The DAO token (HST): an ERC 20 token with ability to track past balances and past supply, based on the OpenZeppelin modules.
  • HST token Farm: the contract to distribute the entire DAO token supply to users of the HashStrat protocol.
  • A Dividends Distribution contract, with the mechanics to re-distribute protocol revenues to DAO token holders as "dividends"
  • Governance & Timelock, DAO Operations: the contracts that allow DAO tokens holders to submit, vote and execute proposals to update the protocol.
  • Treasury: a contract to track protocol revenues and payments authorised by DAO members.

How we built it

The backend of the DAO is a collection of smart contracts built in Solidity. I used Hardhat and Chai for testing. Some of the smart contracts leverage OpenZeppelin for compatibility with the Compound Governor Bravo governance standards.

The frontend is a responsive dapp, built in React and Typescript. It uses ethers and useDapp to connect to the blockchain and material-ui for its look & feel.

Challenges we ran into

For the dividends distribution functionality, initially I thought to implement a process based on "staking" DAO tokens. This would have not worked well because, if DAO tokens were staked to receive dividends, they would have not been available to vote on governance proposals.

At the end, I avoided complicated inter-dependencies between governance and dividends distribution processes, and for the latter, I implemented a solution that uses snapshots of DAO token balances and total supply at past blocks, which I think also provides a better user experience.

Accomplishments that we're proud of

I'm glad to have implemented all HashStrat DAO functionality as I originally intended without having reinvented the wheel. Rather than implementing an ad-hoc governance protocol, I did some research upfront and discovered the OpenZeppelin governance modules. That saved me a bunch of time also because allowed to easily integrate the HashStrat DAO in the Tally app that provides a much better front-end than I would have been able to build in the timeframe of this Hackathon. I'm also proud of the mechanics of the DAO tokens distribution, implemented in the HST token farm.

What we learned

During this project I learnt about a bunch of things, including:

  • The OpenZeppelin Governance contracts
  • The OpenZeppelin ERC20Votes token extension to keep track of past token balances and supply.
  • The Compound Governor Bravo standard
  • The Tally app where I registered the HashStrat Governor & Timelock contracts to get a nice, functional UI to create, vote and execute governance proposals.

What's next for HashStrat DAO

The DAO functionality built out during this Hackathon now requires to be used and battle tested. A nice extension would be an event notification system, for example Telegram or Twitter bots, where DAO members would register and be notified when there are important DAO events, like new proposals to vote or protocol dividends to claim.

Built With

Share this project:

Updates