tx · AYXDXN4rqZdR8XJmrLM96YcqjQYS7rTW8hMhUs3moNYN 3N1rMmzVpkkVjjHNXjkiD3bsFaoYdT4oDNH: -0.01400000 Waves 2020.11.25 18:01 [1281090] smart account 3N1rMmzVpkkVjjHNXjkiD3bsFaoYdT4oDNH > SELF 0.00000000 Waves
{ "type": 13, "id": "AYXDXN4rqZdR8XJmrLM96YcqjQYS7rTW8hMhUs3moNYN", "fee": 1400000, "feeAssetId": null, "timestamp": 1606316548286, "version": 2, "chainId": 84, "sender": "3N1rMmzVpkkVjjHNXjkiD3bsFaoYdT4oDNH", "senderPublicKey": "DJWd2z896CX9DwLyDNWbc49PJzBJpUMD9KnZ3rzPRU31", "proofs": [ "ZLn7CNSg6jrxYxpdgb6DJEZgCT5ybkkYisHWqhZiRPndi81rCviuRTkdHfJtHTjqRGfon5PY6kE9CPVsYh4q7Km" ], "script": "base64:AAIEAAAAAAAAABIIAhIDCgEIEgMKAQESBAoCAQgAAAAEAQAAAAdpdGVtS2V5AAAAAgAAAAR1c2VyAAAAAmlkCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAV1c2VyXwUAAAAEdXNlcgIAAAAGX2l0ZW1fCQABpAAAAAEFAAAAAmlkAQAAAApjb3VudGVyS2V5AAAAAQAAAAR1c2VyCQABLAAAAAIJAAEsAAAAAgIAAAAFdXNlcl8FAAAABHVzZXICAAAACF9jb3VudGVyAQAAAApnZXRDb3VudGVyAAAAAQAAAAR1c2VyBAAAAAdjb3VudGVyCQAEGgAAAAIFAAAABHRoaXMJAQAAAApjb3VudGVyS2V5AAAAAQUAAAAEdXNlcgQAAAAHJG1hdGNoMAUAAAAHY291bnRlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFjBQAAAAckbWF0Y2gwBQAAAAFjAAAAAAAAAAAAAQAAAAppdGVtRXhpc3RzAAAAAgAAAAR1c2VyAAAAAmlkCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAR0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AAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAlzaWduYXR1cmUJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BAAAAAVvd25lcgkAAAAAAAACCAUAAAAEdGhpcwAAAAVieXRlcwgIBQAAAAJ0eAAAAAZzZW5kZXIAAAAFYnl0ZXMEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAUAAAAJc2lnbmF0dXJlAwUAAAAJc2lnbmF0dXJlBQAAAAVvd25lcgfDUE7B", "height": 1281090, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func itemKey (user,id) = ((("user_" + user) + "_item_") + toString(id)) | |
5 | + | ||
6 | + | ||
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 | |
15 | + | case _ => | |
16 | + | 0 | |
17 | + | } | |
18 | + | } | |
19 | + | ||
20 | + | ||
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 | + | @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 | + | } | |
65 | + |
github/deemru/w8io/169f3d6 22.16 ms ◑