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:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let TWEET_KEY_STRING = "tweet_" | |
9 | 9 | ||
10 | 10 | 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 | + | } | |
11 | 22 | ||
12 | 23 | ||
13 | 24 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MESSAGE_COUNTER = "message_counter" | |
5 | 5 | ||
6 | 6 | let FOLLOW_STRING = "follows" | |
7 | 7 | ||
8 | 8 | let TWEET_KEY_STRING = "tweet_" | |
9 | 9 | ||
10 | 10 | 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 | + | } | |
11 | 22 | ||
12 | 23 | ||
13 | 24 | @Callable(i) | |
14 | 25 | func follow (address) = { | |
15 | 26 | let sender = toString(i.caller) | |
16 | 27 | let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address) | |
17 | 28 | [BooleanEntry(followKey, true)] | |
18 | 29 | } | |
19 | 30 | ||
20 | 31 | ||
21 | 32 | ||
22 | 33 | @Callable(i) | |
23 | 34 | func unfollow (address) = { | |
24 | 35 | let sender = toString(i.caller) | |
25 | 36 | let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address) | |
26 | 37 | [DeleteEntry(followKey)] | |
27 | 38 | } | |
28 | 39 | ||
29 | 40 | ||
30 | 41 | ||
31 | 42 | @Callable(i) | |
32 | 43 | func tweet (message) = { | |
33 | 44 | let messageCounter = (getMessageCounter() + 1) | |
34 | 45 | let sender = toString(i.caller) | |
35 | 46 | let txId = toBase58String(i.transactionId) | |
36 | 47 | let msgKey = ((sender + "_") + txId) | |
37 | 48 | let tweetKey = (TWEET_KEY_STRING + toString(messageCounter)) | |
38 | 49 | [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)] | |
39 | 50 | } | |
40 | 51 | ||
41 | 52 | ||
42 | 53 | @Verifier(tx) | |
43 | 54 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
44 | 55 |
github/deemru/w8io/169f3d6 41.49 ms ◑