forked from ton-blockchain/liquid-staking-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgovernor_requests.func
More file actions
26 lines (22 loc) · 809 Bytes
/
governor_requests.func
File metadata and controls
26 lines (22 loc) · 809 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
;; common functions in all contracts
global slice governor;
global int governor_update_after;
global slice sudoer;
global int sudoer_set_at;
global int state;
global int halted?;
const int GOVERNOR_QUARANTINE = 86400;
() process_set_sudo_request(slice sender, slice in_msg) impure inline_ref {
assert_sender!(sender, governor);
sudoer_set_at = now();
sudoer = in_msg~load_msg_addr();
}
() process_prepare_governance_migration(slice sender, slice in_msg) impure inline_ref {
assert_sender!(sender, governor);
governor_update_after = in_msg~load_timestamp();
throw_unless(error::governor_update_too_soon, governor_update_after - now() > GOVERNOR_QUARANTINE );
}
() process_unhalt_request(slice sender) impure inline_ref {
assert_sender!(sender, governor);
halted? = false;
}