A Peer Assessment DAO where students submit their project work for review/marking by other students.
The DAO is made of students studying the same subject/course where they will all eventually submit their work for review/marking. On submission, their work will be assessed by other students against a set criteria (provided by the teaching organisation).
In order to be awarded their diploma, a project will require a "pass" from a % of the DAO and on passing a student will be awarded their diploma certificate.
The DAO is based on the OpenZeppelin Governance model uses ERC20 tokens for voting. On successfully passing, a student will be able to mint their Diploma certificate. This Diploma is a non-transferable NFT (ERC721 token) ie. A pseudo "Soulbound" Token.
The DAO makes use of Timelock to ensure that the DAO remains 'trustless', and the execution of Diploma minting can only be performed the DAO if a project successfully passes and not directly by students or the teaching organisation.
The application utilises the following four smart contracts, which are all deployed to the Sepolia testnet, at the following addresses:
-
Marking Token (ERC20): 0x93530f913232EC2D46daE425E163fBc8eCC399c3
-
DiplomaGuild (ERC721): 0xa4a229194FfB476803543f5f31df870ADb424E3F
The following is a sequence diagram outlining the contract interactions:
sequenceDiagram
Student ->> MarkingToken: Request and Delegate tokens
MarkingToken -> Student: <-- Mint tokens and grant "voting" power
Student ->> Governor: Review other students projects with delegated tokens
Student ->> Governor: Submit own project for review
Governor -> Student: <-- Return Project ID on successful submission
Student ->> Governor: If own project has passed, request Diploma
Governor ->> Timelock: Queue and Execute successfully passed project
Timelock ->> DiplomaNFT: Mint Diploma NFT on behalf of passing student
DiplomaNFT -> Student: <--Transfer Diploma NFT to student
To faciliate the Timelock aspect of the DAO i.e. Queuing and Execution, an API layer (running on https://nestjs.com/) is implemented with the following single end-point that will be called by the Application's front-end:
POST /queue-and-lock
Request Body:
{
projectURL: <STRING>
studentAddress: <STRING>
}
Response:
{
execution_tx_id: <STRING>
}
The frontend layer is a react based web app that permits the following actions for a user (Student):
- Login to application via their wallet.
- Request Marking tokens so that they may be able to review/mark projects.
- Submit their own project and track its progress.
- Request Diploma if project has passed.
- Mark/review other student projects.
UI design/wireframes desgins are available from UI design/wireframes desgins are available from diploma_dao_ui_wireframe.pdf
├── contracts
│ ├── DiplomaGuildGov.sol
│ ├── DiplomaGuildNFT.sol
│ ├── DiplomaGuildProps.sol
│ ├── DiplomaGuildTimeLock.sol
│ └── MarkingToken.sol
├── scripts
│ ├── deploy_gov.ts
│ ├── generateNFTMetadata.ts
│ ├── gov.ts
│ ├── gov_v2.ts
│ ├── readStorage.ts
│ └── sepolia_dep.ts
├── tests
│ └── test.ts
├── assests
│ ├── DiplomaGuild.png
│ ├── DiplomaGuild.svg
│ └── metadata.json
├── backend
│ ├── dist
│ ├── nest-cli.json
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ ├── test
│ ├── tsconfig.build.json
│ ├── tsconfig.json
│ ├── vercel.json
│ └── yarn.lock
├── frontend
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ ├── src
│ ├── tailwind.config.js
│ └── tsconfig.json
├── hardhat.config.ts
|── node_modules
├── package-lock.json
├── package.json
Project was built and tested against:
-
Node v19.7.0
-
Npm v9.5.0
-
Yarn v3.5.0
-
Ensure dotenv is setup with team 4 keys/signers
- From the repo root run
yarn install
- Once install is complete:
- To compile the contract(s) run:
yarn hardhat compile
- To test the contract(s) run:
yarn hardhat --network hardhat test
- To run contracts run:
yarn hardhat --network hardhat run scripts/gov_v2.ts
- To compile the contract(s) run:
- Cd to the backend directory.
- Run
yarn install
- Once install is complete:
- To start in dev the run:
yarn start
- To start in dev the run:
- Swagger API will be accessible via http://localhost:3001/api
- Cd to the frontend directory.
- Run
npm install
- Once install is complete:
- To start, run:
npm run start
- To start, run:
- App will be accessible via http://localhost:3000/
Built for the Encode Solidity Bootcamp 2023 by: