The Colab Student Registry is a Solidity-based smart contract designed to facilitate the registration of students. The process requires students to pay a fee before they can register. Once payment is confirmed, they can register, but the registration must be authorized by the contract owner before it is fully accepted.
- Payment System: Students must pay a fee before registering.
- Registration Authorization: The contract owner must authorize the registration of a student.
- Student Management: The contract provides functionalities to add, update, view, and delete student records.
- Fee Withdrawal: The contract owner can withdraw the collected fees.
- Contracts: Contains the
StudentRegistryV2.sol
contract, which implements the core functionality of the registry. - Tests: Contains TypeScript files used for testing the contract.
- Subgraph: Contains configuration files for the subgraph.
- Scripts: Includes deployment scripts and utility scripts.
- Configuration Files: Includes
package.json
,yarn.lock
,tsconfig.json
, and other configuration files necessary for setting up the project.
This project uses React with Vite for the frontend. The Vite setup provides a minimal configuration to get React working with Hot Module Replacement (HMR) and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
To get started with this project, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/colab-student-registry.git cd colab-student-registry
- Install dependencies: The project uses Yarn as the package manager. Install the dependencies by running:
yarn install
- Compile the contracts: Compile the Solidity contracts using Hardhat:
npx hardhat compile
- Run Tests: You can run the tests to ensure the contract functions as expected:
npx hardhat test
- Deploy the contract: Deploy the contract to your preferred network:
npx hardhat run scripts/deploy.ts --network <network-name>
Description: This smart contract provides a decentralized platform for student registration and management. It allows students to register, pay fees, and view their registration status. The contract owner can authorize registrations, update student information, and withdraw accumulated fees.
payFee()
: Students pay a fee before registering.registerStudent(address, string, uint256)
: Students register with their address, name, and age.authorizeRegistration(address)
: The contract owner authorizes a student's registration.getStudentInfo(address)
: Retrieves student information based on address.getStudentInfoById(uint256)
: Retrieves student information based on ID.updateStudentInfo(address, string, uint256)
: Updates student information.deleteStudent(address)
: Deletes a student's record.withdrawFees()
: The contract owner withdraws accumulated fees.
- Scaffold: For setting up the development environment
- Yarn: Package manager
- Hardhat: Development environment for smart contracts
- TypeScript: For writing tests and scripts
- React + Vite: For the frontend interface
The project includes TypeScript-based tests for the contract.
This project is licensed under the MIT License. See the LICENSE file for details.