-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDateTimeInput.sol
117 lines (99 loc) · 3.12 KB
/
DateTimeInput.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
pragma ton-solidity >= 0.35.0;
interface IDateTimeInput {
function getDate(
uint32 answerId,
string prompt,
int128 defaultDate,
int128 minDate,
int128 maxDate
) external returns (int128 date);
function getTime(
uint32 answerId,
string prompt,
uint32 defaultTime,
uint32 minTime,
uint32 maxTime,
uint8 minuteInterval
) external returns (uint32 time);
function getDateTime(
uint32 answerId,
string prompt,
int128 defaultDatetime,
int128 minDatetime,
int128 maxDatetime,
uint8 minuteInterval,
int16 inTimeZoneOffset
) external returns (int128 datetime, int16 timeZoneOffset);
function getTimeZoneOffset(uint32 answerId) external returns (int16 timeZoneOffset);
}
library DateTimeInput {
int8 constant DEBOT_WC = -31;
uint256 constant ID = 0x4e862a9df81183ab425bdf0fbd76bd0b558c7f44c24887b4354bf1c26c74a623;
function getDate(
uint32 answerId,
string prompt,
int128 defaultDate,
int128 minDate,
int128 maxDate
) public {
address addr = address.makeAddrStd(DEBOT_WC, ID);
IDateTimeInput(addr).getDate(answerId, prompt, defaultDate, minDate, maxDate);
}
function getTime(
uint32 answerId,
string prompt,
uint32 defaultTime,
uint32 minTime,
uint32 maxTime,
uint8 minuteInterval
) public {
address addr = address.makeAddrStd(DEBOT_WC, ID);
IDateTimeInput(addr).getTime(answerId, prompt, defaultTime, minTime, maxTime, minuteInterval);
}
function getDateTime(
uint32 answerId,
string prompt,
int128 defaultDatetime,
int128 minDatetime,
int128 maxDatetime,
uint8 minuteInterval,
int16 inTimeZoneOffset
) public {
address addr = address.makeAddrStd(DEBOT_WC, ID);
IDateTimeInput(addr).getDateTime(
answerId, prompt, defaultDatetime, minDatetime, maxDatetime, minuteInterval, inTimeZoneOffset
);
}
function getTimeZoneOffset(uint32 answerId) public {
address addr = address.makeAddrStd(DEBOT_WC, ID);
IDateTimeInput(addr).getTimeZoneOffset(answerId);
}
}
contract DateTimeInputABI is IDateTimeInput {
function getDate(
uint32 answerId,
string prompt,
int128 defaultDate,
int128 minDate,
int128 maxDate
) external override returns (int128 date) {}
function getTime(
uint32 answerId,
string prompt,
uint32 defaultTime,
uint32 minTime,
uint32 maxTime,
uint8 minuteInterval
) external override returns (uint32 time) {}
function getDateTime(
uint32 answerId,
string prompt,
int128 defaultDatetime,
int128 minDatetime,
int128 maxDatetime,
uint8 minuteInterval,
int16 inTimeZoneOffset
) external override returns (int128 datetime, int16 timeZoneOffset) {}
function getTimeZoneOffset(uint32 answerId)
external override returns (int16 timeZoneOffset) {}
}