tx · DqMNFSoUksrzmvyfqhf9nxbp1tNePL3YaGHWCDFoE7pi

3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp:  -0.01000000 Waves

2022.02.17 17:43 [1927753] smart account 3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp > SELF 0.00000000 Waves

{ "type": 13, "id": "DqMNFSoUksrzmvyfqhf9nxbp1tNePL3YaGHWCDFoE7pi", "fee": 1000000, "feeAssetId": null, "timestamp": 1645109032745, "version": 2, "chainId": 84, "sender": "3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp", "senderPublicKey": "DBFsF67y4W1PHwv8PvsfD9mctboYQZBGGNm7EwHckCgh", "proofs": [ "3ybtrRCpPQPWuRAPHRNrpx9DXXGavEnXaPKMfsP9xjH6eqWEEoc4YSnmB8fhDrXStwMQxQ7Jaxm1naScszdqss31" ], "script": "base64:AAIFAAAAAAAAABgIAhIDCgEIEgUKAwgICBIICgYICAgICAgAAAAOAQAAAA1rZXlDb2xsZWN0aW9uAAAAAgAAAAZjYWxsZXIAAAAMY29sbGVjdGlvbklkCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAtjb2xsZWN0aW9uXwUAAAAMY29sbGVjdGlvbklkAgAAAAFfBQAAAAZjYWxsZXIBAAAAEGtleVN1YmNvbGxlY3Rpb24AAAACAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADnN1YmNvbGxlY3Rpb25fBQAAAAxjb2xsZWN0aW9uSWQCAAAAAV8FAAAABmNhbGxlcgEAAAAaa2V5U3ViY29sbGVjdGlvbkNvbGxlY3Rpb24AAAADAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQAAAAKY29sbGVjdGlvbgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAGXN1YmNvbGxlY3Rpb25fY29sbGVjdGlvbl8FAAAADGNvbGxlY3Rpb25JZAI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uQnlLZXkAAAABBQAAAAdzYWxlS2V5CQAAAgAAAAECAAAAL0NhbiBub3QgdXBkYXRlIGNvbGxlY3Rpb24gZnJvbSBhcnR3b3JrIGZvciBzYWxlBAAAAA1kZWxldGVFbnRyaWVzAwMJAQAAAAIhPQAAAAIFAAAADW9sZENvbGxlY3Rpb24FAAAACmNvbGxlY3Rpb24GCQEAAAACIT0AAAACBQAAABBvbGRTdWJjb2xsZWN0aW9uBQAAAA1zdWJjb2xsZWN0aW9uCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAABprZXlTdWJjb2xsZWN0aW9uQ29sbGVjdGlvbgAAAAMFAAAABmNhbGxlcgUAAAAMY29sbGVjdGlvbklkBQAAAApjb2xsZWN0aW9uBQAAAANuaWwFAAAAA25pbAkABE4AAAACBQAAAA1kZWxldGVFbnRyaWVzCQEAAAALY29sbGVjdGlvbnMAAAAFBQAAAAxjb2xsZWN0aW9uSWQFAAAAAWkFAAAACmNvbGxlY3Rpb24FAAAADXN1YmNvbGxlY3Rpb24FAAAABmNhbGxlcgAAAABINwUG", "height": 1927753, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: CXRkV1XGgyFCDjKmG8u9Nk916kAGuncogFMEx7P2LwrB Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func keyCollection (caller,collectionId) = ((("collection_" + collectionId) + "_") + caller)
5+
6+
7+func keySubcollection (caller,collectionId) = ((("subcollection_" + collectionId) + "_") + caller)
8+
9+
10+func keySubcollectionCollection (caller,collectionId,collection) = ((((("subcollection_collection_" + collectionId) + "_") + caller) + "_") + collection)
11+
12+
13+func keyOnSale (caller,collectionId) = ((("art_onsale_" + collectionId) + "_") + caller)
14+
15+
16+let sconexDappKey = "sconexDapp"
17+
18+let oracleKey = "oracleKey"
19+
20+func getStr (key) = match getString(this, key) {
21+ case b: String =>
22+ b
23+ case _ =>
24+ ""
25+}
26+
27+
28+let oracle = getStr(oracleKey)
29+
30+let oracleFee = value(addressFromString(oracle))
31+
32+let sconexDapp = getStringValue(oracleFee, sconexDappKey)
33+
34+func getBooleanByKey (key) = valueOrElse(getBoolean(addressFromStringValue(sconexDapp), key), false)
35+
36+
37+func invokerIsSconexDapp (invoker) = if ((invoker == addressFromString(sconexDapp)))
38+ then true
39+ else throw("Only the sconex dapp can invoke this")
40+
41+
42+func getStringByKeyFromDapp (dapp,key) = valueOrElse(getString(dapp, key), "")
43+
44+
45+func collections (collectionId,i,collection,subcollection,creator) = if (if (invokerIsSconexDapp(i.caller))
46+ then true
47+ else (i.caller == this))
48+ then if ((collection == ""))
49+ then throw("Collections can not be empty!")
50+ else if ((subcollection == ""))
51+ then [StringEntry(keyCollection(creator, collectionId), collection)]
52+ else [StringEntry(keyCollection(creator, collectionId), collection), StringEntry(keySubcollectionCollection(creator, collectionId, collection), subcollection)]
53+ else throw("Wrong invoker")
54+
55+
56+@Callable(i)
57+func initDapp (dappKey) = if ((i.caller != this))
58+ then throw("You cannot do this action")
59+ else if ((oracle != ""))
60+ then throw("oracle already set, you can't override!")
61+ else [StringEntry(oracleKey, dappKey)]
62+
63+
64+
65+@Callable(i)
66+func collectionProcess (collection,subcollection,creator) = $Tuple2(collections(toBase58String(i.transactionId), i, collection, subcollection, creator), toBase58String(i.transactionId))
67+
68+
69+
70+@Callable(i)
71+func updateCollection (collectionId,oldCollection,oldSubcollection,artId,collection,subcollection) = {
72+ let caller = toBase58String(i.caller.bytes)
73+ let saleKey = keyOnSale(artId, caller)
74+ if ((getStringByKeyFromDapp(addressFromStringValue(sconexDapp), ((("collection_" + artId) + "_") + caller)) != collectionId))
75+ then throw("This collection is not linked with the artwork")
76+ else if (getBooleanByKey(saleKey))
77+ then throw("Can not update collection from artwork for sale")
78+ else {
79+ let deleteEntries = if (if ((oldCollection != collection))
80+ then true
81+ else (oldSubcollection != subcollection))
82+ then [DeleteEntry(keySubcollectionCollection(caller, collectionId, collection))]
83+ else nil
84+ (deleteEntries ++ collections(collectionId, i, collection, subcollection, caller))
85+ }
86+ }
87+
88+

github/deemru/w8io/169f3d6 
15.84 ms