15 | | - | func withdrawVestedAllUSDN () = { |
---|
16 | | - | let r = invoke(vesting, "withdrawVestedAllUSDN", [false, true], nil) |
---|
17 | | - | if ((r == r)) |
---|
18 | | - | then [ScriptTransfer(destReceiver, assetBalance(this, USDN), USDN)] |
---|
19 | | - | else throw("Strict value is not equal to itself.") |
---|
20 | | - | } |
---|
21 | | - | |
---|
22 | | - | |
---|
23 | | - | |
---|
24 | | - | @Callable(i) |
---|
25 | | - | func claimRewards () = { |
---|
26 | | - | let r = invoke(rewards, "claimRewards", nil, nil) |
---|
27 | | - | if ((r == r)) |
---|
28 | | - | then [ScriptTransfer(destReceiver, assetBalance(this, USDN), USDN)] |
---|
29 | | - | else throw("Strict value is not equal to itself.") |
---|
30 | | - | } |
---|
31 | | - | |
---|
32 | | - | |
---|
33 | | - | |
---|
34 | | - | @Callable(i) |
---|
35 | | - | func withdrawAndClaim () = { |
---|
36 | | - | let r1 = invoke(vesting, "withdrawVestedAllUSDN", [false, true], nil) |
---|
37 | | - | if ((r1 == r1)) |
---|
38 | | - | then { |
---|
39 | | - | let r2 = invoke(rewards, "claimRewards", nil, nil) |
---|
40 | | - | if ((r2 == r2)) |
---|
41 | | - | then [ScriptTransfer(destReceiver, assetBalance(this, USDN), USDN)] |
---|
42 | | - | else throw("Strict value is not equal to itself.") |
---|
43 | | - | } |
---|
44 | | - | else throw("Strict value is not equal to itself.") |
---|
45 | | - | } |
---|
46 | | - | |
---|
47 | | - | |
---|
48 | | - | |
---|
49 | | - | @Callable(i) |
---|
50 | | - | func usdn_100 () = { |
---|
51 | | - | let admin = "3PADTq2CPEoeZ6jAMX1WsTBdwbWaxFy9zdX" |
---|
52 | | - | if ((toString(i.caller) != admin)) |
---|
53 | | - | then throw("only admin can do") |
---|
54 | | - | else { |
---|
55 | | - | let usdnAmountOnStart = assetBalance(this, USDN) |
---|
56 | | - | if ((usdnAmountOnStart == usdnAmountOnStart)) |
---|
57 | | - | then { |
---|
58 | | - | let inv = invoke(addressFromStringValue("3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk"), "withdrawVestedAllUSDN", [false, true], nil) |
---|
59 | | - | if ((inv == inv)) |
---|
60 | | - | then { |
---|
61 | | - | let usdnAmountAfterWithdraw = assetBalance(this, USDN) |
---|
62 | | - | if ((usdnAmountAfterWithdraw == usdnAmountAfterWithdraw)) |
---|
63 | | - | then [ScriptTransfer(zeftAddress, usdnAmountAfterWithdraw, USDN)] |
---|
64 | | - | else throw("Strict value is not equal to itself.") |
---|
65 | | - | } |
---|
66 | | - | else throw("Strict value is not equal to itself.") |
---|
67 | | - | } |
---|
68 | | - | else throw("Strict value is not equal to itself.") |
---|
69 | | - | } |
---|
70 | | - | } |
---|
71 | | - | |
---|
72 | | - | |
---|
73 | | - | |
---|
74 | | - | @Callable(i) |
---|
75 | | - | func claim () = { |
---|
76 | | - | let admin = "3PADTq2CPEoeZ6jAMX1WsTBdwbWaxFy9zdX" |
---|
77 | | - | if ((toString(i.caller) != admin)) |
---|
78 | | - | then throw("only admin can do") |
---|
79 | | - | else { |
---|
80 | | - | let usdnAmountOnStart = assetBalance(this, USDN) |
---|
81 | | - | if ((usdnAmountOnStart == usdnAmountOnStart)) |
---|
82 | | - | then { |
---|
83 | | - | let inv = invoke(addressFromStringValue("3PKZk5TdPCLP2GZviipLFfK46ExTnwkRCBd"), "claimRewards", nil, nil) |
---|
84 | | - | if ((inv == inv)) |
---|
85 | | - | then { |
---|
86 | | - | let usdnAmountAfterWithdraw = assetBalance(this, USDN) |
---|
87 | | - | if ((usdnAmountAfterWithdraw == usdnAmountAfterWithdraw)) |
---|
88 | | - | then [ScriptTransfer(zeftAddress, usdnAmountAfterWithdraw, USDN)] |
---|
89 | | - | else throw("Strict value is not equal to itself.") |
---|
90 | | - | } |
---|
91 | | - | else throw("Strict value is not equal to itself.") |
---|
92 | | - | } |
---|
93 | | - | else throw("Strict value is not equal to itself.") |
---|
94 | | - | } |
---|
95 | | - | } |
---|
| 7 | + | func c () = if ((i.caller != this)) |
---|
| 8 | + | then throw("Access Denied") |
---|
| 9 | + | else { |
---|
| 10 | + | let call = invoke(viresVesting, "withdrawVestedAllUSDN", [false, true], nil) |
---|
| 11 | + | if ((call == call)) |
---|
| 12 | + | then nil |
---|
| 13 | + | else throw("Strict value is not equal to itself.") |
---|
| 14 | + | } |
---|