tx · AfETrorqRgfDLe8aNB3cyztx4w7J6VoRCmTCmmHiUNqb

3MpKmkFmjoGLpPWhScheYrN7fjdJAFp9tEX:  -0.01400000 Waves

2020.10.08 22:36 [1212019] smart account 3MpKmkFmjoGLpPWhScheYrN7fjdJAFp9tEX > SELF 0.00000000 Waves

{ "type": 13, "id": "AfETrorqRgfDLe8aNB3cyztx4w7J6VoRCmTCmmHiUNqb", "fee": 1400000, "feeAssetId": null, "timestamp": 1602185861320, "version": 2, "chainId": 84, "sender": "3MpKmkFmjoGLpPWhScheYrN7fjdJAFp9tEX", "senderPublicKey": "33Gr5uEJMDMKdRs25QUDvTeQ7q5EpGcAdPztrFvQWdv9", "proofs": [ "2ZWM2tx8xviZfb7t7JzHh3b7fS4gX3uQBs45TSWw1hAKRJv3FTB8u2gsB9F5d78VyaUL9CzxcM7oHVEEEtLB4r2p" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAEAAAAAA9mcm9zdEJsb2NrQ291bnQAAAAAAAAAAGQAAAAAB3BlcmNlbnQAAAAAAAAAABQBAAAADGdldFN0YXRpc3RpYwAAAAAEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAAJc3RhdGlzdGljAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAADTBfMF8wXzBfMF8wXzABAAAAB2dldFVzZXIAAAABAAAABHVzZXIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAAEdXNlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAABcwXzBfMF8wXzBfMF8wXzBfMF8wXzBfMAAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAA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AAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAEAAAAgHkxz8qzFYQy/gEmjfxlkGkg1N6RMNBT1/p4yXLb8QTIGKOiE1A==", "height": 1212019, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Cgrg89DV4jpbv6UBzU7Wyqq538vEjXaPtY3WXdHHpBwK Next: EVtVE3LyYrcrmiNZbC7kij6kxHyMknRkGfKFMtspBQ26 Diff:
OldNewDifferences
3636 let sum = ((pmt.amount / 100) * (100 + percent))
3737 let user = split(getUser(currentKey), "_")
3838 let userData2 = parseIntValue(user[2])
39- WriteSet([DataEntry("statistic", ((((((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + "_") + statistic[5]) + "_") + statistic[6])), DataEntry(currentKey, (((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]))])
39+ WriteSet([DataEntry("statistic", ((((((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + "_") + statistic[5]) + "_") + statistic[6])), DataEntry(currentKey, ((((((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]) + "_"))])
4040 }
4141 }
4242 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let frostBlockCount = 100
55
66 let percent = 20
77
88 func getStatistic () = match getString(this, "statistic") {
99 case a: String =>
1010 a
1111 case _ =>
1212 "0_0_0_0_0_0_0"
1313 }
1414
1515
1616 func getUser (user) = match getString(this, user) {
1717 case a: String =>
1818 a
1919 case _ =>
2020 "0_0_0_0_0_0_0_0_0_0_0_0"
2121 }
2222
2323
2424 @Callable(i)
2525 func deposit () = {
2626 let pmt = extract(i.payment)
2727 if (isDefined(pmt.assetId))
2828 then throw("can hodl waves only at the moment")
2929 else {
3030 let currentKey = toBase58String(i.caller.bytes)
3131 if ((currentKey == "3N2hHaqEEXjFHE5G8NTw6v7KNMwcHob2Ena"))
3232 then WriteSet([DataEntry("statistic", getStatistic())])
3333 else {
3434 let statistic = split(getStatistic(), "_")
3535 let blockHeight = lastBlock.height
3636 let sum = ((pmt.amount / 100) * (100 + percent))
3737 let user = split(getUser(currentKey), "_")
3838 let userData2 = parseIntValue(user[2])
39- WriteSet([DataEntry("statistic", ((((((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + "_") + statistic[5]) + "_") + statistic[6])), DataEntry(currentKey, (((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]))])
39+ WriteSet([DataEntry("statistic", ((((((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + "_") + statistic[5]) + "_") + statistic[6])), DataEntry(currentKey, ((((((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]) + "_"))])
4040 }
4141 }
4242 }
4343
4444
4545
4646 @Callable(i)
4747 func withdraw (amount) = {
4848 let currentKey = toBase58String(i.caller.bytes)
4949 let user = split(getUser(currentKey), "_")
5050 let statistic = split(getStatistic(), "_")
5151 let oldAmount = parseIntValue(user[2])
5252 let newAmount = (oldAmount - amount)
5353 let blockHeight = lastBlock.height
5454 let frostBlockHeight = parseIntValue(user[1])
5555 let defrostBlockHeight = (frostBlockHeight + frostBlockCount)
5656 let sumWithdraw = (parseIntValue(user[2]) + amount)
5757 let maxWithdraw = if ((blockHeight >= defrostBlockHeight))
5858 then oldAmount
5959 else ((frostBlockCount - (defrostBlockHeight - blockHeight)) * (oldAmount / frostBlockCount))
6060 if ((0 > amount))
6161 then throw("Can't withdraw negative amount")
6262 else if ((amount > maxWithdraw))
6363 then throw(("Max sum: " + toString(maxWithdraw)))
6464 else if ((0 > newAmount))
6565 then throw("Not enough balance")
6666 else ScriptResult(WriteSet([DataEntry("statistic", (((((((((statistic[0] + "_") + statistic[1]) + "_") + toString((parseIntValue(statistic[2]) + amount))) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[4]) + statistic[5])), DataEntry(currentKey, ((((((((((((((((((((((user[0] + "_") + user[1]) + "_") + toString(newAmount)) + "_") + user[3]) + "_") + toString(blockHeight)) + "_") + toString((parseIntValue(user[5]) + amount))) + "_") + toString((parseIntValue(user[6]) + amount))) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]))]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
6767 }
6868
6969
7070 @Verifier(tx)
7171 func verify () = match tx {
7272 case d: SetScriptTransaction =>
7373 sigVerify(tx.bodyBytes, tx.proofs[0], base58'33Gr5uEJMDMKdRs25QUDvTeQ7q5EpGcAdPztrFvQWdv9')
7474 case _ =>
7575 true
7676 }
7777

github/deemru/w8io/169f3d6 
39.55 ms