Skip to content

Commit

Permalink
feat: add registry
Browse files Browse the repository at this point in the history
  • Loading branch information
dawksh committed Aug 3, 2024
1 parent 90d0787 commit 7c92d97
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/NebulaRegistry.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.24;

contract NebulaRegistry {
mapping(bytes8 => address) registeryMapping;

function register(address identity) external returns (bytes8) {
bytes8 identifier = bytes8(
keccak256(abi.encodePacked(identity, msg.sender))
);
registeryMapping[identifier] = identity;
return identifier;
}

function resolve(bytes8 identity) external view returns (address) {
return registeryMapping[identity];
}
}
3 changes: 2 additions & 1 deletion test/Nebula.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ contract NebulaTest is Test {
Nebula public nebula;

function setUp() public {
nebula = new Nebula();
// update with correct verifier contract address
nebula = new Nebula(0x5B38Da6a701c568545dCfcB03FcB875f56beddC4);
}

function testNebula() public {}
Expand Down

0 comments on commit 7c92d97

Please sign in to comment.