BuidlGuidl / eth-tech-tree-challenges

This repository houses the many challenges of the Ethereum Development Tech Tree
MIT License
3 stars 9 forks source link

Initial Challenge Setup - Onchain Proposals #42

Open escottalexander opened 2 weeks ago

escottalexander commented 2 weeks ago

The setup is like this; eth-tech-tree is a CLI for downloading, submitting and managing which challenges a user has completed. The repo that houses all the challenges in called eth-tech-tree-challenges. Each challenge is a new branch on that repo.

Follow the example left by the Token Wrapper WETH challenge.

Here are the steps for adding a new challenge:

Creating a new challenge

  1. Fork and download the eth-tech-tree-challenges repo
  2. Create a new branch based on the main branch (which is set up to be a template for any challenge) with the name of the challenge e.g. 'onchain-proposals'
  3. Write out a solution to the challenge in solidity using best industry standards as generically as possible by editing Challenge.sol and changing it's name to match the challenge
  4. Write tests that cover the most common pitfalls and guarantee the contract operates as expected (Challenge.t.sol) - change it's name to match the contract
  5. Update README in your challenge to give the user clarity about what they must accomplish and also any helpful resources (see the token-wrapper-weth challenge for an example)
  6. Commit and push your changes to your remote repo, creating a new branch on your remote git push
  7. Submit a PR to the main eth-tech-tree-challenges repo pointed to the branch that matches your challenge name e.g. 'onchain-proposals'

Later, in another task, we will erase your specific solution code from the git history for your new branch in eth-tech-tree-challenges.


Onchain Proposals challenge specifics

This challenge will require users to implement the Compound Governance contract structure and functionality by creating two separate contracts;

This challenge shouldn't encapsulate everything the Compound contracts can do, only the main mechanism of having onchain proposals that can affect the token supply (and distribution to specific accounts) should be implemented.

Anyone can create a contract and send 100 of the tokens (or whatever amount you choose) to their proposal contract (this is a requirement of a proposal contract). The proposal contract address is then submitted to the governance contract. Holders of the token then vote based on a timeline (hardcoded 1 week from proposal submission is fine). If the majority votes "for" the proposal then after the deadline the main governance contract can call the proposal contract which should affect the ERC20 supply and/or distribution - whatever the proposal contract enacts.

Feel free to ask any questions or express any ideas that will help the end user learn through this challenge.

steve0xp commented 5 days ago

I can grab this one unless there are others that make more sense for me to jump on that aren't on this issues page (I can't see drafts but am wondering about things like generic ERC 4626 tutorials etc.).