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:BgI0CAISAwoBARIDCgEEEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESACUADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUFkbWluTGlzdAkAuQkCCQDMCAICAiVzCQDMCAICCWFkbWluTGlzdAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJAgkAzAgCAg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BaQELY2FuY2VsTGVhc2UCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQERZ2V0VW5zdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQVjbGFpbQEGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQEIY2xhaW1BbGwABAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDEzMzg3MTM0NDcJARVnZXRVc2VyVG9DbGFpbUJhbGFuY2UBBQt1c2VyQWRkcmVzcwQHdG9DbGFpbQgFDSR0MDEzMzg3MTM0NDcCXzEECHRvVW5sb2NrCAUNJHQwMTMzODcxMzQ0NwJfMgQGY2hlY2tzCQDMCAIDCQBmAgUHdG9DbGFpbQAABgkBCHRocm93RXJyAQIQbm90aGluZyB0byBjbGFpbQUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzCQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDaXceS", "height": 2974562, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK Next: EHjWDZsTpFpnHRJcNvoFYUXwufcHiSSgN5ZQY6LN25up Diff:
OldNewDifferences
1111 let keyAssetId = makeString(["%s", "assetId"], SEP)
1212
1313 let keyAdminList = makeString(["%s", "adminList"], SEP)
14+
15+let keyForceStop = makeString(["%s", "forceStop"], SEP)
1416
1517 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1618
5658 else fromBase58String(assetIdString)
5759
5860 let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
61+
62+let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false)
5963
6064 func isAdmin (address) = containsElement(adminListRaw, address)
6165
149153 then true
150154 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
151155 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")]
153159 if ((checks == checks))
154160 then {
155161 let userLeasingAmount = i.payments[0].amount
156- let $t059886061 = getLeasingNodeData(nodeAddress)
157- let nodeCurrentLeased = $t059886061._1
158- let nodeNextLeased = $t059886061._2
162+ let $t061786251 = getLeasingNodeData(nodeAddress)
163+ let nodeCurrentLeased = $t061786251._1
164+ let nodeNextLeased = $t061786251._2
159165 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
160- let $t061296215 = getUserLeasingData(nodeAddress, userAddress)
161- let userCurrentLeased = $t061296215._1
162- let userNextLeased = $t061296215._2
166+ let $t063196405 = getUserLeasingData(nodeAddress, userAddress)
167+ let userCurrentLeased = $t063196405._1
168+ let userNextLeased = $t063196405._2
163169 let newUserNextLeased = (userNextLeased + userLeasingAmount)
164170 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
165171 }
168174
169175
170176 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
171- let $t067276800 = getLeasingNodeData(nodeAddress)
172- let nodeCurrentLeased = $t067276800._1
173- let nodeNextLeased = $t067276800._2
174- let $t068056891 = getUserLeasingData(nodeAddress, userAddress)
175- let userCurrentLeased = $t068056891._1
176- let userNextLeased = $t068056891._2
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
177183 let checks = [if ((unstakeAmount > 0))
178184 then true
179185 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
184190 then true
185191 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
186192 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")]
188196 if ((checks == checks))
189197 then {
190198 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
191199 let newUserNextLeased = (userNextLeased - unstakeAmount)
192- let $t075847689 = getUserToClaimBalance(userAddress)
193- let toClaim = $t075847689._1
194- let toUnlock = $t075847689._2
200+ let $t078427947 = getUserToClaimBalance(userAddress)
201+ let toClaim = $t078427947._1
202+ let toUnlock = $t078427947._2
195203 let newToUnlock = (toUnlock + unstakeAmount)
196204 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
197205 }
200208
201209
202210 func getClaimUnlockedActions (userAddress,claimAmount) = {
203- let $t082328292 = getUserToClaimBalance(userAddress)
204- let toClaim = $t082328292._1
205- let toUnlock = $t082328292._2
211+ let $t084908550 = getUserToClaimBalance(userAddress)
212+ let toClaim = $t084908550._1
213+ let toUnlock = $t084908550._2
206214 let checks = [if ((claimAmount > 0))
207215 then true
208216 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
209217 then true
210218 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
211219 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")]
213223 if ((checks == checks))
214224 then {
215225 let newToClaim = (toClaim - claimAmount)
220230
221231
222232 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
223- let $t089328992 = getUserToClaimBalance(userAddress)
224- let toClaim = $t089328992._1
225- let toUnlock = $t089328992._2
233+ let $t092589318 = getUserToClaimBalance(userAddress)
234+ let toClaim = $t092589318._1
235+ let toUnlock = $t092589318._2
226236 let available = (toUnlock + toClaim)
227237 let checks = [if ((userLeasingAmount > 0))
228238 then true
232242 then true
233243 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
234244 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")]
236248 if ((checks == checks))
237249 then {
238- let $t094699542 = getLeasingNodeData(nodeAddress)
239- let nodeCurrentLeased = $t094699542._1
240- let nodeNextLeased = $t094699542._2
250+ let $t098639936 = getLeasingNodeData(nodeAddress)
251+ let nodeCurrentLeased = $t098639936._1
252+ let nodeNextLeased = $t098639936._2
241253 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
242- let $t096109696 = getUserLeasingData(nodeAddress, userAddress)
243- let userCurrentLeased = $t096109696._1
244- let userNextLeased = $t096109696._2
254+ let $t01000410090 = getUserLeasingData(nodeAddress, userAddress)
255+ let userCurrentLeased = $t01000410090._1
256+ let userNextLeased = $t01000410090._2
245257 let newUserNextLeased = (userNextLeased + userLeasingAmount)
246258 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
247259 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
267279 func setNewPeriodLength (newPeriodLength) = {
268280 let checks = [if (isAdmin(toString(i.caller)))
269281 then true
270- else throwErr("i.caller is not in adminList")]
282+ else throwErr("caller is not in adminList")]
271283 if ((checks == checks))
272284 then getSetNewPeriodLengthActions(newPeriodLength)
273285 else throw("Strict value is not equal to itself.")
276288
277289
278290 @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)
279303 func getNodeDataREADONLY (nodeAddress) = {
280- let $t01138011444 = getLeasingNodeData(nodeAddress)
281- let currentLease = $t01138011444._1
282- let nextLeased = $t01138011444._2
304+ let $t01198612050 = getLeasingNodeData(nodeAddress)
305+ let currentLease = $t01198612050._1
306+ let nextLeased = $t01198612050._2
283307 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
284308 }
285309
287311
288312 @Callable(i)
289313 func getUserDataREADONLY (userAddress) = {
290- let $t01179311853 = getUserToClaimBalance(userAddress)
291- let toClaim = $t01179311853._1
292- let toUnlock = $t01179311853._2
314+ let $t01239912459 = getUserToClaimBalance(userAddress)
315+ let toClaim = $t01239912459._1
316+ let toUnlock = $t01239912459._2
293317 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
294318 }
295319
335359 @Callable(i)
336360 func claimAll () = {
337361 let userAddress = toString(i.caller)
338- let $t01278112841 = getUserToClaimBalance(userAddress)
339- let toClaim = $t01278112841._1
340- let toUnlock = $t01278112841._2
362+ let $t01338713447 = getUserToClaimBalance(userAddress)
363+ let toClaim = $t01338713447._1
364+ let toUnlock = $t01338713447._2
341365 let checks = [if ((toClaim > 0))
342366 then true
343367 else throwErr("nothing to claim")]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "l2mp_leasing.ride"
55
66 let SEP = "__"
77
88 func throwErr (msg) = throw(((contractFile + ": ") + msg))
99
1010
1111 let keyAssetId = makeString(["%s", "assetId"], SEP)
1212
1313 let keyAdminList = makeString(["%s", "adminList"], SEP)
14+
15+let keyForceStop = makeString(["%s", "forceStop"], SEP)
1416
1517 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1618
1719 let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP)
1820
1921 let keyPeriodLength = makeString(["%s", "periodLength"], SEP)
2022
2123 let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0)
2224
2325 let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000)
2426
2527 let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1)
2628
2729 let currentPeriodId = if (if ((height > periodOffsetHeight))
2830 then (periodOffsetHeight != -1)
2931 else false)
3032 then (((height - periodOffsetHeight) / periodLength) + periodOffsetId)
3133 else max([0, (periodOffsetId - 1)])
3234
3335 let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength))
3436
3537 let nextPeriodHeight = (currentPeriodHeight + periodLength)
3638
3739 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
3840
3941
4042 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
4143
4244
4345 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
4446
4547
4648 func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
4749
4850
4951 func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
5052
5153
5254 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
5355
5456 let assetIdBytes = if ((assetIdString == "WAVES"))
5557 then unit
5658 else fromBase58String(assetIdString)
5759
5860 let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
61+
62+let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false)
5963
6064 func isAdmin (address) = containsElement(adminListRaw, address)
6165
6266
6367 func isValidAddress (address) = match addressFromString(address) {
6468 case a: Address =>
6569 true
6670 case _ =>
6771 false
6872 }
6973
7074
7175 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
7276 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
7377 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
7478 }
7579
7680
7781 func getLeasingNodeData (nodeAddress) = {
7882 let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
7983 match leasingNodeDataStringRaw {
8084 case ds: String =>
8185 let dataList = split(ds, SEP)
8286 let nodeCurrentPeriod = parseIntValue(dataList[1])
8387 let nodeCurrentLeased = parseIntValue(dataList[2])
8488 let nodeNextPeriod = parseIntValue(dataList[3])
8589 let nodeNextLeased = parseIntValue(dataList[4])
8690 if ((nodeNextPeriod > height))
8791 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
8892 else $Tuple2(nodeNextLeased, nodeNextLeased)
8993 case _ =>
9094 $Tuple2(0, 0)
9195 }
9296 }
9397
9498
9599 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
96100 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
97101 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
98102 }
99103
100104
101105 func getUserLeasingData (nodeAddress,userAddress) = {
102106 let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
103107 match leasingUserDataStringRaw {
104108 case ds: String =>
105109 let dataList = split(ds, SEP)
106110 let userCurrentPeriod = parseIntValue(dataList[1])
107111 let userCurrentLeased = parseIntValue(dataList[2])
108112 let userNextPeriod = parseIntValue(dataList[3])
109113 let userNextLeased = parseIntValue(dataList[4])
110114 if ((userNextPeriod > height))
111115 then $Tuple2(userCurrentLeased, userNextLeased)
112116 else $Tuple2(userNextLeased, userNextLeased)
113117 case _ =>
114118 $Tuple2(0, 0)
115119 }
116120 }
117121
118122
119123 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
120124 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
121125 StringEntry(keyUserToClaim(userAddress), valueString)
122126 }
123127
124128
125129 func getUserToClaimBalance (userAddress) = {
126130 let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress))
127131 match userToClaimDataStringRaw {
128132 case ds: String =>
129133 let dataList = split(ds, SEP)
130134 let currentPeriod = parseIntValue(dataList[1])
131135 let toClaim = parseIntValue(dataList[2])
132136 let nextPeriod = parseIntValue(dataList[3])
133137 let toUnlock = parseIntValue(dataList[4])
134138 if ((nextPeriod > height))
135139 then $Tuple2(toClaim, toUnlock)
136140 else $Tuple2((toClaim + toUnlock), 0)
137141 case _ =>
138142 $Tuple2(0, 0)
139143 }
140144 }
141145
142146
143147 func getStakeActions (nodeAddress,userAddress,i) = {
144148 let checks = [if ((size(i.payments) == 1))
145149 then true
146150 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
147151 then true
148152 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
149153 then true
150154 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
151155 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")]
153159 if ((checks == checks))
154160 then {
155161 let userLeasingAmount = i.payments[0].amount
156- let $t059886061 = getLeasingNodeData(nodeAddress)
157- let nodeCurrentLeased = $t059886061._1
158- let nodeNextLeased = $t059886061._2
162+ let $t061786251 = getLeasingNodeData(nodeAddress)
163+ let nodeCurrentLeased = $t061786251._1
164+ let nodeNextLeased = $t061786251._2
159165 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
160- let $t061296215 = getUserLeasingData(nodeAddress, userAddress)
161- let userCurrentLeased = $t061296215._1
162- let userNextLeased = $t061296215._2
166+ let $t063196405 = getUserLeasingData(nodeAddress, userAddress)
167+ let userCurrentLeased = $t063196405._1
168+ let userNextLeased = $t063196405._2
163169 let newUserNextLeased = (userNextLeased + userLeasingAmount)
164170 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
165171 }
166172 else throw("Strict value is not equal to itself.")
167173 }
168174
169175
170176 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
171- let $t067276800 = getLeasingNodeData(nodeAddress)
172- let nodeCurrentLeased = $t067276800._1
173- let nodeNextLeased = $t067276800._2
174- let $t068056891 = getUserLeasingData(nodeAddress, userAddress)
175- let userCurrentLeased = $t068056891._1
176- let userNextLeased = $t068056891._2
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
177183 let checks = [if ((unstakeAmount > 0))
178184 then true
179185 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
180186 then true
181187 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
182188 then true
183189 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
184190 then true
185191 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
186192 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")]
188196 if ((checks == checks))
189197 then {
190198 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
191199 let newUserNextLeased = (userNextLeased - unstakeAmount)
192- let $t075847689 = getUserToClaimBalance(userAddress)
193- let toClaim = $t075847689._1
194- let toUnlock = $t075847689._2
200+ let $t078427947 = getUserToClaimBalance(userAddress)
201+ let toClaim = $t078427947._1
202+ let toUnlock = $t078427947._2
195203 let newToUnlock = (toUnlock + unstakeAmount)
196204 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
197205 }
198206 else throw("Strict value is not equal to itself.")
199207 }
200208
201209
202210 func getClaimUnlockedActions (userAddress,claimAmount) = {
203- let $t082328292 = getUserToClaimBalance(userAddress)
204- let toClaim = $t082328292._1
205- let toUnlock = $t082328292._2
211+ let $t084908550 = getUserToClaimBalance(userAddress)
212+ let toClaim = $t084908550._1
213+ let toUnlock = $t084908550._2
206214 let checks = [if ((claimAmount > 0))
207215 then true
208216 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
209217 then true
210218 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
211219 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")]
213223 if ((checks == checks))
214224 then {
215225 let newToClaim = (toClaim - claimAmount)
216226 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
217227 }
218228 else throw("Strict value is not equal to itself.")
219229 }
220230
221231
222232 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
223- let $t089328992 = getUserToClaimBalance(userAddress)
224- let toClaim = $t089328992._1
225- let toUnlock = $t089328992._2
233+ let $t092589318 = getUserToClaimBalance(userAddress)
234+ let toClaim = $t092589318._1
235+ let toUnlock = $t092589318._2
226236 let available = (toUnlock + toClaim)
227237 let checks = [if ((userLeasingAmount > 0))
228238 then true
229239 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
230240 then true
231241 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
232242 then true
233243 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
234244 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")]
236248 if ((checks == checks))
237249 then {
238- let $t094699542 = getLeasingNodeData(nodeAddress)
239- let nodeCurrentLeased = $t094699542._1
240- let nodeNextLeased = $t094699542._2
250+ let $t098639936 = getLeasingNodeData(nodeAddress)
251+ let nodeCurrentLeased = $t098639936._1
252+ let nodeNextLeased = $t098639936._2
241253 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
242- let $t096109696 = getUserLeasingData(nodeAddress, userAddress)
243- let userCurrentLeased = $t096109696._1
244- let userNextLeased = $t096109696._2
254+ let $t01000410090 = getUserLeasingData(nodeAddress, userAddress)
255+ let userCurrentLeased = $t01000410090._1
256+ let userNextLeased = $t01000410090._2
245257 let newUserNextLeased = (userNextLeased + userLeasingAmount)
246258 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
247259 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
248260 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
249261 }
250262 else throw("Strict value is not equal to itself.")
251263 }
252264
253265
254266 func getSetNewPeriodLengthActions (newPeriodLength) = {
255267 let check = [if ((newPeriodLength > 0))
256268 then true
257269 else throwErr("period length should be greater than 0")]
258270 if ((check == check))
259271 then if ((periodOffsetHeight == -1))
260272 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
261273 else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
262274 else throw("Strict value is not equal to itself.")
263275 }
264276
265277
266278 @Callable(i)
267279 func setNewPeriodLength (newPeriodLength) = {
268280 let checks = [if (isAdmin(toString(i.caller)))
269281 then true
270- else throwErr("i.caller is not in adminList")]
282+ else throwErr("caller is not in adminList")]
271283 if ((checks == checks))
272284 then getSetNewPeriodLengthActions(newPeriodLength)
273285 else throw("Strict value is not equal to itself.")
274286 }
275287
276288
277289
278290 @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)
279303 func getNodeDataREADONLY (nodeAddress) = {
280- let $t01138011444 = getLeasingNodeData(nodeAddress)
281- let currentLease = $t01138011444._1
282- let nextLeased = $t01138011444._2
304+ let $t01198612050 = getLeasingNodeData(nodeAddress)
305+ let currentLease = $t01198612050._1
306+ let nextLeased = $t01198612050._2
283307 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
284308 }
285309
286310
287311
288312 @Callable(i)
289313 func getUserDataREADONLY (userAddress) = {
290- let $t01179311853 = getUserToClaimBalance(userAddress)
291- let toClaim = $t01179311853._1
292- let toUnlock = $t01179311853._2
314+ let $t01239912459 = getUserToClaimBalance(userAddress)
315+ let toClaim = $t01239912459._1
316+ let toUnlock = $t01239912459._2
293317 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
294318 }
295319
296320
297321
298322 @Callable(i)
299323 func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
300324
301325
302326
303327 @Callable(i)
304328 func lease (nodeAddress) = {
305329 let userAddress = toString(i.caller)
306330 getStakeActions(nodeAddress, userAddress, i)
307331 }
308332
309333
310334
311335 @Callable(i)
312336 func leaseFromUnlocked (nodeAddress,amount) = {
313337 let userAddress = toString(i.caller)
314338 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
315339 }
316340
317341
318342
319343 @Callable(i)
320344 func cancelLease (nodeAddress,amount) = {
321345 let userAddress = toString(i.caller)
322346 getUnstakeActions(nodeAddress, userAddress, amount)
323347 }
324348
325349
326350
327351 @Callable(i)
328352 func claim (amount) = {
329353 let userAddress = toString(i.caller)
330354 getClaimUnlockedActions(userAddress, amount)
331355 }
332356
333357
334358
335359 @Callable(i)
336360 func claimAll () = {
337361 let userAddress = toString(i.caller)
338- let $t01278112841 = getUserToClaimBalance(userAddress)
339- let toClaim = $t01278112841._1
340- let toUnlock = $t01278112841._2
362+ let $t01338713447 = getUserToClaimBalance(userAddress)
363+ let toClaim = $t01338713447._1
364+ let toUnlock = $t01338713447._2
341365 let checks = [if ((toClaim > 0))
342366 then true
343367 else throwErr("nothing to claim")]
344368 if ((checks == checks))
345369 then getClaimUnlockedActions(userAddress, toClaim)
346370 else throw("Strict value is not equal to itself.")
347371 }
348372
349373

github/deemru/w8io/026f985 
64.05 ms