tx · FracjSDzeGMWzndkyggfFQAiABE3YrdrNMmXpr579s6f 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.01200000 Waves 2024.02.13 17:09 [2974562] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "FracjSDzeGMWzndkyggfFQAiABE3YrdrNMmXpr579s6f", "fee": 1200000, "feeAssetId": null, "timestamp": 1707833443983, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "2ttD4XQTRYWL6TAhQ4aPMxX95xfbYSUKLQp2KFd1WuU6pV65MJFkWvV9Twhvim4BaK5MLoeHuZHSKCMBNXrSy2eP" ], "script": "base64:BgI0CAISAwoBARIDCgEEEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESACUADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUFkbWluTGlzdAkAuQkCCQDMCAICAiVzCQDMCAICCWFkbWluTGlzdAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJAgkAzAgCAgI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aQELY2FuY2VsTGVhc2UCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQERZ2V0VW5zdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQVjbGFpbQEGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQEIY2xhaW1BbGwABAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDEzMzg3MTM0NDcJARVnZXRVc2VyVG9DbGFpbUJhbGFuY2UBBQt1c2VyQWRkcmVzcwQHdG9DbGFpbQgFDSR0MDEzMzg3MTM0NDcCXzEECHRvVW5sb2NrCAUNJHQwMTMzODcxMzQ0NwJfMgQGY2hlY2tzCQDMCAIDCQBmAgUHdG9DbGFpbQAABgkBCHRocm93RXJyAQIQbm90aGluZyB0byBjbGFpbQUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzCQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDaXceS", "height": 2974562, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK Next: EHjWDZsTpFpnHRJcNvoFYUXwufcHiSSgN5ZQY6LN25up Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
12 | 12 | ||
13 | 13 | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
14 | + | ||
15 | + | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
14 | 16 | ||
15 | 17 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
16 | 18 | ||
56 | 58 | else fromBase58String(assetIdString) | |
57 | 59 | ||
58 | 60 | let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP) | |
61 | + | ||
62 | + | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
59 | 63 | ||
60 | 64 | func isAdmin (address) = containsElement(adminListRaw, address) | |
61 | 65 | ||
149 | 153 | then true | |
150 | 154 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
151 | 155 | then true | |
152 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
156 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
157 | + | then true | |
158 | + | else throwErr("contract is temporary stopped")] | |
153 | 159 | if ((checks == checks)) | |
154 | 160 | then { | |
155 | 161 | let userLeasingAmount = i.payments[0].amount | |
156 | - | let $ | |
157 | - | let nodeCurrentLeased = $ | |
158 | - | let nodeNextLeased = $ | |
162 | + | let $t061786251 = getLeasingNodeData(nodeAddress) | |
163 | + | let nodeCurrentLeased = $t061786251._1 | |
164 | + | let nodeNextLeased = $t061786251._2 | |
159 | 165 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
160 | - | let $ | |
161 | - | let userCurrentLeased = $ | |
162 | - | let userNextLeased = $ | |
166 | + | let $t063196405 = getUserLeasingData(nodeAddress, userAddress) | |
167 | + | let userCurrentLeased = $t063196405._1 | |
168 | + | let userNextLeased = $t063196405._2 | |
163 | 169 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
164 | 170 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
165 | 171 | } | |
168 | 174 | ||
169 | 175 | ||
170 | 176 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
171 | - | let $ | |
172 | - | let nodeCurrentLeased = $ | |
173 | - | let nodeNextLeased = $ | |
174 | - | let $ | |
175 | - | let userCurrentLeased = $ | |
176 | - | let userNextLeased = $ | |
177 | + | let $t069176990 = getLeasingNodeData(nodeAddress) | |
178 | + | let nodeCurrentLeased = $t069176990._1 | |
179 | + | let nodeNextLeased = $t069176990._2 | |
180 | + | let $t069957081 = getUserLeasingData(nodeAddress, userAddress) | |
181 | + | let userCurrentLeased = $t069957081._1 | |
182 | + | let userNextLeased = $t069957081._2 | |
177 | 183 | let checks = [if ((unstakeAmount > 0)) | |
178 | 184 | then true | |
179 | 185 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
184 | 190 | then true | |
185 | 191 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
186 | 192 | then true | |
187 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
193 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
194 | + | then true | |
195 | + | else throwErr("contract is temporary stopped")] | |
188 | 196 | if ((checks == checks)) | |
189 | 197 | then { | |
190 | 198 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
191 | 199 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
192 | - | let $ | |
193 | - | let toClaim = $ | |
194 | - | let toUnlock = $ | |
200 | + | let $t078427947 = getUserToClaimBalance(userAddress) | |
201 | + | let toClaim = $t078427947._1 | |
202 | + | let toUnlock = $t078427947._2 | |
195 | 203 | let newToUnlock = (toUnlock + unstakeAmount) | |
196 | 204 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
197 | 205 | } | |
200 | 208 | ||
201 | 209 | ||
202 | 210 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
203 | - | let $ | |
204 | - | let toClaim = $ | |
205 | - | let toUnlock = $ | |
211 | + | let $t084908550 = getUserToClaimBalance(userAddress) | |
212 | + | let toClaim = $t084908550._1 | |
213 | + | let toUnlock = $t084908550._2 | |
206 | 214 | let checks = [if ((claimAmount > 0)) | |
207 | 215 | then true | |
208 | 216 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
209 | 217 | then true | |
210 | 218 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
211 | 219 | then true | |
212 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
220 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
221 | + | then true | |
222 | + | else throwErr("contract is temporary stopped")] | |
213 | 223 | if ((checks == checks)) | |
214 | 224 | then { | |
215 | 225 | let newToClaim = (toClaim - claimAmount) | |
220 | 230 | ||
221 | 231 | ||
222 | 232 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
223 | - | let $ | |
224 | - | let toClaim = $ | |
225 | - | let toUnlock = $ | |
233 | + | let $t092589318 = getUserToClaimBalance(userAddress) | |
234 | + | let toClaim = $t092589318._1 | |
235 | + | let toUnlock = $t092589318._2 | |
226 | 236 | let available = (toUnlock + toClaim) | |
227 | 237 | let checks = [if ((userLeasingAmount > 0)) | |
228 | 238 | then true | |
232 | 242 | then true | |
233 | 243 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
234 | 244 | then true | |
235 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
245 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
246 | + | then true | |
247 | + | else throwErr("contract is temporary stopped")] | |
236 | 248 | if ((checks == checks)) | |
237 | 249 | then { | |
238 | - | let $ | |
239 | - | let nodeCurrentLeased = $ | |
240 | - | let nodeNextLeased = $ | |
250 | + | let $t098639936 = getLeasingNodeData(nodeAddress) | |
251 | + | let nodeCurrentLeased = $t098639936._1 | |
252 | + | let nodeNextLeased = $t098639936._2 | |
241 | 253 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
242 | - | let $ | |
243 | - | let userCurrentLeased = $ | |
244 | - | let userNextLeased = $ | |
254 | + | let $t01000410090 = getUserLeasingData(nodeAddress, userAddress) | |
255 | + | let userCurrentLeased = $t01000410090._1 | |
256 | + | let userNextLeased = $t01000410090._2 | |
245 | 257 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
246 | 258 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
247 | 259 | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
267 | 279 | func setNewPeriodLength (newPeriodLength) = { | |
268 | 280 | let checks = [if (isAdmin(toString(i.caller))) | |
269 | 281 | then true | |
270 | - | else throwErr(" | |
282 | + | else throwErr("caller is not in adminList")] | |
271 | 283 | if ((checks == checks)) | |
272 | 284 | then getSetNewPeriodLengthActions(newPeriodLength) | |
273 | 285 | else throw("Strict value is not equal to itself.") | |
276 | 288 | ||
277 | 289 | ||
278 | 290 | @Callable(i) | |
291 | + | func setForceStopFlag (stop) = { | |
292 | + | let check = [if (isAdmin(toString(i.caller))) | |
293 | + | then true | |
294 | + | else throwErr("caller is not an admin")] | |
295 | + | if ((check == check)) | |
296 | + | then [BooleanEntry(keyForceStop, stop)] | |
297 | + | else throw("Strict value is not equal to itself.") | |
298 | + | } | |
299 | + | ||
300 | + | ||
301 | + | ||
302 | + | @Callable(i) | |
279 | 303 | func getNodeDataREADONLY (nodeAddress) = { | |
280 | - | let $ | |
281 | - | let currentLease = $ | |
282 | - | let nextLeased = $ | |
304 | + | let $t01198612050 = getLeasingNodeData(nodeAddress) | |
305 | + | let currentLease = $t01198612050._1 | |
306 | + | let nextLeased = $t01198612050._2 | |
283 | 307 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
284 | 308 | } | |
285 | 309 | ||
287 | 311 | ||
288 | 312 | @Callable(i) | |
289 | 313 | func getUserDataREADONLY (userAddress) = { | |
290 | - | let $ | |
291 | - | let toClaim = $ | |
292 | - | let toUnlock = $ | |
314 | + | let $t01239912459 = getUserToClaimBalance(userAddress) | |
315 | + | let toClaim = $t01239912459._1 | |
316 | + | let toUnlock = $t01239912459._2 | |
293 | 317 | $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height)) | |
294 | 318 | } | |
295 | 319 | ||
335 | 359 | @Callable(i) | |
336 | 360 | func claimAll () = { | |
337 | 361 | let userAddress = toString(i.caller) | |
338 | - | let $ | |
339 | - | let toClaim = $ | |
340 | - | let toUnlock = $ | |
362 | + | let $t01338713447 = getUserToClaimBalance(userAddress) | |
363 | + | let toClaim = $t01338713447._1 | |
364 | + | let toUnlock = $t01338713447._2 | |
341 | 365 | let checks = [if ((toClaim > 0)) | |
342 | 366 | then true | |
343 | 367 | else throwErr("nothing to claim")] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "l2mp_leasing.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
12 | 12 | ||
13 | 13 | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
14 | + | ||
15 | + | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
14 | 16 | ||
15 | 17 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
16 | 18 | ||
17 | 19 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
18 | 20 | ||
19 | 21 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
20 | 22 | ||
21 | 23 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
22 | 24 | ||
23 | 25 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
24 | 26 | ||
25 | 27 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
26 | 28 | ||
27 | 29 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
28 | 30 | then (periodOffsetHeight != -1) | |
29 | 31 | else false) | |
30 | 32 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
31 | 33 | else max([0, (periodOffsetId - 1)]) | |
32 | 34 | ||
33 | 35 | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
34 | 36 | ||
35 | 37 | let nextPeriodHeight = (currentPeriodHeight + periodLength) | |
36 | 38 | ||
37 | 39 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
38 | 40 | ||
39 | 41 | ||
40 | 42 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
41 | 43 | ||
42 | 44 | ||
43 | 45 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
44 | 46 | ||
45 | 47 | ||
46 | 48 | func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP) | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP) | |
50 | 52 | ||
51 | 53 | ||
52 | 54 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
53 | 55 | ||
54 | 56 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
55 | 57 | then unit | |
56 | 58 | else fromBase58String(assetIdString) | |
57 | 59 | ||
58 | 60 | let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP) | |
61 | + | ||
62 | + | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
59 | 63 | ||
60 | 64 | func isAdmin (address) = containsElement(adminListRaw, address) | |
61 | 65 | ||
62 | 66 | ||
63 | 67 | func isValidAddress (address) = match addressFromString(address) { | |
64 | 68 | case a: Address => | |
65 | 69 | true | |
66 | 70 | case _ => | |
67 | 71 | false | |
68 | 72 | } | |
69 | 73 | ||
70 | 74 | ||
71 | 75 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
72 | 76 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
73 | 77 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
74 | 78 | } | |
75 | 79 | ||
76 | 80 | ||
77 | 81 | func getLeasingNodeData (nodeAddress) = { | |
78 | 82 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
79 | 83 | match leasingNodeDataStringRaw { | |
80 | 84 | case ds: String => | |
81 | 85 | let dataList = split(ds, SEP) | |
82 | 86 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
83 | 87 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
84 | 88 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
85 | 89 | let nodeNextLeased = parseIntValue(dataList[4]) | |
86 | 90 | if ((nodeNextPeriod > height)) | |
87 | 91 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
88 | 92 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
89 | 93 | case _ => | |
90 | 94 | $Tuple2(0, 0) | |
91 | 95 | } | |
92 | 96 | } | |
93 | 97 | ||
94 | 98 | ||
95 | 99 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
96 | 100 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
97 | 101 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
98 | 102 | } | |
99 | 103 | ||
100 | 104 | ||
101 | 105 | func getUserLeasingData (nodeAddress,userAddress) = { | |
102 | 106 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
103 | 107 | match leasingUserDataStringRaw { | |
104 | 108 | case ds: String => | |
105 | 109 | let dataList = split(ds, SEP) | |
106 | 110 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
107 | 111 | let userCurrentLeased = parseIntValue(dataList[2]) | |
108 | 112 | let userNextPeriod = parseIntValue(dataList[3]) | |
109 | 113 | let userNextLeased = parseIntValue(dataList[4]) | |
110 | 114 | if ((userNextPeriod > height)) | |
111 | 115 | then $Tuple2(userCurrentLeased, userNextLeased) | |
112 | 116 | else $Tuple2(userNextLeased, userNextLeased) | |
113 | 117 | case _ => | |
114 | 118 | $Tuple2(0, 0) | |
115 | 119 | } | |
116 | 120 | } | |
117 | 121 | ||
118 | 122 | ||
119 | 123 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
120 | 124 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
121 | 125 | StringEntry(keyUserToClaim(userAddress), valueString) | |
122 | 126 | } | |
123 | 127 | ||
124 | 128 | ||
125 | 129 | func getUserToClaimBalance (userAddress) = { | |
126 | 130 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
127 | 131 | match userToClaimDataStringRaw { | |
128 | 132 | case ds: String => | |
129 | 133 | let dataList = split(ds, SEP) | |
130 | 134 | let currentPeriod = parseIntValue(dataList[1]) | |
131 | 135 | let toClaim = parseIntValue(dataList[2]) | |
132 | 136 | let nextPeriod = parseIntValue(dataList[3]) | |
133 | 137 | let toUnlock = parseIntValue(dataList[4]) | |
134 | 138 | if ((nextPeriod > height)) | |
135 | 139 | then $Tuple2(toClaim, toUnlock) | |
136 | 140 | else $Tuple2((toClaim + toUnlock), 0) | |
137 | 141 | case _ => | |
138 | 142 | $Tuple2(0, 0) | |
139 | 143 | } | |
140 | 144 | } | |
141 | 145 | ||
142 | 146 | ||
143 | 147 | func getStakeActions (nodeAddress,userAddress,i) = { | |
144 | 148 | let checks = [if ((size(i.payments) == 1)) | |
145 | 149 | then true | |
146 | 150 | else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes)) | |
147 | 151 | then true | |
148 | 152 | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress)) | |
149 | 153 | then true | |
150 | 154 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
151 | 155 | then true | |
152 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
156 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
157 | + | then true | |
158 | + | else throwErr("contract is temporary stopped")] | |
153 | 159 | if ((checks == checks)) | |
154 | 160 | then { | |
155 | 161 | let userLeasingAmount = i.payments[0].amount | |
156 | - | let $ | |
157 | - | let nodeCurrentLeased = $ | |
158 | - | let nodeNextLeased = $ | |
162 | + | let $t061786251 = getLeasingNodeData(nodeAddress) | |
163 | + | let nodeCurrentLeased = $t061786251._1 | |
164 | + | let nodeNextLeased = $t061786251._2 | |
159 | 165 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
160 | - | let $ | |
161 | - | let userCurrentLeased = $ | |
162 | - | let userNextLeased = $ | |
166 | + | let $t063196405 = getUserLeasingData(nodeAddress, userAddress) | |
167 | + | let userCurrentLeased = $t063196405._1 | |
168 | + | let userNextLeased = $t063196405._2 | |
163 | 169 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
164 | 170 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
165 | 171 | } | |
166 | 172 | else throw("Strict value is not equal to itself.") | |
167 | 173 | } | |
168 | 174 | ||
169 | 175 | ||
170 | 176 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
171 | - | let $ | |
172 | - | let nodeCurrentLeased = $ | |
173 | - | let nodeNextLeased = $ | |
174 | - | let $ | |
175 | - | let userCurrentLeased = $ | |
176 | - | let userNextLeased = $ | |
177 | + | let $t069176990 = getLeasingNodeData(nodeAddress) | |
178 | + | let nodeCurrentLeased = $t069176990._1 | |
179 | + | let nodeNextLeased = $t069176990._2 | |
180 | + | let $t069957081 = getUserLeasingData(nodeAddress, userAddress) | |
181 | + | let userCurrentLeased = $t069957081._1 | |
182 | + | let userNextLeased = $t069957081._2 | |
177 | 183 | let checks = [if ((unstakeAmount > 0)) | |
178 | 184 | then true | |
179 | 185 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
180 | 186 | then true | |
181 | 187 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
182 | 188 | then true | |
183 | 189 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
184 | 190 | then true | |
185 | 191 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
186 | 192 | then true | |
187 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
193 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
194 | + | then true | |
195 | + | else throwErr("contract is temporary stopped")] | |
188 | 196 | if ((checks == checks)) | |
189 | 197 | then { | |
190 | 198 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
191 | 199 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
192 | - | let $ | |
193 | - | let toClaim = $ | |
194 | - | let toUnlock = $ | |
200 | + | let $t078427947 = getUserToClaimBalance(userAddress) | |
201 | + | let toClaim = $t078427947._1 | |
202 | + | let toUnlock = $t078427947._2 | |
195 | 203 | let newToUnlock = (toUnlock + unstakeAmount) | |
196 | 204 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
197 | 205 | } | |
198 | 206 | else throw("Strict value is not equal to itself.") | |
199 | 207 | } | |
200 | 208 | ||
201 | 209 | ||
202 | 210 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
203 | - | let $ | |
204 | - | let toClaim = $ | |
205 | - | let toUnlock = $ | |
211 | + | let $t084908550 = getUserToClaimBalance(userAddress) | |
212 | + | let toClaim = $t084908550._1 | |
213 | + | let toUnlock = $t084908550._2 | |
206 | 214 | let checks = [if ((claimAmount > 0)) | |
207 | 215 | then true | |
208 | 216 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
209 | 217 | then true | |
210 | 218 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
211 | 219 | then true | |
212 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
220 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
221 | + | then true | |
222 | + | else throwErr("contract is temporary stopped")] | |
213 | 223 | if ((checks == checks)) | |
214 | 224 | then { | |
215 | 225 | let newToClaim = (toClaim - claimAmount) | |
216 | 226 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
217 | 227 | } | |
218 | 228 | else throw("Strict value is not equal to itself.") | |
219 | 229 | } | |
220 | 230 | ||
221 | 231 | ||
222 | 232 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
223 | - | let $ | |
224 | - | let toClaim = $ | |
225 | - | let toUnlock = $ | |
233 | + | let $t092589318 = getUserToClaimBalance(userAddress) | |
234 | + | let toClaim = $t092589318._1 | |
235 | + | let toUnlock = $t092589318._2 | |
226 | 236 | let available = (toUnlock + toClaim) | |
227 | 237 | let checks = [if ((userLeasingAmount > 0)) | |
228 | 238 | then true | |
229 | 239 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
230 | 240 | then true | |
231 | 241 | else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress)) | |
232 | 242 | then true | |
233 | 243 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
234 | 244 | then true | |
235 | - | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
245 | + | else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop)) | |
246 | + | then true | |
247 | + | else throwErr("contract is temporary stopped")] | |
236 | 248 | if ((checks == checks)) | |
237 | 249 | then { | |
238 | - | let $ | |
239 | - | let nodeCurrentLeased = $ | |
240 | - | let nodeNextLeased = $ | |
250 | + | let $t098639936 = getLeasingNodeData(nodeAddress) | |
251 | + | let nodeCurrentLeased = $t098639936._1 | |
252 | + | let nodeNextLeased = $t098639936._2 | |
241 | 253 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
242 | - | let $ | |
243 | - | let userCurrentLeased = $ | |
244 | - | let userNextLeased = $ | |
254 | + | let $t01000410090 = getUserLeasingData(nodeAddress, userAddress) | |
255 | + | let userCurrentLeased = $t01000410090._1 | |
256 | + | let userNextLeased = $t01000410090._2 | |
245 | 257 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
246 | 258 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
247 | 259 | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
248 | 260 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
249 | 261 | } | |
250 | 262 | else throw("Strict value is not equal to itself.") | |
251 | 263 | } | |
252 | 264 | ||
253 | 265 | ||
254 | 266 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
255 | 267 | let check = [if ((newPeriodLength > 0)) | |
256 | 268 | then true | |
257 | 269 | else throwErr("period length should be greater than 0")] | |
258 | 270 | if ((check == check)) | |
259 | 271 | then if ((periodOffsetHeight == -1)) | |
260 | 272 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
261 | 273 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
262 | 274 | else throw("Strict value is not equal to itself.") | |
263 | 275 | } | |
264 | 276 | ||
265 | 277 | ||
266 | 278 | @Callable(i) | |
267 | 279 | func setNewPeriodLength (newPeriodLength) = { | |
268 | 280 | let checks = [if (isAdmin(toString(i.caller))) | |
269 | 281 | then true | |
270 | - | else throwErr(" | |
282 | + | else throwErr("caller is not in adminList")] | |
271 | 283 | if ((checks == checks)) | |
272 | 284 | then getSetNewPeriodLengthActions(newPeriodLength) | |
273 | 285 | else throw("Strict value is not equal to itself.") | |
274 | 286 | } | |
275 | 287 | ||
276 | 288 | ||
277 | 289 | ||
278 | 290 | @Callable(i) | |
291 | + | func setForceStopFlag (stop) = { | |
292 | + | let check = [if (isAdmin(toString(i.caller))) | |
293 | + | then true | |
294 | + | else throwErr("caller is not an admin")] | |
295 | + | if ((check == check)) | |
296 | + | then [BooleanEntry(keyForceStop, stop)] | |
297 | + | else throw("Strict value is not equal to itself.") | |
298 | + | } | |
299 | + | ||
300 | + | ||
301 | + | ||
302 | + | @Callable(i) | |
279 | 303 | func getNodeDataREADONLY (nodeAddress) = { | |
280 | - | let $ | |
281 | - | let currentLease = $ | |
282 | - | let nextLeased = $ | |
304 | + | let $t01198612050 = getLeasingNodeData(nodeAddress) | |
305 | + | let currentLease = $t01198612050._1 | |
306 | + | let nextLeased = $t01198612050._2 | |
283 | 307 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
284 | 308 | } | |
285 | 309 | ||
286 | 310 | ||
287 | 311 | ||
288 | 312 | @Callable(i) | |
289 | 313 | func getUserDataREADONLY (userAddress) = { | |
290 | - | let $ | |
291 | - | let toClaim = $ | |
292 | - | let toUnlock = $ | |
314 | + | let $t01239912459 = getUserToClaimBalance(userAddress) | |
315 | + | let toClaim = $t01239912459._1 | |
316 | + | let toUnlock = $t01239912459._2 | |
293 | 317 | $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height)) | |
294 | 318 | } | |
295 | 319 | ||
296 | 320 | ||
297 | 321 | ||
298 | 322 | @Callable(i) | |
299 | 323 | func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i) | |
300 | 324 | ||
301 | 325 | ||
302 | 326 | ||
303 | 327 | @Callable(i) | |
304 | 328 | func lease (nodeAddress) = { | |
305 | 329 | let userAddress = toString(i.caller) | |
306 | 330 | getStakeActions(nodeAddress, userAddress, i) | |
307 | 331 | } | |
308 | 332 | ||
309 | 333 | ||
310 | 334 | ||
311 | 335 | @Callable(i) | |
312 | 336 | func leaseFromUnlocked (nodeAddress,amount) = { | |
313 | 337 | let userAddress = toString(i.caller) | |
314 | 338 | getStakeFromUnlockedActions(nodeAddress, userAddress, amount) | |
315 | 339 | } | |
316 | 340 | ||
317 | 341 | ||
318 | 342 | ||
319 | 343 | @Callable(i) | |
320 | 344 | func cancelLease (nodeAddress,amount) = { | |
321 | 345 | let userAddress = toString(i.caller) | |
322 | 346 | getUnstakeActions(nodeAddress, userAddress, amount) | |
323 | 347 | } | |
324 | 348 | ||
325 | 349 | ||
326 | 350 | ||
327 | 351 | @Callable(i) | |
328 | 352 | func claim (amount) = { | |
329 | 353 | let userAddress = toString(i.caller) | |
330 | 354 | getClaimUnlockedActions(userAddress, amount) | |
331 | 355 | } | |
332 | 356 | ||
333 | 357 | ||
334 | 358 | ||
335 | 359 | @Callable(i) | |
336 | 360 | func claimAll () = { | |
337 | 361 | let userAddress = toString(i.caller) | |
338 | - | let $ | |
339 | - | let toClaim = $ | |
340 | - | let toUnlock = $ | |
362 | + | let $t01338713447 = getUserToClaimBalance(userAddress) | |
363 | + | let toClaim = $t01338713447._1 | |
364 | + | let toUnlock = $t01338713447._2 | |
341 | 365 | let checks = [if ((toClaim > 0)) | |
342 | 366 | then true | |
343 | 367 | else throwErr("nothing to claim")] | |
344 | 368 | if ((checks == checks)) | |
345 | 369 | then getClaimUnlockedActions(userAddress, toClaim) | |
346 | 370 | else throw("Strict value is not equal to itself.") | |
347 | 371 | } | |
348 | 372 | ||
349 | 373 |
github/deemru/w8io/026f985 64.05 ms ◑