-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcertificate_design1.sol
39 lines (33 loc) · 1.1 KB
/
certificate_design1.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
contract certificate {
address internal school;
Profile public profile;
struct Profile {
string name;
address account;
string courseName;
string schoolName;
string courseDate;
string certificateHash;
string hashSignature;
string createrId;
string auditorId;
}
modifier onlySchool {
require(msg.sender == school, "Permission denied. Please use school account.");
_;
}
function add(string memory name, address account, string memory courseName, string memory schoolName, string memory courseDate, string memory certificateHash, string memory hashSignature, string memory createrId, string memory auditorId) public {
school = msg.sender;
profile = Profile({
name: name,
account: account,
courseName: courseName,
schoolName: schoolName,
courseDate: courseDate,
certificateHash:certificateHash,
hashSignature: hashSignature,
createrId:createrId,
auditorId:auditorId
});
}
}