tx · HsjWvuS1WgMYTbsG5ziMVtVzZx916WBJ9B2VuSC7MSxi

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01300000 Waves

2024.02.12 15:23 [2973036] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "HsjWvuS1WgMYTbsG5ziMVtVzZx916WBJ9B2VuSC7MSxi", "fee": 1300000, "feeAssetId": null, "timestamp": 1707740619332, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "5j928PxmFMaq1nFAwVLg55CAi7ZTHg4uNNECjjkNoL8nTjf4YqC8vBwKXUtCuwsNSUr7yDpQpHEvhb11kbn3YTWu" ], "script": "base64:BgIvCAISAwoBARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgAkAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fAAZzY2FsZTgAgMLXLwEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAARa2V5UGVyaW9kT2Zmc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAghvZmZzZXRJZAUDbmlsBQNTRVAAFWtleVBlcmlvZE9mZnNldEhlaWdodAkAuQkCCQDMCAICAiVzCQDMCAICDG9mZnNldEhlaWdodAUDbmlsBQNTRVAAD2tleVBlcmlvZExlbmd0aAkAuQkCCQDMCAICAiVzCQDMCAICDHBlcmlvZExlbmd0aAUDbmlsBQNTRVAADnBlcmlvZE9mZnNldElkCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFEWtleVBlcmlvZE9mZnNldElkAAAADHBlc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VzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDEzMjcwMTMzMzAJARVnZXRVc2VyVG9DbGFpbUJhbGFuY2UBBQt1c2VyQWRkcmVzcwQHdG9DbGFpbQgFDSR0MDEzMjcwMTMzMzACXzEECHRvVW5sb2NrCAUNJHQwMTMyNzAxMzMzMAJfMgkBF2dldENsYWltVW5sb2NrZWRBY3Rpb25zAgULdXNlckFkZHJlc3MFB3RvQ2xhaW0AWCQw4g==", "height": 2973036, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FnM5niybaRHAzGUDCTqcCXp5YmWFPANhmr39Q2pQHZPV Next: 78wCSZXshmt5KwAVGPkv6nGCgo7PRKLS1Wa3roxGAkZi Diff:
OldNewDifferences
298298 }
299299
300300
301-func getPeriodData () = $Tuple2(currentPeriodHeight, nextPeriodHeight)
302-
303-
304301 @Callable(i)
305302 func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
306303
308305
309306 @Callable(i)
310307 func getNodeDataREADONLY (nodeAddress) = {
311- let $t01207912143 = getLeasingNodeData(nodeAddress)
312- let currentLease = $t01207912143._1
313- let nextLeased = $t01207912143._2
314- let $t01214812197 = getPeriodData()
315- let currentPeriod = $t01214812197._1
316- let nextPeriod = $t01214812197._2
317- $Tuple2(nil, $Tuple5(currentLease, nextLeased, height, currentPeriod, nextPeriod))
308+ let $t01200712071 = getLeasingNodeData(nodeAddress)
309+ let currentLease = $t01200712071._1
310+ let nextLeased = $t01200712071._2
311+ $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
318312 }
319313
320314
321315
322316 @Callable(i)
323317 func getUserDataREADONLY (userAddress) = {
324- let $t01234112401 = getUserToClaimBalance(userAddress)
325- let toClaim = $t01234112401._1
326- let toUnlock = $t01234112401._2
327- let $t01240612455 = getPeriodData()
328- let currentPeriod = $t01240612455._1
329- let nextPeriod = $t01240612455._2
318+ let $t01222712287 = getUserToClaimBalance(userAddress)
319+ let toClaim = $t01222712287._1
320+ let toUnlock = $t01222712287._2
330321 let nodeList = getUserLeasingNodeList(userAddress)
331- $Tuple2(nil, $Tuple6(toClaim, toUnlock, height, currentPeriod, nextPeriod, nodeList))
322+ $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height, nodeList))
332323 }
333324
334325
373364 @Callable(i)
374365 func claimAll () = {
375366 let userAddress = toString(i.caller)
376- let $t01342613486 = getUserToClaimBalance(userAddress)
377- let toClaim = $t01342613486._1
378- let toUnlock = $t01342613486._2
367+ let $t01327013330 = getUserToClaimBalance(userAddress)
368+ let toClaim = $t01327013330._1
369+ let toUnlock = $t01327013330._2
379370 getClaimUnlockedActions(userAddress, toClaim)
380371 }
381372
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 let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength))
3434
3535 let nextPeriodHeight = (currentPeriodHeight + periodLength)
3636
3737 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
3838
3939
4040 func keyUserLeasingNodeList (userAddress) = makeString(["%s%s", "userLeasingNodeList", userAddress], SEP)
4141
4242
4343 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
4444
4545
4646 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
4747
4848
4949 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
5050
5151 let assetIdBytes = if ((assetIdString == "WAVES"))
5252 then unit
5353 else fromBase58String(assetIdString)
5454
5555 func isValidAddress (address) = match addressFromString(address) {
5656 case a: Address =>
5757 true
5858 case _ =>
5959 false
6060 }
6161
6262
6363 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
6464 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
6565 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
6666 }
6767
6868
6969 func getLeasingNodeData (nodeAddress) = {
7070 let leasingDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
7171 match leasingDataStringRaw {
7272 case ds: String =>
7373 let dataList = split(ds, SEP)
7474 let nodeCurrentPeriod = parseIntValue(dataList[1])
7575 let nodeCurrentLeased = parseIntValue(dataList[2])
7676 let nodeNextPeriod = parseIntValue(dataList[3])
7777 let nodeNextLeased = parseIntValue(dataList[4])
7878 if ((nodeNextPeriod > height))
7979 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
8080 else $Tuple2(nodeNextLeased, nodeNextLeased)
8181 case _ =>
8282 $Tuple2(0, 0)
8383 }
8484 }
8585
8686
8787 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
8888 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
8989 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
9090 }
9191
9292
9393 func getUserLeasingData (nodeAddress,userAddress) = {
9494 let leasingDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
9595 match leasingDataStringRaw {
9696 case ds: String =>
9797 let dataList = split(ds, SEP)
9898 let userCurrentPeriod = parseIntValue(dataList[1])
9999 let userCurrentLeased = parseIntValue(dataList[2])
100100 let userNextPeriod = parseIntValue(dataList[3])
101101 let userNextLeased = parseIntValue(dataList[4])
102102 if ((userNextPeriod > height))
103103 then $Tuple2(userCurrentLeased, userNextLeased)
104104 else $Tuple2(userNextLeased, userNextLeased)
105105 case _ =>
106106 $Tuple2(0, 0)
107107 }
108108 }
109109
110110
111111 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
112112 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
113113 StringEntry(keyUserToClaim(userAddress), valueString)
114114 }
115115
116116
117117 func getUserToClaimBalance (userAddress) = {
118118 let userToClaimDataRaw = getString(this, keyUserToClaim(userAddress))
119119 match userToClaimDataRaw {
120120 case ds: String =>
121121 let dataList = split(ds, SEP)
122122 let currentPeriod = parseIntValue(dataList[1])
123123 let toClaim = parseIntValue(dataList[2])
124124 let nextPeriod = parseIntValue(dataList[3])
125125 let toUnlock = parseIntValue(dataList[4])
126126 if ((nextPeriod > height))
127127 then $Tuple2(toClaim, toUnlock)
128128 else $Tuple2((toClaim + toUnlock), 0)
129129 case _ =>
130130 $Tuple2(0, 0)
131131 }
132132 }
133133
134134
135135 func getUserLeasingNodeList (userAddress) = {
136136 let leasingDataStringRaw = getString(this, keyUserLeasingNodeList(userAddress))
137137 match leasingDataStringRaw {
138138 case ds: String =>
139139 let dataList = split_51C(ds, SEP)
140140 dataList
141141 case _ =>
142142 nil
143143 }
144144 }
145145
146146
147147 func getUserNodeListEntry (userAddress,nodeList) = if ((size(nodeList) == 0))
148148 then DeleteEntry(keyUserLeasingNodeList(userAddress))
149149 else StringEntry(keyUserLeasingNodeList(userAddress), makeString_11C(nodeList, SEP))
150150
151151
152152 func addNodeToNodeList (userAddress,nodeAddress) = {
153153 let nodeList = getUserLeasingNodeList(userAddress)
154154 if (containsElement(nodeList, nodeAddress))
155155 then nodeList
156156 else (nodeList :+ nodeAddress)
157157 }
158158
159159
160160 func removeNodeFromNodeList (userAddress,nodeAddress) = {
161161 let nodeList = getUserLeasingNodeList(userAddress)
162162 match indexOf(nodeList, nodeAddress) {
163163 case index: Int =>
164164 removeByIndex(nodeList, index)
165165 case _ =>
166166 nodeList
167167 }
168168 }
169169
170170
171171 func getStakeActions (nodeAddress,userAddress,i) = {
172172 let checks = [if ((size(i.payments) == 1))
173173 then true
174174 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
175175 then true
176176 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
177177 then true
178178 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
179179 then true
180180 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
181181 if ((checks == checks))
182182 then {
183183 let userLeasingAmount = i.payments[0].amount
184184 let $t066986771 = getLeasingNodeData(nodeAddress)
185185 let nodeCurrentLeased = $t066986771._1
186186 let nodeNextLeased = $t066986771._2
187187 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
188188 let $t068396925 = getUserLeasingData(nodeAddress, userAddress)
189189 let userCurrentLeased = $t068396925._1
190190 let userNextLeased = $t068396925._2
191191 let newUserNextLeased = (userNextLeased + userLeasingAmount)
192192 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))]
193193 }
194194 else throw("Strict value is not equal to itself.")
195195 }
196196
197197
198198 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
199199 let $t075437616 = getLeasingNodeData(nodeAddress)
200200 let nodeCurrentLeased = $t075437616._1
201201 let nodeNextLeased = $t075437616._2
202202 let $t076217707 = getUserLeasingData(nodeAddress, userAddress)
203203 let userCurrentLeased = $t076217707._1
204204 let userNextLeased = $t076217707._2
205205 let checks = [if ((unstakeAmount > 0))
206206 then true
207207 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
208208 then true
209209 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
210210 then true
211211 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
212212 then true
213213 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
214214 then true
215215 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
216216 if ((checks == checks))
217217 then {
218218 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
219219 let newUserNextLeased = (userNextLeased - unstakeAmount)
220220 let $t084008505 = getUserToClaimBalance(userAddress)
221221 let toClaim = $t084008505._1
222222 let toUnlock = $t084008505._2
223223 let newToUnlock = (toUnlock + unstakeAmount)
224224 let removeNodeActions = if ((newUserNextLeased == 0))
225225 then [getUserNodeListEntry(userAddress, removeNodeFromNodeList(userAddress, nodeAddress))]
226226 else nil
227227 ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock)] ++ removeNodeActions)
228228 }
229229 else throw("Strict value is not equal to itself.")
230230 }
231231
232232
233233 func getClaimUnlockedActions (userAddress,claimAmount) = {
234234 let $t090759135 = getUserToClaimBalance(userAddress)
235235 let toClaim = $t090759135._1
236236 let toUnlock = $t090759135._2
237237 let checks = [if ((claimAmount > 0))
238238 then true
239239 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
240240 then true
241241 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
242242 then true
243243 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
244244 if ((checks == checks))
245245 then {
246246 let newToClaim = (toClaim - claimAmount)
247247 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
248248 }
249249 else throw("Strict value is not equal to itself.")
250250 }
251251
252252
253253 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
254254 let $t097759835 = getUserToClaimBalance(userAddress)
255255 let toClaim = $t097759835._1
256256 let toUnlock = $t097759835._2
257257 let available = (toUnlock + toClaim)
258258 let checks = [if ((userLeasingAmount > 0))
259259 then true
260260 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
261261 then true
262262 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
263263 then true
264264 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
265265 then true
266266 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
267267 if ((checks == checks))
268268 then {
269269 let $t01031210385 = getLeasingNodeData(nodeAddress)
270270 let nodeCurrentLeased = $t01031210385._1
271271 let nodeNextLeased = $t01031210385._2
272272 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
273273 let $t01045310539 = getUserLeasingData(nodeAddress, userAddress)
274274 let userCurrentLeased = $t01045310539._1
275275 let userNextLeased = $t01045310539._2
276276 let newUserNextLeased = (userNextLeased + userLeasingAmount)
277277 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
278278 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
279279 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, nodeNextLeased), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))]
280280 }
281281 else throw("Strict value is not equal to itself.")
282282 }
283283
284284
285285 func getSetNewPeriodLengthActions (newPeriodLength) = {
286286 let check = [if ((newPeriodLength > 0))
287287 then true
288288 else throwErr("period length should be greater than 0")]
289289 if ((check == check))
290290 then if ((periodOffsetHeight == -1))
291291 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
292292 else {
293293 let newPeriodOffsetId = (currentPeriodId + 1)
294294 let newOffsetHeight = ((periodLength * (newPeriodOffsetId - periodOffsetId)) + periodOffsetHeight)
295295 [IntegerEntry(keyPeriodOffsetId, newPeriodOffsetId), IntegerEntry(keyPeriodOffsetHeight, newOffsetHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
296296 }
297297 else throw("Strict value is not equal to itself.")
298298 }
299299
300300
301-func getPeriodData () = $Tuple2(currentPeriodHeight, nextPeriodHeight)
302-
303-
304301 @Callable(i)
305302 func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
306303
307304
308305
309306 @Callable(i)
310307 func getNodeDataREADONLY (nodeAddress) = {
311- let $t01207912143 = getLeasingNodeData(nodeAddress)
312- let currentLease = $t01207912143._1
313- let nextLeased = $t01207912143._2
314- let $t01214812197 = getPeriodData()
315- let currentPeriod = $t01214812197._1
316- let nextPeriod = $t01214812197._2
317- $Tuple2(nil, $Tuple5(currentLease, nextLeased, height, currentPeriod, nextPeriod))
308+ let $t01200712071 = getLeasingNodeData(nodeAddress)
309+ let currentLease = $t01200712071._1
310+ let nextLeased = $t01200712071._2
311+ $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
318312 }
319313
320314
321315
322316 @Callable(i)
323317 func getUserDataREADONLY (userAddress) = {
324- let $t01234112401 = getUserToClaimBalance(userAddress)
325- let toClaim = $t01234112401._1
326- let toUnlock = $t01234112401._2
327- let $t01240612455 = getPeriodData()
328- let currentPeriod = $t01240612455._1
329- let nextPeriod = $t01240612455._2
318+ let $t01222712287 = getUserToClaimBalance(userAddress)
319+ let toClaim = $t01222712287._1
320+ let toUnlock = $t01222712287._2
330321 let nodeList = getUserLeasingNodeList(userAddress)
331- $Tuple2(nil, $Tuple6(toClaim, toUnlock, height, currentPeriod, nextPeriod, nodeList))
322+ $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height, nodeList))
332323 }
333324
334325
335326
336327 @Callable(i)
337328 func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
338329
339330
340331
341332 @Callable(i)
342333 func stake (nodeAddress) = {
343334 let userAddress = toString(i.caller)
344335 getStakeActions(nodeAddress, userAddress, i)
345336 }
346337
347338
348339
349340 @Callable(i)
350341 func stakeFromUnlocked (nodeAddress,amount) = {
351342 let userAddress = toString(i.caller)
352343 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
353344 }
354345
355346
356347
357348 @Callable(i)
358349 func unstake (nodeAddress,amount) = {
359350 let userAddress = toString(i.caller)
360351 getUnstakeActions(nodeAddress, userAddress, amount)
361352 }
362353
363354
364355
365356 @Callable(i)
366357 func claim (amount) = {
367358 let userAddress = toString(i.caller)
368359 getClaimUnlockedActions(userAddress, amount)
369360 }
370361
371362
372363
373364 @Callable(i)
374365 func claimAll () = {
375366 let userAddress = toString(i.caller)
376- let $t01342613486 = getUserToClaimBalance(userAddress)
377- let toClaim = $t01342613486._1
378- let toUnlock = $t01342613486._2
367+ let $t01327013330 = getUserToClaimBalance(userAddress)
368+ let toClaim = $t01327013330._1
369+ let toUnlock = $t01327013330._2
379370 getClaimUnlockedActions(userAddress, toClaim)
380371 }
381372
382373

github/deemru/w8io/026f985 
51.09 ms