/
ProxyNotify.sol
57 lines (44 loc) · 1.56 KB
/
ProxyNotify.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
/* */
pragma ton-solidity ^0.47.0;
import "Upgradable.sol";
interface SNotify {
function end1(uint128 counter) external functionID(0xc);
function end2(uint128 counter) external functionID(0xd);
function start1(uint128 counter) external functionID(0xe);
function start2(uint128 counter) external functionID(0xf);
function tryNotify1(uint128 counter) external functionID(0xfa);
}
contract ProxyNotify is Upgradable{
uint128 ver = 3;
address _Notify;
modifier alwaysAccept {
tvm.accept();
_;
}
constructor() public alwaysAccept {
}
function EndPeriod1(uint128 counter) view external functionID(0xc) {
SNotify(_Notify).end1{value: 0.1 ton}(counter + 1);
}
function EndPeriod2(uint128 counter) view external functionID(0xd){
SNotify(_Notify).end2{value: 0.1 ton}(counter + 1);
}
function StartPeriod1(uint128 counter) view external functionID(0xe) {
SNotify(_Notify).start1{value: 0.1 ton}(counter + 1);
}
function StartPeriod2(uint128 counter) view external functionID(0xf) {
SNotify(_Notify).start2{value: 0.1 ton}(counter + 1);
}
function tryN (uint128 counter) view external functionID(0xfa){
SNotify(_Notify).tryNotify1{value: 0.1 ton}(counter + 1);
}
function setNotify(address notify) public functionID(0xfb) alwaysAccept {
_Notify = notify;
}
/* fallback/receive */
receive() external {
}
function onCodeUpgrade() internal override {
tvm.resetStorage();
}
}