tx · BYCEoBuZfqUGpeQgvjJrrY65LaJ1Z2dcwF1kVGd9AwFn 3N8mwjgLRxL4TqXfzx1BkDQowTd11YQzonb: -0.01000000 Waves 2022.02.13 19:29 [1922091] smart account 3N8mwjgLRxL4TqXfzx1BkDQowTd11YQzonb > SELF 0.00000000 Waves
{ "type": 13, "id": "BYCEoBuZfqUGpeQgvjJrrY65LaJ1Z2dcwF1kVGd9AwFn", "fee": 1000000, "feeAssetId": null, "timestamp": 1644769759198, "version": 2, "chainId": 84, "sender": "3N8mwjgLRxL4TqXfzx1BkDQowTd11YQzonb", "senderPublicKey": "FRWHTvHAyrGoiWNsvEJfBfhsqvQVZTYSYrFdXkm9fABv", "proofs": [ "KtALywsXGcF2whi27ypnbcCYXDTzPaZgb4R9YLxP48QcQhKPbAKoAZ8Sy4CCBw5KrwyzaPwBa86ZNdD5PE2saLR" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEIEgYKBAgICAgSCAoGCAgICAgIAAAACgEAAAANa2V5Q29sbGVjdGlvbgAAAAIAAAAGY2FsbGVyAAAADGNvbGxlY3Rpb25JZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAALY29sbGVjdGlvbl8FAAAADGNvbGxlY3Rpb25JZAIAAAABXwUAAAAGY2FsbGVyAQAAABBrZXlTdWJjb2xsZWN0aW9uAAAAAgAAAAZjYWxsZXIAAAAMY29sbGVjdGlvbklkCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAA5zdWJjb2xsZWN0aW9uXwUAAAAMY29sbGVjdGlvbklkAgAAAAFfBQAAAAZjYWxsZXIBAAAAGmtleVN1YmNvbGxlY3Rpb25Db2xsZWN0aW9uAAAAAwAAAAZjYWxsZXIAAAAMY29sbGVjdGlvbklkAAAACmNvbGxlY3Rpb24JAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABlzdWJjb2xsZWN0aW9uX2NvbGxlY3Rpb25fBQAAAAxjb2xsZWN0aW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0 } View: original | compacted Prev: 5ftb5gmWAnJyVGk9zkrcSmEf3Xn4ojUFDjd7UQgKfeY5 Next: BfwxJVDQVG7XTmwKi1cUbeCL1FgstGz5EidHvpohbAH Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func keyCollection (caller, | |
4 | + | func keyCollection (caller,collectionId) = ((("collection_" + collectionId) + "_") + caller) | |
5 | 5 | ||
6 | 6 | ||
7 | - | func keySubcollection (caller, | |
7 | + | func keySubcollection (caller,collectionId) = ((("subcollection_" + collectionId) + "_") + caller) | |
8 | 8 | ||
9 | 9 | ||
10 | - | func keySubcollectionCollection (caller, | |
10 | + | func keySubcollectionCollection (caller,collectionId,collection) = ((((("subcollection_collection_" + collectionId) + "_") + caller) + "_") + collection) | |
11 | 11 | ||
12 | 12 | ||
13 | - | func keyOnSale (caller, | |
13 | + | func keyOnSale (caller,collectionId) = ((("art_onsale_" + collectionId) + "_") + caller) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | let sconexDappKey = "sconexDappKey" | |
33 | 33 | else throw("Only the sconex dapp can invoke this") | |
34 | 34 | ||
35 | 35 | ||
36 | - | func collections (i,collection,subcollection,artId,creator) = if (if (invokerIsSconexDapp(i.caller)) | |
36 | + | func collections (txId,i,collection,subcollection,artId,creator) = if (if (invokerIsSconexDapp(i.caller)) | |
37 | 37 | then true | |
38 | 38 | else (i.caller == this)) | |
39 | 39 | then if ((collection == "")) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | - | func collectionProcess (collection,subcollection,artId,creator) = $Tuple2(collections(i, collection, subcollection, artId, creator), toBase58String(i.transactionId)) | |
57 | + | func collectionProcess (collection,subcollection,artId,creator) = $Tuple2(collections(toBase58String(i.transactionId), i, collection, subcollection, artId, creator), toBase58String(i.transactionId)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(i) | |
62 | - | func updateCollection (oldCollection,oldSubcollection,artId,collection,subcollection) = { | |
62 | + | func updateCollection (collectionId,oldCollection,oldSubcollection,artId,collection,subcollection) = { | |
63 | 63 | let caller = toBase58String(i.caller.bytes) | |
64 | 64 | let saleKey = keyOnSale(artId, caller) | |
65 | 65 | if (getBooleanByKey(saleKey)) | |
70 | 70 | else (oldSubcollection != subcollection)) | |
71 | 71 | then [DeleteEntry(keySubcollectionCollection(caller, artId, collection))] | |
72 | 72 | else nil | |
73 | - | (deleteEntries ++ collections(i, collection, subcollection, artId, caller)) | |
73 | + | (deleteEntries ++ collections(collectionId, i, collection, subcollection, artId, caller)) | |
74 | 74 | } | |
75 | 75 | } | |
76 | 76 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func keyCollection (caller, | |
4 | + | func keyCollection (caller,collectionId) = ((("collection_" + collectionId) + "_") + caller) | |
5 | 5 | ||
6 | 6 | ||
7 | - | func keySubcollection (caller, | |
7 | + | func keySubcollection (caller,collectionId) = ((("subcollection_" + collectionId) + "_") + caller) | |
8 | 8 | ||
9 | 9 | ||
10 | - | func keySubcollectionCollection (caller, | |
10 | + | func keySubcollectionCollection (caller,collectionId,collection) = ((((("subcollection_collection_" + collectionId) + "_") + caller) + "_") + collection) | |
11 | 11 | ||
12 | 12 | ||
13 | - | func keyOnSale (caller, | |
13 | + | func keyOnSale (caller,collectionId) = ((("art_onsale_" + collectionId) + "_") + caller) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | let sconexDappKey = "sconexDappKey" | |
17 | 17 | ||
18 | 18 | func getStr (key) = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let sconexDapp = getStr(sconexDappKey) | |
27 | 27 | ||
28 | 28 | func getBooleanByKey (key) = valueOrElse(getBoolean(addressFromStringValue(sconexDapp), key), false) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func invokerIsSconexDapp (invoker) = if ((invoker == addressFromString(sconexDapp))) | |
32 | 32 | then true | |
33 | 33 | else throw("Only the sconex dapp can invoke this") | |
34 | 34 | ||
35 | 35 | ||
36 | - | func collections (i,collection,subcollection,artId,creator) = if (if (invokerIsSconexDapp(i.caller)) | |
36 | + | func collections (txId,i,collection,subcollection,artId,creator) = if (if (invokerIsSconexDapp(i.caller)) | |
37 | 37 | then true | |
38 | 38 | else (i.caller == this)) | |
39 | 39 | then if ((collection == "")) | |
40 | 40 | then throw("Collections can not be empty!") | |
41 | 41 | else if ((subcollection == "")) | |
42 | 42 | then [StringEntry(keyCollection(creator, artId), collection)] | |
43 | 43 | else [StringEntry(keyCollection(creator, artId), collection), StringEntry(keySubcollectionCollection(creator, artId, collection), subcollection)] | |
44 | 44 | else throw("Wrong invoker") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func initDapp (dappKey) = if ((i.caller != this)) | |
49 | 49 | then throw("You cannot do this action") | |
50 | 50 | else if ((sconexDapp != "")) | |
51 | 51 | then throw("Sconex dapp already set, you can't override!") | |
52 | 52 | else [StringEntry(sconexDappKey, dappKey)] | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | - | func collectionProcess (collection,subcollection,artId,creator) = $Tuple2(collections(i, collection, subcollection, artId, creator), toBase58String(i.transactionId)) | |
57 | + | func collectionProcess (collection,subcollection,artId,creator) = $Tuple2(collections(toBase58String(i.transactionId), i, collection, subcollection, artId, creator), toBase58String(i.transactionId)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(i) | |
62 | - | func updateCollection (oldCollection,oldSubcollection,artId,collection,subcollection) = { | |
62 | + | func updateCollection (collectionId,oldCollection,oldSubcollection,artId,collection,subcollection) = { | |
63 | 63 | let caller = toBase58String(i.caller.bytes) | |
64 | 64 | let saleKey = keyOnSale(artId, caller) | |
65 | 65 | if (getBooleanByKey(saleKey)) | |
66 | 66 | then throw("Can not update collection from artwork for sale") | |
67 | 67 | else { | |
68 | 68 | let deleteEntries = if (if ((oldCollection != collection)) | |
69 | 69 | then true | |
70 | 70 | else (oldSubcollection != subcollection)) | |
71 | 71 | then [DeleteEntry(keySubcollectionCollection(caller, artId, collection))] | |
72 | 72 | else nil | |
73 | - | (deleteEntries ++ collections(i, collection, subcollection, artId, caller)) | |
73 | + | (deleteEntries ++ collections(collectionId, i, collection, subcollection, artId, caller)) | |
74 | 74 | } | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 |
github/deemru/w8io/169f3d6 37.00 ms ◑