Skip to content

Commit

Permalink
Merge branch 'main' into rename-enrolment-to-enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
daqhris authored Aug 11, 2024
2 parents 6be438d + 96400af commit 3bbdecf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions PR_MESSAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This pull request includes changes that address various improvements and updates to the codebase. Significant refactoring has been done to enhance functionality, improve error handling, and update dependencies. These changes are crucial for the ongoing development and maintenance of the application.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# MissionEnrolment2024: Onchain Attestation and Verification
# MissionEnrollment2024: Onchain Attestation and Verification

MissionEnrolment2024 is a decentralized application (dApp) that leverages blockchain technology to create immutable attestations for mission enrolment.
MissionEnrollment2024 is a decentralized application (dApp) that leverages blockchain technology to create immutable attestations for mission enrollment.
Built with Next.js, React, and the Ethereum Attestation Service (EAS), this project aims to provide a transparent and decentralized platform for verifying mission participation and achievements.

## SuperHack 2024

This dApp was developed during [SuperHack 2024](https://ethglobal.com/events/superhack2024), an online async hackathon organized by [ETHGlobal](https://ethglobal.com/).
The event took place from August 2nd to August 16th, 2024, bringing together developers, designers, and blockchain enthusiasts to collaborate on innovative projects.
MissionEnrolment2024 showcases the potential of blockchain technology in creating verifiable and transparent systems for mission-based activities on Ethereum.
MissionEnrollment2024 showcases the potential of blockchain technology in creating verifiable and transparent systems for mission-based activities on Ethereum.

## Features

- **Onchain Attestations**: Creates immutable records of mission enrolment using the Ethereum Attestation Service (EAS).
- **Onchain Attestations**: Creates immutable records of mission enrollment using the Ethereum Attestation Service (EAS).
- **ENS Integration**: Supports Ethereum Name Service for user-friendly addressing.
- **ETHGlobal POAPs Retrieval**: Verifies attendance at ETHGlobal events through Proof of Attendance Protocol tokens.
- **Interactive Single-Page Application**: Offers a streamlined user experience with stage-based components.
Expand Down Expand Up @@ -79,21 +79,21 @@ MissionEnrolment2024 showcases the potential of blockchain technology in creatin

## Usage

MissionEnrolment2024 provides a streamlined single-page application flow for mission enrolment, verification, and NFT migration:
MissionEnrollment2024 provides a streamlined single-page application flow for mission enrollment, verification, and NFT migration:

1. Connect your Ethereum wallet to the application using the "Connect Wallet" button.
2. Navigate through the mission enrolment stages:
2. Navigate through the mission enrollment stages:
a. Enter your ENS (Ethereum Name Service) name or Ethereum address for identity verification.
b. The application will automatically retrieve and verify your ETHGlobal POAPs to confirm event attendance.
c. Review the details of your mission participation, including verified events and achievements.
3. Create an onchain attestation for your mission enrolment:
3. Create an onchain attestation for your mission enrollment:
a. Click the "Create Attestation" button to initiate the process.
b. Sign the attestation transaction using your connected wallet.
c. Wait for the transaction to be confirmed on the Ethereum network.
4. Once confirmed, view your attestation details, which are now immutably recorded on the blockchain.
5. Explore the "Recent Attestations" section to see other verified mission enrolments and the growing community of participants.
5. Explore the "Recent Attestations" section to see other verified mission enrollments and the growing community of participants.

This streamlined process ensures a transparent and verifiable record of your mission enrolment, leveraging the security and immutability of blockchain technology. The single-page application design provides a seamless user experience throughout the entire enrolment and verification process.
This streamlined process ensures a transparent and verifiable record of your mission enrollment, leveraging the security and immutability of blockchain technology. The single-page application design provides a seamless user experience throughout the entire enrollment and verification process.

## Disclaimer

Expand Down
10 changes: 5 additions & 5 deletions contracts/AttestationService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract AttestationService is Ownable {
IEAS private immutable eas;
ISchemaRegistry private immutable schemaRegistry;

bytes32 public missionEnrolmentSchema;
bytes32 public missionEnrollmentSchema;

event SchemaCreated(bytes32 indexed schemaId);
event AttestationCreated(bytes32 indexed attestationId, address indexed recipient);
Expand All @@ -21,15 +21,15 @@ contract AttestationService is Ownable {
schemaRegistry = ISchemaRegistry(_schemaRegistry);
}

function createMissionEnrolmentSchema() external onlyOwner {
function createMissionEnrollmentSchema() external onlyOwner {
string memory schema = "address userAddress,uint256 tokenId,uint256 timestamp";
bytes32 schemaId = schemaRegistry.register(schema, ISchemaResolver(address(0)), true);
missionEnrolmentSchema = schemaId;
missionEnrollmentSchema = schemaId;
emit SchemaCreated(schemaId);
}

function createMissionEnrolmentAttestation(address recipient, uint256 tokenId) external returns (bytes32) {
require(missionEnrolmentSchema != bytes32(0), "Schema not created");
function createMissionEnrollmentAttestation(address recipient, uint256 tokenId) external returns (bytes32) {
require(missionEnrollmentSchema != bytes32(0), "Schema not created");

bytes memory data = abi.encode(recipient, tokenId, block.timestamp);

Expand Down
12 changes: 10 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useEffect, useState } from "react";
import { useLocalStorage } from "usehooks-ts";
import EventAttendanceProof from "../components/EventAttendanceProof";
import IdentityVerification from "../components/IdentityVerification";
import OnchainAttestation from "../components/OnchainAttestation";

Expand Down Expand Up @@ -29,13 +31,19 @@ const Home: React.FC = () => {
if (completedStages.length === 0 && currentStage !== "identity") {
setCurrentStage("identity");
}
}, [completedStages, currentStage]);
}, [completedStages, currentStage, setCurrentStage]);

const handleStageCompletion = (stage: Stage) => {
setCompletedStages((prev) => [...prev, stage]);
const newCompletedStages = [...completedStages, stage];
setCompletedStages(newCompletedStages);
localStorage.setItem('completedStages', JSON.stringify(newCompletedStages));

const currentIndex = stages.indexOf(stage);
if (currentIndex < stages.length - 1) {
setCurrentStage(stages[currentIndex + 1]);
const nextStage = stages[currentIndex + 1];
setCurrentStage(nextStage);
localStorage.setItem('currentStage', nextStage);
}
};

Expand Down

0 comments on commit 3bbdecf

Please sign in to comment.