This repository correspond to the graduation phase of the DAO Adventure. To check out the complete DAO Adventure repository, click here.
- Motoko Bootcamp Dashboard (Click on Login to access)
- Motoko Bootcamp Discord
- Graduation Notion Guide
- [Graduation Video Guide] - COMING SOON
A DAO, which stands for Decentralized Autonomous Organization, is a new type of organization (or company) that runs leveraging blockchain technology. This enables us to create more transparent, trusted and efficient organisations.
DAOs are the biggest innovation in the field of governance since the invention of the LLC or perhaps even democracy itself. Just like the steam engine made the Industrial Revolution possible by harnessing physical power, DAOs harness political power and make a Web3 revolution possible. This could fundamentally change how we organize resources, people and capital with the end goal of creating a more stable, flourishing, collaborative and fair civilisation.
This future is only possible if enough builders stand up to make the dream a reality. Your goal, if you wish to earn your Motoko Bootcamp Diploma, is to build a simple DAO.
Based on all the knowledge you've acquired during your training, you should be able to build, from scratch, a project that follows the necessary requirements.
You have two available options:
-
Run this repository directly in your browser. This is the easiest way to get started. You can do so by clicking on the following button:
GitPod is a cloud-based development environment. We will use it to access and edit the project files directly from the web browser. That way you don’t have to install any additional software or worry about setting up your development environment locally. If you are facing issues with GitPod try the followings: Switch to another browser (Firefox is recommended) | Empty your cache and do a hard reset | Use Incognito Mode.
- Run this repository locally. You'll need to install the DFINITY Canister SDK to do so and setup your environment. You can find a detailed guide on how to do so here. Then simply download this repository and open it in your favorite IDE.
- Double canisters: this project is made up of two different canisters.
- The Webpage canister - this canister serves a webpage.
- The DAO canister - this canister manages the member of the DAO, the voting system, the manifesto and the goals of the DAO.
- Membership and Token Allocation:
- New members receive 10 Motoko Bootcamp Tokens (MBT) upon joining.
- MBTs are used for participating in DAO activities.
- Role System:
- The DAO comprises three roles: Students, Graduates, and Mentors.
- Students: All members start as students. They are members who haven't completed the Motoko Bootcamp.
- Graduates: These are members who have completed the Motoko Bootcamp. They gain the right to vote on proposals. Any member can become a Graduate through a
graduate
function, which only a Mentor executes. There's no need to implement a verification process for this. - Mentors: Graduates who are selected by the DAO become Mentors. They can both vote on and create proposals. An existing Mentor can assign the Mentor role to any Graduate member by creating a proposal. This proposal has to be approved by the DAO.
- Proposal Creation
- Only Mentors are authorized to create proposals.
- To create a proposal, a Mentor must burn 1 MBT, which decreases their token balance.
- Voting System:
-
Only Graduates and Mentors are allowed to vote.
-
The voting power of a member is determined as follows:
- If the member is a Student - the voting power is set to 0 (Student doesn't have voting power).
- If the member is a Graduate - his voting power is directly equal to the number of MBC token they hold at the moment of voting.
- If the member is a Mentor - his voting power is equal to 5x the number of MBC token they hold at the moment of voting.
-
The
yesOrNo
field of theVote
object is aBool
representing whether a vote is meant to approve or refuse a proposal.true
represents a vote in favor of a proposal andfalse
represents a vote against a proposal. -
When a member votes on a proposal, his voting power is added or substracted to the
voteScore
variable of theProposal
object. -
A proposal is automatically accepted if the
voteScore
reaches 100 or more. A proposal is automatically rejected if thevoteScore
reaches 100 or less. A stays open as long as it's not approved or rejected. -
Approved proposals are automatically executed.
For instance if a mentor with a token balance of 15 MBC votes on a proposal with a
true
vote - 75 will be added to thevoteScore
. Assuming thevoteScore
was originally at 30, thevoteScore
is now at 105 and the proposal is accepted and executed.
- Proposal Types
They are 3 types of proposal:
ChangeManifesto
: those proposals contain aText
that if approved will be the new manifesto of the DAO. If the proposal is approved the changes should be reflected on the DAO canister and on the Webpage canister.AddGoal
: those proposals contain aText
that if approved will be added to the goals of the DAO. If the proposal is approved the changes should be reflected on the DAO canister and on the Webpage canister.AddMentor
: those proposals contain aPrincipal
that if approved will be come a mentor of the DAO. Whenever such a proposal is created, we need to verify that the specified principal is a Graduate of the DAO, as only Graduate can become Mentors. If the proposal is approved the changes should be reflected on the DAO canister.
- Initial Setup: The initial setup of the DAO should include an initial mentor to ensure that theo DAO is operational:
- Mentor:
- Name: Motoko Bootcamp
- Associated Principal:
gth2f-eyaaa-aaaaj-qa2pq-cai
(Canister ID of the dashboard).
You can decide to hardcode the initial setup or create an external that will be executed canister upon deployment.
- Token Faucet
You are required to use the Motoko Bootcamp Token, a free, educational token faucet. It allows unlimited minting but holds no real economic value; it's solely for educational use.
Find the token faucet source code in the token_faucet folder of this repository. Deploy it locally for building and testing. For your live project on the Internet Computer, your are required to use the existing token faucet on the Internet Computer with the canister ID jaamb-mqaaa-aaaaj-qa3ka-cai
.
Access the interface of the deployed token faucet canister here.
You'll need to use the Faucet canister to:
- Mint tokens when a new member joins your DAO.
- Burn tokens when a new proposal is created.
- Stable Structure
Your project will make use of stable data-structures. The aim is to ensure that your DAO can be upgraded in the future without losing any data.
All the necessary types are defined in the types.mo file.
The interface of your DAO canister should strictly respect the following:
actor {
getIdWebpage : shared query () -> async Principal;
getName : shared query () -> async Text;
getManifesto : shared query () -> async Text;
registerMember : shared (name : Text) -> async Result<(),Text>;
getMember : shared query (p : Principal) -> async Result<Member,Text>;
getStats : shared query () -> async Stats;
graduate : shared (student : Principal) -> async Result<(),Text>;
createProposal : shared (content : ProposalContent) -> async Result<ProposalId,Text>;
getProposal : shared query (id : ProposalId) -> async Result<Proposal,Text>;
getAllProposals : shared query () -> async [Proposal];
voteProposal : shared (proposalId : ProposalId, vote : Vote) -> async Result<(),Text>;
}
The interface of your Webpage canister should strictly respect the following:
actor {
getManifesto : shared query () -> async Text;
setManifesto : shared (manifesto : Text) -> async Result<(), Text>;
getGoals : shared query () -> async [Text];
addGoal : shared (goal : Text) -> async Result<(), Text>;
http_request : shared query (request : HttpRequest) -> async HttpResponse;
}
Head over to the Motoko Bootcamp Dashboard, section Submit, Graduation and input your canister ID. You should submit the canister ID of your DAO canister.
Upon submitting your project, to determine if you have gratuated or not, a few tests will be automatically performed on your DAO canister. Those tests will take between 20 and 30 seconds.
- Do not interact with the DAO canister during the testing phase.
- Strictly respect the interface and types that are defined and provided in this repository. Any modification will result in a failed test.
- If your test fails without prompting an error message or loads for more than 1 minute, open your browser inspector, click on at the developer console, take a screenshot and report the issue on our [feedback channel].
Your Motoko Bootcamp diploma will grant you the following lifetime benefits:
- Access to a dedicated Motoko Bootcamp Graduate Channel on OpenChat.
- Access to a dedicated Motoko Bootcamp Portal on DSCVR.
- Access to the Motoko Bootcamp Manifesto.
- Possible participation in future Bootcamps.
- Additional benefits to be announced.
The Motoko Bootcamp Diploma and the associated on-chain infrastructure are still under development. We will keep you updated on the progress.
An initiative powered and 100% supported by Code & State - the leading Web3 venture studio for the Internet Computer.