forked from apoorv9496/LENDEN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lenden.sol
57 lines (44 loc) · 1.24 KB
/
lenden.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
49
50
51
52
53
54
55
56
57
pragma solidity ^0.4.0;
contract lenden {
// owner address
address _owner;
// accounting total users + acting as unique ID
uint _userCounter = 0;
// verify owner
modifier owner {
require(msg.sender == _owner);
_;
}
struct user{
uint id;
string name;
bool active;
uint rating;
uint lends;
uint borrows;
}
struct request {
address reqAddress;
uint interestRate;
uint period;
bool active;
}
// mapping address to a person info
mapping (address => user) public _userList;
request[] _borrowRequestList;
request[] _lendRequestList;
constructor() public {
_owner = msg.sender;
}
// owner calls to create an account only after KYC success of a to be user
function createAccount(string name, address userAddress) public owner {
_userCounter++;
_userList[userAddress].name = name;
_userList[userAddress].active = true;
_userList[userAddress].rating = 0;
_userList[userAddress].lends = 0;
_userList[userAddress].borrows = 0;
}
function createBorrowRequest() public {
}
}