tx · Twdt5tGW9YTy38JQsu7ve3mDgxf679Kn9nVmsCaoqJ7 3MowAaaWs8T4yPQpTQQ5sUonXgyu5nJqNp2: -0.01000000 Waves 2023.10.12 08:42 [2794978] smart account 3MowAaaWs8T4yPQpTQQ5sUonXgyu5nJqNp2 > SELF 0.00000000 Waves
{ "type": 13, "id": "Twdt5tGW9YTy38JQsu7ve3mDgxf679Kn9nVmsCaoqJ7", "fee": 1000000, "feeAssetId": null, "timestamp": 1697089430780, "version": 2, "chainId": 84, "sender": "3MowAaaWs8T4yPQpTQQ5sUonXgyu5nJqNp2", "senderPublicKey": "FTWvTVhRuUTHAYb3U7dJYk5wch3jV8D6Xoveww9o2WX7", "proofs": [ "wGrpFRYdqzjvPMwMb1SxgKnvFpQCEj5ZB3waQa1pU5f2BAFndRFXhwLFVzWuRq7vd78r4Eya4QiEpihpumQGact" ], "script": "base64:AAIFAAAAAAAAABgIAhIECgIICBIFCgMICAgSBwoFCAgICAgAAAAWAAAAAAdWRVJTSU9OAgAAAAUxLjAuMAAAAAAOU1RBVFVTX1BFTkRJTkcCAAAAB1BFTkRJTkcAAAAADlNUQVRVU19GTEFHR0VEAgAAAAdGTEFHR0VEAAAAAA5TVEFUVVNfQ0xFQVJFRAIAAAAHQ0xFQVJFRAAAAAAUQVJUV09SS19GTEFHX0NPTlNFTlQCAAAAB0NPTlNFTlQAAAAAEkFSVFdPUktfRkxBR19SRVNFVAIAAAAAAAAAABxBUlRXT1JLX0ZMQUdfQ0hBTkdFX1JFUVVJUkVEAgAAAA9DSEFOR0VfUkVRVUlSRUQAAAAAFEFSVFdPUktfRkxBR19GTEFHR0VEAgAAAAdGTEFHR0VEAAAAABRBUlRXT1JLX0ZMQUdfSUxMRUdBTAIAAAAHSUxMRUdBTAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAAAAAALYXJ0d29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ydElkBQAAAARhZGRyAgAAAA5fY29tbWVudF9hZG1pbgUAAAAHY29tbWVudAUAAAADbmlsBQAAABFyZXdhcmRfYW5kX3VwZGF0ZQkAAAIAAAABAgAAAAtOb3QgYWxsb3dlZAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebR4ri4=", "height": 2794978, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: G9JAysewdH6WHpCUQ2gcaqGbVGfvWKrmd6VRuSPvNp25 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let VERSION = "1.0.0" | |
5 | + | ||
6 | + | let STATUS_PENDING = "PENDING" | |
7 | + | ||
8 | + | let STATUS_FLAGGED = "FLAGGED" | |
9 | + | ||
10 | + | let STATUS_CLEARED = "CLEARED" | |
11 | + | ||
12 | + | let ARTWORK_FLAG_CONSENT = "CONSENT" | |
13 | + | ||
14 | + | let ARTWORK_FLAG_RESET = "" | |
15 | + | ||
16 | + | let ARTWORK_FLAG_CHANGE_REQUIRED = "CHANGE_REQUIRED" | |
17 | + | ||
18 | + | let ARTWORK_FLAG_FLAGGED = "FLAGGED" | |
19 | + | ||
20 | + | let ARTWORK_FLAG_ILLEGAL = "ILLEGAL" | |
21 | + | ||
22 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
23 | + | ||
24 | + | ||
25 | + | let artworkDapp = value(addressFromString(getStringByKey("conf_artwork_dapp"))) | |
26 | + | ||
27 | + | func getStringByKeyOnArt (key) = valueOrElse(getString(artworkDapp, key), "") | |
28 | + | ||
29 | + | ||
30 | + | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
31 | + | ||
32 | + | ||
33 | + | func keyReport (artId,addr) = ((artId + "_") + addr) | |
34 | + | ||
35 | + | ||
36 | + | let dappRunning = valueOrElse(getBoolean(this, "conf_dapp_is_running"), true) | |
37 | + | ||
38 | + | let maintenanceMSG = valueOrElse(getString(this, "conf_maintenance_msg"), "") | |
39 | + | ||
40 | + | let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee"))) | |
41 | + | ||
42 | + | let artAssetId_str = getStringByKey("conf_accepted_asset_ART") | |
43 | + | ||
44 | + | let artAssetId = fromBase58String(artAssetId_str) | |
45 | + | ||
46 | + | let chris = getStringByKey("conf_admin_1") | |
47 | + | ||
48 | + | func idCallerDate (i) = if (!(dappRunning)) | |
49 | + | then throw(maintenanceMSG) | |
50 | + | else $Tuple2(toBase58String(i.transactionId), toBase58String(i.caller.bytes)) | |
51 | + | ||
52 | + | ||
53 | + | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
54 | + | ||
55 | + | ||
56 | + | @Callable(invoke) | |
57 | + | func setConf (key,val) = { | |
58 | + | let caller = toString(invoke.caller) | |
59 | + | if (containsElement([chris, toString(this)], caller)) | |
60 | + | then if (contains(key, "conf_")) | |
61 | + | then [StringEntry(key, val)] | |
62 | + | else throw("Entries starting with conf_ only") | |
63 | + | else throw("You are not allowed to change this") | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | @Callable(i) | |
69 | + | func report (artId,addr,msg) = { | |
70 | + | let $t019742008 = idCallerDate(i) | |
71 | + | let id = $t019742008._1 | |
72 | + | let caller = $t019742008._2 | |
73 | + | if ((getStringByKeyOnArt(keyName(addr, artId)) == "")) | |
74 | + | then throw("No art matching for this address") | |
75 | + | else if ((getStringByKey(keyReport(artId, addr)) != "")) | |
76 | + | then throw("Already reported.") | |
77 | + | else [StringEntry(keyReport(artId, addr), (((STATUS_PENDING + "_") + caller) + "_0")), StringEntry((keyReport(artId, addr) + "_comment_reporter"), msg)] | |
78 | + | } | |
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | @Callable(i) | |
83 | + | func processReport (artId,addr,status,comment,status_on_art_dapp) = if ((getStringByKeyOnArt(keyName(addr, artId)) == "")) | |
84 | + | then throw("No art matching for this address") | |
85 | + | else if (!(containsElement([STATUS_CLEARED, STATUS_FLAGGED], status))) | |
86 | + | then throw("Status not found") | |
87 | + | else { | |
88 | + | let get_report = getStringByKey(keyReport(artId, addr)) | |
89 | + | if ((get_report == "")) | |
90 | + | then throw("Report not found.") | |
91 | + | else { | |
92 | + | let reward = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(artAssetId))) | |
93 | + | let status_reporter = split(get_report, "_") | |
94 | + | let reward_and_update = if (if ((status == STATUS_FLAGGED)) | |
95 | + | then (status_reporter[2] == "0") | |
96 | + | else false) | |
97 | + | then [ScriptTransfer(Address(fromBase58String(status_reporter[1])), reward, artAssetId), StringEntry(keyReport(artId, addr), ((((status + "_") + status_reporter[1]) + "_") + toString(reward)))] | |
98 | + | else [StringEntry(keyReport(artId, addr), ((((status + "_") + status_reporter[1]) + "_") + status_reporter[2]))] | |
99 | + | if (!(containsElement([ARTWORK_FLAG_CONSENT, ARTWORK_FLAG_RESET, ARTWORK_FLAG_CHANGE_REQUIRED, ARTWORK_FLAG_FLAGGED, ARTWORK_FLAG_ILLEGAL], status_on_art_dapp))) | |
100 | + | then throw("status_on_art_dapp unknown") | |
101 | + | else { | |
102 | + | let flag_artwork = invoke(artworkDapp, "flagArtwork", [artId, addr, status_on_art_dapp, comment], nil) | |
103 | + | if ((flag_artwork == flag_artwork)) | |
104 | + | then { | |
105 | + | let $t036673701 = idCallerDate(i) | |
106 | + | let id = $t036673701._1 | |
107 | + | let caller = $t036673701._2 | |
108 | + | if (containsElement([chris, toString(this)], caller)) | |
109 | + | then ([StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)] ++ reward_and_update) | |
110 | + | else throw("Not allowed") | |
111 | + | } | |
112 | + | else throw("Strict value is not equal to itself.") | |
113 | + | } | |
114 | + | } | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | @Verifier(tx) | |
119 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
120 | + |
github/deemru/w8io/169f3d6 21.01 ms ◑