project screenshot 1
project screenshot 2
project screenshot 3

Lens DAO

Lens DAO is a smart contract for building DAOs whose governance token is a FollowNFT from Lens Protocol. It uses OpenZeppelin's IGovernor interface because it is battle-tested and a standard, but replaces IVotes with the Lens Protocol FollowNFT's built-in capabilities.

Lens DAO

Created At

DAOHacks

Winner of

trophy

🥇 Lens — Best use

Project Description

The Lens Protocol is web3 social media. Wallets (and contracts I believe) have the ability to create profiles, follow other profiles (and receive followNFTs), post, comment on posts, etc. This project uses the followNFT capability. This token has in-built governance capabilities, with functions such as delegate, delegateBySig, getPowerByBlockNumber(), and getDelegatedSupplyByBlockNumber(). All of these make it possible for the followNFT token to stand in for a ERC721Votes contract in the Open Zeppelin Governor contract. This means followers can participate in governance for DAOs created by the profiles they follow. Since the Governor contract is an Open Zeppelin Governor, DAOs can be managed using websites like tally.xyz. Building a full-fledged frontend was not part of the project, although there is a little one to demo creating a DAO for my Lens Profile (hardcoded).

How it's Made

This project uses Open Zeppelin's Governor and Timelock contracts, as well as the LensHub and FollowNFT interfaces from the Lens Protocol. The main contract, GovernorFactory, is a factory contract. When a call is made to create a DAO, the contract creates clones of the Governor and Timelock contracts, initialises them, and emits their addresses as an event. A future plan is to use storage for those addresses to enable lookup by profileId, tokenAddress, and a unique identifier from both of those and other parameters. The major sponsor technology used here is Lens Protocol, as it is what the governance is built on. I was only passingly familiar with Solidity before this, and had only tried out Lens using the API, so building something so smart contract focused was a...task. I did a lot of research (spent 70% of the time researching, 20% staring at my computer, 5% reading console errors, and 5% coding). I love the factory implementation, i.e that each DAO gets their own smart contracts which they can customise before creation (customisable parameters is a priority for me going forward), and I love that this is essentially the reddit/discord for lens protocol (imagine being able to participate in the moderation of the channel, not just adhering to rules). I've laid the foundation here and I'm excited to continue it.

background image mobile

Join the mailing list

Get the latest news and updates