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