-
-
sheeple - Create DAOform
-
sheeple - Responsive mobile layout
-
sheeple - Sign in with Twitch - outsource some verification to web2 for onboarding
-
sheeple - Connect wallet to create DAOs, create proposals and sign votes
-
sheeple - Vote prisma schema (provisional)
-
sheeple - Create proposal - TODO needs a complicated component for easy proposal creation e.g. encoding function call arguments
-
sheeple - Proposal created (not actually, just database rows on the backend)
-
sheeple - Connect wallet to sign vote
-
sheeple - Vote form
-
polity - House governor call graph (with solidity visual developer ext)
-
Polity - house governor inheritance
-
Polity - Senate governor call graph
-
Polity - senate governor contract interactions
Inspiration
Satoshi, grant me the serenity to accept the things I cannot decentralize, the courage to decentralize the things I can, and the wisdom to know the difference.
- Blockchain developer's prayer (apocryphal, circa 2022)
Web3 shouldn't lead to the Same Bank-runs & Frauds that we got pre-web3.
Decentralized organizations are a good potential path.
As a newbie, the abstruseness of DAO proposals (call method "doXYZBySigReentrancyGuardInitializable" on "0x....") and having to pay to vote and participate is falls short of expectations.
Plutocratic voting in proportion to wealth in tokens is also a disappointment.
Snapshot is an impressive decentralized voting system, but was also confusing to a newbie like me because of the ENS requirement.
Optimism and Jur have good ideas on governance through tiered "houses" and "Citizen NFTs" -- like in modern democracies. But, I haven't found any actual implementations.
The web3 community seems quite fixated on recreating corporate and "democracy-like" organizations. I thought it'd be amusing to try and implement tiered governance -- a house and a senate -- as well as a "constitutional monarchy" or "benevolent dictator" hierarchy in a DAO.
I saw Patrick talk about importing Snapshot voting into blockchains using ChainLink, so I wanted to start implementing an EA to get the ball rolling. This, unfortunately, requires querying the snapshot GraphQL server which seems to be the only centralized location to get all the IPFS CIDs of the voting and proposal data from. Storing signed votes on IPFS and importing them into chains via EAs also seemed like another good avenue to explore.
What it does
Polity - democracy like governance contracts
https://github.com/bk62/polity
Polity is a set of (very basic) contracts based on OpenZeppelin governance contracts.
A "lower house" governance tier has NFT based voting -- assuming one person one NFT distribution implemented by some way e.g. "Twitter blue" API verification.
An "senate" governance tier that implements ERC-20 token based weighed voting.
Finally, a "president" who gets to veto proposals.
Why decentralize only to re-centralize again?
Explicit centralization is better than implicit centralization -- then you can prepare for it.
I think it can make sense sometimes. I bet a lot of people who learned blockchain development from Patrick would join a DAO where Patrick could veto proposals he especially didn't like. You wouldn't want pseudonymous folks over the internet doing whatever they want in a DAO with your name on it.
An obvious use case, IMO, is creating DAO communities around Twitch streamers. Which brings me to:
sheeple - DAOs for followers
https://github.com/bk62/sheeple So I also started a web app called sheeple, "DAOs for followers", with the following planned feature set;
- Log in with twitch
- Create DAOs
- Invite your subscribers: mint them citizen NFTs and Governance tokens in some manner
- Let them vote off chain (ipfs, web3 storage, orbitdb etc); the community would sponsor pulling the voting results on-chain via EAs
- Create and reward "Achievement" ERC-1155 fungible and non-fungible tokens in the community
Actually deploying proxy contract clones, creating proposals etc are WIP -- need polity contracts improvements first.
Orbit-votes
https://github.com/bk62/orbit-ballot Trying to create a IPFS based DAO votes DB using OrbitDB.
Snapshot EA
https://github.com/bk62/external-adapters-js
Look at https://github.com/bk62/external-adapters-js/tree/develop/packages/composites/snapshot (Recommended way to create typescript EAs is to keep it in the monorepo)
Using ChainLink Typescript EA monorepo examples and GraphQL EA source to create a composite EA that pulls the final voting results for a proposal, given its ID or IPFS CID, from snapshot. So, a contract would need to call the EA with the ID for the proposal it wants to get a result for.
How we built it
Challenges we ran into
This project is a lot less ambitious than the one I did for the spring hackathon. I took a step back and tried to read and learn a lot as opposed to just building a lot asap. This has lead to a lot of partially implemented half-baked ideas, and some half thought out plans abandoned after finding out how difficult/non-starter it is, e.g:
- IPFS node + orbit db instance on the browser coordinating to replicate votes DBs
- deploying DAO contracts directly from the browser instead of hardhat
Unfortunately, all the pieces in this project are quite incomplete. Although, I think a lot of important components are starting to take shape, there's a lot of work to be done to make Polity and sheeple actually usable.
As someone who doesn't use snapshot, I am not too sure what features the Snapshot EA should have.
I wanted to add OrbitDB databases to store and easily query votes data JSONs from IPFS, but ran into quite a few challenges involving using typescript, undocumented bugs etc. It's also not too clear how to use the P2P db-replication features to keep redundant copies of community votes and make them available e.g. how to bootstrap peers, ensure security etc. But, I think this is something worth exploring more.
Accomplishments that we're proud of
Learned a lot
What we learned
A lot about Chainlink EAs, IPLD, libp2p, IPFS, OrbitDB, governance on chain etc.
What's next for chain-polity
- Implement the polity contracts with access control, modularity and as Clonable proxies to save gas and to enable (almost) one click deployment via browsers, ethers and metamask
- Work more on the snapshot EA, after confirming the use cases
- Create web3.storage and/or orbit-db EA, and a composite EA on top to import signed votes from IPFS
- sheeple only creates entries in the backend right now, and the signed voting -> web3.storage + IPFS is WIP
- and so on, there a lot of possible things to build out
Note: I pushed one final commit to the sheeple repo to fix a bug that crashed the vote page during the submission period extension (https://github.com/bk62/sheeple/commit/5a41d0197b482be8339bdfe49a91ba1533f249f8).
Built With
- nextjs
- solidity
- t3stack
- typescript
Log in or sign up for Devpost to join the conversation.