tx · 57KAy3WDXNrFtUN5iLoZSz7gLFfN8Ly4GaUPFvuWmvZc

3Mtwm9zTenpozLfVL46hAidH3zuLKScURQK:  -0.01400000 Waves

2021.11.17 16:57 [1795122] smart account 3Mtwm9zTenpozLfVL46hAidH3zuLKScURQK > SELF 0.00000000 Waves

{ "type": 13, "id": "57KAy3WDXNrFtUN5iLoZSz7gLFfN8Ly4GaUPFvuWmvZc", "fee": 1400000, "feeAssetId": null, "timestamp": 1637157493998, "version": 2, "chainId": 84, "sender": "3Mtwm9zTenpozLfVL46hAidH3zuLKScURQK", "senderPublicKey": "Eu1AYNJAMgEeS5Wftr8wEFyspBRFVBv9qQV7XCYzGpxn", "proofs": [ "4KYqKxkt8v9mQoteGeBM3otwgXFhHG8y7rs8PDzuwKxuRUKAFKJzv2UJ4cwdnTMbpvNyac3t7JneZJzPvU5hm8h" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQESAAAAAAgAAAAACkRJU0NMQUlNRVICAAAARXRlc3RpbmcgUFVaWkxFIHN0YWtpbmcgc21hcnQgY29udHJhY3Qgd2l0aCByZXdhcmRzIGluIG11bHRpcGxlIGFzc2V0cwAAAAAFc2NhbGUAAAAAAAX14QAAAAAACHB1enpsZUlkAQAAACD+xBrh3u/naSJ9Eujvd+1d33EPvCCH0lpodP3xbghYNwAAAAAMZWFybmVkQXNzZXRzCQAETAAAAAIBAAAAIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkCQAETAAAAAIBAAAAILYmKcME9c5TkaQOS3UkL2SMUbH6369UKb1I0h0qsqrRCQAETAAAAAIBAAAAIMsNZWEOiZVYNXpBi2Ybb1youCxEjpzJ+bYYhbDils6dCQAETAAAAAIBAAAAIJWeoqHE/VM6llJihm3Pbu4DsBTneJAmzXJqqfw3qIHoCQAETAAAAAIBAAAAIERMQj0IfbtQ71vvD6lMQZsjo7R1kbzVylNCXNNKY0ExCQAETAAAAAIBAAAAIDxTA10LiK0+XoDGc8iIJH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": 1795122, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AFMkPUJdUV6m4NXpK5M9MzZ7Sq9S2aUPqQHvit9os2t2 Next: Am7RAxgqgvi8rY2bdNnhXnbc6wFE3JshPYw8q8LMKykX Diff:
OldNewDifferences
55
66 let scale = 100000000
77
8-let puzzleId = base58'5PFDy4GuDdeKLfKwcdm65s9y3MiEB7w1yEiEDkXNSCSU'
8+let puzzleId = base58'J9VzWPfRSQyCbEv5oWpxLSihigbpbJsGBHJZV9Ct8ook'
99
1010 let earnedAssets = [base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H', base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p', base58'EfdcPXw7o7rrrPWmMBr2sa66Dk95n56622ngujbaGhye', base58'B543bkZcZNo5GrUnd5fxB6EwkiJhAVyKCkPn5nWzZC2s', base58'5bcAh1r6ydrpk44FEmrnmJQjumgKo3NKEEsyfgmZYwxC', base58'54UszKAj3MtYmkdRCqSXAcaQLaVALBy7CCrVkfmfzhxR', base58'5nk9JW8yRonyNBEwhChoksLxpBECVxbVLqaNuQs9EJn1', base58'Dfx6LJPndo1h5Umk9SofDhMDs6Gi8cHyT3873pSgoASU', base58'4kwKSf4Bx2Wq8YxKnVZBhcEHyXzEtJ2pw7ixfJgirwf2', base58'Ej7kEzxvUsoiMtJKiuFpMD9tC6qfCADpZynyW2vqcWW', base58'5HGPPLj58XUx3ryMgkASJoqYq33zwBbTMf1CGxfKw6jp', base58'yDf4UTg4DS75sCNP7oC1HraTN4KHtqmd6WueTid4PF1', base58'2R57nL7ftpuwbgdprcmAeA9i7ykLH6A4wzLkZHWPiHKc', base58'CE5cxMvz7865CyFZPFUmDiL4KRkYXP6b6oYgN3vmWdV5', base58'5m5stLsMZSPomwxTTjJGMMEnjMafRMfap5vZyaLwgMKD', base58'46PdJcKzDuYfzLuLNjffM3F8jR8hL357V9AdGK2xN3kx', base58'ESaD2AREvgk7o4C9eQkZ8Nmau9BSHqgTK5ymHV36xocy']
1111
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let DISCLAIMER = "testing PUZZLE staking smart contract with rewards in multiple assets"
55
66 let scale = 100000000
77
8-let puzzleId = base58'5PFDy4GuDdeKLfKwcdm65s9y3MiEB7w1yEiEDkXNSCSU'
8+let puzzleId = base58'J9VzWPfRSQyCbEv5oWpxLSihigbpbJsGBHJZV9Ct8ook'
99
1010 let earnedAssets = [base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H', base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p', base58'EfdcPXw7o7rrrPWmMBr2sa66Dk95n56622ngujbaGhye', base58'B543bkZcZNo5GrUnd5fxB6EwkiJhAVyKCkPn5nWzZC2s', base58'5bcAh1r6ydrpk44FEmrnmJQjumgKo3NKEEsyfgmZYwxC', base58'54UszKAj3MtYmkdRCqSXAcaQLaVALBy7CCrVkfmfzhxR', base58'5nk9JW8yRonyNBEwhChoksLxpBECVxbVLqaNuQs9EJn1', base58'Dfx6LJPndo1h5Umk9SofDhMDs6Gi8cHyT3873pSgoASU', base58'4kwKSf4Bx2Wq8YxKnVZBhcEHyXzEtJ2pw7ixfJgirwf2', base58'Ej7kEzxvUsoiMtJKiuFpMD9tC6qfCADpZynyW2vqcWW', base58'5HGPPLj58XUx3ryMgkASJoqYq33zwBbTMf1CGxfKw6jp', base58'yDf4UTg4DS75sCNP7oC1HraTN4KHtqmd6WueTid4PF1', base58'2R57nL7ftpuwbgdprcmAeA9i7ykLH6A4wzLkZHWPiHKc', base58'CE5cxMvz7865CyFZPFUmDiL4KRkYXP6b6oYgN3vmWdV5', base58'5m5stLsMZSPomwxTTjJGMMEnjMafRMfap5vZyaLwgMKD', base58'46PdJcKzDuYfzLuLNjffM3F8jR8hL357V9AdGK2xN3kx', base58'ESaD2AREvgk7o4C9eQkZ8Nmau9BSHqgTK5ymHV36xocy']
1111
1212 let earnedAssetsAmount = size(earnedAssets)
1313
1414 func tryGetInteger (key) = match getInteger(this, key) {
1515 case b: Int =>
1616 b
1717 case _ =>
1818 0
1919 }
2020
2121
2222 func calculateCurrentAssetInterest (assetId,assetIdStr) = {
2323 let totalStaked = tryGetInteger("global_puzzleStaked")
2424 let tokenBalanceLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings"))
2525 let currentTokenEarnings = max([tokenBalanceLastCheck, assetBalance(this, assetId)])
2626 let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck)
2727 let newInterest = if ((totalStaked == 0))
2828 then 0
2929 else fraction(newEarnings, scale, totalStaked)
3030 let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
3131 (lastCheckInterest + newInterest)
3232 }
3333
3434
3535 func claimResult (address) = {
3636 let addressStr = toString(address)
3737 let puzzleAmount = tryGetInteger((addressStr + "_puzzleStaked"))
3838 func handler (accum,assetId) = {
3939 let assetIdStr = toBase58String(assetId)
4040 let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr)
4141 let currentTokenEarnings = max([tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings")), assetBalance(this, assetId)])
4242 let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), scale)
4343 if ((rewardAmount == 0))
4444 then accum
4545 else (accum ++ [IntegerEntry((("global_lastCheck_" + assetIdStr) + "_earnings"), (currentTokenEarnings - rewardAmount)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentTokenInterest), ScriptTransfer(address, rewardAmount, assetId)])
4646 }
4747
4848 let $l = earnedAssets
4949 let $s = size($l)
5050 let $acc0 = nil
5151 func 1 ($a,$i) = if (($i >= $s))
5252 then $a
5353 else handler($a, $l[$i])
5454
5555 func 2 ($a,$i) = if (($i >= $s))
5656 then $a
5757 else throw("List size exceeds 17")
5858
5959 2(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
6060 }
6161
6262
6363 @Callable(i)
6464 func stake () = {
6565 let addressStr = toString(i.caller)
6666 let pmt = i.payments[0]
6767 if ((value(pmt.assetId) != puzzleId))
6868 then throw("wrong asset attached")
6969 else {
7070 func handler (accum,assetId) = {
7171 let assetIdStr = toBase58String(assetId)
7272 let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr)
7373 (accum ++ [IntegerEntry((("global_lastCheck_" + assetIdStr) + "_earnings"), assetBalance(this, assetId)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentTokenInterest)])
7474 }
7575
7676 let li = {
7777 let $l = earnedAssets
7878 let $s = size($l)
7979 let $acc0 = nil
8080 func 1 ($a,$i) = if (($i >= $s))
8181 then $a
8282 else handler($a, $l[$i])
8383
8484 func 2 ($a,$i) = if (($i >= $s))
8585 then $a
8686 else throw("List size exceeds 17")
8787
8888 2(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
8989 }
9090 (li ++ [IntegerEntry((addressStr + "_puzzleStaked"), (tryGetInteger((addressStr + "_puzzleStaked")) + pmt.amount)), IntegerEntry("global_puzzleStaked", (tryGetInteger("global_puzzleStaked") + pmt.amount))])
9191 }
9292 }
9393
9494
9595
9696 @Callable(i)
9797 func unstake (puzzleAmount) = {
9898 let addressStr = toString(i.caller)
9999 let puzzleAvailable = tryGetInteger((addressStr + "_puzzleStaked"))
100100 if ((puzzleAmount > puzzleAvailable))
101101 then throw("you don't have PUZZLE available")
102102 else (claimResult(i.caller) ++ [IntegerEntry((addressStr + "_puzzleStaked"), (puzzleAvailable - puzzleAmount)), IntegerEntry("global_puzzleStaked", (tryGetInteger("global_puzzleStaked") - puzzleAmount))])
103103 }
104104
105105
106106
107107 @Callable(i)
108108 func claim () = claimResult(i.caller)
109109
110110
111111 @Verifier(tx)
112112 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
113113

github/deemru/w8io/169f3d6 
31.41 ms