tx · 4T8getL4ABxxbKzBGGX613ovqYFpoikP9tDxD1E5NQF1 3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ: -0.01000000 Waves 2023.10.12 08:00 [2794936] smart account 3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ > SELF 0.00000000 Waves
{ "type": 13, "id": "4T8getL4ABxxbKzBGGX613ovqYFpoikP9tDxD1E5NQF1", "fee": 1000000, "feeAssetId": null, "timestamp": 1697086865805, "version": 2, "chainId": 84, "sender": "3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ", "senderPublicKey": "HhtVcCt3Zxp8Tuqw9d9Er8kVG8AhbCuxygMA2pTYqrj4", "proofs": [ "51W2YJCxbS16UbSUbUTDL46NP9PHzuxD1EbnwWXpZxrRzRex9EN8oYuy4Sw5nLEEJtXL1Tc5vq1PnuEuTqrbQAkp" ], "script": "base64:AAIFAAAAAAAAABcIAhIECgIICBIFCgMICAgSBgoECAgICAAAABEAAAAAB1ZFUlNJT04CAAAABTEuMC4wAAAAAA5TVEFUVVNfUEVORElORwIAAAAHUEVORElORwAAAAAOU1RBVFVTX0ZMQUdHRUQCAAAAB0ZMQUdHRUQAAAAADlNUQVRVU19DTEVBUkVEAgAAAAdDTEVBUkVEAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAAAAAAthcnR3b3JrRGFwcAkBAAAABXZhbHVlAAAAAQkABCYAAAABCQEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAgAAABFjb25mX2FydHdvcmtfZGFwcAEAAAATZ2V0U3RyaW5nQnlLZXlPbkFydAAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAAC2FydHdvcmtEYXBwBQAAAANrZXkCAAAAAAEAAAAHa2V5TmFtZQAAAAIAAAAGY2FsbGVyAAAABWFydElkCQABLAAAAA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BQAAAAZzdGF0dXMFAAAADlNUQVRVU19GTEFHR0VECQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAD3N0YXR1c19yZXBvcnRlcgAAAAAAAAAAAQUAAAAGcmV3YXJkBQAAAAphcnRBc3NldElkBQAAAANuaWwFAAAAA25pbAQAAAALJHQwMjg3MDI5MDQJAQAAAAxpZENhbGxlckRhdGUAAAABBQAAAAFpBAAAAAJpZAgFAAAACyR0MDI4NzAyOTA0AAAAAl8xBAAAAAZjYWxsZXIIBQAAAAskdDAyODcwMjkwNAAAAAJfMgMJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAIFAAAABWNocmlzCQAETAAAAAIJAAQlAAAAAQUAAAAEdGhpcwUAAAADbmlsBQAAAAZjYWxsZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAACWtleVJlcG9ydAAAAAIFAAAABWFydElkBQAAAARhZGRyBQAAAAZzdGF0dXMJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACCQEAAAAJa2V5UmVwb3J0AAAAAgUAAAAFYXJ0SWQFAAAABGFkZHICAAAADl9jb21tZW50X2FkbWluBQAAAAdjb21tZW50BQAAAANuaWwJAAACAAAAAQIAAAALTm90IGFsbG93ZWQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleY3/ocM=", "height": 2794936, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9tmk7twWB8y9rGxYyMe33uKb1H4esyNiQXb5DAxmqfaQ Next: 9qZAabPwAjjur13t3TsxGPqnzGwq7Je6ngRSVZomyebW Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | - | func processReport (artId,addr,status,comment) = if (( | |
73 | + | func processReport (artId,addr,status,comment) = if ((getStringByKeyOnArt(keyName(addr, artId)) == "")) | |
74 | 74 | then throw("No art matching for this address") | |
75 | 75 | else if (!(containsElement([STATUS_CLEARED, STATUS_FLAGGED], status))) | |
76 | 76 | then throw("Status not found") | |
84 | 84 | let pay = if ((status == STATUS_FLAGGED)) | |
85 | 85 | then [ScriptTransfer(Address(fromBase58String(status_reporter[1])), reward, artAssetId)] | |
86 | 86 | else nil | |
87 | - | let $ | |
88 | - | let id = $ | |
89 | - | let caller = $ | |
87 | + | let $t028702904 = idCallerDate(i) | |
88 | + | let id = $t028702904._1 | |
89 | + | let caller = $t028702904._2 | |
90 | 90 | if (containsElement([chris, toString(this)], caller)) | |
91 | 91 | then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)] | |
92 | 92 | else throw("Not allowed") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let VERSION = "1.0.0" | |
5 | 5 | ||
6 | 6 | let STATUS_PENDING = "PENDING" | |
7 | 7 | ||
8 | 8 | let STATUS_FLAGGED = "FLAGGED" | |
9 | 9 | ||
10 | 10 | let STATUS_CLEARED = "CLEARED" | |
11 | 11 | ||
12 | 12 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | let artworkDapp = value(addressFromString(getStringByKey("conf_artwork_dapp"))) | |
16 | 16 | ||
17 | 17 | func getStringByKeyOnArt (key) = valueOrElse(getString(artworkDapp, key), "") | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyReport (artId,addr) = ((artId + "_") + addr) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let dappRunning = valueOrElse(getBoolean(this, "conf_dapp_is_running"), true) | |
27 | 27 | ||
28 | 28 | let maintenanceMSG = valueOrElse(getString(this, "conf_maintenance_msg"), "") | |
29 | 29 | ||
30 | 30 | let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee"))) | |
31 | 31 | ||
32 | 32 | let artAssetId_str = getStringByKey("conf_accepted_asset_ART") | |
33 | 33 | ||
34 | 34 | let artAssetId = fromBase58String(artAssetId_str) | |
35 | 35 | ||
36 | 36 | let chris = getStringByKey("conf_admin_1") | |
37 | 37 | ||
38 | 38 | func idCallerDate (i) = if (!(dappRunning)) | |
39 | 39 | then throw(maintenanceMSG) | |
40 | 40 | else $Tuple2(toBase58String(i.transactionId), toBase58String(i.caller.bytes)) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(invoke) | |
47 | 47 | func setConf (key,val) = { | |
48 | 48 | let caller = toString(invoke.caller) | |
49 | 49 | if (containsElement([chris, toString(this)], caller)) | |
50 | 50 | then if (contains(key, "conf_")) | |
51 | 51 | then [StringEntry(key, val)] | |
52 | 52 | else throw("Entries starting with conf_ only") | |
53 | 53 | else throw("You are not allowed to change this") | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | 58 | @Callable(i) | |
59 | 59 | func report (artId,addr,msg) = { | |
60 | 60 | let $t017811815 = idCallerDate(i) | |
61 | 61 | let id = $t017811815._1 | |
62 | 62 | let caller = $t017811815._2 | |
63 | 63 | if ((getStringByKeyOnArt(keyName(addr, artId)) == "")) | |
64 | 64 | then throw("No art matching for this address") | |
65 | 65 | else if ((getStringByKey(keyReport(artId, addr)) != "")) | |
66 | 66 | then throw("Already reported.") | |
67 | 67 | else [StringEntry(keyReport(artId, addr), ((STATUS_PENDING + "_") + caller)), StringEntry((keyReport(artId, addr) + "_comment_reporter"), msg)] | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | - | func processReport (artId,addr,status,comment) = if (( | |
73 | + | func processReport (artId,addr,status,comment) = if ((getStringByKeyOnArt(keyName(addr, artId)) == "")) | |
74 | 74 | then throw("No art matching for this address") | |
75 | 75 | else if (!(containsElement([STATUS_CLEARED, STATUS_FLAGGED], status))) | |
76 | 76 | then throw("Status not found") | |
77 | 77 | else { | |
78 | 78 | let get_report = getStringByKey(keyReport(artId, addr)) | |
79 | 79 | if ((get_report == "")) | |
80 | 80 | then throw("Report not found.") | |
81 | 81 | else { | |
82 | 82 | let reward = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(artAssetId))) | |
83 | 83 | let status_reporter = split(get_report, "_") | |
84 | 84 | let pay = if ((status == STATUS_FLAGGED)) | |
85 | 85 | then [ScriptTransfer(Address(fromBase58String(status_reporter[1])), reward, artAssetId)] | |
86 | 86 | else nil | |
87 | - | let $ | |
88 | - | let id = $ | |
89 | - | let caller = $ | |
87 | + | let $t028702904 = idCallerDate(i) | |
88 | + | let id = $t028702904._1 | |
89 | + | let caller = $t028702904._2 | |
90 | 90 | if (containsElement([chris, toString(this)], caller)) | |
91 | 91 | then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)] | |
92 | 92 | else throw("Not allowed") | |
93 | 93 | } | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | @Verifier(tx) | |
98 | 98 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
99 | 99 |
github/deemru/w8io/026f985 24.76 ms ◑