Skip to content

Commit

Permalink
Merge branch 'main' into feat_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
MishraSomesh001 authored Apr 16, 2024
2 parents c4feee6 + 42881a0 commit 045b43d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contract/Database.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ contract Database{
mapping( string => bool ) public added;
mapping( address => bool ) public restrictedUser;
mapping( string => address ) public aadharToAddress;

address public admin;
bool alreadyset=false;

Expand All @@ -27,6 +28,7 @@ contract Database{
}



modifier personPresent{
require(keccak256(abi.encodePacked(list[msg.sender].aadharId)) != keccak256(abi.encodePacked("")), "User doesn't exist");
_;
Expand All @@ -37,6 +39,7 @@ contract Database{
_;
}


modifier onlyOnce()
{
require(!alreadyset,"Admin is already set");
Expand Down Expand Up @@ -69,6 +72,7 @@ contract Database{
return msg.sender;
}


function addPerson(string memory aadharId,string memory name, string memory DOB, string memory phoneNo, string memory rollNo, string memory batchNo) public Added (aadharId) isNotRestricted
{
require(bytes(list[msg.sender].aadharId).length == 0, "User already exists");
Expand All @@ -77,6 +81,7 @@ contract Database{
added[aadharId] = true;
aadharToAddress[aadharId] = msg.sender;
aadharToUser[aadharId] = person;
added[aadharId]=true;
count++;
}

Expand Down

0 comments on commit 045b43d

Please sign in to comment.