tx · 7asKqh4U2DurHxd9sLRBYeWynuPoiby3kJEMvFEjjqix

3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2:  -0.05000000 Waves

2022.12.21 18:32 [2370235] smart account 3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2 > SELF 0.00000000 Waves

{ "type": 13, "id": "7asKqh4U2DurHxd9sLRBYeWynuPoiby3kJEMvFEjjqix", "fee": 5000000, "feeAssetId": null, "timestamp": 1671636779584, "version": 2, "chainId": 84, "sender": "3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2", "senderPublicKey": "3XEAduJnZeFRL74JfaQk7MgrGDo9a9xREYyfLvyivREU", "proofs": [ "2pGUWNxwxwnfwu653MsYS1Udh1hSrYZarhPx1FiKe54Bypa8R93Asgs79Gmy9mLAazX5YhYES88sYVB4w5JYVTVQ" ], "script": "base64:BgIRCAISAwoBCBIDCgEIEgMKAQgFAA9NRVNTQUdFX0NPVU5URVICD21lc3NhZ2VfY291bnRlcgANRk9MTE9XX1NUUklORwIHZm9sbG93cwAQVFdFRVRfS0VZX1NUUklORwIGdHdlZXRfARFnZXRNZXNzYWdlQ291bnRlcgAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUPTUVTU0FHRV9DT1VOVEVSAAABG2dldExhdGVzdFR3ZWV0SWZGcm9tQWRkcmVzcwEHYWRkcmVzcwQObWVzc2FnZUNvdW50ZXIJARFnZXRNZXNzYWdlQ291bnRlcgAEB3R3ZWV0SWQJAQt2YWx1ZU9yRWxzZQIJAKIIAQkArAICBRBUV0VFVF9LRVlfU1RSSU5HCQCkAwEFDm1lc3NhZ2VDb3VudGVyAgAEBXBhcnRzCQC1CQIFB3R3ZWV0SWQCAV8EBnNlbmRlcgkAkQMCBQVwYXJ0cwAAAwkAAAIFBnNlbmRlcgUHYWRkcmVzcwkAoggBBQd0d2VldElkAgADAWkBBmZvbGxvdwEHYWRkcmVzcwQGc2VuZGVyCQClCAEIBQFpBmNhbGxlcgQJZm9sbG93S2V5CQCsAgIJAKwCAgkArAICCQCsAgIFBnNlbmRlcgIBXwUNRk9MTE9XX1NUUklORwIBXwUHYWRkcmVzcwkAzAgCCQEMQm9vbGVhbkVudHJ5AgUJZm9sbG93S2V5BgUDbmlsAWkBCHVuZm9sbG93AQdhZGRyZXNzBAZzZW5kZXIJAKUIAQgFAWkGY2FsbGVyBAlmb2xsb3dLZXkJAKwCAgkArAICCQCsAgIJAKwCAgUGc2VuZGVyAgFfBQ1GT0xMT1dfU1RSSU5HAgFfBQdhZGRyZXNzCQDMCAIJAQtEZWxldGVFbnRyeQEFCWZvbGxvd0tleQUDbmlsAWkBBXR3ZWV0AQdtZXNzYWdlBA5tZXNzYWdlQ291bnRlcgkAZAIJARFnZXRNZXNzYWdlQ291bnRlcgAAAQQGc2VuZGVyCQClCAEIBQFpBmNhbGxlcgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAZtc2dLZXkJAKwCAgkArAICBQZzZW5kZXICAV8FBHR4SWQECHR3ZWV0S2V5CQCsAgIFEFRXRUVUX0tFWV9TVFJJTkcJAKQDAQUObWVzc2FnZUNvdW50ZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgUGbXNnS2V5BQdtZXNzYWdlCQDMCAIJAQtTdHJpbmdFbnRyeQIFCHR3ZWV0S2V5BQZtc2dLZXkJAMwIAgkBDEludGVnZXJFbnRyeQIFD01FU1NBR0VfQ09VTlRFUgUObWVzc2FnZUNvdW50ZXIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXk9y4nT", "height": 2370235, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CLpirwaS6k9K9CEqrFDHbYCGdK9RGZCFQkp5FM5ELsC9 Next: HLjZ4B25xaugnjDtdDuZU9geDgFkX7kfZHBLqZqx2meF Diff:
OldNewDifferences
88 let TWEET_KEY_STRING = "tweet_"
99
1010 func getMessageCounter () = valueOrElse(getInteger(MESSAGE_COUNTER), 0)
11+
12+
13+func getLatestTweetIfFromAddress (address) = {
14+ let messageCounter = getMessageCounter()
15+ let tweetId = valueOrElse(getString((TWEET_KEY_STRING + toString(messageCounter))), "")
16+ let parts = split(tweetId, "_")
17+ let sender = parts[0]
18+ if ((sender == address))
19+ then getString(tweetId)
20+ else ""
21+ }
1122
1223
1324 @Callable(i)
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)
11+
12+
13+func getLatestTweetIfFromAddress (address) = {
14+ let messageCounter = getMessageCounter()
15+ let tweetId = valueOrElse(getString((TWEET_KEY_STRING + toString(messageCounter))), "")
16+ let parts = split(tweetId, "_")
17+ let sender = parts[0]
18+ if ((sender == address))
19+ then getString(tweetId)
20+ else ""
21+ }
1122
1223
1324 @Callable(i)
1425 func follow (address) = {
1526 let sender = toString(i.caller)
1627 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
1728 [BooleanEntry(followKey, true)]
1829 }
1930
2031
2132
2233 @Callable(i)
2334 func unfollow (address) = {
2435 let sender = toString(i.caller)
2536 let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address)
2637 [DeleteEntry(followKey)]
2738 }
2839
2940
3041
3142 @Callable(i)
3243 func tweet (message) = {
3344 let messageCounter = (getMessageCounter() + 1)
3445 let sender = toString(i.caller)
3546 let txId = toBase58String(i.transactionId)
3647 let msgKey = ((sender + "_") + txId)
3748 let tweetKey = (TWEET_KEY_STRING + toString(messageCounter))
3849 [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)]
3950 }
4051
4152
4253 @Verifier(tx)
4354 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
4455

github/deemru/w8io/169f3d6 
41.49 ms