tx · FDxNChEkCHScZTSYJ6rffX4kSUAhr4AzgniBsZxzhYGc

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01100000 Waves

2024.02.05 17:19 [2963070] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "FDxNChEkCHScZTSYJ6rffX4kSUAhr4AzgniBsZxzhYGc", "fee": 1100000, "feeAssetId": null, "timestamp": 1707142811929, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "41Vzfxpee9BxrFBCFFDxrS9gqjrZBjCCDukPrpcSitMCJUvxLyhZCrXUZg22ZepZPD4wVrJVnxUMKKRcxgEUtGiK" ], "script": "base64:BgIqCAISAwoBARIDCgEIEgQKAggIEgMKAQgSBAoCCAESBAoCCAESAwoBARIAIgAMY29udHJhY3RGaWxlAhFsMm1wX2xlYXNpbmcucmlkZQADU0VQAgJfXwAGc2NhbGU4AIDC1y8BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJAgkAzAgCAgIlcwkAzAgCAgxwZXJpb2RMZW5ndGgFA25pbAUDU0VQAA5wZXJpb2RPZmZzZXRJZAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBRFrZXlQZXJpb2RPZmZzZXRJZA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XJBZGRyZXNzBQZhbW91bnQBaQEIY2xhaW1BbGwABAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDEyMTI1MTIxOTcJAQ9nZXRVc2VyQmFsYW5jZXMBBQt1c2VyQWRkcmVzcwQIcGVyaW9kSWQIBQ0kdDAxMjEyNTEyMTk3Al8xBAZsZWFzZWQIBQ0kdDAxMjEyNTEyMTk3Al8yBAh0b1VubG9jawgFDSR0MDEyMTI1MTIxOTcCXzMEB3RvQ2xhaW0IBQ0kdDAxMjEyNTEyMTk3Al80CQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQBeIiNc", "height": 2963070, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HrB96xP1V5rTpGr9vnLL1r6Q3Pyyp2S4Y4REcEa8Swpi Next: 42vGnGiVpH7pUFxoMExUo42xj52nfGRJQskBfYrVXMw1 Diff:
OldNewDifferences
5858
5959 func getLeasingNodeEntry (nodeAddress,totalLeased) = {
6060 let valueString = makeString(["%d", toString(totalLeased)], SEP)
61- StringEntry(keyLeasingNodeData(nodeAddress), valueString)
61+ if ((totalLeased != 0))
62+ then StringEntry(keyLeasingNodeData(nodeAddress), valueString)
63+ else DeleteEntry(keyLeasingNodeData(nodeAddress))
6264 }
6365
6466
7779
7880 func getUserLeasingEntry (nodeAddress,userAddress,totalUserLeased) = {
7981 let valueString = makeString(["%d", toString(totalUserLeased)], SEP)
80- StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
82+ if ((totalUserLeased != 0))
83+ then StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
84+ else DeleteEntry(keyUserLeasingNodeData(userAddress, nodeAddress))
8185 }
8286
8387
171175 let newTotalLease = (totalNodeLeased + userLeasingAmount)
172176 let userTotalLeased = getUserLeasingData(nodeAddress, userAddress)
173177 let newUserTotalLease = (userTotalLeased + userLeasingAmount)
174- let $t058645936 = getUserBalances(userAddress)
175- let periodId = $t058645936._1
176- let leased = $t058645936._2
177- let toUnlock = $t058645936._3
178- let toClaim = $t058645936._4
178+ let $t060716143 = getUserBalances(userAddress)
179+ let periodId = $t060716143._1
180+ let leased = $t060716143._2
181+ let toUnlock = $t060716143._3
182+ let toClaim = $t060716143._4
179183 let newLeased = (leased + userLeasingAmount)
180184 [getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, periodId, newLeased, toUnlock, toClaim), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))]
181185 }
201205 then {
202206 let newTotalLease = (totalNodeLeased - unstakeAmount)
203207 let newUserTotalLease = (userTotalLeased - unstakeAmount)
204- let $t072127284 = getUserBalances(userAddress)
205- let periodId = $t072127284._1
206- let leased = $t072127284._2
207- let toUnlock = $t072127284._3
208- let toClaim = $t072127284._4
208+ let $t074197491 = getUserBalances(userAddress)
209+ let periodId = $t074197491._1
210+ let leased = $t074197491._2
211+ let toUnlock = $t074197491._3
212+ let toClaim = $t074197491._4
209213 let newLeased = (leased - unstakeAmount)
210214 let newToUnlock = (toUnlock + unstakeAmount)
211215 let removeNodeActions = if ((newUserTotalLease == 0))
218222
219223
220224 func getClaimUnlockedActions (userAddress,claimAmount) = {
221- let $t078857957 = getUserBalances(userAddress)
222- let periodId = $t078857957._1
223- let leased = $t078857957._2
224- let toUnlock = $t078857957._3
225- let toClaim = $t078857957._4
225+ let $t080928164 = getUserBalances(userAddress)
226+ let periodId = $t080928164._1
227+ let leased = $t080928164._2
228+ let toUnlock = $t080928164._3
229+ let toClaim = $t080928164._4
226230 let checks = [if ((claimAmount > 0))
227231 then true
228232 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
240244
241245
242246 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
243- let $t086238695 = getUserBalances(userAddress)
244- let periodId = $t086238695._1
245- let leased = $t086238695._2
246- let toUnlock = $t086238695._3
247- let toClaim = $t086238695._4
247+ let $t088308902 = getUserBalances(userAddress)
248+ let periodId = $t088308902._1
249+ let leased = $t088308902._2
250+ let toUnlock = $t088308902._3
251+ let toClaim = $t088308902._4
248252 let available = (toUnlock + toClaim)
249253 let checks = [if ((userLeasingAmount > 0))
250254 then true
293297
294298 @Callable(i)
295299 func getUserData (userAddress) = {
296- let $t01084710919 = getUserBalances(userAddress)
297- let periodId = $t01084710919._1
298- let leased = $t01084710919._2
299- let toUnlock = $t01084710919._3
300- let toClaim = $t01084710919._4
300+ let $t01105411126 = getUserBalances(userAddress)
301+ let periodId = $t01105411126._1
302+ let leased = $t01105411126._2
303+ let toUnlock = $t01105411126._3
304+ let toClaim = $t01105411126._4
301305 let nodeList = getUserLeasingNodeList(userAddress)
302306 $Tuple2(nil, $Tuple6($Tuple2(currentPeriodId, periodLength), leased, toUnlock, toClaim, (toUnlock + toClaim), nodeList))
303307 }
344348 @Callable(i)
345349 func claimAll () = {
346350 let userAddress = toString(i.caller)
347- let $t01191811990 = getUserBalances(userAddress)
348- let periodId = $t01191811990._1
349- let leased = $t01191811990._2
350- let toUnlock = $t01191811990._3
351- let toClaim = $t01191811990._4
351+ let $t01212512197 = getUserBalances(userAddress)
352+ let periodId = $t01212512197._1
353+ let leased = $t01212512197._2
354+ let toUnlock = $t01212512197._3
355+ let toClaim = $t01212512197._4
352356 getClaimUnlockedActions(userAddress, toClaim)
353357 }
354358
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 let scale8 = 100000000
99
1010 func throwErr (msg) = throw(((contractFile + ": ") + msg))
1111
1212
1313 let keyAssetId = makeString(["%s", "assetId"], SEP)
1414
1515 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1616
1717 let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP)
1818
1919 let keyPeriodLength = makeString(["%s", "periodLength"], SEP)
2020
2121 let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0)
2222
2323 let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000)
2424
2525 let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1)
2626
2727 let currentPeriodId = if (if ((height > periodOffsetHeight))
2828 then (periodOffsetHeight != -1)
2929 else false)
3030 then (((height - periodOffsetHeight) / periodLength) + periodOffsetId)
3131 else max([0, (periodOffsetId - 1)])
3232
3333 func keyLeasingNodeData (nodeAddress) = makeString(["%s", "leasingNode", nodeAddress], SEP)
3434
3535
3636 func keyUserLeasingNodeList (userAddress) = makeString(["%s%s", "userLeasingNodeList", userAddress], SEP)
3737
3838
3939 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", "userLeasingNodeData", userAddress, nodeAddress], SEP)
4040
4141
4242 func keyUserBalances (userAddress) = makeString(["%s%s", "userBalances", userAddress], SEP)
4343
4444
4545 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
4646
4747 let assetIdBytes = if ((assetIdString == "WAVES"))
4848 then unit
4949 else fromBase58String(assetIdString)
5050
5151 func isValidAddress (address) = match addressFromString(address) {
5252 case a: Address =>
5353 true
5454 case _ =>
5555 false
5656 }
5757
5858
5959 func getLeasingNodeEntry (nodeAddress,totalLeased) = {
6060 let valueString = makeString(["%d", toString(totalLeased)], SEP)
61- StringEntry(keyLeasingNodeData(nodeAddress), valueString)
61+ if ((totalLeased != 0))
62+ then StringEntry(keyLeasingNodeData(nodeAddress), valueString)
63+ else DeleteEntry(keyLeasingNodeData(nodeAddress))
6264 }
6365
6466
6567 func getLeasingNodeData (nodeAddress) = {
6668 let leasingDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
6769 match leasingDataStringRaw {
6870 case ds: String =>
6971 let dataList = split(ds, SEP)
7072 let totalLeased = parseIntValue(dataList[1])
7173 totalLeased
7274 case _ =>
7375 0
7476 }
7577 }
7678
7779
7880 func getUserLeasingEntry (nodeAddress,userAddress,totalUserLeased) = {
7981 let valueString = makeString(["%d", toString(totalUserLeased)], SEP)
80- StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
82+ if ((totalUserLeased != 0))
83+ then StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
84+ else DeleteEntry(keyUserLeasingNodeData(userAddress, nodeAddress))
8185 }
8286
8387
8488 func getUserLeasingData (nodeAddress,userAddress) = {
8589 let leasingDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
8690 match leasingDataStringRaw {
8791 case ds: String =>
8892 let dataList = split(ds, SEP)
8993 let totalLeased = parseIntValue(dataList[1])
9094 totalLeased
9195 case _ =>
9296 0
9397 }
9498 }
9599
96100
97101 func getUserBalancesEntry (userAddress,periodId,leased,toUnlock,toClaim) = {
98102 let valueString = makeString(["%d%d%d%d", toString(periodId), toString(leased), toString(toUnlock), toString(toClaim)], SEP)
99103 StringEntry(keyUserBalances(userAddress), valueString)
100104 }
101105
102106
103107 func getUserBalances (userAddress) = {
104108 let leasingDataStringRaw = getString(this, keyUserBalances(userAddress))
105109 match leasingDataStringRaw {
106110 case ds: String =>
107111 let dataList = split(ds, SEP)
108112 let periodId = parseIntValue(dataList[1])
109113 let leased = parseIntValue(dataList[2])
110114 let toUnlock = parseIntValue(dataList[3])
111115 let toClaim = parseIntValue(dataList[4])
112116 if (((currentPeriodId - periodId) > 0))
113117 then $Tuple4(periodId, leased, 0, (toClaim + toUnlock))
114118 else $Tuple4(periodId, leased, toUnlock, toClaim)
115119 case _ =>
116120 $Tuple4(0, 0, 0, 0)
117121 }
118122 }
119123
120124
121125 func getUserLeasingNodeList (userAddress) = {
122126 let leasingDataStringRaw = getString(this, keyUserLeasingNodeList(userAddress))
123127 match leasingDataStringRaw {
124128 case ds: String =>
125129 let dataList = split_51C(ds, SEP)
126130 dataList
127131 case _ =>
128132 nil
129133 }
130134 }
131135
132136
133137 func getUserNodeListEntry (userAddress,nodeList) = if ((size(nodeList) == 0))
134138 then DeleteEntry(keyUserLeasingNodeList(userAddress))
135139 else StringEntry(keyUserLeasingNodeList(userAddress), makeString_11C(nodeList, SEP))
136140
137141
138142 func addNodeToNodeList (userAddress,nodeAddress) = {
139143 let nodeList = getUserLeasingNodeList(userAddress)
140144 if (containsElement(nodeList, nodeAddress))
141145 then nodeList
142146 else (nodeList :+ nodeAddress)
143147 }
144148
145149
146150 func removeNodeFromNodeList (userAddress,nodeAddress) = {
147151 let nodeList = getUserLeasingNodeList(userAddress)
148152 match indexOf(nodeList, nodeAddress) {
149153 case index: Int =>
150154 removeByIndex(nodeList, index)
151155 case _ =>
152156 nodeList
153157 }
154158 }
155159
156160
157161 func getStakeActions (nodeAddress,userAddress,i) = {
158162 let checks = [if ((size(i.payments) == 1))
159163 then true
160164 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
161165 then true
162166 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
163167 then true
164168 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
165169 then true
166170 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
167171 if ((checks == checks))
168172 then {
169173 let userLeasingAmount = i.payments[0].amount
170174 let totalNodeLeased = getLeasingNodeData(nodeAddress)
171175 let newTotalLease = (totalNodeLeased + userLeasingAmount)
172176 let userTotalLeased = getUserLeasingData(nodeAddress, userAddress)
173177 let newUserTotalLease = (userTotalLeased + userLeasingAmount)
174- let $t058645936 = getUserBalances(userAddress)
175- let periodId = $t058645936._1
176- let leased = $t058645936._2
177- let toUnlock = $t058645936._3
178- let toClaim = $t058645936._4
178+ let $t060716143 = getUserBalances(userAddress)
179+ let periodId = $t060716143._1
180+ let leased = $t060716143._2
181+ let toUnlock = $t060716143._3
182+ let toClaim = $t060716143._4
179183 let newLeased = (leased + userLeasingAmount)
180184 [getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, periodId, newLeased, toUnlock, toClaim), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))]
181185 }
182186 else throw("Strict value is not equal to itself.")
183187 }
184188
185189
186190 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
187191 let totalNodeLeased = getLeasingNodeData(nodeAddress)
188192 let userTotalLeased = getUserLeasingData(nodeAddress, userAddress)
189193 let checks = [if ((unstakeAmount > 0))
190194 then true
191195 else throwErr("unstake amount should be greater than 0"), if ((userTotalLeased >= unstakeAmount))
192196 then true
193197 else throwErr("unstake amount should be less or equal user staked amount"), if ((totalNodeLeased >= unstakeAmount))
194198 then true
195199 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
196200 then true
197201 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
198202 then true
199203 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
200204 if ((checks == checks))
201205 then {
202206 let newTotalLease = (totalNodeLeased - unstakeAmount)
203207 let newUserTotalLease = (userTotalLeased - unstakeAmount)
204- let $t072127284 = getUserBalances(userAddress)
205- let periodId = $t072127284._1
206- let leased = $t072127284._2
207- let toUnlock = $t072127284._3
208- let toClaim = $t072127284._4
208+ let $t074197491 = getUserBalances(userAddress)
209+ let periodId = $t074197491._1
210+ let leased = $t074197491._2
211+ let toUnlock = $t074197491._3
212+ let toClaim = $t074197491._4
209213 let newLeased = (leased - unstakeAmount)
210214 let newToUnlock = (toUnlock + unstakeAmount)
211215 let removeNodeActions = if ((newUserTotalLease == 0))
212216 then [getUserNodeListEntry(userAddress, removeNodeFromNodeList(userAddress, nodeAddress))]
213217 else nil
214218 ([getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, currentPeriodId, newLeased, newToUnlock, toClaim)] ++ removeNodeActions)
215219 }
216220 else throw("Strict value is not equal to itself.")
217221 }
218222
219223
220224 func getClaimUnlockedActions (userAddress,claimAmount) = {
221- let $t078857957 = getUserBalances(userAddress)
222- let periodId = $t078857957._1
223- let leased = $t078857957._2
224- let toUnlock = $t078857957._3
225- let toClaim = $t078857957._4
225+ let $t080928164 = getUserBalances(userAddress)
226+ let periodId = $t080928164._1
227+ let leased = $t080928164._2
228+ let toUnlock = $t080928164._3
229+ let toClaim = $t080928164._4
226230 let checks = [if ((claimAmount > 0))
227231 then true
228232 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
229233 then true
230234 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
231235 then true
232236 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
233237 if ((checks == checks))
234238 then {
235239 let newToClaim = (toClaim - claimAmount)
236240 [getUserBalancesEntry(userAddress, currentPeriodId, leased, toUnlock, newToClaim), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
237241 }
238242 else throw("Strict value is not equal to itself.")
239243 }
240244
241245
242246 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
243- let $t086238695 = getUserBalances(userAddress)
244- let periodId = $t086238695._1
245- let leased = $t086238695._2
246- let toUnlock = $t086238695._3
247- let toClaim = $t086238695._4
247+ let $t088308902 = getUserBalances(userAddress)
248+ let periodId = $t088308902._1
249+ let leased = $t088308902._2
250+ let toUnlock = $t088308902._3
251+ let toClaim = $t088308902._4
248252 let available = (toUnlock + toClaim)
249253 let checks = [if ((userLeasingAmount > 0))
250254 then true
251255 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
252256 then true
253257 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
254258 then true
255259 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
256260 then true
257261 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
258262 if ((checks == checks))
259263 then {
260264 let totalNodeLeased = getLeasingNodeData(nodeAddress)
261265 let newTotalLease = (totalNodeLeased + userLeasingAmount)
262266 let userTotalLeased = getUserLeasingData(nodeAddress, userAddress)
263267 let newUserTotalLease = (userTotalLeased + userLeasingAmount)
264268 let newLeased = (leased + userLeasingAmount)
265269 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
266270 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
267271 [getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, periodId, newLeased, newToUnlock, newToClaim), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))]
268272 }
269273 else throw("Strict value is not equal to itself.")
270274 }
271275
272276
273277 func getSetNewPeriodLengthActions (newPeriodLength) = {
274278 let check = [if ((newPeriodLength > 0))
275279 then true
276280 else throwErr("period length should be greater than 0")]
277281 if ((check == check))
278282 then if ((periodOffsetHeight == -1))
279283 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
280284 else {
281285 let newPeriodOffsetId = (currentPeriodId + 1)
282286 let newOffsetHeight = ((periodLength * (newPeriodOffsetId - periodOffsetId)) + periodOffsetHeight)
283287 [IntegerEntry(keyPeriodOffsetId, newPeriodOffsetId), IntegerEntry(keyPeriodOffsetHeight, newOffsetHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
284288 }
285289 else throw("Strict value is not equal to itself.")
286290 }
287291
288292
289293 @Callable(i)
290294 func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
291295
292296
293297
294298 @Callable(i)
295299 func getUserData (userAddress) = {
296- let $t01084710919 = getUserBalances(userAddress)
297- let periodId = $t01084710919._1
298- let leased = $t01084710919._2
299- let toUnlock = $t01084710919._3
300- let toClaim = $t01084710919._4
300+ let $t01105411126 = getUserBalances(userAddress)
301+ let periodId = $t01105411126._1
302+ let leased = $t01105411126._2
303+ let toUnlock = $t01105411126._3
304+ let toClaim = $t01105411126._4
301305 let nodeList = getUserLeasingNodeList(userAddress)
302306 $Tuple2(nil, $Tuple6($Tuple2(currentPeriodId, periodLength), leased, toUnlock, toClaim, (toUnlock + toClaim), nodeList))
303307 }
304308
305309
306310
307311 @Callable(i)
308312 func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
309313
310314
311315
312316 @Callable(i)
313317 func stake (nodeAddress) = {
314318 let userAddress = toString(i.caller)
315319 getStakeActions(nodeAddress, userAddress, i)
316320 }
317321
318322
319323
320324 @Callable(i)
321325 func stakeFromUnlocked (nodeAddress,amount) = {
322326 let userAddress = toString(i.caller)
323327 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
324328 }
325329
326330
327331
328332 @Callable(i)
329333 func unstake (nodeAddress,amount) = {
330334 let userAddress = toString(i.caller)
331335 getUnstakeActions(nodeAddress, userAddress, amount)
332336 }
333337
334338
335339
336340 @Callable(i)
337341 func claim (amount) = {
338342 let userAddress = toString(i.caller)
339343 getClaimUnlockedActions(userAddress, amount)
340344 }
341345
342346
343347
344348 @Callable(i)
345349 func claimAll () = {
346350 let userAddress = toString(i.caller)
347- let $t01191811990 = getUserBalances(userAddress)
348- let periodId = $t01191811990._1
349- let leased = $t01191811990._2
350- let toUnlock = $t01191811990._3
351- let toClaim = $t01191811990._4
351+ let $t01212512197 = getUserBalances(userAddress)
352+ let periodId = $t01212512197._1
353+ let leased = $t01212512197._2
354+ let toUnlock = $t01212512197._3
355+ let toClaim = $t01212512197._4
352356 getClaimUnlockedActions(userAddress, toClaim)
353357 }
354358
355359

github/deemru/w8io/026f985 
45.43 ms