My Create Project 💻

Jerry Qi
3 min readMay 1, 2022

This is my create project for my blockchain explore. This marks an end to me fiddling around with ethers.js from day till night. Very excited for the crypto space in the future, but for now, hear me out on my create project.

I named it peopleDAO

I named it PeopleDAO

Naming stuff is weird. Picking logos is weirder. It only occured to me 4 days after I’ve started working on this project that peopleDAO is already a thing: sorry PeopleDAO I didn’t mean to steal your name.

The Project: people can donate to the treasury, then vote to fund requests for eth. By donating eth to the treasury, people can mint an NFT.

The concept:

People can fund people, people can ask for help from people.

Here are the nfts for now.

NFT Page for people to mint.

The Solidity Part

There’s a bunch happening behind the back of the dao.

ICO process raises funding to treasury, governance tokens gets you nfts and are used to make votes on funding proposals to addresses.

Which brings use of: Crowdsale contract, token contract, governance contract, a nft contract and a backbackend transfer contract.

[Insert Image]

Governance

I did these two operations through thirdweb. s/o to their platform.

Their governance contract branches off the governor of openzeppelin. At the core of the governance is the proposal mechanism.

Proposals in this contract help with the autonomous nature of the DAO. Unlike tally and snapshot which require the dao team to carry out the execution, the contract supports full vote to execute process solely by code.

Proposals are stored in structs, and stored in a map.

mapping(uint256 => Proposal) public proposals;struct Proposal { 
uint256 proposalId;
address proposer;
address[] targets;
uint256[] values;
string[] signatures;
bytes[] calldatas;
uint256 startBlock;
uint256 endBlock;
string description;
}
Propose Method

Proposals can be called by anyone. When rinkeby arrives at the ending block, the proposal will execute through the website.

[Example of creating the transfer proposal]

Token

This is in the form of erc20.

The token is used for voting, the more you donate into treasury, the more voting power you have for the proposals.

Check out dirtcoin (my first erc20 project).

By the way. You should also check out thirdweb if you are intermediate in smart contract development, it saves a bunch of time if you are trying to implement common contracts/mechanisms on chain.

Crowdfunding

An ICO is used to distribute the funding to the treasury while supplying people who donate with governance erc20 tokens.

The contract looks like this:

Crowdfunding contract

The crowdfunding contract imports the template from openzeppelin crowdsale.

This is one of the most important functions of the open-zeppelin crowdfunding contract, exchanging eth for erc20 tokens.

The contract itself will hold tokens. Calling the function with a set amount of Eth is buying the same amount worth of governance tokens.

Amount of governance tokens given: Rate x Wei.

The crowdfunding contract will then deliver the ethereum into a fund holder contract allowing the dao voting contract to retrieve it on execution of proposal to fund someone.

Transfer Contract

Here’s the transfer contract.

Chill! I know this is not very secure for now, this was due to the trouble I had with the governance contract. I will improve the contract through further conditions in later stages.

The Project Details

you can find the project at:

link: https://peopledao-2efd1.web.app/

github: https://github.com/jerryq0101/peopleDAO (frontend)

github2: https://github.com/jerryq0101/pplDAOcontracts/tree/main (backend)

video walk through: https://www.loom.com/share/0b4be426c94a4f5abb9817b2c7b037d7

--

--

Jerry Qi

Grade 11 Student at tks.world. Passionate and write about emerging tech.