tx · HN2kPArSP8XEVsyLnxwMR12CwdrrMPzw7VoG7WPBV7Wa

3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2:  -0.05000000 Waves

2022.12.22 14:59 [2371474] smart account 3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2 > SELF 0.00000000 Waves

{ "type": 13, "id": "HN2kPArSP8XEVsyLnxwMR12CwdrrMPzw7VoG7WPBV7Wa", "fee": 5000000, "feeAssetId": null, "timestamp": 1671710445664, "version": 2, "chainId": 84, "sender": "3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2", "senderPublicKey": "3XEAduJnZeFRL74JfaQk7MgrGDo9a9xREYyfLvyivREU", "proofs": [ "3NrqanwMWrvLcByJd9VqfvgvZtRm46J9P8YRmNHY57QWwpSNXYtEoFQ3FwNGBe6Y7oMFQxV3AQ8BwbmeBZ6AkqJ3" ], "script": "base64:BgIRCAISAwoBCBIDCgEIEgMKAQgGAA9NRVNTQUdFX0NPVU5URVICD21lc3NhZ2VfY291bnRlcgANRk9MTE9XX1NUUklORwIHZm9sbG93cwAQVFdFRVRfS0VZX1NUUklORwIGdHdlZXRfARFnZXRNZXNzYWdlQ291bnRlcgAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUPTUVTU0FHRV9DT1VOVEVSAAABKWdldExhdGVzdFR3ZWV0SWZGcm9tU29tZW9uZUFkZHJlc3NGb2xsb3dzAgVhY2N1bQZwYXJhbXMEB2FkZHJlc3MEByRtYXRjaDAJAJEDAgUGcGFyYW1zAAEDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFzBQckbWF0Y2gwBQFzAgAEBm9mZnNldAQHJG1hdGNoMAkAkQMCBQZwYXJhbXMAAAMJAAECBQckbWF0Y2gwAgNJbnQEAWkFByRtYXRjaDAFAWkAAAQObWVzc2FnZUNvdW50ZXIJARFnZXRNZXNzYWdlQ291bnRlcgAEB3R3ZWV0SWQJAQt2YWx1ZU9yRWxzZQIJAKIIAQkArAICBRBUV0VFVF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XNzYWdlQ291bnRlcgkAzAgCCQELU3RyaW5nRW50cnkCBQZtc2dLZXkFB21lc3NhZ2UJAMwIAgkBC1N0cmluZ0VudHJ5AgUIdHdlZXRLZXkFBm1zZ0tleQkAzAgCCQEMSW50ZWdlckVudHJ5AgUPTUVTU0FHRV9DT1VOVEVSBQ5tZXNzYWdlQ291bnRlcgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tled24Z2Q=", "height": 2371474, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HN4iZCyeZZF51XTw3M3DzytsAE2Shaw7zuxCCoWKfsPB Next: none Diff:
OldNewDifferences
3535 }
3636
3737
38-func getLatestTweetsFromFollowingAddresses (address) = {
39- let list = [[0, address], [1, address], [2, address], [3, address], [4, address], [5, address], [6, address], [7, address], [8, address], [9, address]]
38+func getLatestTweetsFromFollowingAddresses (address,offset) = {
39+ let list = [[(0 + offset), address], [(1 + offset), address], [(2 + offset), address], [(3 + offset), address], [(4 + offset), address], [(5 + offset), address], [(6 + offset), address], [(7 + offset), address], [(8 + offset), address], [(9 + offset), address]]
4040 let $l = list
4141 let $s = size($l)
4242 let $acc0 = nil
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MESSAGE_COUNTER = "message_counter"
55
66 let FOLLOW_STRING = "follows"
77
88 let TWEET_KEY_STRING = "tweet_"
99
1010 func getMessageCounter () = valueOrElse(getInteger(MESSAGE_COUNTER), 0)
1111
1212
1313 func getLatestTweetIfFromSomeoneAddressFollows (accum,params) = {
1414 let address = match params[1] {
1515 case s: String =>
1616 s
1717 case _ =>
1818 ""
1919 }
2020 let offset = match params[0] {
2121 case i: Int =>
2222 i
2323 case _ =>
2424 0
2525 }
2626 let messageCounter = getMessageCounter()
2727 let tweetId = valueOrElse(getString((TWEET_KEY_STRING + toString((messageCounter - offset)))), "")
2828 let parts = split(tweetId, "_")
2929 let sender = parts[0]
3030 let keyToCheckFollowing = ((((address + "_") + FOLLOW_STRING) + "_") + sender)
3131 let following = valueOrElse(getBoolean(keyToCheckFollowing), false)
3232 if (following)
3333 then (accum :+ getString(tweetId))
3434 else accum
3535 }
3636
3737
38-func getLatestTweetsFromFollowingAddresses (address) = {
39- let list = [[0, address], [1, address], [2, address], [3, address], [4, address], [5, address], [6, address], [7, address], [8, address], [9, address]]
38+func getLatestTweetsFromFollowingAddresses (address,offset) = {
39+ let list = [[(0 + offset), address], [(1 + offset), address], [(2 + offset), address], [(3 + offset), address], [(4 + offset), address], [(5 + offset), address], [(6 + offset), address], [(7 + offset), address], [(8 + offset), address], [(9 + offset), address]]
4040 let $l = list
4141 let $s = size($l)
4242 let $acc0 = nil
4343 func $f0_1 ($a,$i) = if (($i >= $s))
4444 then $a
4545 else getLatestTweetIfFromSomeoneAddressFollows($a, $l[$i])
4646
4747 func $f0_2 ($a,$i) = if (($i >= $s))
4848 then $a
4949 else throw("List size exceeds 10")
5050
5151 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
5252 }
5353
5454
5555 @Callable(i)
5656 func follow (address) = {
5757 let sender = toString(i.caller)
5858 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
5959 [BooleanEntry(followKey, true)]
6060 }
6161
6262
6363
6464 @Callable(i)
6565 func unfollow (address) = {
6666 let sender = toString(i.caller)
6767 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
6868 [DeleteEntry(followKey)]
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func tweet (message) = {
7575 let messageCounter = (getMessageCounter() + 1)
7676 let sender = toString(i.caller)
7777 let txId = toBase58String(i.transactionId)
7878 let msgKey = ((sender + "_") + txId)
7979 let tweetKey = (TWEET_KEY_STRING + toString(messageCounter))
8080 [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)]
8181 }
8282
8383
8484 @Verifier(tx)
8585 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
8686

github/deemru/w8io/169f3d6 
52.72 ms