tx · A3kQoQSnGrcqFFfi8DFpr1ZLxcfqckRYfmdsacgFEWWH 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.02700000 Waves 2024.10.21 15:43 [3336621] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "A3kQoQSnGrcqFFfi8DFpr1ZLxcfqckRYfmdsacgFEWWH", "fee": 2700000, "feeAssetId": null, "timestamp": 1729514616761, "version": 1, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "44U5BdCRsH9GUgYL3xk21119mVfazfCv6BrjtAcopC29fCojCbqP9KtXUvZ4S8qPNNTdp66GEdsLRkp2dhmkwETp" ], "script": "base64:BgJNCAISAwoBARIAEgMKAQQSAwoBBBIDCgEIEgQKAggIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgASAwoBCBIAEgMKAQhNAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fABJCTE9DS1NfSU5fSU5URVJWQUwA6AcABnNjYWxlOACAwtcvABJ1bml0c0NsYWltSW50ZXJ2YWwJAGgCCQBoAgDtAgAYADwBCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAxrZXlMMkFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAAMa2V5Rm9yY2VTdG9wCQC5CQIJAMwIAgICJXMJAMwIAgIJZm9yY2VTdG9wBQNuaWwFA1NFUAAPa2V5Rm9yY2VPdXRTdG9wCQC5CQIJAMwIAgICJXMJAMwIAgIMZm9yY2VPdXRTdG9wBQNuaWwFA1NFUAAPa2V5VW5pdHNBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIMdW5pdHNBc3N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F9GBtsXyxM61QGr Next: 5kig3UQyBqXAuNNrokWxkS13UtjRKtYo9Wb1kxx7NotR Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let scale8 = 100000000 | |
11 | 11 | ||
12 | + | let unitsClaimInterval = ((365 * 24) * 60) | |
13 | + | ||
12 | 14 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
13 | 15 | ||
14 | 16 | ||
15 | - | let | |
17 | + | let keyL2AssetId = makeString(["%s", "assetId"], SEP) | |
16 | 18 | ||
17 | 19 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
18 | 20 | ||
19 | 21 | let keyForceOutStop = makeString(["%s", "forceOutStop"], SEP) | |
22 | + | ||
23 | + | let keyUnitsAssetId = makeString(["%s", "unitsAssetId"], SEP) | |
24 | + | ||
25 | + | let keyUnitsPerBlockScale8 = makeString(["%s", "unitsPerBlock"], SEP) | |
20 | 26 | ||
21 | 27 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
22 | 28 | ||
23 | 29 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
24 | 30 | ||
25 | 31 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
32 | + | ||
33 | + | let keyUnitsClaimStartHeight = makeString(["%s", "unitsClaimStartHeight"], SEP) | |
26 | 34 | ||
27 | 35 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
28 | 36 | ||
52 | 60 | then 0 | |
53 | 61 | else (currentPeriodHeight + periodLength) | |
54 | 62 | ||
63 | + | let unitsClaimStartHeight = valueOrElse(getInteger(this, keyUnitsClaimStartHeight), height) | |
64 | + | ||
55 | 65 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
56 | 66 | ||
57 | 67 | ||
64 | 74 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
65 | 75 | ||
66 | 76 | ||
67 | - | func | |
77 | + | func keyUnitsClaimedBlock (userAddress) = makeString(["%s%s", "unitsClaimedBlock", userAddress], SEP) | |
68 | 78 | ||
69 | 79 | ||
70 | - | func keyTotalUnitsClaimed (userAddress) = makeString(["%s%s", userAddress, "totalUnitsClaimed"], SEP) | |
80 | + | func keyUnlockedUnits (userAddress) = makeString(["%s%s", "unlockedUnits", userAddress], SEP) | |
81 | + | ||
82 | + | ||
83 | + | func keyTotalUnitsClaimed (userAddress) = makeString(["%s%s", "totalUnitsClaimed", userAddress], SEP) | |
84 | + | ||
85 | + | ||
86 | + | func keyL2ToBurn (userAddress) = makeString(["%s%s", "l2ToBurn", userAddress], SEP) | |
87 | + | ||
88 | + | ||
89 | + | func keyL2BurnedTotal (userAddress) = makeString(["%s%s", "l2BurnedTotal", userAddress], SEP) | |
71 | 90 | ||
72 | 91 | ||
73 | 92 | func keyNodeLeasingByHeight (nodeAddress) = { | |
86 | 105 | } | |
87 | 106 | ||
88 | 107 | ||
89 | - | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
90 | - | ||
91 | - | let assetIdBytes = if ((assetIdString == "WAVES")) | |
108 | + | func assetStringToBytes (assetIdString) = if ((assetIdString == "WAVES")) | |
92 | 109 | then unit | |
93 | 110 | else fromBase58String(assetIdString) | |
111 | + | ||
112 | + | ||
113 | + | func assetBytesToString (assetId) = match assetId { | |
114 | + | case a: ByteVector => | |
115 | + | toBase58String(a) | |
116 | + | case _ => | |
117 | + | "WAVES" | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | let l2AssetIdString = valueOrElse(getString(this, keyL2AssetId), "WAVES") | |
122 | + | ||
123 | + | let unitsAssetIdString = valueOrElse(getString(this, keyUnitsAssetId), "WAVES") | |
124 | + | ||
125 | + | let l2AssetIdBytes = assetStringToBytes(l2AssetIdString) | |
126 | + | ||
127 | + | let unitsAssetIdBytes = assetStringToBytes(unitsAssetIdString) | |
94 | 128 | ||
95 | 129 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
96 | 130 | ||
140 | 174 | ||
141 | 175 | ||
142 | 176 | func genVotesKeysHelper (a,adminAddress) = { | |
143 | - | let $ | |
144 | - | let result = $ | |
145 | - | let prefix = $ | |
177 | + | let $t050215045 = a | |
178 | + | let result = $t050215045._1 | |
179 | + | let prefix = $t050215045._2 | |
146 | 180 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
147 | 181 | } | |
148 | 182 | ||
149 | 183 | ||
150 | 184 | func genVotesKeys (keyPrefix) = { | |
151 | 185 | let adminList = keyAdminAddressList() | |
152 | - | let $ | |
186 | + | let $t051925276 = { | |
153 | 187 | let $l = getAdminsList() | |
154 | 188 | let $s = size($l) | |
155 | 189 | let $acc0 = $Tuple2(nil, keyPrefix) | |
163 | 197 | ||
164 | 198 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
165 | 199 | } | |
166 | - | let result = $ | |
167 | - | let prefix = $ | |
200 | + | let result = $t051925276._1 | |
201 | + | let prefix = $t051925276._2 | |
168 | 202 | result | |
169 | 203 | } | |
170 | 204 | ||
315 | 349 | func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0) | |
316 | 350 | ||
317 | 351 | ||
352 | + | func calculateUnitsToClaim (userAddress) = { | |
353 | + | let claimedBlockKey = keyUnitsClaimedBlock(userAddress) | |
354 | + | let claimedBlock = valueOrElse(getInteger(this, claimedBlockKey), unitsClaimStartHeight) | |
355 | + | let unitsPerBlockScale8 = valueOrElse(getInteger(this, keyUnitsPerBlockScale8), 0) | |
356 | + | let currentBlock = min([(unitsClaimStartHeight + unitsClaimInterval), height]) | |
357 | + | let blocksPassed = (currentBlock - claimedBlock) | |
358 | + | let amountStaked = getUserTotalLocked(userAddress) | |
359 | + | let unitsToClaimNow = fraction((unitsPerBlockScale8 * blocksPassed), amountStaked, scale8) | |
360 | + | let l2ToBurn = fraction(amountStaked, blocksPassed, unitsClaimInterval) | |
361 | + | $Tuple3(unitsToClaimNow, l2ToBurn, claimedBlock) | |
362 | + | } | |
363 | + | ||
364 | + | ||
365 | + | func getUnlockUnitsAction (userAddress) = { | |
366 | + | let kUnlockedUnits = keyUnlockedUnits(userAddress) | |
367 | + | let unlockedUnits = valueOrElse(getInteger(this, kUnlockedUnits), 0) | |
368 | + | let kL2ToBurn = keyL2ToBurn(userAddress) | |
369 | + | let l2ToBurn = valueOrElse(getInteger(this, kL2ToBurn), 0) | |
370 | + | let $t01121711302 = calculateUnitsToClaim(userAddress) | |
371 | + | let unitsToClaimNow = $t01121711302._1 | |
372 | + | let l2ToBurnNow = $t01121711302._2 | |
373 | + | let claimedBlock = $t01121711302._3 | |
374 | + | if ((0 >= unitsToClaimNow)) | |
375 | + | then nil | |
376 | + | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), claimedBlock), IntegerEntry(kL2ToBurn, (l2ToBurn + l2ToBurnNow)), IntegerEntry(kUnlockedUnits, (unlockedUnits + unitsToClaimNow))] | |
377 | + | } | |
378 | + | ||
379 | + | ||
318 | 380 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
319 | - | let $ | |
320 | - | let nodeCurrentLeased = $ | |
321 | - | let nodeNextLeased = $ | |
322 | - | let $ | |
323 | - | let userCurrentLeased = $ | |
324 | - | let userNextLeased = $ | |
381 | + | let $t01169711770 = getLeasingNodeData(nodeAddress) | |
382 | + | let nodeCurrentLeased = $t01169711770._1 | |
383 | + | let nodeNextLeased = $t01169711770._2 | |
384 | + | let $t01177511861 = getUserLeasingData(nodeAddress, userAddress) | |
385 | + | let userCurrentLeased = $t01177511861._1 | |
386 | + | let userNextLeased = $t01177511861._2 | |
325 | 387 | let checks = [if (!(isForceStop)) | |
326 | 388 | then true | |
327 | 389 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
341 | 403 | then { | |
342 | 404 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
343 | 405 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
344 | - | let $ | |
345 | - | let toClaim = $ | |
346 | - | let toUnlock = $ | |
406 | + | let $t01274512805 = getUserToClaimBalance(userAddress) | |
407 | + | let toClaim = $t01274512805._1 | |
408 | + | let toUnlock = $t01274512805._2 | |
347 | 409 | let newToUnlock = (toUnlock + unstakeAmount) | |
348 | 410 | let userTotalLocked = getUserTotalLocked(userAddress) | |
349 | 411 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
350 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
412 | + | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
413 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] ++ unitsUnlockedActions) | |
351 | 414 | } | |
352 | 415 | else throw("Strict value is not equal to itself.") | |
353 | 416 | } | |
354 | 417 | ||
355 | 418 | ||
356 | 419 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
357 | - | let $ | |
358 | - | let toClaim = $ | |
359 | - | let toUnlock = $ | |
420 | + | let $t01362413684 = getUserToClaimBalance(userAddress) | |
421 | + | let toClaim = $t01362413684._1 | |
422 | + | let toUnlock = $t01362413684._2 | |
360 | 423 | let checks = [if (!(isForceStop)) | |
361 | 424 | then true | |
362 | 425 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
371 | 434 | if ((checks == checks)) | |
372 | 435 | then { | |
373 | 436 | let newToClaim = (toClaim - claimAmount) | |
374 | - | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, | |
437 | + | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, l2AssetIdBytes)] | |
375 | 438 | } | |
376 | 439 | else throw("Strict value is not equal to itself.") | |
377 | 440 | } | |
378 | 441 | ||
379 | 442 | ||
380 | 443 | func getStakeForActions (userAddress,i) = { | |
381 | - | let $ | |
382 | - | let toClaim = $ | |
383 | - | let toUnlock = $ | |
444 | + | let $t01445014510 = getUserToClaimBalance(userAddress) | |
445 | + | let toClaim = $t01445014510._1 | |
446 | + | let toUnlock = $t01445014510._2 | |
384 | 447 | let checks = [if (!(isForceStop)) | |
385 | 448 | then true | |
386 | 449 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
387 | 450 | then true | |
388 | 451 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
389 | 452 | then true | |
390 | - | else (i.payments[0].assetId == | |
453 | + | else (i.payments[0].assetId == l2AssetIdBytes)) | |
391 | 454 | then true | |
392 | - | else throwErr(makeString(["payment assetId should be:", | |
455 | + | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if (isValidAddress(userAddress)) | |
393 | 456 | then true | |
394 | 457 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
395 | 458 | if ((checks == checks)) | |
401 | 464 | } | |
402 | 465 | ||
403 | 466 | ||
404 | - | func calculateClaim (userAddress) = { | |
405 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
406 | - | let claimedBlock = valueOrElse(getInteger(this, claimedBlockKey), height) | |
407 | - | let blocksPassed = (height - claimedBlock) | |
408 | - | let amountStaked = getUserTotalLocked(userAddress) | |
409 | - | let toClaimNow = ((blocksPassed * (amountStaked * scale8)) / BLOCKS_IN_INTERVAL) | |
410 | - | toClaimNow | |
411 | - | } | |
412 | - | ||
413 | - | ||
414 | - | func setUser (userAddress,claimedBlock) = { | |
415 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
416 | - | [IntegerEntry(claimedBlockKey, claimedBlock)] | |
417 | - | } | |
418 | - | ||
419 | - | ||
420 | 467 | func getStakeActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
421 | - | let $ | |
422 | - | let toClaim = $ | |
423 | - | let toUnlock = $ | |
468 | + | let $t01524215302 = getUserToClaimBalance(userAddress) | |
469 | + | let toClaim = $t01524215302._1 | |
470 | + | let toUnlock = $t01524215302._2 | |
424 | 471 | let paymentAmount = if ((size(i.payments) == 0)) | |
425 | 472 | then 0 | |
426 | 473 | else i.payments[0].amount | |
431 | 478 | then true | |
432 | 479 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
433 | 480 | then true | |
434 | - | else (i.payments[0].assetId == | |
481 | + | else (i.payments[0].assetId == l2AssetIdBytes)) | |
435 | 482 | then true | |
436 | - | else throwErr(makeString(["payment assetId should be:", | |
483 | + | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if ((userLeasingAmount > 0)) | |
437 | 484 | then true | |
438 | 485 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
439 | 486 | then true | |
446 | 493 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
447 | 494 | if ((checks == checks)) | |
448 | 495 | then { | |
449 | - | let $ | |
450 | - | let nodeCurrentLeased = $ | |
451 | - | let nodeNextLeased = $ | |
496 | + | let $t01637716450 = getLeasingNodeData(nodeAddress) | |
497 | + | let nodeCurrentLeased = $t01637716450._1 | |
498 | + | let nodeNextLeased = $t01637716450._2 | |
452 | 499 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
453 | - | let $ | |
454 | - | let userCurrentLeased = $ | |
455 | - | let userNextLeased = $ | |
500 | + | let $t01651816604 = getUserLeasingData(nodeAddress, userAddress) | |
501 | + | let userCurrentLeased = $t01651816604._1 | |
502 | + | let userNextLeased = $t01651816604._2 | |
456 | 503 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
457 | 504 | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
458 | 505 | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
459 | 506 | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
460 | 507 | let userTotalLocked = getUserTotalLocked(userAddress) | |
461 | 508 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
462 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
509 | + | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
510 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] ++ unitsUnlockedActions) | |
463 | 511 | } | |
464 | 512 | else throw("Strict value is not equal to itself.") | |
465 | 513 | } | |
487 | 535 | } | |
488 | 536 | ||
489 | 537 | ||
538 | + | func getUnitsClaimData (userAddress) = { | |
539 | + | let $t01848918574 = calculateUnitsToClaim(userAddress) | |
540 | + | let unlockedUnitNow = $t01848918574._1 | |
541 | + | let l2ToBurnNow = $t01848918574._2 | |
542 | + | let claimedBlock = $t01848918574._3 | |
543 | + | let unlockedUnitsPrev = valueOrElse(getInteger(this, keyUnlockedUnits(userAddress)), 0) | |
544 | + | let unitsToSend = (unlockedUnitNow + unlockedUnitsPrev) | |
545 | + | let l2ToBurnPrev = valueOrElse(getInteger(this, keyL2ToBurn(userAddress)), 0) | |
546 | + | let l2ToBurn = (l2ToBurnPrev + l2ToBurnNow) | |
547 | + | let totalUnitsClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
548 | + | let totalL2Burned = valueOrElse(getInteger(this, keyL2BurnedTotal(userAddress)), 0) | |
549 | + | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, claimedBlock) | |
550 | + | } | |
551 | + | ||
552 | + | ||
553 | + | func getClaimUnitsActions (userAddress) = { | |
554 | + | let $t01916619274 = getUnitsClaimData(userAddress) | |
555 | + | let unitsToSend = $t01916619274._1 | |
556 | + | let totalUnitsClaimed = $t01916619274._2 | |
557 | + | let l2ToBurn = $t01916619274._3 | |
558 | + | let totalL2Burned = $t01916619274._4 | |
559 | + | let claimedBlock = $t01916619274._5 | |
560 | + | let check = [if ((0 >= unitsToSend)) | |
561 | + | then true | |
562 | + | else throwErr("nothing to claim")] | |
563 | + | if ((check == check)) | |
564 | + | then { | |
565 | + | let burnAction = match l2AssetIdBytes { | |
566 | + | case id: ByteVector => | |
567 | + | [Burn(id, l2ToBurn)] | |
568 | + | case _ => | |
569 | + | nil | |
570 | + | } | |
571 | + | ([IntegerEntry(keyUnitsClaimedBlock(userAddress), claimedBlock), IntegerEntry(keyTotalUnitsClaimed(userAddress), (totalUnitsClaimed + unitsToSend)), IntegerEntry(keyL2BurnedTotal(userAddress), (totalL2Burned + l2ToBurn)), IntegerEntry(keyUnlockedUnits(userAddress), 0), IntegerEntry(keyL2ToBurn(userAddress), 0), ScriptTransfer(addressFromStringValue(userAddress), unitsToSend, unitsAssetIdBytes)] ++ burnAction) | |
572 | + | } | |
573 | + | else throw("Strict value is not equal to itself.") | |
574 | + | } | |
575 | + | ||
576 | + | ||
490 | 577 | @Callable(i) | |
491 | 578 | func setNewPeriodLength (newPeriodLength) = { | |
492 | 579 | let checks = [if (isInAdminList(toString(i.caller))) | |
500 | 587 | ||
501 | 588 | ||
502 | 589 | @Callable(i) | |
503 | - | func | |
590 | + | func claimUnits () = { | |
504 | 591 | let userAddress = toString(i.caller) | |
505 | - | let toClaimNow = calculateClaim(userAddress) | |
506 | - | let totalUnitClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
507 | - | let totalL2Staked = getUserTotalLocked(userAddress) | |
508 | - | let check = [if ((totalL2Staked >= (totalUnitClaimed + toClaimNow))) | |
509 | - | then true | |
510 | - | else throwErr("Can't claim more than staked")] | |
511 | - | if ((check == check)) | |
512 | - | then { | |
513 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
514 | - | let actions = [IntegerEntry(claimedBlockKey, height), IntegerEntry(keyTotalUnitsClaimed(userAddress), (totalUnitClaimed + toClaimNow))] | |
515 | - | let transferUnits = ScriptTransfer(i.caller, toClaimNow, unit) | |
516 | - | (actions ++ [transferUnits]) | |
517 | - | } | |
518 | - | else throw("Strict value is not equal to itself.") | |
592 | + | getClaimUnitsActions(userAddress) | |
519 | 593 | } | |
520 | 594 | ||
521 | 595 | ||
546 | 620 | ||
547 | 621 | @Callable(i) | |
548 | 622 | func getNodeDataREADONLY (nodeAddress) = { | |
549 | - | let $ | |
550 | - | let currentLease = $ | |
551 | - | let nextLeased = $ | |
623 | + | let $t02100721071 = getLeasingNodeData(nodeAddress) | |
624 | + | let currentLease = $t02100721071._1 | |
625 | + | let nextLeased = $t02100721071._2 | |
552 | 626 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
553 | 627 | } | |
554 | 628 | ||
556 | 630 | ||
557 | 631 | @Callable(i) | |
558 | 632 | func getUserLeasingDataREADONLY (nodeAddress,userAddress) = { | |
559 | - | let $ | |
560 | - | let currentLease = $ | |
561 | - | let nextLeased = $ | |
633 | + | let $t02144121518 = getUserLeasingData(nodeAddress, userAddress) | |
634 | + | let currentLease = $t02144121518._1 | |
635 | + | let nextLeased = $t02144121518._2 | |
562 | 636 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
563 | 637 | } | |
564 | 638 | ||
566 | 640 | ||
567 | 641 | @Callable(i) | |
568 | 642 | func getUserDataREADONLY (userAddress) = { | |
569 | - | let $ | |
570 | - | let toClaim = $ | |
571 | - | let toUnlock = $ | |
643 | + | let $t02203422094 = getUserToClaimBalance(userAddress) | |
644 | + | let toClaim = $t02203422094._1 | |
645 | + | let toUnlock = $t02203422094._2 | |
572 | 646 | let userTotalLocked = getUserTotalLocked(userAddress) | |
573 | - | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
647 | + | let $t02215722265 = getUnitsClaimData(userAddress) | |
648 | + | let unitsToSend = $t02215722265._1 | |
649 | + | let totalUnitsClaimed = $t02215722265._2 | |
650 | + | let l2ToBurn = $t02215722265._3 | |
651 | + | let totalL2Burned = $t02215722265._4 | |
652 | + | let claimedBlock = $t02215722265._5 | |
653 | + | $Tuple2(nil, $Tuple11(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height, unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, claimedBlock)) | |
574 | 654 | } | |
575 | 655 | ||
576 | 656 | ||
615 | 695 | @Callable(i) | |
616 | 696 | func claimAll () = { | |
617 | 697 | let userAddress = toString(i.caller) | |
618 | - | let $ | |
619 | - | let toClaim = $ | |
620 | - | let toUnlock = $ | |
698 | + | let $t02345723517 = getUserToClaimBalance(userAddress) | |
699 | + | let toClaim = $t02345723517._1 | |
700 | + | let toUnlock = $t02345723517._2 | |
621 | 701 | let checks = [if ((toClaim > 0)) | |
622 | 702 | then true | |
623 | 703 | else throwErr("nothing to claim")] | |
630 | 710 | ||
631 | 711 | @Callable(i) | |
632 | 712 | func stakeFor (userAddress) = getStakeForActions(userAddress, i) | |
713 | + | ||
714 | + | ||
715 | + | ||
716 | + | @Callable(i) | |
717 | + | func startUnitsVesting () = { | |
718 | + | let totalL2 = 100000000000000000 | |
719 | + | let totalUnits = i.payments[0].amount | |
720 | + | let unitsPerBlockScale8 = (fraction(totalL2, scale8, totalUnits) / unitsClaimInterval) | |
721 | + | let check = [if (isInAdminList(toString(i.caller))) | |
722 | + | then true | |
723 | + | else throwErr("caller is not in adminList"), if ((size(i.payments) == 1)) | |
724 | + | then true | |
725 | + | else throwErr("should be 1 payment"), if ((unitsPerBlockScale8 > 0)) | |
726 | + | then true | |
727 | + | else throwErr("units per block should be greated than 0")] | |
728 | + | if ((check == check)) | |
729 | + | then [IntegerEntry(keyUnitsPerBlockScale8, unitsPerBlockScale8), IntegerEntry(keyUnitsClaimStartHeight, height), StringEntry(keyUnitsAssetId, assetBytesToString(i.payments[0].assetId))] | |
730 | + | else throw("Strict value is not equal to itself.") | |
731 | + | } | |
633 | 732 | ||
634 | 733 | ||
635 | 734 |
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 | let BLOCKS_IN_INTERVAL = 1000 | |
9 | 9 | ||
10 | 10 | let scale8 = 100000000 | |
11 | 11 | ||
12 | + | let unitsClaimInterval = ((365 * 24) * 60) | |
13 | + | ||
12 | 14 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
13 | 15 | ||
14 | 16 | ||
15 | - | let | |
17 | + | let keyL2AssetId = makeString(["%s", "assetId"], SEP) | |
16 | 18 | ||
17 | 19 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
18 | 20 | ||
19 | 21 | let keyForceOutStop = makeString(["%s", "forceOutStop"], SEP) | |
22 | + | ||
23 | + | let keyUnitsAssetId = makeString(["%s", "unitsAssetId"], SEP) | |
24 | + | ||
25 | + | let keyUnitsPerBlockScale8 = makeString(["%s", "unitsPerBlock"], SEP) | |
20 | 26 | ||
21 | 27 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
22 | 28 | ||
23 | 29 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
24 | 30 | ||
25 | 31 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
32 | + | ||
33 | + | let keyUnitsClaimStartHeight = makeString(["%s", "unitsClaimStartHeight"], SEP) | |
26 | 34 | ||
27 | 35 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
28 | 36 | ||
29 | 37 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
30 | 38 | ||
31 | 39 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
32 | 40 | ||
33 | 41 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
34 | 42 | then (periodOffsetHeight != -1) | |
35 | 43 | else false) | |
36 | 44 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
37 | 45 | else max([0, (periodOffsetId - 1)]) | |
38 | 46 | ||
39 | 47 | let currentPeriodHeight = if (if ((periodOffsetHeight == -1)) | |
40 | 48 | then true | |
41 | 49 | else if ((currentPeriodId == 0)) | |
42 | 50 | then (periodOffsetHeight > height) | |
43 | 51 | else false) | |
44 | 52 | then 0 | |
45 | 53 | else (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
46 | 54 | ||
47 | 55 | let nextPeriodHeight = if (if ((periodOffsetHeight == -1)) | |
48 | 56 | then true | |
49 | 57 | else if ((currentPeriodId == 0)) | |
50 | 58 | then (periodOffsetHeight > height) | |
51 | 59 | else false) | |
52 | 60 | then 0 | |
53 | 61 | else (currentPeriodHeight + periodLength) | |
54 | 62 | ||
63 | + | let unitsClaimStartHeight = valueOrElse(getInteger(this, keyUnitsClaimStartHeight), height) | |
64 | + | ||
55 | 65 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
56 | 66 | ||
57 | 67 | ||
58 | 68 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
59 | 69 | ||
60 | 70 | ||
61 | 71 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
62 | 72 | ||
63 | 73 | ||
64 | 74 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
65 | 75 | ||
66 | 76 | ||
67 | - | func | |
77 | + | func keyUnitsClaimedBlock (userAddress) = makeString(["%s%s", "unitsClaimedBlock", userAddress], SEP) | |
68 | 78 | ||
69 | 79 | ||
70 | - | func keyTotalUnitsClaimed (userAddress) = makeString(["%s%s", userAddress, "totalUnitsClaimed"], SEP) | |
80 | + | func keyUnlockedUnits (userAddress) = makeString(["%s%s", "unlockedUnits", userAddress], SEP) | |
81 | + | ||
82 | + | ||
83 | + | func keyTotalUnitsClaimed (userAddress) = makeString(["%s%s", "totalUnitsClaimed", userAddress], SEP) | |
84 | + | ||
85 | + | ||
86 | + | func keyL2ToBurn (userAddress) = makeString(["%s%s", "l2ToBurn", userAddress], SEP) | |
87 | + | ||
88 | + | ||
89 | + | func keyL2BurnedTotal (userAddress) = makeString(["%s%s", "l2BurnedTotal", userAddress], SEP) | |
71 | 90 | ||
72 | 91 | ||
73 | 92 | func keyNodeLeasingByHeight (nodeAddress) = { | |
74 | 93 | let h = if ((periodOffsetHeight == -1)) | |
75 | 94 | then 0 | |
76 | 95 | else height | |
77 | 96 | makeString(["%s%d", nodeAddress, toString(h)], SEP) | |
78 | 97 | } | |
79 | 98 | ||
80 | 99 | ||
81 | 100 | func keyUserLeasingByHeight (nodeAddress,userAddress) = { | |
82 | 101 | let h = if ((periodOffsetHeight == -1)) | |
83 | 102 | then 0 | |
84 | 103 | else height | |
85 | 104 | makeString(["%s%s%d", nodeAddress, userAddress, toString(h)], SEP) | |
86 | 105 | } | |
87 | 106 | ||
88 | 107 | ||
89 | - | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
90 | - | ||
91 | - | let assetIdBytes = if ((assetIdString == "WAVES")) | |
108 | + | func assetStringToBytes (assetIdString) = if ((assetIdString == "WAVES")) | |
92 | 109 | then unit | |
93 | 110 | else fromBase58String(assetIdString) | |
111 | + | ||
112 | + | ||
113 | + | func assetBytesToString (assetId) = match assetId { | |
114 | + | case a: ByteVector => | |
115 | + | toBase58String(a) | |
116 | + | case _ => | |
117 | + | "WAVES" | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | let l2AssetIdString = valueOrElse(getString(this, keyL2AssetId), "WAVES") | |
122 | + | ||
123 | + | let unitsAssetIdString = valueOrElse(getString(this, keyUnitsAssetId), "WAVES") | |
124 | + | ||
125 | + | let l2AssetIdBytes = assetStringToBytes(l2AssetIdString) | |
126 | + | ||
127 | + | let unitsAssetIdBytes = assetStringToBytes(unitsAssetIdString) | |
94 | 128 | ||
95 | 129 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
96 | 130 | ||
97 | 131 | let isForceOutStop = valueOrElse(getBoolean(this, keyForceOutStop), false) | |
98 | 132 | ||
99 | 133 | func isValidAddress (address) = match addressFromString(address) { | |
100 | 134 | case a: Address => | |
101 | 135 | true | |
102 | 136 | case _ => | |
103 | 137 | false | |
104 | 138 | } | |
105 | 139 | ||
106 | 140 | ||
107 | 141 | let ADMIN_LIST_SIZE = 5 | |
108 | 142 | ||
109 | 143 | let QUORUM = 3 | |
110 | 144 | ||
111 | 145 | let TXID_BYTES_LENGTH = 32 | |
112 | 146 | ||
113 | 147 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
114 | 148 | ||
115 | 149 | ||
116 | 150 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
117 | 151 | ||
118 | 152 | ||
119 | 153 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
120 | 154 | ||
121 | 155 | ||
122 | 156 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
123 | 157 | ||
124 | 158 | ||
125 | 159 | func getAdminVote (prefix,admin) = { | |
126 | 160 | let voteKey = keyFullAdminVote(prefix, admin) | |
127 | 161 | valueOrElse(getInteger(voteKey), 0) | |
128 | 162 | } | |
129 | 163 | ||
130 | 164 | ||
131 | 165 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
132 | 166 | case s: String => | |
133 | 167 | split(s, SEP) | |
134 | 168 | case _ => | |
135 | 169 | nil | |
136 | 170 | } | |
137 | 171 | ||
138 | 172 | ||
139 | 173 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
140 | 174 | ||
141 | 175 | ||
142 | 176 | func genVotesKeysHelper (a,adminAddress) = { | |
143 | - | let $ | |
144 | - | let result = $ | |
145 | - | let prefix = $ | |
177 | + | let $t050215045 = a | |
178 | + | let result = $t050215045._1 | |
179 | + | let prefix = $t050215045._2 | |
146 | 180 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
147 | 181 | } | |
148 | 182 | ||
149 | 183 | ||
150 | 184 | func genVotesKeys (keyPrefix) = { | |
151 | 185 | let adminList = keyAdminAddressList() | |
152 | - | let $ | |
186 | + | let $t051925276 = { | |
153 | 187 | let $l = getAdminsList() | |
154 | 188 | let $s = size($l) | |
155 | 189 | let $acc0 = $Tuple2(nil, keyPrefix) | |
156 | 190 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | 191 | then $a | |
158 | 192 | else genVotesKeysHelper($a, $l[$i]) | |
159 | 193 | ||
160 | 194 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | 195 | then $a | |
162 | 196 | else throw("List size exceeds 5") | |
163 | 197 | ||
164 | 198 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
165 | 199 | } | |
166 | - | let result = $ | |
167 | - | let prefix = $ | |
200 | + | let result = $t051925276._1 | |
201 | + | let prefix = $t051925276._2 | |
168 | 202 | result | |
169 | 203 | } | |
170 | 204 | ||
171 | 205 | ||
172 | 206 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
173 | 207 | ||
174 | 208 | ||
175 | 209 | func countVotes (prefix) = { | |
176 | 210 | let votes = genVotesKeys(prefix) | |
177 | 211 | let $l = votes | |
178 | 212 | let $s = size($l) | |
179 | 213 | let $acc0 = 0 | |
180 | 214 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
181 | 215 | then $a | |
182 | 216 | else countVotesHelper($a, $l[$i]) | |
183 | 217 | ||
184 | 218 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
185 | 219 | then $a | |
186 | 220 | else throw("List size exceeds 5") | |
187 | 221 | ||
188 | 222 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
189 | 223 | } | |
190 | 224 | ||
191 | 225 | ||
192 | 226 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
193 | 227 | ||
194 | 228 | ||
195 | 229 | func getClearVoteEntries (prefix) = { | |
196 | 230 | let votes = genVotesKeys(prefix) | |
197 | 231 | let $l = votes | |
198 | 232 | let $s = size($l) | |
199 | 233 | let $acc0 = nil | |
200 | 234 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
201 | 235 | then $a | |
202 | 236 | else clearVotesHelper($a, $l[$i]) | |
203 | 237 | ||
204 | 238 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
205 | 239 | then $a | |
206 | 240 | else throw("List size exceeds 5") | |
207 | 241 | ||
208 | 242 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
209 | 243 | } | |
210 | 244 | ||
211 | 245 | ||
212 | 246 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
213 | 247 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
214 | 248 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
215 | 249 | let err = if (!(isInAdminList(callerAddressString))) | |
216 | 250 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
217 | 251 | else if ((adminCurrentVote == 1)) | |
218 | 252 | then throwErr((voteKey + " you already voted")) | |
219 | 253 | else unit | |
220 | 254 | if ((err == err)) | |
221 | 255 | then { | |
222 | 256 | let votes = countVotes(keyPrefix) | |
223 | 257 | if (((votes + 1) >= minVotes)) | |
224 | 258 | then { | |
225 | 259 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
226 | 260 | (clearVoteEntries ++ voteResult) | |
227 | 261 | } | |
228 | 262 | else [IntegerEntry(voteKey, 1)] | |
229 | 263 | } | |
230 | 264 | else throw("Strict value is not equal to itself.") | |
231 | 265 | } | |
232 | 266 | ||
233 | 267 | ||
234 | 268 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
235 | 269 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
236 | 270 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
237 | 271 | } | |
238 | 272 | ||
239 | 273 | ||
240 | 274 | func getLeasingNodeData (nodeAddress) = { | |
241 | 275 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
242 | 276 | match leasingNodeDataStringRaw { | |
243 | 277 | case ds: String => | |
244 | 278 | let dataList = split(ds, SEP) | |
245 | 279 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
246 | 280 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
247 | 281 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
248 | 282 | let nodeNextLeased = parseIntValue(dataList[4]) | |
249 | 283 | if (if ((nodeNextPeriod > height)) | |
250 | 284 | then true | |
251 | 285 | else (periodOffsetHeight == -1)) | |
252 | 286 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
253 | 287 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
254 | 288 | case _ => | |
255 | 289 | $Tuple2(0, 0) | |
256 | 290 | } | |
257 | 291 | } | |
258 | 292 | ||
259 | 293 | ||
260 | 294 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
261 | 295 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
262 | 296 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
263 | 297 | } | |
264 | 298 | ||
265 | 299 | ||
266 | 300 | func getUserLeasingData (nodeAddress,userAddress) = { | |
267 | 301 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
268 | 302 | match leasingUserDataStringRaw { | |
269 | 303 | case ds: String => | |
270 | 304 | let dataList = split(ds, SEP) | |
271 | 305 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
272 | 306 | let userCurrentLeased = parseIntValue(dataList[2]) | |
273 | 307 | let userNextPeriod = parseIntValue(dataList[3]) | |
274 | 308 | let userNextLeased = parseIntValue(dataList[4]) | |
275 | 309 | if (if ((userNextPeriod > height)) | |
276 | 310 | then true | |
277 | 311 | else (periodOffsetHeight == -1)) | |
278 | 312 | then $Tuple2(userCurrentLeased, userNextLeased) | |
279 | 313 | else $Tuple2(userNextLeased, userNextLeased) | |
280 | 314 | case _ => | |
281 | 315 | $Tuple2(0, 0) | |
282 | 316 | } | |
283 | 317 | } | |
284 | 318 | ||
285 | 319 | ||
286 | 320 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
287 | 321 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
288 | 322 | StringEntry(keyUserToClaim(userAddress), valueString) | |
289 | 323 | } | |
290 | 324 | ||
291 | 325 | ||
292 | 326 | func getUserToClaimBalance (userAddress) = { | |
293 | 327 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
294 | 328 | match userToClaimDataStringRaw { | |
295 | 329 | case ds: String => | |
296 | 330 | let dataList = split(ds, SEP) | |
297 | 331 | let currentPeriod = parseIntValue(dataList[1]) | |
298 | 332 | let toClaim = parseIntValue(dataList[2]) | |
299 | 333 | let nextPeriod = parseIntValue(dataList[3]) | |
300 | 334 | let toUnlock = parseIntValue(dataList[4]) | |
301 | 335 | if (if ((nextPeriod > height)) | |
302 | 336 | then true | |
303 | 337 | else (currentPeriodId == 0)) | |
304 | 338 | then $Tuple2(toClaim, toUnlock) | |
305 | 339 | else $Tuple2((toClaim + toUnlock), 0) | |
306 | 340 | case _ => | |
307 | 341 | $Tuple2(0, 0) | |
308 | 342 | } | |
309 | 343 | } | |
310 | 344 | ||
311 | 345 | ||
312 | 346 | func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked) | |
313 | 347 | ||
314 | 348 | ||
315 | 349 | func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0) | |
316 | 350 | ||
317 | 351 | ||
352 | + | func calculateUnitsToClaim (userAddress) = { | |
353 | + | let claimedBlockKey = keyUnitsClaimedBlock(userAddress) | |
354 | + | let claimedBlock = valueOrElse(getInteger(this, claimedBlockKey), unitsClaimStartHeight) | |
355 | + | let unitsPerBlockScale8 = valueOrElse(getInteger(this, keyUnitsPerBlockScale8), 0) | |
356 | + | let currentBlock = min([(unitsClaimStartHeight + unitsClaimInterval), height]) | |
357 | + | let blocksPassed = (currentBlock - claimedBlock) | |
358 | + | let amountStaked = getUserTotalLocked(userAddress) | |
359 | + | let unitsToClaimNow = fraction((unitsPerBlockScale8 * blocksPassed), amountStaked, scale8) | |
360 | + | let l2ToBurn = fraction(amountStaked, blocksPassed, unitsClaimInterval) | |
361 | + | $Tuple3(unitsToClaimNow, l2ToBurn, claimedBlock) | |
362 | + | } | |
363 | + | ||
364 | + | ||
365 | + | func getUnlockUnitsAction (userAddress) = { | |
366 | + | let kUnlockedUnits = keyUnlockedUnits(userAddress) | |
367 | + | let unlockedUnits = valueOrElse(getInteger(this, kUnlockedUnits), 0) | |
368 | + | let kL2ToBurn = keyL2ToBurn(userAddress) | |
369 | + | let l2ToBurn = valueOrElse(getInteger(this, kL2ToBurn), 0) | |
370 | + | let $t01121711302 = calculateUnitsToClaim(userAddress) | |
371 | + | let unitsToClaimNow = $t01121711302._1 | |
372 | + | let l2ToBurnNow = $t01121711302._2 | |
373 | + | let claimedBlock = $t01121711302._3 | |
374 | + | if ((0 >= unitsToClaimNow)) | |
375 | + | then nil | |
376 | + | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), claimedBlock), IntegerEntry(kL2ToBurn, (l2ToBurn + l2ToBurnNow)), IntegerEntry(kUnlockedUnits, (unlockedUnits + unitsToClaimNow))] | |
377 | + | } | |
378 | + | ||
379 | + | ||
318 | 380 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
319 | - | let $ | |
320 | - | let nodeCurrentLeased = $ | |
321 | - | let nodeNextLeased = $ | |
322 | - | let $ | |
323 | - | let userCurrentLeased = $ | |
324 | - | let userNextLeased = $ | |
381 | + | let $t01169711770 = getLeasingNodeData(nodeAddress) | |
382 | + | let nodeCurrentLeased = $t01169711770._1 | |
383 | + | let nodeNextLeased = $t01169711770._2 | |
384 | + | let $t01177511861 = getUserLeasingData(nodeAddress, userAddress) | |
385 | + | let userCurrentLeased = $t01177511861._1 | |
386 | + | let userNextLeased = $t01177511861._2 | |
325 | 387 | let checks = [if (!(isForceStop)) | |
326 | 388 | then true | |
327 | 389 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
328 | 390 | then true | |
329 | 391 | else throwErr("unstake is temporary disabled"), if ((unstakeAmount > 0)) | |
330 | 392 | then true | |
331 | 393 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
332 | 394 | then true | |
333 | 395 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
334 | 396 | then true | |
335 | 397 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
336 | 398 | then true | |
337 | 399 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
338 | 400 | then true | |
339 | 401 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
340 | 402 | if ((checks == checks)) | |
341 | 403 | then { | |
342 | 404 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
343 | 405 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
344 | - | let $ | |
345 | - | let toClaim = $ | |
346 | - | let toUnlock = $ | |
406 | + | let $t01274512805 = getUserToClaimBalance(userAddress) | |
407 | + | let toClaim = $t01274512805._1 | |
408 | + | let toUnlock = $t01274512805._2 | |
347 | 409 | let newToUnlock = (toUnlock + unstakeAmount) | |
348 | 410 | let userTotalLocked = getUserTotalLocked(userAddress) | |
349 | 411 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
350 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
412 | + | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
413 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] ++ unitsUnlockedActions) | |
351 | 414 | } | |
352 | 415 | else throw("Strict value is not equal to itself.") | |
353 | 416 | } | |
354 | 417 | ||
355 | 418 | ||
356 | 419 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
357 | - | let $ | |
358 | - | let toClaim = $ | |
359 | - | let toUnlock = $ | |
420 | + | let $t01362413684 = getUserToClaimBalance(userAddress) | |
421 | + | let toClaim = $t01362413684._1 | |
422 | + | let toUnlock = $t01362413684._2 | |
360 | 423 | let checks = [if (!(isForceStop)) | |
361 | 424 | then true | |
362 | 425 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
363 | 426 | then true | |
364 | 427 | else throwErr("claim is temporary disabled"), if ((claimAmount > 0)) | |
365 | 428 | then true | |
366 | 429 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
367 | 430 | then true | |
368 | 431 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
369 | 432 | then true | |
370 | 433 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
371 | 434 | if ((checks == checks)) | |
372 | 435 | then { | |
373 | 436 | let newToClaim = (toClaim - claimAmount) | |
374 | - | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, | |
437 | + | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, l2AssetIdBytes)] | |
375 | 438 | } | |
376 | 439 | else throw("Strict value is not equal to itself.") | |
377 | 440 | } | |
378 | 441 | ||
379 | 442 | ||
380 | 443 | func getStakeForActions (userAddress,i) = { | |
381 | - | let $ | |
382 | - | let toClaim = $ | |
383 | - | let toUnlock = $ | |
444 | + | let $t01445014510 = getUserToClaimBalance(userAddress) | |
445 | + | let toClaim = $t01445014510._1 | |
446 | + | let toUnlock = $t01445014510._2 | |
384 | 447 | let checks = [if (!(isForceStop)) | |
385 | 448 | then true | |
386 | 449 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
387 | 450 | then true | |
388 | 451 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
389 | 452 | then true | |
390 | - | else (i.payments[0].assetId == | |
453 | + | else (i.payments[0].assetId == l2AssetIdBytes)) | |
391 | 454 | then true | |
392 | - | else throwErr(makeString(["payment assetId should be:", | |
455 | + | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if (isValidAddress(userAddress)) | |
393 | 456 | then true | |
394 | 457 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
395 | 458 | if ((checks == checks)) | |
396 | 459 | then { | |
397 | 460 | let newToClaim = (toClaim + i.payments[0].amount) | |
398 | 461 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock)] | |
399 | 462 | } | |
400 | 463 | else throw("Strict value is not equal to itself.") | |
401 | 464 | } | |
402 | 465 | ||
403 | 466 | ||
404 | - | func calculateClaim (userAddress) = { | |
405 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
406 | - | let claimedBlock = valueOrElse(getInteger(this, claimedBlockKey), height) | |
407 | - | let blocksPassed = (height - claimedBlock) | |
408 | - | let amountStaked = getUserTotalLocked(userAddress) | |
409 | - | let toClaimNow = ((blocksPassed * (amountStaked * scale8)) / BLOCKS_IN_INTERVAL) | |
410 | - | toClaimNow | |
411 | - | } | |
412 | - | ||
413 | - | ||
414 | - | func setUser (userAddress,claimedBlock) = { | |
415 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
416 | - | [IntegerEntry(claimedBlockKey, claimedBlock)] | |
417 | - | } | |
418 | - | ||
419 | - | ||
420 | 467 | func getStakeActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
421 | - | let $ | |
422 | - | let toClaim = $ | |
423 | - | let toUnlock = $ | |
468 | + | let $t01524215302 = getUserToClaimBalance(userAddress) | |
469 | + | let toClaim = $t01524215302._1 | |
470 | + | let toUnlock = $t01524215302._2 | |
424 | 471 | let paymentAmount = if ((size(i.payments) == 0)) | |
425 | 472 | then 0 | |
426 | 473 | else i.payments[0].amount | |
427 | 474 | let available = ((toUnlock + toClaim) + paymentAmount) | |
428 | 475 | let checks = [if (!(isForceStop)) | |
429 | 476 | then true | |
430 | 477 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
431 | 478 | then true | |
432 | 479 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
433 | 480 | then true | |
434 | - | else (i.payments[0].assetId == | |
481 | + | else (i.payments[0].assetId == l2AssetIdBytes)) | |
435 | 482 | then true | |
436 | - | else throwErr(makeString(["payment assetId should be:", | |
483 | + | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if ((userLeasingAmount > 0)) | |
437 | 484 | then true | |
438 | 485 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
439 | 486 | then true | |
440 | 487 | else throwErr("amount should be less or equal (payment + available) amount"), if ((userLeasingAmount >= paymentAmount)) | |
441 | 488 | then true | |
442 | 489 | else throw("amount should be greater or equal payment amount"), if (isValidAddress(nodeAddress)) | |
443 | 490 | then true | |
444 | 491 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
445 | 492 | then true | |
446 | 493 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
447 | 494 | if ((checks == checks)) | |
448 | 495 | then { | |
449 | - | let $ | |
450 | - | let nodeCurrentLeased = $ | |
451 | - | let nodeNextLeased = $ | |
496 | + | let $t01637716450 = getLeasingNodeData(nodeAddress) | |
497 | + | let nodeCurrentLeased = $t01637716450._1 | |
498 | + | let nodeNextLeased = $t01637716450._2 | |
452 | 499 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
453 | - | let $ | |
454 | - | let userCurrentLeased = $ | |
455 | - | let userNextLeased = $ | |
500 | + | let $t01651816604 = getUserLeasingData(nodeAddress, userAddress) | |
501 | + | let userCurrentLeased = $t01651816604._1 | |
502 | + | let userNextLeased = $t01651816604._2 | |
456 | 503 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
457 | 504 | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
458 | 505 | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
459 | 506 | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
460 | 507 | let userTotalLocked = getUserTotalLocked(userAddress) | |
461 | 508 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
462 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
509 | + | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
510 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] ++ unitsUnlockedActions) | |
463 | 511 | } | |
464 | 512 | else throw("Strict value is not equal to itself.") | |
465 | 513 | } | |
466 | 514 | ||
467 | 515 | ||
468 | 516 | func getStakeFromPaymentActions (nodeAddress,userAddress,i) = { | |
469 | 517 | let checks = [if ((size(i.payments) == 1)) | |
470 | 518 | then true | |
471 | 519 | else throwErr("payment size should be exactly 1")] | |
472 | 520 | if ((checks == checks)) | |
473 | 521 | then getStakeActions(nodeAddress, userAddress, i.payments[0].amount, i) | |
474 | 522 | else throw("Strict value is not equal to itself.") | |
475 | 523 | } | |
476 | 524 | ||
477 | 525 | ||
478 | 526 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
479 | 527 | let check = [if ((newPeriodLength > 0)) | |
480 | 528 | then true | |
481 | 529 | else throwErr("period length should be greater than 0")] | |
482 | 530 | if ((check == check)) | |
483 | 531 | then if ((periodOffsetHeight == -1)) | |
484 | 532 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
485 | 533 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
486 | 534 | else throw("Strict value is not equal to itself.") | |
487 | 535 | } | |
488 | 536 | ||
489 | 537 | ||
538 | + | func getUnitsClaimData (userAddress) = { | |
539 | + | let $t01848918574 = calculateUnitsToClaim(userAddress) | |
540 | + | let unlockedUnitNow = $t01848918574._1 | |
541 | + | let l2ToBurnNow = $t01848918574._2 | |
542 | + | let claimedBlock = $t01848918574._3 | |
543 | + | let unlockedUnitsPrev = valueOrElse(getInteger(this, keyUnlockedUnits(userAddress)), 0) | |
544 | + | let unitsToSend = (unlockedUnitNow + unlockedUnitsPrev) | |
545 | + | let l2ToBurnPrev = valueOrElse(getInteger(this, keyL2ToBurn(userAddress)), 0) | |
546 | + | let l2ToBurn = (l2ToBurnPrev + l2ToBurnNow) | |
547 | + | let totalUnitsClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
548 | + | let totalL2Burned = valueOrElse(getInteger(this, keyL2BurnedTotal(userAddress)), 0) | |
549 | + | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, claimedBlock) | |
550 | + | } | |
551 | + | ||
552 | + | ||
553 | + | func getClaimUnitsActions (userAddress) = { | |
554 | + | let $t01916619274 = getUnitsClaimData(userAddress) | |
555 | + | let unitsToSend = $t01916619274._1 | |
556 | + | let totalUnitsClaimed = $t01916619274._2 | |
557 | + | let l2ToBurn = $t01916619274._3 | |
558 | + | let totalL2Burned = $t01916619274._4 | |
559 | + | let claimedBlock = $t01916619274._5 | |
560 | + | let check = [if ((0 >= unitsToSend)) | |
561 | + | then true | |
562 | + | else throwErr("nothing to claim")] | |
563 | + | if ((check == check)) | |
564 | + | then { | |
565 | + | let burnAction = match l2AssetIdBytes { | |
566 | + | case id: ByteVector => | |
567 | + | [Burn(id, l2ToBurn)] | |
568 | + | case _ => | |
569 | + | nil | |
570 | + | } | |
571 | + | ([IntegerEntry(keyUnitsClaimedBlock(userAddress), claimedBlock), IntegerEntry(keyTotalUnitsClaimed(userAddress), (totalUnitsClaimed + unitsToSend)), IntegerEntry(keyL2BurnedTotal(userAddress), (totalL2Burned + l2ToBurn)), IntegerEntry(keyUnlockedUnits(userAddress), 0), IntegerEntry(keyL2ToBurn(userAddress), 0), ScriptTransfer(addressFromStringValue(userAddress), unitsToSend, unitsAssetIdBytes)] ++ burnAction) | |
572 | + | } | |
573 | + | else throw("Strict value is not equal to itself.") | |
574 | + | } | |
575 | + | ||
576 | + | ||
490 | 577 | @Callable(i) | |
491 | 578 | func setNewPeriodLength (newPeriodLength) = { | |
492 | 579 | let checks = [if (isInAdminList(toString(i.caller))) | |
493 | 580 | then true | |
494 | 581 | else throwErr("caller is not in adminList")] | |
495 | 582 | if ((checks == checks)) | |
496 | 583 | then getSetNewPeriodLengthActions(newPeriodLength) | |
497 | 584 | else throw("Strict value is not equal to itself.") | |
498 | 585 | } | |
499 | 586 | ||
500 | 587 | ||
501 | 588 | ||
502 | 589 | @Callable(i) | |
503 | - | func | |
590 | + | func claimUnits () = { | |
504 | 591 | let userAddress = toString(i.caller) | |
505 | - | let toClaimNow = calculateClaim(userAddress) | |
506 | - | let totalUnitClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
507 | - | let totalL2Staked = getUserTotalLocked(userAddress) | |
508 | - | let check = [if ((totalL2Staked >= (totalUnitClaimed + toClaimNow))) | |
509 | - | then true | |
510 | - | else throwErr("Can't claim more than staked")] | |
511 | - | if ((check == check)) | |
512 | - | then { | |
513 | - | let claimedBlockKey = keyClaimedBlock(userAddress) | |
514 | - | let actions = [IntegerEntry(claimedBlockKey, height), IntegerEntry(keyTotalUnitsClaimed(userAddress), (totalUnitClaimed + toClaimNow))] | |
515 | - | let transferUnits = ScriptTransfer(i.caller, toClaimNow, unit) | |
516 | - | (actions ++ [transferUnits]) | |
517 | - | } | |
518 | - | else throw("Strict value is not equal to itself.") | |
592 | + | getClaimUnitsActions(userAddress) | |
519 | 593 | } | |
520 | 594 | ||
521 | 595 | ||
522 | 596 | ||
523 | 597 | @Callable(i) | |
524 | 598 | func setForceStopFlag (stop) = { | |
525 | 599 | let check = [if (isInAdminList(toString(i.caller))) | |
526 | 600 | then true | |
527 | 601 | else throwErr("caller is not in adminList")] | |
528 | 602 | if ((check == check)) | |
529 | 603 | then [BooleanEntry(keyForceStop, stop)] | |
530 | 604 | else throw("Strict value is not equal to itself.") | |
531 | 605 | } | |
532 | 606 | ||
533 | 607 | ||
534 | 608 | ||
535 | 609 | @Callable(i) | |
536 | 610 | func setForceOutStopFlag (stop) = { | |
537 | 611 | let check = [if (isInAdminList(toString(i.caller))) | |
538 | 612 | then true | |
539 | 613 | else throwErr("caller is not in adminList")] | |
540 | 614 | if ((check == check)) | |
541 | 615 | then [BooleanEntry(keyForceOutStop, stop)] | |
542 | 616 | else throw("Strict value is not equal to itself.") | |
543 | 617 | } | |
544 | 618 | ||
545 | 619 | ||
546 | 620 | ||
547 | 621 | @Callable(i) | |
548 | 622 | func getNodeDataREADONLY (nodeAddress) = { | |
549 | - | let $ | |
550 | - | let currentLease = $ | |
551 | - | let nextLeased = $ | |
623 | + | let $t02100721071 = getLeasingNodeData(nodeAddress) | |
624 | + | let currentLease = $t02100721071._1 | |
625 | + | let nextLeased = $t02100721071._2 | |
552 | 626 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
553 | 627 | } | |
554 | 628 | ||
555 | 629 | ||
556 | 630 | ||
557 | 631 | @Callable(i) | |
558 | 632 | func getUserLeasingDataREADONLY (nodeAddress,userAddress) = { | |
559 | - | let $ | |
560 | - | let currentLease = $ | |
561 | - | let nextLeased = $ | |
633 | + | let $t02144121518 = getUserLeasingData(nodeAddress, userAddress) | |
634 | + | let currentLease = $t02144121518._1 | |
635 | + | let nextLeased = $t02144121518._2 | |
562 | 636 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
563 | 637 | } | |
564 | 638 | ||
565 | 639 | ||
566 | 640 | ||
567 | 641 | @Callable(i) | |
568 | 642 | func getUserDataREADONLY (userAddress) = { | |
569 | - | let $ | |
570 | - | let toClaim = $ | |
571 | - | let toUnlock = $ | |
643 | + | let $t02203422094 = getUserToClaimBalance(userAddress) | |
644 | + | let toClaim = $t02203422094._1 | |
645 | + | let toUnlock = $t02203422094._2 | |
572 | 646 | let userTotalLocked = getUserTotalLocked(userAddress) | |
573 | - | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
647 | + | let $t02215722265 = getUnitsClaimData(userAddress) | |
648 | + | let unitsToSend = $t02215722265._1 | |
649 | + | let totalUnitsClaimed = $t02215722265._2 | |
650 | + | let l2ToBurn = $t02215722265._3 | |
651 | + | let totalL2Burned = $t02215722265._4 | |
652 | + | let claimedBlock = $t02215722265._5 | |
653 | + | $Tuple2(nil, $Tuple11(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height, unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, claimedBlock)) | |
574 | 654 | } | |
575 | 655 | ||
576 | 656 | ||
577 | 657 | ||
578 | 658 | @Callable(i) | |
579 | 659 | func leaseByAddress (nodeAddress,userAddress) = getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
580 | 660 | ||
581 | 661 | ||
582 | 662 | ||
583 | 663 | @Callable(i) | |
584 | 664 | func lease (nodeAddress) = { | |
585 | 665 | let userAddress = toString(i.caller) | |
586 | 666 | getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
587 | 667 | } | |
588 | 668 | ||
589 | 669 | ||
590 | 670 | ||
591 | 671 | @Callable(i) | |
592 | 672 | func leaseFromLocked (nodeAddress,amount) = { | |
593 | 673 | let userAddress = toString(i.caller) | |
594 | 674 | getStakeActions(nodeAddress, userAddress, amount, i) | |
595 | 675 | } | |
596 | 676 | ||
597 | 677 | ||
598 | 678 | ||
599 | 679 | @Callable(i) | |
600 | 680 | func cancelLease (nodeAddress,amount) = { | |
601 | 681 | let userAddress = toString(i.caller) | |
602 | 682 | getUnstakeActions(nodeAddress, userAddress, amount) | |
603 | 683 | } | |
604 | 684 | ||
605 | 685 | ||
606 | 686 | ||
607 | 687 | @Callable(i) | |
608 | 688 | func claim (amount) = { | |
609 | 689 | let userAddress = toString(i.caller) | |
610 | 690 | getClaimUnlockedActions(userAddress, amount) | |
611 | 691 | } | |
612 | 692 | ||
613 | 693 | ||
614 | 694 | ||
615 | 695 | @Callable(i) | |
616 | 696 | func claimAll () = { | |
617 | 697 | let userAddress = toString(i.caller) | |
618 | - | let $ | |
619 | - | let toClaim = $ | |
620 | - | let toUnlock = $ | |
698 | + | let $t02345723517 = getUserToClaimBalance(userAddress) | |
699 | + | let toClaim = $t02345723517._1 | |
700 | + | let toUnlock = $t02345723517._2 | |
621 | 701 | let checks = [if ((toClaim > 0)) | |
622 | 702 | then true | |
623 | 703 | else throwErr("nothing to claim")] | |
624 | 704 | if ((checks == checks)) | |
625 | 705 | then getClaimUnlockedActions(userAddress, toClaim) | |
626 | 706 | else throw("Strict value is not equal to itself.") | |
627 | 707 | } | |
628 | 708 | ||
629 | 709 | ||
630 | 710 | ||
631 | 711 | @Callable(i) | |
632 | 712 | func stakeFor (userAddress) = getStakeForActions(userAddress, i) | |
713 | + | ||
714 | + | ||
715 | + | ||
716 | + | @Callable(i) | |
717 | + | func startUnitsVesting () = { | |
718 | + | let totalL2 = 100000000000000000 | |
719 | + | let totalUnits = i.payments[0].amount | |
720 | + | let unitsPerBlockScale8 = (fraction(totalL2, scale8, totalUnits) / unitsClaimInterval) | |
721 | + | let check = [if (isInAdminList(toString(i.caller))) | |
722 | + | then true | |
723 | + | else throwErr("caller is not in adminList"), if ((size(i.payments) == 1)) | |
724 | + | then true | |
725 | + | else throwErr("should be 1 payment"), if ((unitsPerBlockScale8 > 0)) | |
726 | + | then true | |
727 | + | else throwErr("units per block should be greated than 0")] | |
728 | + | if ((check == check)) | |
729 | + | then [IntegerEntry(keyUnitsPerBlockScale8, unitsPerBlockScale8), IntegerEntry(keyUnitsClaimStartHeight, height), StringEntry(keyUnitsAssetId, assetBytesToString(i.payments[0].assetId))] | |
730 | + | else throw("Strict value is not equal to itself.") | |
731 | + | } | |
633 | 732 | ||
634 | 733 | ||
635 | 734 | ||
636 | 735 | @Callable(i) | |
637 | 736 | func voteForTxId (txId) = { | |
638 | 737 | let callerAddressString = toBase58String(i.caller.bytes) | |
639 | 738 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
640 | 739 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
641 | 740 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
642 | 741 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
643 | 742 | then true | |
644 | 743 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
645 | 744 | then true | |
646 | 745 | else (value(allowedTxIdOption) != txId)) | |
647 | 746 | then true | |
648 | 747 | else throwErr((txId + " is already allowed"))] | |
649 | 748 | if ((err == err)) | |
650 | 749 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
651 | 750 | else throw("Strict value is not equal to itself.") | |
652 | 751 | } | |
653 | 752 | ||
654 | 753 | ||
655 | 754 | @Verifier(tx) | |
656 | 755 | func verify () = { | |
657 | 756 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
658 | 757 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
659 | 758 | then false | |
660 | 759 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
661 | 760 | if (byAdmins) | |
662 | 761 | then true | |
663 | 762 | else byOwner | |
664 | 763 | } | |
665 | 764 |
github/deemru/w8io/026f985 96.03 ms ◑