-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHelpMe.sol
46 lines (35 loc) · 970 Bytes
/
HelpMe.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
pragma experimental ABIEncoderV2;
contract HelpMe {
address owner;
uint reqId;
struct Request {
uint requestId;
address requesterAddr;
string latLong;
}
struct Help {
uint requestId;
address helperAddr;
}
Request[] public requests;
Help[] public helps;
function HelpMe() public {
owner = msg.sender;
reqId = 0;
}
function addRequest(address requester, string _latLong) public {
Request memory req = Request(reqId, requester, _latLong);
requests.push(req);
reqId++;
}
function addHelp(uint reqId, address helper) public {
Help memory hlp = Help(reqId, helper);
helps.push(hlp);
}
function getAllRequests() public constant returns (Request[]) {
return requests;
}
function kill() public {
if(msg.sender == owner) selfdestruct(owner);
}
}