tx · 359kdoujesvz3rkkEnUsrcfivRbnBzHV8Xiwsq7CAkUW
3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2: -0.05000000 Waves
2022.12.21 13:45 [2369951] smart account 3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2 > SELF 0.00000000 Waves
{
"type": 13,
"id": "359kdoujesvz3rkkEnUsrcfivRbnBzHV8Xiwsq7CAkUW",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1671619559123,
"version": 2,
"chainId": 84,
"sender": "3N3evGP2tTeuXuq3iHz13Wrjm7BonuiSMd2",
"senderPublicKey": "3XEAduJnZeFRL74JfaQk7MgrGDo9a9xREYyfLvyivREU",
"proofs": [
"3aP3qnc9WFPpYWcDUpCuaR4a2mxX6Q76RHuLEZyC2oiQwxnPJ7UPEyvvbnTSkHRpkRJgVtLwPPEzbLVnbSQsf31H"
],
"script": "base64:BgIMCAISAwoBCBIDCgEIAwAPTUVTU0FHRV9DT1VOVEVSAg9tZXNzYWdlX2NvdW50ZXIADUZPTExPV19TVFJJTkcCB2ZvbGxvd3MBEWdldE1lc3NhZ2VDb3VudGVyAAQHJG1hdGNoMAkBEUBleHRyTmF0aXZlKDEwNTApAgUEdGhpcwUPTUVTU0FHRV9DT1VOVEVSAwkAAQIFByRtYXRjaDACA0ludAQBaQUHJG1hdGNoMAUBaQAAAgFpAQZmb2xsb3cBB2FkZHJlc3MEBnNlbmRlcgkApQgBCAUBaQZjYWxsZXIECWZvbGxvd0tleQkArAICCQCsAgIJAKwCAgkArAICBQZzZW5kZXICAV8FDUZPTExPV19TVFJJTkcCAV8FB2FkZHJlc3MJAMwIAgkBDEJvb2xlYW5FbnRyeQIFCWZvbGxvd0tleQYFA25pbAFpAQV0d2VldAEHbWVzc2FnZQQObWVzc2FnZUNvdW50ZXIJARFnZXRNZXNzYWdlQ291bnRlcgAEBnNlbmRlcgkApQgBCAUBaQZjYWxsZXIEBHR4SWQJANgEAQgFAWkNdHJhbnNhY3Rpb25JZAQGbXNnS2V5CQCsAgIJAKwCAgUGc2VuZGVyAgFfBQR0eElkCQDMCAIJAQtTdHJpbmdFbnRyeQIFBm1zZ0tleQUHbWVzc2FnZQkAzAgCCQEMSW50ZWdlckVudHJ5AgUPTUVTU0FHRV9DT1VOVEVSCQBkAgUObWVzc2FnZUNvdW50ZXIAAQUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQ5WESw=",
"height": 2369951,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 7covVun4yb5d4BHNARbfB95CciN32yrBPR9CAkrMH4YC
Next: Bx9ht7EedCbdEBnDNhhKnPhCWw6ZrL6DHLWpu5Rb59J3
Diff:
Old | New | | Differences |
---|
4 | 4 | | let MESSAGE_COUNTER = "message_counter" |
---|
5 | 5 | | |
---|
6 | 6 | | let FOLLOW_STRING = "follows" |
---|
| 7 | + | |
---|
| 8 | + | func getMessageCounter () = match getIntegerValue(this, MESSAGE_COUNTER) { |
---|
| 9 | + | case i: Int => |
---|
| 10 | + | i |
---|
| 11 | + | case _ => |
---|
| 12 | + | 0 |
---|
| 13 | + | } |
---|
| 14 | + | |
---|
7 | 15 | | |
---|
8 | 16 | | @Callable(i) |
---|
9 | 17 | | func follow (address) = { |
---|
|
16 | 24 | | |
---|
17 | 25 | | @Callable(i) |
---|
18 | 26 | | func tweet (message) = { |
---|
19 | | - | let messageCounter = getIntegerValue(this, MESSAGE_COUNTER) |
---|
| 27 | + | let messageCounter = getMessageCounter() |
---|
20 | 28 | | let sender = toString(i.caller) |
---|
21 | 29 | | let txId = toBase58String(i.transactionId) |
---|
22 | 30 | | let msgKey = ((sender + "_") + txId) |
---|
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 | + | func getMessageCounter () = match getIntegerValue(this, MESSAGE_COUNTER) { |
---|
| 9 | + | case i: Int => |
---|
| 10 | + | i |
---|
| 11 | + | case _ => |
---|
| 12 | + | 0 |
---|
| 13 | + | } |
---|
| 14 | + | |
---|
7 | 15 | | |
---|
8 | 16 | | @Callable(i) |
---|
9 | 17 | | func follow (address) = { |
---|
10 | 18 | | let sender = toString(i.caller) |
---|
11 | 19 | | let followKey = ((((sender + "_") + FOLLOW_STRING) + "_") + address) |
---|
12 | 20 | | [BooleanEntry(followKey, true)] |
---|
13 | 21 | | } |
---|
14 | 22 | | |
---|
15 | 23 | | |
---|
16 | 24 | | |
---|
17 | 25 | | @Callable(i) |
---|
18 | 26 | | func tweet (message) = { |
---|
19 | | - | let messageCounter = getIntegerValue(this, MESSAGE_COUNTER) |
---|
| 27 | + | let messageCounter = getMessageCounter() |
---|
20 | 28 | | let sender = toString(i.caller) |
---|
21 | 29 | | let txId = toBase58String(i.transactionId) |
---|
22 | 30 | | let msgKey = ((sender + "_") + txId) |
---|
23 | 31 | | [StringEntry(msgKey, message), IntegerEntry(MESSAGE_COUNTER, (messageCounter + 1))] |
---|
24 | 32 | | } |
---|
25 | 33 | | |
---|
26 | 34 | | |
---|
27 | 35 | | @Verifier(tx) |
---|
28 | 36 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
29 | 37 | | |
---|