tx · 99vpEaHsoXs5bTSJCkLur9BwsH1j39xfZNWKMQRahiY2 3MwzVVTXiYGQsp48VX8adQ8cpqERGusRZfD: -0.01400000 Waves 2020.12.03 15:34 [1292493] smart account 3MwzVVTXiYGQsp48VX8adQ8cpqERGusRZfD > SELF 0.00000000 Waves
{ "type": 13, "id": "99vpEaHsoXs5bTSJCkLur9BwsH1j39xfZNWKMQRahiY2", "fee": 1400000, "feeAssetId": null, "timestamp": 1606998924222, "version": 2, "chainId": 84, "sender": "3MwzVVTXiYGQsp48VX8adQ8cpqERGusRZfD", "senderPublicKey": "8ejXYSqoG5h6bNLBRchYHfFvhrj7S4h1tpKRWqZ4oj8D", "proofs": [ "FrFjEzz2Vu9oiXyvXY7fssd44GvDHhLddoZ1ndq2NQMbZ7oxVT5VbVTEeP46vLRbto9eTRCYGiRWGaUrrcrkkjF" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgECAAAAAAAAAAEAAAABaQEAAAAJZ2V0U2NyaXB0AAAAAQAAAAR0eElkBAAAAAJ0eAkAA+4AAAABBQAAAAR0eElkBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAAIAAAABCQACWgAAAAEIBQAAAAF0AAAACWJvZHlCeXRlcwkAAAIAAAABAgAAAAlOb3QgZm91bmQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABthSIak=", "height": 1292493, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: LyW9DYmWqm2HmapPNBYnUAqWU7XDM4YyQVJG7bWrFxX Next: GX6Psxe6dkGvDh7ZMBohLUiepTPXm3wJVQvU7XCLr9cz Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func itemKey (user,id) = ((("user_" + user) + "_item_") + toString(id)) | |
5 | 4 | ||
6 | 5 | ||
7 | - | func counterKey (user) = (("user_" + user) + "_counter") | |
8 | - | ||
9 | - | ||
10 | - | func getCounter (user) = { | |
11 | - | let counter = getInteger(this, counterKey(user)) | |
12 | - | match counter { | |
13 | - | case c: Int => | |
14 | - | c | |
6 | + | @Callable(i) | |
7 | + | func getScript (txId) = { | |
8 | + | let tx = transferTransactionById(txId) | |
9 | + | match tx { | |
10 | + | case t: TransferTransaction => | |
11 | + | throw(toBase64String(t.bodyBytes)) | |
15 | 12 | case _ => | |
16 | - | | |
13 | + | throw("Not found") | |
17 | 14 | } | |
18 | 15 | } | |
19 | 16 | ||
20 | 17 | ||
21 | - | func itemExists (user,id) = isDefined(getString(this, itemKey(user, id))) | |
22 | - | ||
23 | - | ||
24 | - | @Callable(i) | |
25 | - | func createItem (content) = { | |
26 | - | let user = toBase58String(i.caller.bytes) | |
27 | - | let counter = getCounter(user) | |
28 | - | [StringEntry(itemKey(user, (counter + 1)), content), IntegerEntry(counterKey(user), (counter + 1))] | |
29 | - | } | |
30 | - | ||
31 | - | ||
32 | - | ||
33 | - | @Callable(i) | |
34 | - | func removeItem (id) = { | |
35 | - | let user = toBase58String(i.caller.bytes) | |
36 | - | if (!(itemExists(user, id))) | |
37 | - | then throw("Item doesn't exist") | |
38 | - | else [DeleteEntry(itemKey(user, id))] | |
39 | - | } | |
40 | - | ||
41 | - | ||
42 | - | ||
43 | - | @Callable(i) | |
44 | - | func updateItem (id,content) = { | |
45 | - | let user = toBase58String(i.caller.bytes) | |
46 | - | if (!(itemExists(user, id))) | |
47 | - | then throw("Item doesn't exist") | |
48 | - | else [StringEntry(itemKey(user, id), content)] | |
49 | - | } | |
50 | - | ||
51 | - | ||
52 | 18 | @Verifier(tx) | |
53 | - | func verify () = { | |
54 | - | let signature = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
55 | - | let owner = (this.bytes == tx.sender.bytes) | |
56 | - | match tx { | |
57 | - | case t: InvokeScriptTransaction => | |
58 | - | signature | |
59 | - | case _ => | |
60 | - | if (signature) | |
61 | - | then owner | |
62 | - | else false | |
63 | - | } | |
64 | - | } | |
19 | + | func verify () = true | |
65 | 20 |
github/deemru/w8io/873ac7e 37.08 ms ◑![]()