tx · CLpirwaS6k9K9CEqrFDHbYCGdK9RGZCFQkp5FM5ELsC9
3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2: -0.05000000 Waves
2022.12.21 18:18 [2370222] smart account 3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2 > SELF 0.00000000 Waves
{
"type": 13,
"id": "CLpirwaS6k9K9CEqrFDHbYCGdK9RGZCFQkp5FM5ELsC9",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1671635961960,
"version": 2,
"chainId": 84,
"sender": "3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2",
"senderPublicKey": "3XEAduJnZeFRL74JfaQk7MgrGDo9a9xREYyfLvyivREU",
"proofs": [
"KBwRU5YAWxwuFdxLT4sbcv9hGeoSwkXA9f3w6dtv2XSpkQRLo9tDfxuPqwG7bh9FrWfJmDULj96zzKVeKiAGogv"
],
"script": "base64:BgIRCAISAwoBCBIDCgEIEgMKAQgEAA9NRVNTQUdFX0NPVU5URVICD21lc3NhZ2VfY291bnRlcgANRk9MTE9XX1NUUklORwIHZm9sbG93cwAQVFdFRVRfS0VZX1NUUklORwIGdHdlZXRfARFnZXRNZXNzYWdlQ291bnRlcgAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUPTUVTU0FHRV9DT1VOVEVSAAADAWkBBmZvbGxvdwEHYWRkcmVzcwQGc2VuZGVyCQClCAEIBQFpBmNhbGxlcgQJZm9sbG93S2V5CQCsAgIJAKwCAgkArAICCQCsAgIFBnNlbmRlcgIBXwUNRk9MTE9XX1NUUklORwIBXwUHYWRkcmVzcwkAzAgCCQEMQm9vbGVhbkVudHJ5AgUJZm9sbG93S2V5BgUDbmlsAWkBCHVuZm9sbG93AQdhZGRyZXNzBAZzZW5kZXIJAKUIAQgFAWkGY2FsbGVyBAlmb2xsb3dLZXkJAKwCAgkArAICCQCsAgIJAKwCAgUGc2VuZGVyAgFfBQ1GT0xMT1dfU1RSSU5HAgFfBQdhZGRyZXNzCQDMCAIJAQtEZWxldGVFbnRyeQEFCWZvbGxvd0tleQUDbmlsAWkBBXR3ZWV0AQdtZXNzYWdlBA5tZXNzYWdlQ291bnRlcgkAZAIJARFnZXRNZXNzYWdlQ291bnRlcgAAAQQGc2VuZGVyCQClCAEIBQFpBmNhbGxlcgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAZtc2dLZXkJAKwCAgkArAICBQZzZW5kZXICAV8FBHR4SWQECHR3ZWV0S2V5CQCsAgIFEFRXRUVUX0tFWV9TVFJJTkcJAKQDAQUObWVzc2FnZUNvdW50ZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgUGbXNnS2V5BQdtZXNzYWdlCQDMCAIJAQtTdHJpbmdFbnRyeQIFCHR3ZWV0S2V5BQZtc2dLZXkJAMwIAgkBDEludGVnZXJFbnRyeQIFD01FU1NBR0VfQ09VTlRFUgUObWVzc2FnZUNvdW50ZXIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXnjMG6R",
"height": 2370222,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: PRE32GEqXMQr7GJyVYC7jyCJ8LsECErPzpFrT6inoiv
Next: 7asKqh4U2DurHxd9sLRBYeWynuPoiby3kJEMvFEjjqix
Diff:
Old | New | | Differences |
---|
4 | 4 | | let MESSAGE_COUNTER = "message_counter" |
---|
5 | 5 | | |
---|
6 | 6 | | let FOLLOW_STRING = "follows" |
---|
| 7 | + | |
---|
| 8 | + | let TWEET_KEY_STRING = "tweet_" |
---|
7 | 9 | | |
---|
8 | 10 | | func getMessageCounter () = valueOrElse(getInteger(MESSAGE_COUNTER), 0) |
---|
9 | 11 | | |
---|
|
28 | 30 | | |
---|
29 | 31 | | @Callable(i) |
---|
30 | 32 | | func tweet (message) = { |
---|
31 | | - | let messageCounter = getMessageCounter() |
---|
| 33 | + | let messageCounter = (getMessageCounter() + 1) |
---|
32 | 34 | | let sender = toString(i.caller) |
---|
33 | 35 | | let txId = toBase58String(i.transactionId) |
---|
34 | 36 | | let msgKey = ((sender + "_") + txId) |
---|
35 | | - | [StringEntry(msgKey, message), IntegerEntry(MESSAGE_COUNTER, (messageCounter + 1))] |
---|
| 37 | + | let tweetKey = (TWEET_KEY_STRING + toString(messageCounter)) |
---|
| 38 | + | [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)] |
---|
36 | 39 | | } |
---|
37 | 40 | | |
---|
38 | 41 | | |
---|
Full:
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 | + | |
---|
| 8 | + | let TWEET_KEY_STRING = "tweet_" |
---|
7 | 9 | | |
---|
8 | 10 | | func getMessageCounter () = valueOrElse(getInteger(MESSAGE_COUNTER), 0) |
---|
9 | 11 | | |
---|
10 | 12 | | |
---|
11 | 13 | | @Callable(i) |
---|
12 | 14 | | func follow (address) = { |
---|
13 | 15 | | let sender = toString(i.caller) |
---|
14 | 16 | | let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address) |
---|
15 | 17 | | [BooleanEntry(followKey, true)] |
---|
16 | 18 | | } |
---|
17 | 19 | | |
---|
18 | 20 | | |
---|
19 | 21 | | |
---|
20 | 22 | | @Callable(i) |
---|
21 | 23 | | func unfollow (address) = { |
---|
22 | 24 | | let sender = toString(i.caller) |
---|
23 | 25 | | let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address) |
---|
24 | 26 | | [DeleteEntry(followKey)] |
---|
25 | 27 | | } |
---|
26 | 28 | | |
---|
27 | 29 | | |
---|
28 | 30 | | |
---|
29 | 31 | | @Callable(i) |
---|
30 | 32 | | func tweet (message) = { |
---|
31 | | - | let messageCounter = getMessageCounter() |
---|
| 33 | + | let messageCounter = (getMessageCounter() + 1) |
---|
32 | 34 | | let sender = toString(i.caller) |
---|
33 | 35 | | let txId = toBase58String(i.transactionId) |
---|
34 | 36 | | let msgKey = ((sender + "_") + txId) |
---|
35 | | - | [StringEntry(msgKey, message), IntegerEntry(MESSAGE_COUNTER, (messageCounter + 1))] |
---|
| 37 | + | let tweetKey = (TWEET_KEY_STRING + toString(messageCounter)) |
---|
| 38 | + | [StringEntry(msgKey, message), StringEntry(tweetKey, msgKey), IntegerEntry(MESSAGE_COUNTER, messageCounter)] |
---|
36 | 39 | | } |
---|
37 | 40 | | |
---|
38 | 41 | | |
---|
39 | 42 | | @Verifier(tx) |
---|
40 | 43 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
41 | 44 | | |
---|