-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create blockchain_identity_verification.sol
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
features/blockchain_identity_verification/blockchain_identity_verification.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// File name: blockchain_identity_verification.sol | ||
pragma solidity ^0.8.0; | ||
|
||
contract BlockchainIdentityVerification { | ||
address private owner; | ||
mapping (address => string) public identities; | ||
|
||
constructor() public { | ||
owner = msg.sender; | ||
} | ||
|
||
function verifyIdentity(address user, string identity) public { | ||
require(msg.sender == owner, "Only the owner can verify identities"); | ||
identities[user] = identity; | ||
} | ||
|
||
function getIdentity(address user) public view returns (string) { | ||
return identities[user]; | ||
} | ||
} |