tx · 7u6JvknCqMSsAD161gL4c18v3tdBK3N5qAryDTujh4qj

3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp:  -0.01000000 Waves

2022.02.27 14:20 [1941947] smart account 3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp > SELF 0.00000000 Waves

{ "type": 13, "id": "7u6JvknCqMSsAD161gL4c18v3tdBK3N5qAryDTujh4qj", "fee": 1000000, "feeAssetId": null, "timestamp": 1645960870275, "version": 2, "chainId": 84, "sender": "3Ms9YDMep25yKVDZmzP8PaG6vpZMyRN1kJp", "senderPublicKey": "DBFsF67y4W1PHwv8PvsfD9mctboYQZBGGNm7EwHckCgh", "proofs": [ "4TokY36hRLices5KWHyXV6EU9URxdeNZf1VbCW7FZtaUmMfFXExKQFJRLHDirRz4QdLVBwz3N1BGHN3xwCf6eke9" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgUKAwgICBIHCgUICAgICAAAAA0BAAAADWtleUNvbGxlY3Rpb24AAAACAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAC2NvbGxlY3Rpb25fBQAAAAxjb2xsZWN0aW9uSWQCAAAAAV8FAAAABmNhbGxlcgEAAAAaa2V5U3ViY29sbGVjdGlvbkNvbGxlY3Rpb24AAAADAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQAAAAKY29sbGVjdGlvbgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAGXN1YmNvbGxlY3Rpb25fY29sbGVjdGlvbl8FAAAADGNvbGxlY3Rpb25JZAIAAAABXwUAAAAGY2FsbGVyAgAAAAFfBQAAAApjb2xsZWN0aW9uAQAAAAlrZXlPblNhbGUAAAACAAAABmNhbGxlcgAAAAxjb2xsZWN0aW9uSWQJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAC2FydF9vbnNhbGVfBQAAAAxjb2xsZWN0aW9uSWQC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sZXRlRW50cmllcwkBAAAAC2NvbGxlY3Rpb25zAAAABQUAAAAFYXJ0SWQFAAAAAWkFAAAACmNvbGxlY3Rpb24FAAAADXN1YmNvbGxlY3Rpb24FAAAABmNhbGxlcgAAAACpOnTM", "height": 1941947, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CXRkV1XGgyFCDjKmG8u9Nk916kAGuncogFMEx7P2LwrB Next: GSKmWSumBcLoFBGSxVgrpk3Y8aW4Z7SnRXKCiSWwCUiA Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func keyCollection (caller,collectionId) = ((("collection_" + collectionId) + "_") + caller)
5-
6-
7-func keySubcollection (caller,collectionId) = ((("subcollection_" + collectionId) + "_") + caller)
85
96
107 func keySubcollectionCollection (caller,collectionId,collection) = ((((("subcollection_collection_" + collectionId) + "_") + caller) + "_") + collection)
2724
2825 let oracle = getStr(oracleKey)
2926
30-let oracleFee = value(addressFromString(oracle))
27+let oracleFee = valueOrErrorMessage(addressFromString(oracle), "Collections dapp doesnt have oracle defined")
3128
3229 let sconexDapp = getStringValue(oracleFee, sconexDappKey)
3330
6865
6966
7067 @Callable(i)
71-func updateCollection (collectionId,oldCollection,oldSubcollection,artId,collection,subcollection) = {
68+func updateCollection (oldCollection,oldSubcollection,artId,collection,subcollection) = {
7269 let caller = toBase58String(i.caller.bytes)
7370 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- }
71+ if (getBooleanByKey(saleKey))
72+ then throw("Can not update collection from artwork for sale")
73+ else {
74+ let deleteEntries = if (if ((oldCollection != collection))
75+ then true
76+ else (oldSubcollection != subcollection))
77+ then [DeleteEntry(keySubcollectionCollection(caller, artId, collection))]
78+ else nil
79+ (deleteEntries ++ collections(artId, i, collection, subcollection, caller))
80+ }
8681 }
8782
8883
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func keyCollection (caller,collectionId) = ((("collection_" + collectionId) + "_") + caller)
5-
6-
7-func keySubcollection (caller,collectionId) = ((("subcollection_" + collectionId) + "_") + caller)
85
96
107 func keySubcollectionCollection (caller,collectionId,collection) = ((((("subcollection_collection_" + collectionId) + "_") + caller) + "_") + collection)
118
129
1310 func keyOnSale (caller,collectionId) = ((("art_onsale_" + collectionId) + "_") + caller)
1411
1512
1613 let sconexDappKey = "sconexDapp"
1714
1815 let oracleKey = "oracleKey"
1916
2017 func getStr (key) = match getString(this, key) {
2118 case b: String =>
2219 b
2320 case _ =>
2421 ""
2522 }
2623
2724
2825 let oracle = getStr(oracleKey)
2926
30-let oracleFee = value(addressFromString(oracle))
27+let oracleFee = valueOrErrorMessage(addressFromString(oracle), "Collections dapp doesnt have oracle defined")
3128
3229 let sconexDapp = getStringValue(oracleFee, sconexDappKey)
3330
3431 func getBooleanByKey (key) = valueOrElse(getBoolean(addressFromStringValue(sconexDapp), key), false)
3532
3633
3734 func invokerIsSconexDapp (invoker) = if ((invoker == addressFromString(sconexDapp)))
3835 then true
3936 else throw("Only the sconex dapp can invoke this")
4037
4138
4239 func getStringByKeyFromDapp (dapp,key) = valueOrElse(getString(dapp, key), "")
4340
4441
4542 func collections (collectionId,i,collection,subcollection,creator) = if (if (invokerIsSconexDapp(i.caller))
4643 then true
4744 else (i.caller == this))
4845 then if ((collection == ""))
4946 then throw("Collections can not be empty!")
5047 else if ((subcollection == ""))
5148 then [StringEntry(keyCollection(creator, collectionId), collection)]
5249 else [StringEntry(keyCollection(creator, collectionId), collection), StringEntry(keySubcollectionCollection(creator, collectionId, collection), subcollection)]
5350 else throw("Wrong invoker")
5451
5552
5653 @Callable(i)
5754 func initDapp (dappKey) = if ((i.caller != this))
5855 then throw("You cannot do this action")
5956 else if ((oracle != ""))
6057 then throw("oracle already set, you can't override!")
6158 else [StringEntry(oracleKey, dappKey)]
6259
6360
6461
6562 @Callable(i)
6663 func collectionProcess (collection,subcollection,creator) = $Tuple2(collections(toBase58String(i.transactionId), i, collection, subcollection, creator), toBase58String(i.transactionId))
6764
6865
6966
7067 @Callable(i)
71-func updateCollection (collectionId,oldCollection,oldSubcollection,artId,collection,subcollection) = {
68+func updateCollection (oldCollection,oldSubcollection,artId,collection,subcollection) = {
7269 let caller = toBase58String(i.caller.bytes)
7370 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- }
71+ if (getBooleanByKey(saleKey))
72+ then throw("Can not update collection from artwork for sale")
73+ else {
74+ let deleteEntries = if (if ((oldCollection != collection))
75+ then true
76+ else (oldSubcollection != subcollection))
77+ then [DeleteEntry(keySubcollectionCollection(caller, artId, collection))]
78+ else nil
79+ (deleteEntries ++ collections(artId, i, collection, subcollection, caller))
80+ }
8681 }
8782
8883

github/deemru/w8io/169f3d6 
30.19 ms