tx · 9qZAabPwAjjur13t3TsxGPqnzGwq7Je6ngRSVZomyebW

3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ:  -0.01000000 Waves

2023.10.12 08:21 [2794956] smart account 3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ > SELF 0.00000000 Waves

{ "type": 13, "id": "9qZAabPwAjjur13t3TsxGPqnzGwq7Je6ngRSVZomyebW", "fee": 1000000, "feeAssetId": null, "timestamp": 1697088136322, "version": 2, "chainId": 84, "sender": "3N7yL6nhsHwrkLfxpWGjM39hFj4qo97bCdZ", "senderPublicKey": "HhtVcCt3Zxp8Tuqw9d9Er8kVG8AhbCuxygMA2pTYqrj4", "proofs": [ "5s9KNF5qmTdU9ZBPtBH8bg7e6GEUKCaNrCKoefAc74oexS1nePSYfWGidHVt9zgMSnM1myCGa4ZBKbGBKjS1K42" ], "script": "base64:AAIFAAAAAAAAABgIAhIECgIICBIFCgMICAgSBwoFCAgICAgAAAAWAAAAAAdWRVJTSU9OAgAAAAUxLjAuMAAAAAAOU1RBVFVTX1BFTkRJTkcCAAAAB1BFTkRJTkcAAAAADlNUQVRVU19GTEFHR0VEAgAAAAdGTEFHR0VEAAAAAA5TVEFUVVNfQ0xFQVJFRAIAAAAHQ0xFQVJFRAAAAAAUQVJUV09SS19GTEFHX0NPTlNFTlQCAAAAB0NPTlNFTlQAAAAAEkFSVFdPUktfRkxBR19SRVNFVAIAAAAAAAAAABxBUlRXT1JLX0ZMQUdfQ0hBTkdFX1JFUVVJUkVEAgAAAA9DSEFOR0VfUkVRVUlSRUQAAAAAFEFSVFdPUktfRkxBR19GTEFHR0VEAgAAAAdGTEFHR0VEAAAAABRBUlRXT1JLX0ZMQUdfSUxMRUdBTAIAAAAHSUxMRUdBTAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAAAAAALYXJ0d29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AkABEwAAAACBQAAAARhZGRyCQAETAAAAAIFAAAABnN0YXR1cwkABEwAAAACBQAAAAdjb21tZW50BQAAAANuaWwFAAAAA25pbAUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAADGZsYWdfYXJ0d29yawUAAAAMZmxhZ19hcnR3b3JrBAAAAAskdDAzNDMyMzQ2NgkBAAAADGlkQ2FsbGVyRGF0ZQAAAAEFAAAAAWkEAAAAAmlkCAUAAAALJHQwMzQzMjM0NjYAAAACXzEEAAAABmNhbGxlcggFAAAACyR0MDM0MzIzNDY2AAAAAl8yAwkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAIJAARMAAAAAgUAAAAFY2hyaXMJAARMAAAAAgkABCUAAAABBQAAAAR0aGlzBQAAAANuaWwFAAAABmNhbGxlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAJa2V5UmVwb3J0AAAAAgUAAAAFYXJ0SWQFAAAABGFkZHIFAAAABnN0YXR1cwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAQAAAAlrZXlSZXBvcnQAAAACBQAAAAVhcnRJZAUAAAAEYWRkcgIAAAAOX2NvbW1lbnRfYWRtaW4FAAAAB2NvbW1lbnQFAAAAA25pbAkAAAIAAAABAgAAAAtOb3QgYWxsb3dlZAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleTQvjJE=", "height": 2794956, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4T8getL4ABxxbKzBGGX613ovqYFpoikP9tDxD1E5NQF1 Next: BckVET91Ypte8GwmgfJiai4u6Zo2mzCMjjgojZsoQUJr Diff:
OldNewDifferences
88 let STATUS_FLAGGED = "FLAGGED"
99
1010 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"
1121
1222 func getStringByKey (key) = valueOrElse(getString(this, key), "")
1323
5767
5868 @Callable(i)
5969 func report (artId,addr,msg) = {
60- let $t017811815 = idCallerDate(i)
61- let id = $t017811815._1
62- let caller = $t017811815._2
70+ let $t019742008 = idCallerDate(i)
71+ let id = $t019742008._1
72+ let caller = $t019742008._2
6373 if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
6474 then throw("No art matching for this address")
6575 else if ((getStringByKey(keyReport(artId, addr)) != ""))
7080
7181
7282 @Callable(i)
73-func processReport (artId,addr,status,comment) = if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
83+func processReport (artId,addr,status,comment,status_on_art_dapp) = if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
7484 then throw("No art matching for this address")
7585 else if (!(containsElement([STATUS_CLEARED, STATUS_FLAGGED], status)))
7686 then throw("Status not found")
8494 let pay = if ((status == STATUS_FLAGGED))
8595 then [ScriptTransfer(Address(fromBase58String(status_reporter[1])), reward, artAssetId)]
8696 else nil
87- let $t028702904 = idCallerDate(i)
88- let id = $t028702904._1
89- let caller = $t028702904._2
90- if (containsElement([chris, toString(this)], caller))
91- then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)]
92- else throw("Not allowed")
97+ if (!(containsElement([ARTWORK_FLAG_CONSENT, ARTWORK_FLAG_RESET, ARTWORK_FLAG_CHANGE_REQUIRED, ARTWORK_FLAG_FLAGGED, ARTWORK_FLAG_ILLEGAL], status_on_art_dapp)))
98+ then throw("status_on_art_dapp unknown")
99+ else {
100+ let flag_artwork = if ((status == STATUS_FLAGGED))
101+ then [invoke(artworkDapp, "flagArtwork", [artId, addr, status, comment], nil)]
102+ else nil
103+ if ((flag_artwork == flag_artwork))
104+ then {
105+ let $t034323466 = idCallerDate(i)
106+ let id = $t034323466._1
107+ let caller = $t034323466._2
108+ if (containsElement([chris, toString(this)], caller))
109+ then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)]
110+ else throw("Not allowed")
111+ }
112+ else throw("Strict value is not equal to itself.")
113+ }
93114 }
94115 }
95116
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VERSION = "1.0.0"
55
66 let STATUS_PENDING = "PENDING"
77
88 let STATUS_FLAGGED = "FLAGGED"
99
1010 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"
1121
1222 func getStringByKey (key) = valueOrElse(getString(this, key), "")
1323
1424
1525 let artworkDapp = value(addressFromString(getStringByKey("conf_artwork_dapp")))
1626
1727 func getStringByKeyOnArt (key) = valueOrElse(getString(artworkDapp, key), "")
1828
1929
2030 func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
2131
2232
2333 func keyReport (artId,addr) = ((artId + "_") + addr)
2434
2535
2636 let dappRunning = valueOrElse(getBoolean(this, "conf_dapp_is_running"), true)
2737
2838 let maintenanceMSG = valueOrElse(getString(this, "conf_maintenance_msg"), "")
2939
3040 let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee")))
3141
3242 let artAssetId_str = getStringByKey("conf_accepted_asset_ART")
3343
3444 let artAssetId = fromBase58String(artAssetId_str)
3545
3646 let chris = getStringByKey("conf_admin_1")
3747
3848 func idCallerDate (i) = if (!(dappRunning))
3949 then throw(maintenanceMSG)
4050 else $Tuple2(toBase58String(i.transactionId), toBase58String(i.caller.bytes))
4151
4252
4353 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
4454
4555
4656 @Callable(invoke)
4757 func setConf (key,val) = {
4858 let caller = toString(invoke.caller)
4959 if (containsElement([chris, toString(this)], caller))
5060 then if (contains(key, "conf_"))
5161 then [StringEntry(key, val)]
5262 else throw("Entries starting with conf_ only")
5363 else throw("You are not allowed to change this")
5464 }
5565
5666
5767
5868 @Callable(i)
5969 func report (artId,addr,msg) = {
60- let $t017811815 = idCallerDate(i)
61- let id = $t017811815._1
62- let caller = $t017811815._2
70+ let $t019742008 = idCallerDate(i)
71+ let id = $t019742008._1
72+ let caller = $t019742008._2
6373 if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
6474 then throw("No art matching for this address")
6575 else if ((getStringByKey(keyReport(artId, addr)) != ""))
6676 then throw("Already reported.")
6777 else [StringEntry(keyReport(artId, addr), ((STATUS_PENDING + "_") + caller)), StringEntry((keyReport(artId, addr) + "_comment_reporter"), msg)]
6878 }
6979
7080
7181
7282 @Callable(i)
73-func processReport (artId,addr,status,comment) = if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
83+func processReport (artId,addr,status,comment,status_on_art_dapp) = if ((getStringByKeyOnArt(keyName(addr, artId)) == ""))
7484 then throw("No art matching for this address")
7585 else if (!(containsElement([STATUS_CLEARED, STATUS_FLAGGED], status)))
7686 then throw("Status not found")
7787 else {
7888 let get_report = getStringByKey(keyReport(artId, addr))
7989 if ((get_report == ""))
8090 then throw("Report not found.")
8191 else {
8292 let reward = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(artAssetId)))
8393 let status_reporter = split(get_report, "_")
8494 let pay = if ((status == STATUS_FLAGGED))
8595 then [ScriptTransfer(Address(fromBase58String(status_reporter[1])), reward, artAssetId)]
8696 else nil
87- let $t028702904 = idCallerDate(i)
88- let id = $t028702904._1
89- let caller = $t028702904._2
90- if (containsElement([chris, toString(this)], caller))
91- then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)]
92- else throw("Not allowed")
97+ if (!(containsElement([ARTWORK_FLAG_CONSENT, ARTWORK_FLAG_RESET, ARTWORK_FLAG_CHANGE_REQUIRED, ARTWORK_FLAG_FLAGGED, ARTWORK_FLAG_ILLEGAL], status_on_art_dapp)))
98+ then throw("status_on_art_dapp unknown")
99+ else {
100+ let flag_artwork = if ((status == STATUS_FLAGGED))
101+ then [invoke(artworkDapp, "flagArtwork", [artId, addr, status, comment], nil)]
102+ else nil
103+ if ((flag_artwork == flag_artwork))
104+ then {
105+ let $t034323466 = idCallerDate(i)
106+ let id = $t034323466._1
107+ let caller = $t034323466._2
108+ if (containsElement([chris, toString(this)], caller))
109+ then [StringEntry(keyReport(artId, addr), status), StringEntry((keyReport(artId, addr) + "_comment_admin"), comment)]
110+ else throw("Not allowed")
111+ }
112+ else throw("Strict value is not equal to itself.")
113+ }
93114 }
94115 }
95116
96117
97118 @Verifier(tx)
98119 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
99120

github/deemru/w8io/026f985 
49.77 ms