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