SafeEduPlatform

SafeEduPlatform README

Project: SafeEdu – Blockchain Educational Social Platform
Author: SkyTiger@soratoraservices.com
Company: Soratora Services Ltd
Website: https://skytiger.tech
Network: Polygon Amoy Testnet (with Polygon Mainnet support)
License: MIT

1. Overview

SafeEdu is a blockchain-based educational social platform built for the Tech Fairness Hackathon (July 2025), combining tech, fitness, and meme-based challenges with transparent content moderation. Deployed on the Polygon Amoy testnet (with optional Polygon mainnet support), SafeEdu promotes tech fairness through:

The platform includes a meme engine for creating and voting on tech/fitness-themed memes, minted as NFTs. This runbook guides you through setting up SafeEdu from scratch, deploying contracts, and preparing for the Tech Fairness submission.

2. Prerequisites

2.1 System Requirements

2.2 Project Files

Contracts, scripts, tests, and documentation:

SafeEdu/
├── contracts/
│   ├── SafeEduToken.sol
│   ├── SafeEduPlatform.sol
│   ├── ContentModeration.sol
│   ├── MemeNFT.sol
├── scripts/
│   ├── FinalDeployWithDemoSchool.js
│   ├── setup_transfer_moderation.js
│   ├── confirmTransferCompleted.js
│   ├── setup_school_roles.js
│   ├── TestMemeNFTScenarios.js
│   ├── verify.js
│   ├── generate-abi.js
├── test/
│   ├── SafeEduPlatform.test.js
├── docs/
│   ├── architecture.md
│   ├── user-guide.md
│   ├── deployment-guide.md
├── README.md
├── package.json
├── hardhat.config.js
├── .gitignore

3. Initial Setup

3.1 Initialize Project

Create Project Directory:

mkdir SafeEdu
cd SafeEdu

Initialize npm:

npm init -y

Initialize Hardhat:

npx hardhat init

Delete default files:

del contracts\Greeter.sol
del scripts\deploy.js
del test\sample-test.js

Create .gitignore:

node_modules/
.env
artifacts/
cache/
coverage/
contractAddresses.json
safeedu-backup-*.json

3.2 Copy Project Files

Place all contract and script files into their respective directories.

3.3 Install Dependencies

npm install --save-dev hardhat@2.24.1 @nomicfoundation/hardhat-toolbox@5.0.0
npm install @openzeppelin/contracts@5.0.2 dotenv@16.4.5

3.4 Environment Configuration

Create a .env file:

DEPLOYER_KEY=<private key>
STUDENT_KEY=<private key>
TEACHER_KEY=<private key>
CREATOR_KEY=<private key>
VOTER_KEY=<private key>

POLYGONSCAN_API_KEY=<your key>
AMOY_RPC_URL=https://rpc-amoy.polygon.technology

Ensure Hardhat config references these keys.

4. Pre-Deployment Checklist

Verify Hardhat:

npx hardhat version

Compile Contracts:

npx hardhat compile

Test Network Connectivity:

npx hardhat console --network amoy
await ethers.provider.getNetwork()

Run Tests:

npx hardhat test

5. Deployment Process

Step 1: Deploy to Amoy Testnet

Deploy contracts:

npx hardhat run scripts/FinalDeployWithDemoSchool.js --network amoy

Deployment output includes contract addresses, ABI generation, and school registration.

1.2 Transfer Ownership of ContentModeration

npx hardhat run scripts/setup_transfer_moderation.js --network amoy

1.3 Confirm Transfer

npx hardhat run scripts/confirmTransferCompleted.js --network amoy

Step 2: Verify Contracts on Polygonscan

npx hardhat run scripts/verify.js --network amoy

Verification includes SafeEduToken, ContentModeration, SafeEduPlatform, and MemeNFT.

Step 3: Setup Demo Data

3.1 Setup School Roles

npx hardhat run scripts/setup_school_roles.js --network amoy

3.2 Transfer SEDU Tokens

const token = await ethers.getContractAt("SafeEduToken", "<address>");
await token.transfer(teacher, ethers.parseUnits("100", 18));

6. Testing

Run Meme/NFT Challenge Test:

npx hardhat run scripts/TestMemeNFTScenarios.js --network amoy

Outputs challenge creation, registration, moderation, voting, and NFT mint attempts.

7. Emergency Procedures

Pause Contracts:

const platform = await ethers.getContractAt("SafeEduPlatform", "<address>");
await platform.pause();

Data Migration: Redeploy and use backup-data.js.

8. Support & Resources

9. Notes

10. Monitoring & Maintenance (WIP)

Support & Contact

Author: SkyTiger@soratoraservices.com
Company: Soratora Services Ltd
Website: https://skytiger.tech
Repository: GitHub
License: MIT
Last Updated: 20/07/2025
Version: 1.0.0