Setup
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 is called eth-tech-tree-challenges. Each challenge is a new branch on that repo.
The challenges are Scaffold-ETH2 Extensions so you should be familiar with the process of creating extensions. It will also be helpful to reference an existing extension branch such as the Token Voting challenge. You might even want to copy all the files from that and modify as needed.
Here are the steps for adding a new challenge:
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { console2 } from "../lib/forge-std/src/console2.sol";
// Good luck!
Challenge Details
Onchain Proposals challenge specifics
This challenge will require users to implement the Compound Governance contract structure and functionality by creating two separate contracts;
ERC20 Token whose supply and distribution can be changed by a proposal
Governance contract (manages voting state and proposal execution)
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.
Setup
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 is called eth-tech-tree-challenges. Each challenge is a new branch on that repo.
The challenges are Scaffold-ETH2 Extensions so you should be familiar with the process of creating extensions. It will also be helpful to reference an existing extension branch such as the Token Voting challenge. You might even want to copy all the files from that and modify as needed.
Here are the steps for adding a new challenge:
vm.expectEmit()). We cannot guarantee that a user will write these exactly as we intend because of theindexedattributecontract.method(...). You will need to tell the user exactly what these methods are expecting and returning in the README.packages/foundry/extra/with the same name as your contract except with an "I" preceeding the name (e.g.IVoting.sol), fill out this contract with all the expected methods that the test relies on. This is for the testing server to use as a placeholder. The test should be able to compile and run (with falures) when you use this contract as the challenge contract. The important thing is that it can compile.create-ethextension system test the whole process of setting up an extension and solving the contract. See if you hit any unexpected bugs.onchain-proposals-extensionbranch. If the branch doesn't exist, ping @escottalexanderChallenge Details
Onchain Proposals challenge specifics
This challenge will require users to implement the Compound Governance contract structure and functionality by creating two separate contracts;
ERC20 Token whose supply and distribution can be changed by a proposal
Governance contract (manages voting state and proposal execution)
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.