-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKYC_Private.sol
48 lines (36 loc) · 1.42 KB
/
KYC_Private.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
pragma solidity ^ 0.5.11;
contract KYC_Private {
struct KYCRequest{
address MemberAddr;
string IPFS_CID;
}
KYCRequest [] private kyc_reqs;
KYCRequest [] private kyc_infos;
// this function is responsible for delivering all the pending KYC Request
function getPendingKYCRequest(address _address)public returns( address, string memory){
for(uint i=0;i<kyc_reqs.length ;i++)
{
if(kyc_reqs[i].MemberAddr==_address){
return (kyc_reqs[i].MemberAddr,kyc_reqs[i].IPFS_CID );
}
}
}
// this function stores all new incoming KYC requests
function registerKYCRequest(address _address, string memory _ipfs)public returns(string memory){
KYCRequest memory kyc_req = KYCRequest(_address, _ipfs);
kyc_reqs.push(kyc_req);
return "KYC Request Added!!!";
}
//this function is responsible for storing the
function storeKYCInfo(address _address, string memory _ipfs)public returns(string memory){
KYCRequest memory kyc_info = KYCRequest(_address, _ipfs);
kyc_infos.push(kyc_info);
for(uint i=0;i<kyc_reqs.length ;i++)
{
if(kyc_reqs[i].MemberAddr==_address){
delete kyc_reqs[i];
}
}
return "KYC Member Registered";
}
}