Skip to content

Commit

Permalink
feat: add worldid verification
Browse files Browse the repository at this point in the history
  • Loading branch information
dawksh committed Aug 3, 2024
1 parent 033b495 commit 554ba4f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
36 changes: 35 additions & 1 deletion src/Nebula.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

contract Nebula {}
import {WorldIDVerifier} from "./WorldIDVerifier.sol";

contract Nebula {
/// @dev Universal Nebula world id verifier
WorldIDVerifier verifier;

struct WorldIDProof {
address signal;
uint256 root;
uint256 nullifierHash;
uint256[8] proof;
}

/// @param _verifier Universal verifier for worldid
constructor(address _verifier) {
verifier = WorldIDVerifier(_verifier);
}

/// @notice Verifies a given proof
/// @param proof WorldID Proof
/// @param identity WorldID Proof
function verifyIdentity(
WorldIDProof calldata proof,
bytes8 identity
) external {
verifier.verifyAndExecute(
proof.signal,
proof.root,
proof.nullifierHash,
proof.proof
);

// Resolve Identity, Verify and Issue
}
}
4 changes: 2 additions & 2 deletions src/WorldcoinVerifier.sol → src/WorldIDVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface IWorldID {
) external view;
}

contract WorldcoinVerifier {
contract WorldIDVerifier {
using ByteHasher for bytes;

/// @notice Thrown when attempting to reuse a nullifier
Expand Down Expand Up @@ -75,7 +75,7 @@ contract WorldcoinVerifier {

worldId.verifyProof(
root,
groupId, // set to "1" in the constructor
groupId,
abi.encodePacked(signal).hashToField(),
nullifierHash,
externalNullifierHash,
Expand Down

0 comments on commit 554ba4f

Please sign in to comment.