Skip to content

Commit

Permalink
Contract changes and redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Nov 26, 2021
1 parent 377486f commit 4fe5c89
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 33 deletions.
44 changes: 19 additions & 25 deletions ethereum/contracts/identity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,6 @@ contract Identity {
IssuerDetail[_Issuer].Request[IssuerDetail[_Issuer].ReqCount++] = NewRequest;
}

//Modify An Identity
function modifyId(string memory _Hash, address _Issuer,string memory _Sign ,
uint _IdNum , string memory _IssuerHash) registered(msg.sender) issue(_Issuer) public{
require(_IdNum < UserDetail[msg.sender].IdCount , "Id does not Exist");

identity memory NewId;
NewId.Name = IssuerDetail[_Issuer].IssueId;
NewId.Hash = _Hash;
NewId.Owner = msg.sender;
NewId.Issuer = _Issuer;
NewId.OwnerSignature = _Sign;
NewId.IssuerSignature = "Pending";
UserDetail[msg.sender].Ids[_IdNum] = NewId;

//create a verification request
verifyIdRequest memory NewRequest;
NewRequest.Owner = msg.sender;
NewRequest.Hash = _IssuerHash;
NewRequest.Status = 1;
IssuerDetail[_Issuer].Request[IssuerDetail[_Issuer].ReqCount++] = NewRequest;
}

//Delete An Identity
function deleteId(uint _IdNum) registered(msg.sender) public {
require(_IdNum < UserDetail[msg.sender].IdCount , "Id does not Exist");
Expand Down Expand Up @@ -213,7 +191,8 @@ contract Identity {
break;
}
}
require(flag == true, "User Identity Not Found");//use revert
if(flag == false)
revert("User Identity Not Found");

IssuerDetail[msg.sender].Request[_ReqNo].Status = 2;
}
Expand All @@ -236,16 +215,31 @@ contract Identity {
break;
}
}
require(flag == true, "User Identity Not Found");
}

function totalId() public view returns (uint){
return UserDetail[msg.sender].IdCount;
}

function getId(uint _IdNo, address account) public view returns (identity memory){
require(_IdNo < UserDetail[account].IdCount, "Id does not exist");
return UserDetail[account].Ids[_IdNo];
}

function getRequest(uint _RqNo) public issue(msg.sender) view returns (verifyIdRequest memory){
function totalIssuer() public view returns (uint){
return Issuer.length;
}

function totalRequest() public view returns (uint){
return IssuerDetail[msg.sender].ReqCount;
}

function getRequest(uint _RqNo) issue(msg.sender) public view returns (verifyIdRequest memory){
require(_RqNo < IssuerDetail[msg.sender].ReqCount, "Request does not exist");
return IssuerDetail[msg.sender].Request[_RqNo];
}

function issuerVerificationRequestCount() public view returns (uint){
return IssuerVerificationRequest.length;
}
}
16 changes: 8 additions & 8 deletions ethereum/details.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
> transaction hash: 0x7c7b3e3fd1d3383d48b3c60be9ed2e0fdecfd14e877b6599318d6f4222002ba8
> Blocks: 3 Seconds: 14
> contract address: 0x384D0D5eD8A094511b804dcde855f6AAe3416476
> block number: 11379394
> block timestamp: 1636281478
> transaction hash: 0x158e33e030162391d6e396f40ac6a678b223bda4932d6939da643f8525a28d8f
> Blocks: 2 Seconds: 25
> contract address: 0xc5a422571d21EeCe071Ac2f61dc6c9FcC61137A6
> block number: 11497990
> block timestamp: 1637907064
> account: 0x35B84d6848D16415177c64D64504663b998A6ab4
> balance: 4.435744650856135872
> gas used: 2476618 (0x25ca4a)
> balance: 2.164354919362498411
> gas used: 2295852 (0x23082c)
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.04953236 ETH
> total cost: 0.04591704 ETH

0 comments on commit 4fe5c89

Please sign in to comment.