tx · 8RDBbqchKHDpMCkXTgXAKcs2CjwrDVh84iKKwqUy1RHn

3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2:  -0.05000000 Waves

2022.12.22 14:44 [2371458] smart account 3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2 > SELF 0.00000000 Waves

{ "type": 13, "id": "8RDBbqchKHDpMCkXTgXAKcs2CjwrDVh84iKKwqUy1RHn", "fee": 5000000, "feeAssetId": null, "timestamp": 1671709473579, "version": 2, "chainId": 84, "sender": "3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2", "senderPublicKey": "3XEAduJnZeFRL74JfaQk7MgrGDo9a9xREYyfLvyivREU", "proofs": [ "H8CoXCD7Lj6XfqZAVyyMXLvRsvXvvSuzwAwuHuXR6swoSXgZHwZeRuPbvWjB1SremY7b39aMQZiFh2DLDbXHKwi" ], "script": "base64:BgIRCAISAwoBCBIDCgEIEgMKAQgGAA9NRVNTQUdFX0NPVU5URVICD21lc3NhZ2VfY291bnRlcgANRk9MTE9XX1NUUklORwIHZm9sbG93cwAQVFdFRVRfS0VZX1NUUklORwIGdHdlZXRfARFnZXRNZXNzYWdlQ291bnRlcgAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUPTUVTU0FHRV9DT1VOVEVSAAABKWdldExhdGVzdFR3ZWV0SWZGcm9tU29tZW9uZUFkZHJlc3NGb2xsb3dzAgVhY2N1bQZwYXJhbXMEB2FkZHJlc3MEByRtYXRjaDAJAJEDAgUGcGFyYW1zAAEDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFzBQckbWF0Y2gwBQFzAgAEBm9mZnNldAQHJG1hdGNoMAkAkQMCBQZwYXJhbXMAAAMJAAECBQckbWF0Y2gwAgNJbnQEAWkFByRtYXRjaDAFAWkAAAQObWVzc2FnZUNvdW50ZXIJARFnZXRNZXNzYWdlQ291bnRlcgAEB3R3ZWV0SWQJAQt2YWx1ZU9yRWxzZQIJAKIIAQkArAICBRBUV0VFVF9LRVlf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kVudHJ5AgUJZm9sbG93S2V5BgUDbmlsAWkBCHVuZm9sbG93AQdhZGRyZXNzBAZzZW5kZXIJAKUIAQgFAWkGY2FsbGVyBAlmb2xsb3dLZXkJAKwCAgkArAICCQCsAgIJAKwCAgUGc2VuZGVyAgFfBQ1GT0xMT1dfU1RSSU5HAgFfBQdhZGRyZXNzCQDMCAIJAQtEZWxldGVFbnRyeQEFCWZvbGxvd0tleQUDbmlsAWkBBXR3ZWV0AQdtZXNzYWdlBA5tZXNzYWdlQ291bnRlcgkAZAIJARFnZXRNZXNzYWdlQ291bnRlcgAAAQQGc2VuZGVyCQClCAEIBQFpBmNhbGxlcgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAZtc2dLZXkJAKwCAgkArAICBQZzZW5kZXICAV8FBHR4SWQECHR3ZWV0S2V5CQCsAgIFEFRXRUVUX0tFWV9TVFJJTkcJAKQDAQUObWVzc2FnZUNvdW50ZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgUGbXNnS2V5BQdtZXNzYWdlCQDMCAIJAQtTdHJpbmdFbnRyeQIFCHR3ZWV0S2V5BQZtc2dLZXkJAMwIAgkBDEludGVnZXJFbnRyeQIFD01FU1NBR0VfQ09VTlRFUgUObWVzc2FnZUNvdW50ZXIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlO3Kx2", "height": 2371458, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9YhdhF59bKVXCBEFwTYseRGCbc2h46RGpakR82MWURs9 Next: ELmRELFADPT7UAgT7bo8HdMB35Pt5A7LYEqe68MUWMxu Diff:
OldNewDifferences
1010 func getMessageCounter () = valueOrElse(getInteger(MESSAGE_COUNTER), 0)
1111
1212
13-func getLatestTweetIfFromSomeoneAddressFollows (accum,offset) = {
14- let address = "3MuSvxzfzqLTDPq1j5mTHwK5tLx5ChDcQMi"
13+func getLatestTweetIfFromSomeoneAddressFollows (accum,params) = {
14+ let address = match params[1] {
15+ case s: String =>
16+ s
17+ case _ =>
18+ ""
19+ }
20+ let offset = match params[0] {
21+ case i: Int =>
22+ i
23+ case _ =>
24+ 0
25+ }
1526 let messageCounter = getMessageCounter()
1627 let tweetId = valueOrElse(getString((TWEET_KEY_STRING + toString((messageCounter - offset)))), "")
1728 let parts = split(tweetId, "_")
2536
2637
2738 func getLatestTweetsFromFollowingAddresses (address) = {
28- let list = [0, 1, 2]
39+ let list = [[0, address], [1, address], [2, address]]
2940 let $l = list
3041 let $s = size($l)
3142 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
13-func getLatestTweetIfFromSomeoneAddressFollows (accum,offset) = {
14- let address = "3MuSvxzfzqLTDPq1j5mTHwK5tLx5ChDcQMi"
13+func getLatestTweetIfFromSomeoneAddressFollows (accum,params) = {
14+ let address = match params[1] {
15+ case s: String =>
16+ s
17+ case _ =>
18+ ""
19+ }
20+ let offset = match params[0] {
21+ case i: Int =>
22+ i
23+ case _ =>
24+ 0
25+ }
1526 let messageCounter = getMessageCounter()
1627 let tweetId = valueOrElse(getString((TWEET_KEY_STRING + toString((messageCounter - offset)))), "")
1728 let parts = split(tweetId, "_")
1829 let sender = parts[0]
1930 let keyToCheckFollowing = ((((address + "_") + FOLLOW_STRING) + "_") + sender)
2031 let following = valueOrElse(getBoolean(keyToCheckFollowing), false)
2132 if (following)
2233 then (accum :+ getString(tweetId))
2334 else accum
2435 }
2536
2637
2738 func getLatestTweetsFromFollowingAddresses (address) = {
28- let list = [0, 1, 2]
39+ let list = [[0, address], [1, address], [2, address]]
2940 let $l = list
3041 let $s = size($l)
3142 let $acc0 = nil
3243 func $f0_1 ($a,$i) = if (($i >= $s))
3344 then $a
3445 else getLatestTweetIfFromSomeoneAddressFollows($a, $l[$i])
3546
3647 func $f0_2 ($a,$i) = if (($i >= $s))
3748 then $a
3849 else throw("List size exceeds 3")
3950
4051 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
4152 }
4253
4354
4455 @Callable(i)
4556 func follow (address) = {
4657 let sender = toString(i.caller)
4758 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
4859 [BooleanEntry(followKey, true)]
4960 }
5061
5162
5263
5364 @Callable(i)
5465 func unfollow (address) = {
5566 let sender = toString(i.caller)
5667 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
5768 [DeleteEntry(followKey)]
5869 }
5970
6071
6172
6273 @Callable(i)
6374 func tweet (message) = {
6475 let messageCounter = (getMessageCounter() + 1)
6576 let sender = toString(i.caller)
6677 let txId = toBase58String(i.transactionId)
6778 let msgKey = ((sender + "_") + txId)
6879 let tweetKey = (TWEET_KEY_STRING + toString(messageCounter))
6980 [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)]
7081 }
7182
7283
7384 @Verifier(tx)
7485 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7586

github/deemru/w8io/169f3d6 
39.19 ms