-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCourse.sol
41 lines (32 loc) · 937 Bytes
/
Course.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
pragma solidity ^0.5.0;
contract CourseCreator {
address creator;
mapping(address => address) deployedAddress;
constructor() public {
creator = msg.sender;
}
function createCourse(uint256 deadline) public returns (address) {
Course ob = new Course(deadline);
deployedAddress[msg.sender] = address(ob);
return address(ob);
}
function fetchCourseAddress() public view returns (address) {
return deployedAddress[msg.sender];
}
function getCreator() public view returns (address) {
return creator;
}
}
contract Course {
uint256 deadline;
// mapping (address=>uint256) submissionTime;
mapping(address => string) public fileHash;
constructor(uint256 dl) public {
deadline = dl;
}
function submit(string memory file) public {
if (now < deadline) {
fileHash[msg.sender] = file;
}
}
}