thirdweb

CourseContract

The Peace Antz Academy Course Contract is designed to manage educational courses on the Ethereum blockchain. The contract establishes roles such as the administrator (Peace Antz Academy Council Multisig), teachers, students, and sponsors, and offers functionalities like course and payment statuses, teacher-set payment amounts, student stake management, and sponsorship tracking. The contract also allows students to enroll, withdraw, or drop out of courses, while sponsors can provide or withdraw support. Utilizing OpenZeppelin's AccessControl for role-based permissions and Initializable for contract initialization, this contract offers a comprehensive, secure, and user-friendly system for managing educational courses in a decentralized context.

Course Contract

The Course Contract is a decentralized application (dApp) written in Solidity. It is designed to facilitate the setup and operation of an online course system, where teachers, students, and sponsors interact within a blockchain environment. The contract is compatible with any Ethereum Virtual Machine (EVM) compatible chain.

Features

  • Teacher Control: A teacher has control over the course status and payment. They can set the course status to either open or closed and also set the payment amount required for the course.
  • Student Interaction: Students can enroll in a course by staking a certain amount of currency. If a student passes the course, their stake is returned. If they drop out, their stake is sent to the Peace Antz Council multisig address for further dApp development.
  • Sponsorship: Sponsorship is possible for each course. Sponsors deposit funds into the contract, which can be withdrawn by the teacher once the course is completed and at least one student has passed.

How to use

As a Teacher

  1. Initialize the contract with your address and the Course Factory address.
  2. Set the payment amount for the course using setAmount().
  3. Start the course using updateCourseStatus(). The course will be locked in, and no more enrollments or sponsorship payments can be made.
  4. Pass students who complete the course using passStudent(). The student's stake will be returned to them.
  5. Boot students who fail or violate the course's rules using bootStudent(). The student's stake will be sent to the Peace Antz Council multisig address.
  6. Claim the sponsored payment using claimPayment().

As a Student

  1. Enroll in a course using enroll(). You must stake the required amount to be enrolled.
  2. If you wish to leave the course before it starts, use withdraw().
  3. If you wish to drop out after the course has started, use dropOut(). Your stake will be sent to the Peace Antz Council multisig address.

As a Sponsor

  1. Sponsor a course using sponsor().
  2. If you wish to withdraw your sponsorship before the course begins, use unsponsor().

Contract Structure

The contract includes multiple events and mappings to track the status of each address (teacher, student, sponsor) and their respective deposits. Roles are tracked using keccak256 hashed values of the role names.

The Peace Antz Council multisig address is set to 0xdD870fA1b7C4700F2BD7f44238821C26f7392148. This address receives funds from students who drop out of a course.

Dependencies

The contract uses OpenZeppelin's Access Control contract for access control functionalities and the Initializable contract for initializing the contract in an upgradeable context.

Disclaimer

This contract has not been audited. Use at your own risk.

Contact

If you have any questions, issues, or suggestions, feel free to reach out.

1.0.15 Release Notes


Fixed sponsorship issue. All bugz fixed! For now..


ADMIN

(ADMIN)

view

Published by

View all contracts

Details

  • Publish Date

    Feb 02, 2024

  • Licenses

    MIT, Apache-2.0

  • Learn more about Publish