-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthorization.sol
More file actions
44 lines (36 loc) · 889 Bytes
/
authorization.sol
File metadata and controls
44 lines (36 loc) · 889 Bytes
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
/// Smart contract for Authorization
pragma solidity ^0.4.25;
contract authorization {
uint private serial_imei;
uint timestamp;
address pub_key;
uint covid_status = 0;
event update_positive(
uint timestamp,
address pub_key,
uint covid_status
);
event update_negative(
uint timestamp,
address pub_key,
uint covid_status
);
function log_positive
(address _pub_key)
public{
pub_key = _pub_key;
covid_status = 1;
timestamp = now;
emit update_positive
(timestamp, pub_key, covid_status);
}
function
log_negative(address _pub_key)
public{
pub_key = _pub_key;
covid_status = 0;
timestamp = now;
emit update_negative
(timestamp, pub_key, covid_status);
}
}