tx · 5gTXAN5D6yz9K2MDuva43qqccfU2eKUVWPTBVzLQA6BG 3N4XDqsd3iMrXb6kS7R7Wwd4azMsqUXMvfe: -0.03800000 Waves 2022.12.01 20:56 [2341600] smart account 3N4XDqsd3iMrXb6kS7R7Wwd4azMsqUXMvfe > SELF 0.00000000 Waves
{ "type": 13, "id": "5gTXAN5D6yz9K2MDuva43qqccfU2eKUVWPTBVzLQA6BG", "fee": 3800000, "feeAssetId": null, "timestamp": 1669917400222, "version": 2, "chainId": 84, "sender": "3N4XDqsd3iMrXb6kS7R7Wwd4azMsqUXMvfe", "senderPublicKey": "C2mzHuEYRUgN9aEFza8tUYr6jfSWEgS6WvPmA54fejJk", "proofs": [ "4yahwsbkCuELJ4yyosjnGCM7DZ9oEQ3nmBRZG2ePCJZVE9ptXLsFigXBwY5RLapQ66ShWEY46gPQaFf7kE3tSzTG" ], "script": "base64:BgJhCAISAwoBCBIDCgEIEgMKAQgSBAoCGBESAwoBCBIFCgMIAQESBQoDAQgREgUKAwEIERIGCgQBCAEREgMKAQgSABIXChUICAgBAQEBGAgICAgICAgYGBgYGBgSBAoCCAgSAA8AFG5mdF9jcmVhdGlvbl9hZGRyZXNzCQEHQWRkcmVzcwEBGgFU+NRXhjw+So4GTxfJhBBro3CmzrXdqrQsABVwcmljZV9pbmNyZWFzZV9wZXJpb2QACgAPbWludF9jb2xsZWN0aW9uAhJDbGVmIGdlbmVzaXMgc29uZ3MAEG1pbnRfZGVzY3JpcHRpb24CZEdlbmVzaXMgQ2xlZiBzb25nLiBUaGlzIG1lbG9keSBpcyBjcmFmdGVkIHRvIGJlY29tZSB5b3VyIGVsZWN0cm9uaWMgamFtLiBVc2UgaXQgb24gY2xlZi5vbmUg8J+SmvCfpI0AEWh5YnJpZF9jb2xsZWN0aW9uAgpDbGVmIG1peGVzABJoeWJyaWRfZGVzY3JpcHRpb24CV0NsZWYgbWl4LiBUaGlzIG1lbG9keSB3YXMgY3JlYXRlZCBieSBhbiBhbGdvcml0aG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AIBAg1Xcm9uZyBwYXltZW50BAlzb25nXzFfaWQEByRtYXRjaDAICQCRAwIIBQFpCHBheW1lbnRzAAEHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwBQFiCQACAQINV3JvbmcgcGF5bWVudAMJAAACBQlzb25nXzBfaWQFCXNvbmdfMV9pZAkAAgECGVNvbmdzIHNob3VsZCBiZSBkaWZmZXJlbnQEBnNvbmdfMAkBEUBleHRyTmF0aXZlKDEwNTgpAQkA2AQBBQlzb25nXzBfaWQEBnNvbmdfMQkBEUBleHRyTmF0aXZlKDEwNTgpAQkA2AQBBQlzb25nXzFfaWQEBWJ1cm4wCQD8BwQFFG5mdF9jcmVhdGlvbl9hZGRyZXNzAgdidXJuTkZUBQNuaWwJAMwIAgkAkQMCCAUBaQhwYXltZW50cwAABQNuaWwDCQAAAgUFYnVybjAFBWJ1cm4wBAVidXJuMQkA/AcEBRRuZnRfY3JlYXRpb25fYWRkcmVzcwIHYnVybk5GVAUDbmlsCQDMCAIJAJEDAggFAWkIcGF5bWVudHMAAQUDbmlsAwkAAAIFBWJ1cm4xBQVidXJuMQkAlAoCCQEObWFrZV9oeWJyaWRfdHgDBQFpBQZzb25nXzAFBnNvbmdfMQUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDOTJPj", "height": 2341600, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2YBSEHGp3bbumVgnFHn6jW4cAg2wB76CZdiqQwephjfo Next: 39aJpSPJa1z3HMgnmGpTcRJaDriytfsrXzrGpX7cpkPh Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let nft_creation_address = Address(base58'3NCbmjGV7YHKdkHEfWkfGhmZyXsJbymQ5Z5') | |
5 | + | ||
6 | + | let price_increase_period = 10 | |
7 | + | ||
8 | + | let mint_collection = "Clef genesis songs" | |
9 | + | ||
10 | + | let mint_description = "Genesis Clef song. This melody is crafted to become your electronic jam. Use it on clef.one 💚🤍" | |
11 | + | ||
12 | + | let hybrid_collection = "Clef mixes" | |
13 | + | ||
14 | + | let hybrid_description = "Clef mix. This melody was created by an algorithm. Enjoy this jam or use it on clef.one" | |
15 | + | ||
16 | + | let indices_20 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
17 | + | ||
4 | 18 | func to_key (n) = toBase58String(toBytes(n)) | |
5 | 19 | ||
6 | 20 | ||
20 | 34 | else key_1 | |
21 | 35 | ||
22 | 36 | ||
23 | - | func | |
24 | - | then | |
37 | + | func hybrid_calculate_change (i,token,amount) = if ((size(i.payments) != 1)) | |
38 | + | then -1 | |
25 | 39 | else { | |
26 | 40 | let p = i.payments[0] | |
27 | 41 | let p_token = match p.assetId { | |
30 | 44 | case _ => | |
31 | 45 | "" | |
32 | 46 | } | |
33 | - | let token = getStringValue("price_hybrid_token") | |
34 | - | let amount = getIntegerValue("price_hybrid_amount") | |
35 | 47 | if ((p_token != token)) | |
36 | - | then false | |
37 | - | else if ((amount != p.amount)) | |
38 | - | then false | |
39 | - | else true | |
48 | + | then -1 | |
49 | + | else (p.amount - amount) | |
40 | 50 | } | |
41 | 51 | ||
42 | 52 | ||
47 | 57 | case _ => | |
48 | 58 | 0 | |
49 | 59 | } | |
50 | - | let issue = Issue(("Clef " + toString(n)), "Clef song.", 1, 0, false) | |
51 | - | let id_b = calculateAssetId(issue) | |
52 | - | let id = toBase58String(id_b) | |
53 | - | let key = to_key(n) | |
54 | - | let bytes = unique_bytes(i) | |
55 | - | let rand_0 = random_uint(bytes, 0) | |
56 | - | let rand_1 = random_uint(bytes, 1) | |
57 | - | [issue, IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), (max([getIntegerValue((song_0 + "_G")), getIntegerValue((song_1 + "_G"))]) + 1)), StringEntry((key + "_SL"), ""), IntegerEntry((key + "_SN"), rand_0), StringEntry((key + "_SP0"), song_0), StringEntry((key + "_SP1"), song_1), IntegerEntry((key + "_SB0"), getIntegerValue((pick_one(song_0, song_1, rand_0, 1) + "_SB0"))), IntegerEntry((key + "_SB1"), getIntegerValue((pick_one(song_0, song_1, rand_0, 2) + "_SB1"))), IntegerEntry((key + "_SB2"), getIntegerValue((pick_one(song_0, song_1, rand_0, 4) + "_SB2"))), IntegerEntry((key + "_ST"), getIntegerValue((pick_one(song_0, song_1, rand_0, 8) + "_ST"))), StringEntry((key + "_SC0"), getStringValue((pick_one(song_0, song_1, rand_0, 16) + "_SC0"))), StringEntry((key + "_SC1"), getStringValue((pick_one(song_0, song_1, rand_0, 32) + "_SC1"))), StringEntry((key + "_SC2"), getStringValue((pick_one(song_0, song_1, rand_0, 64) + "_SC2"))), StringEntry((key + "_SC3"), getStringValue((pick_one(song_0, song_1, rand_0, 128) + "_SC3"))), StringEntry((key + "_SC4"), getStringValue((pick_one(song_0, song_1, rand_0, 512) + "_SC4"))), StringEntry((key + "_SC5"), getStringValue((pick_one(song_0, song_1, rand_0, 1024) + "_SC5"))), StringEntry((key + "_SC6"), getStringValue((pick_one(song_0, song_1, rand_0, 2048) + "_SC6"))), StringEntry((key + "_SC7"), getStringValue((pick_one(song_0, song_1, rand_0, 4096) + "_SC7"))), StringEntry((key + "_SM"), getStringValue((pick_one(song_0, song_1, rand_0, 8192) + "_SM"))), StringEntry((key + "_SI0"), getStringValue((pick_one(song_0, song_1, rand_0, 16384) + "_SI0"))), StringEntry((key + "_SI1"), getStringValue((pick_one(song_0, song_1, rand_0, 32768) + "_SI1"))), StringEntry((key + "_SI2"), getStringValue((pick_one(song_0, song_1, rand_0, 65536) + "_SI2"))), StringEntry((key + "_SI3"), getStringValue((pick_one(song_0, song_1, rand_0, 131072) + "_SI3"))), StringEntry((key + "_SI4"), getStringValue((pick_one(song_0, song_1, rand_0, 262144) + "_SI4"))), StringEntry((key + "_SI5"), getStringValue((pick_one(song_0, song_1, rand_0, 524288) + "_SI5"))), StringEntry((key + "_SI50"), getStringValue((pick_one(song_0, song_1, rand_0, 1048576) + "_SI50"))), StringEntry((key + "_SI51"), getStringValue((pick_one(song_0, song_1, rand_0, 2097152) + "_SI51"))), StringEntry((key + "_SI52"), getStringValue((pick_one(song_0, song_1, rand_0, 4194304) + "_SI52"))), StringEntry((key + "_SI53"), getStringValue((pick_one(song_0, song_1, rand_0, 8388608) + "_SI53"))), StringEntry((key + "_SI54"), getStringValue((pick_one(song_0, song_1, rand_0, 16777216) + "_SI54"))), StringEntry((key + "_SI55"), getStringValue((pick_one(song_0, song_1, rand_0, 33554432) + "_SI55"))), StringEntry((key + "_SI56"), getStringValue((pick_one(song_0, song_1, rand_0, 67108864) + "_SI56"))), StringEntry((key + "_SI57"), getStringValue((pick_one(song_0, song_1, rand_0, 134217728) + "_SI57"))), StringEntry((key + "_SI00"), getStringValue((pick_one(song_0, song_1, rand_0, 268435456) + "_SI00"))), StringEntry((key + "_SI01"), getStringValue((pick_one(song_0, song_1, rand_0, 536870912) + "_SI01"))), StringEntry((key + "_SI02"), getStringValue((pick_one(song_0, song_1, rand_0, 1073741824) + "_SI02"))), StringEntry((key + "_SI03"), getStringValue((pick_one(song_0, song_1, rand_0, 2147483648) + "_SI03"))), StringEntry((key + "_SI04"), getStringValue((pick_one(song_0, song_1, rand_0, 4294967296) + "_SI04"))), StringEntry((key + "_SI05"), getStringValue((pick_one(song_0, song_1, rand_0, 8589934592) + "_SI05"))), StringEntry((key + "_SI06"), getStringValue((pick_one(song_0, song_1, rand_1, 1) + "_SI06"))), StringEntry((key + "_SI07"), getStringValue((pick_one(song_0, song_1, rand_1, 2) + "_SI07"))), StringEntry((key + "_SI10"), getStringValue((pick_one(song_0, song_1, rand_1, 4) + "_SI10"))), StringEntry((key + "_SI11"), getStringValue((pick_one(song_0, song_1, rand_1, 8) + "_SI11"))), StringEntry((key + "_SI12"), getStringValue((pick_one(song_0, song_1, rand_1, 16) + "_SI12"))), StringEntry((key + "_SI13"), getStringValue((pick_one(song_0, song_1, rand_1, 32) + "_SI13"))), StringEntry((key + "_SI14"), getStringValue((pick_one(song_0, song_1, rand_1, 64) + "_SI14"))), StringEntry((key + "_SI15"), getStringValue((pick_one(song_0, song_1, rand_1, 128) + "_SI15"))), StringEntry((key + "_SI16"), getStringValue((pick_one(song_0, song_1, rand_1, 256) + "_SI16"))), StringEntry((key + "_SI17"), getStringValue((pick_one(song_0, song_1, rand_1, 512) + "_SI17"))), StringEntry((key + "_SI20"), getStringValue((pick_one(song_0, song_1, rand_1, 1024) + "_SI20"))), StringEntry((key + "_SI21"), getStringValue((pick_one(song_0, song_1, rand_1, 2048) + "_SI21"))), StringEntry((key + "_SI22"), getStringValue((pick_one(song_0, song_1, rand_1, 4096) + "_SI22"))), StringEntry((key + "_SI23"), getStringValue((pick_one(song_0, song_1, rand_1, 8192) + "_SI23"))), StringEntry((key + "_SI24"), getStringValue((pick_one(song_0, song_1, rand_1, 16384) + "_SI24"))), StringEntry((key + "_SI25"), getStringValue((pick_one(song_0, song_1, rand_1, 32768) + "_SI25"))), StringEntry((key + "_SI26"), getStringValue((pick_one(song_0, song_1, rand_1, 65536) + "_SI26"))), StringEntry((key + "_SI27"), getStringValue((pick_one(song_0, song_1, rand_1, 131072) + "_SI27"))), StringEntry((key + "_SI30"), getStringValue((pick_one(song_0, song_1, rand_1, 262144) + "_SI30"))), StringEntry((key + "_SI31"), getStringValue((pick_one(song_0, song_1, rand_1, 524288) + "_SI31"))), StringEntry((key + "_SI32"), getStringValue((pick_one(song_0, song_1, rand_1, 1048576) + "_SI32"))), StringEntry((key + "_SI33"), getStringValue((pick_one(song_0, song_1, rand_1, 2097152) + "_SI33"))), StringEntry((key + "_SI34"), getStringValue((pick_one(song_0, song_1, rand_1, 4194304) + "_SI34"))), StringEntry((key + "_SI35"), getStringValue((pick_one(song_0, song_1, rand_1, 8388608) + "_SI35"))), StringEntry((key + "_SI36"), getStringValue((pick_one(song_0, song_1, rand_1, 16777216) + "_SI36"))), StringEntry((key + "_SI37"), getStringValue((pick_one(song_0, song_1, rand_1, 33554432) + "_SI37"))), StringEntry((key + "_SI40"), getStringValue((pick_one(song_0, song_1, rand_1, 67108864) + "_SI40"))), StringEntry((key + "_SI41"), getStringValue((pick_one(song_0, song_1, rand_1, 134217728) + "_SI41"))), StringEntry((key + "_SI42"), getStringValue((pick_one(song_0, song_1, rand_1, 268435456) + "_SI42"))), StringEntry((key + "_SI43"), getStringValue((pick_one(song_0, song_1, rand_1, 536870912) + "_SI43"))), StringEntry((key + "_SI44"), getStringValue((pick_one(song_0, song_1, rand_1, 1073741824) + "_SI44"))), StringEntry((key + "_SI45"), getStringValue((pick_one(song_0, song_1, rand_1, 2147483648) + "_SI45"))), StringEntry((key + "_SI46"), getStringValue((pick_one(song_0, song_1, rand_1, 4294967296) + "_SI46"))), StringEntry((key + "_SI47"), getStringValue((pick_one(song_0, song_1, rand_1, 8589934592) + "_SI47"))), ScriptTransfer(Address(i.caller.bytes), 1, id_b)] | |
60 | + | let name_short = take(("Clef " + toString(n)), 16) | |
61 | + | let description = hybrid_description | |
62 | + | let collection = hybrid_collection | |
63 | + | let id = match invoke(nft_creation_address, "createNFT", [name_short, description, getStringValue("market_image_link"), collection], nil) { | |
64 | + | case x: String => | |
65 | + | x | |
66 | + | case _ => | |
67 | + | throw("NFT creation failed") | |
68 | + | } | |
69 | + | if ((id == id)) | |
70 | + | then { | |
71 | + | let id_b = fromBase58String(id) | |
72 | + | let key = to_key(n) | |
73 | + | let bytes = unique_bytes(i) | |
74 | + | let rand_0 = random_uint(bytes, 0) | |
75 | + | let rand_1 = random_uint(bytes, 1) | |
76 | + | [IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), (max([getIntegerValue((song_0 + "_G")), getIntegerValue((song_1 + "_G"))]) + 1)), StringEntry((key + "_SL"), ""), IntegerEntry((key + "_SN"), rand_0), StringEntry((key + "_SP0"), song_0), StringEntry((key + "_SP1"), song_1), IntegerEntry((key + "_SB0"), getIntegerValue((pick_one(song_0, song_1, rand_0, 1) + "_SB0"))), IntegerEntry((key + "_SB1"), getIntegerValue((pick_one(song_0, song_1, rand_0, 2) + "_SB1"))), IntegerEntry((key + "_SB2"), getIntegerValue((pick_one(song_0, song_1, rand_0, 4) + "_SB2"))), IntegerEntry((key + "_ST"), getIntegerValue((pick_one(song_0, song_1, rand_0, 8) + "_ST"))), StringEntry((key + "_SC0"), getStringValue((pick_one(song_0, song_1, rand_0, 16) + "_SC0"))), StringEntry((key + "_SC1"), getStringValue((pick_one(song_0, song_1, rand_0, 32) + "_SC1"))), StringEntry((key + "_SC2"), getStringValue((pick_one(song_0, song_1, rand_0, 64) + "_SC2"))), StringEntry((key + "_SC3"), getStringValue((pick_one(song_0, song_1, rand_0, 128) + "_SC3"))), StringEntry((key + "_SC4"), getStringValue((pick_one(song_0, song_1, rand_0, 512) + "_SC4"))), StringEntry((key + "_SC5"), getStringValue((pick_one(song_0, song_1, rand_0, 1024) + "_SC5"))), StringEntry((key + "_SC6"), getStringValue((pick_one(song_0, song_1, rand_0, 2048) + "_SC6"))), StringEntry((key + "_SC7"), getStringValue((pick_one(song_0, song_1, rand_0, 4096) + "_SC7"))), StringEntry((key + "_SA"), getStringValue((pick_one(song_0, song_1, rand_0, 8192) + "_SA"))), StringEntry((key + "_SI0"), getStringValue((pick_one(song_0, song_1, rand_0, 16384) + "_SI0"))), StringEntry((key + "_SI1"), getStringValue((pick_one(song_0, song_1, rand_0, 32768) + "_SI1"))), StringEntry((key + "_SI2"), getStringValue((pick_one(song_0, song_1, rand_0, 65536) + "_SI2"))), StringEntry((key + "_SI3"), getStringValue((pick_one(song_0, song_1, rand_0, 131072) + "_SI3"))), StringEntry((key + "_SI4"), getStringValue((pick_one(song_0, song_1, rand_0, 262144) + "_SI4"))), StringEntry((key + "_SI5"), getStringValue((pick_one(song_0, song_1, rand_0, 524288) + "_SI5"))), StringEntry((key + "_SI50"), getStringValue((pick_one(song_0, song_1, rand_0, 1048576) + "_SI50"))), StringEntry((key + "_SI51"), getStringValue((pick_one(song_0, song_1, rand_0, 2097152) + "_SI51"))), StringEntry((key + "_SI52"), getStringValue((pick_one(song_0, song_1, rand_0, 4194304) + "_SI52"))), StringEntry((key + "_SI53"), getStringValue((pick_one(song_0, song_1, rand_0, 8388608) + "_SI53"))), StringEntry((key + "_SI54"), getStringValue((pick_one(song_0, song_1, rand_0, 16777216) + "_SI54"))), StringEntry((key + "_SI55"), getStringValue((pick_one(song_0, song_1, rand_0, 33554432) + "_SI55"))), StringEntry((key + "_SI56"), getStringValue((pick_one(song_0, song_1, rand_0, 67108864) + "_SI56"))), StringEntry((key + "_SI57"), getStringValue((pick_one(song_0, song_1, rand_0, 134217728) + "_SI57"))), StringEntry((key + "_SI00"), getStringValue((pick_one(song_0, song_1, rand_0, 268435456) + "_SI00"))), StringEntry((key + "_SI01"), getStringValue((pick_one(song_0, song_1, rand_0, 536870912) + "_SI01"))), StringEntry((key + "_SI02"), getStringValue((pick_one(song_0, song_1, rand_0, 1073741824) + "_SI02"))), StringEntry((key + "_SI03"), getStringValue((pick_one(song_0, song_1, rand_0, 2147483648) + "_SI03"))), StringEntry((key + "_SI04"), getStringValue((pick_one(song_0, song_1, rand_0, 4294967296) + "_SI04"))), StringEntry((key + "_SI05"), getStringValue((pick_one(song_0, song_1, rand_0, 8589934592) + "_SI05"))), StringEntry((key + "_SI06"), getStringValue((pick_one(song_0, song_1, rand_1, 1) + "_SI06"))), StringEntry((key + "_SI07"), getStringValue((pick_one(song_0, song_1, rand_1, 2) + "_SI07"))), StringEntry((key + "_SI10"), getStringValue((pick_one(song_0, song_1, rand_1, 4) + "_SI10"))), StringEntry((key + "_SI11"), getStringValue((pick_one(song_0, song_1, rand_1, 8) + "_SI11"))), StringEntry((key + "_SI12"), getStringValue((pick_one(song_0, song_1, rand_1, 16) + "_SI12"))), StringEntry((key + "_SI13"), getStringValue((pick_one(song_0, song_1, rand_1, 32) + "_SI13"))), StringEntry((key + "_SI14"), getStringValue((pick_one(song_0, song_1, rand_1, 64) + "_SI14"))), StringEntry((key + "_SI15"), getStringValue((pick_one(song_0, song_1, rand_1, 128) + "_SI15"))), StringEntry((key + "_SI16"), getStringValue((pick_one(song_0, song_1, rand_1, 256) + "_SI16"))), StringEntry((key + "_SI17"), getStringValue((pick_one(song_0, song_1, rand_1, 512) + "_SI17"))), StringEntry((key + "_SI20"), getStringValue((pick_one(song_0, song_1, rand_1, 1024) + "_SI20"))), StringEntry((key + "_SI21"), getStringValue((pick_one(song_0, song_1, rand_1, 2048) + "_SI21"))), StringEntry((key + "_SI22"), getStringValue((pick_one(song_0, song_1, rand_1, 4096) + "_SI22"))), StringEntry((key + "_SI23"), getStringValue((pick_one(song_0, song_1, rand_1, 8192) + "_SI23"))), StringEntry((key + "_SI24"), getStringValue((pick_one(song_0, song_1, rand_1, 16384) + "_SI24"))), StringEntry((key + "_SI25"), getStringValue((pick_one(song_0, song_1, rand_1, 32768) + "_SI25"))), StringEntry((key + "_SI26"), getStringValue((pick_one(song_0, song_1, rand_1, 65536) + "_SI26"))), StringEntry((key + "_SI27"), getStringValue((pick_one(song_0, song_1, rand_1, 131072) + "_SI27"))), StringEntry((key + "_SI30"), getStringValue((pick_one(song_0, song_1, rand_1, 262144) + "_SI30"))), StringEntry((key + "_SI31"), getStringValue((pick_one(song_0, song_1, rand_1, 524288) + "_SI31"))), StringEntry((key + "_SI32"), getStringValue((pick_one(song_0, song_1, rand_1, 1048576) + "_SI32"))), StringEntry((key + "_SI33"), getStringValue((pick_one(song_0, song_1, rand_1, 2097152) + "_SI33"))), StringEntry((key + "_SI34"), getStringValue((pick_one(song_0, song_1, rand_1, 4194304) + "_SI34"))), StringEntry((key + "_SI35"), getStringValue((pick_one(song_0, song_1, rand_1, 8388608) + "_SI35"))), StringEntry((key + "_SI36"), getStringValue((pick_one(song_0, song_1, rand_1, 16777216) + "_SI36"))), StringEntry((key + "_SI37"), getStringValue((pick_one(song_0, song_1, rand_1, 33554432) + "_SI37"))), StringEntry((key + "_SI40"), getStringValue((pick_one(song_0, song_1, rand_1, 67108864) + "_SI40"))), StringEntry((key + "_SI41"), getStringValue((pick_one(song_0, song_1, rand_1, 134217728) + "_SI41"))), StringEntry((key + "_SI42"), getStringValue((pick_one(song_0, song_1, rand_1, 268435456) + "_SI42"))), StringEntry((key + "_SI43"), getStringValue((pick_one(song_0, song_1, rand_1, 536870912) + "_SI43"))), StringEntry((key + "_SI44"), getStringValue((pick_one(song_0, song_1, rand_1, 1073741824) + "_SI44"))), StringEntry((key + "_SI45"), getStringValue((pick_one(song_0, song_1, rand_1, 2147483648) + "_SI45"))), StringEntry((key + "_SI46"), getStringValue((pick_one(song_0, song_1, rand_1, 4294967296) + "_SI46"))), StringEntry((key + "_SI47"), getStringValue((pick_one(song_0, song_1, rand_1, 8589934592) + "_SI47"))), ScriptTransfer(Address(i.caller.bytes), 1, id_b)] | |
77 | + | } | |
78 | + | else throw("Strict value is not equal to itself.") | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func check_whitelist (caller) = if ((this == caller)) | |
83 | + | then true | |
84 | + | else match getBoolean(("W_" + toBase58String(caller.bytes))) { | |
85 | + | case x: Boolean => | |
86 | + | x | |
87 | + | case _ => | |
88 | + | false | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | func fold_set_rarity (accum,index) = { | |
93 | + | let $t098009837 = accum | |
94 | + | let entries = $t098009837._1 | |
95 | + | let assets = $t098009837._2 | |
96 | + | let values = $t098009837._3 | |
97 | + | if ((index >= size(assets))) | |
98 | + | then accum | |
99 | + | else if (if ((0 > values[index])) | |
100 | + | then true | |
101 | + | else (values[index] > 100)) | |
102 | + | then throw("Invalid rarity value (must be in range from 0 to 100)") | |
103 | + | else $Tuple3((entries :+ IntegerEntry(("rarity_" + assets[index]), values[index])), assets, values) | |
58 | 104 | } | |
59 | 105 | ||
60 | 106 | ||
61 | 107 | @Callable(i) | |
62 | - | func | |
108 | + | func whitelist_add (user) = if ((this != i.caller)) | |
63 | 109 | then throw("Caller is not dApp owner") | |
64 | - | else $Tuple2([ | |
110 | + | else $Tuple2([BooleanEntry(("W_" + user), true)], unit) | |
65 | 111 | ||
66 | 112 | ||
67 | 113 | ||
68 | 114 | @Callable(i) | |
69 | - | func | |
115 | + | func whitelist_remove (user) = if ((this != i.caller)) | |
70 | 116 | then throw("Caller is not dApp owner") | |
117 | + | else $Tuple2([DeleteEntry(("W_" + user))], unit) | |
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | @Callable(i) | |
122 | + | func set_daemon (address) = if ((this != i.caller)) | |
123 | + | then throw("Caller is not dApp owner") | |
124 | + | else $Tuple2([StringEntry("daemon", address)], unit) | |
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | @Callable(i) | |
129 | + | func set_rarity (assets,values) = if (match getString("daemon") { | |
130 | + | case x: String => | |
131 | + | (x != toBase58String(i.caller.bytes)) | |
132 | + | case _ => | |
133 | + | true | |
134 | + | }) | |
135 | + | then throw("Caller is not daemon") | |
136 | + | else if ((size(assets) == 0)) | |
137 | + | then throw("No assets") | |
138 | + | else if ((size(assets) > 20)) | |
139 | + | then throw("To many assets (must be no more than 20)") | |
140 | + | else if ((size(assets) != size(values))) | |
141 | + | then throw("Assets and values list size mismatch") | |
142 | + | else { | |
143 | + | let $t01114011235 = { | |
144 | + | let $l = indices_20 | |
145 | + | let $s = size($l) | |
146 | + | let $acc0 = $Tuple3(nil, assets, values) | |
147 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
148 | + | then $a | |
149 | + | else fold_set_rarity($a, $l[$i]) | |
150 | + | ||
151 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
152 | + | then $a | |
153 | + | else throw("List size exceeds 20") | |
154 | + | ||
155 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
156 | + | } | |
157 | + | let entries = $t01114011235._1 | |
158 | + | let assets_ = $t01114011235._2 | |
159 | + | let values_ = $t01114011235._3 | |
160 | + | $Tuple2(entries, unit) | |
161 | + | } | |
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | @Callable(i) | |
166 | + | func set_market_image (url) = if (!(check_whitelist(i.caller))) | |
167 | + | then throw("Caller not in whitelist") | |
168 | + | else $Tuple2([StringEntry("market_image_link", url)], unit) | |
169 | + | ||
170 | + | ||
171 | + | ||
172 | + | @Callable(i) | |
173 | + | func set_price_hybrid (token,amount,increment) = if (!(check_whitelist(i.caller))) | |
174 | + | then throw("Caller not in whitelist") | |
175 | + | else $Tuple2([StringEntry("price_hybrid_token", token), IntegerEntry("price_hybrid_amount", amount), IntegerEntry("price_hybrid_increment", increment)], unit) | |
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | @Callable(i) | |
180 | + | func mint_chord (index,name,notes) = if (!(check_whitelist(i.caller))) | |
181 | + | then throw("Caller not in whitelist") | |
71 | 182 | else if ((size(notes) != 5)) | |
72 | 183 | then throw("Wrong notes size") | |
73 | 184 | else { | |
77 | 188 | case _ => | |
78 | 189 | 0 | |
79 | 190 | } | |
80 | - | let key = to_key( | |
81 | - | $Tuple2([IntegerEntry("count", ( | |
191 | + | let key = to_key(index) | |
192 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_CL"), name), IntegerEntry((key + "_C0"), notes[0]), IntegerEntry((key + "_C1"), notes[1]), IntegerEntry((key + "_C2"), notes[2]), IntegerEntry((key + "_C3"), notes[3]), IntegerEntry((key + "_C4"), notes[4])], unit) | |
82 | 193 | } | |
83 | 194 | ||
84 | 195 | ||
85 | 196 | ||
86 | 197 | @Callable(i) | |
87 | - | func mint_ | |
88 | - | then throw("Caller | |
198 | + | func mint_arpeggio (index,name,notes) = if (!(check_whitelist(i.caller))) | |
199 | + | then throw("Caller not in whitelist") | |
89 | 200 | else if ((size(notes) != 16)) | |
90 | 201 | then throw("Wrong notes size") | |
91 | 202 | else { | |
95 | 206 | case _ => | |
96 | 207 | 0 | |
97 | 208 | } | |
98 | - | let key = to_key( | |
99 | - | $Tuple2([IntegerEntry("count", ( | |
209 | + | let key = to_key(index) | |
210 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_AL"), name), IntegerEntry((key + "_A00"), notes[0]), IntegerEntry((key + "_A01"), notes[1]), IntegerEntry((key + "_A02"), notes[2]), IntegerEntry((key + "_A03"), notes[3]), IntegerEntry((key + "_A04"), notes[4]), IntegerEntry((key + "_A05"), notes[5]), IntegerEntry((key + "_A06"), notes[6]), IntegerEntry((key + "_A07"), notes[7]), IntegerEntry((key + "_A08"), notes[8]), IntegerEntry((key + "_A09"), notes[9]), IntegerEntry((key + "_A10"), notes[10]), IntegerEntry((key + "_A11"), notes[11]), IntegerEntry((key + "_A12"), notes[12]), IntegerEntry((key + "_A13"), notes[13]), IntegerEntry((key + "_A14"), notes[14]), IntegerEntry((key + "_A15"), notes[15])], unit) | |
100 | 211 | } | |
101 | 212 | ||
102 | 213 | ||
103 | 214 | ||
104 | 215 | @Callable(i) | |
105 | - | func mint_rhythm (name,scale,notes) = if (( | |
106 | - | then throw("Caller | |
216 | + | func mint_rhythm (index,name,scale,notes) = if (!(check_whitelist(i.caller))) | |
217 | + | then throw("Caller not in whitelist") | |
107 | 218 | else if ((size(notes) != 16)) | |
108 | 219 | then throw("Wrong notes size") | |
109 | 220 | else { | |
113 | 224 | case _ => | |
114 | 225 | 0 | |
115 | 226 | } | |
116 | - | let key = to_key( | |
117 | - | $Tuple2([IntegerEntry("count", ( | |
227 | + | let key = to_key(index) | |
228 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_RL"), name), IntegerEntry((key + "_RS"), scale), IntegerEntry((key + "_R00"), notes[0]), IntegerEntry((key + "_R01"), notes[1]), IntegerEntry((key + "_R02"), notes[2]), IntegerEntry((key + "_R03"), notes[3]), IntegerEntry((key + "_R04"), notes[4]), IntegerEntry((key + "_R05"), notes[5]), IntegerEntry((key + "_R06"), notes[6]), IntegerEntry((key + "_R07"), notes[7]), IntegerEntry((key + "_R08"), notes[8]), IntegerEntry((key + "_R09"), notes[9]), IntegerEntry((key + "_R10"), notes[10]), IntegerEntry((key + "_R11"), notes[11]), IntegerEntry((key + "_R12"), notes[12]), IntegerEntry((key + "_R13"), notes[13]), IntegerEntry((key + "_R14"), notes[14]), IntegerEntry((key + "_R15"), notes[15])], unit) | |
118 | 229 | } | |
119 | 230 | ||
120 | 231 | ||
121 | 232 | ||
122 | 233 | @Callable(i) | |
123 | - | func mint_song (name,parent_0,parent_1,bpm,bar_size,beat_size,tonality,chords,melody,kick_instrument,snare_instrument,hihat_instrument,bass_instrument,back_instrument,lead_instrument,kick_rhythms,snare_rhythms,hihat_rhythms,bass_rhythms,back_rhythms,lead_rhythms) = if ((this != i.caller)) | |
124 | - | then throw("Caller is not dApp owner") | |
234 | + | func burn_internal (asset_id) = if (!(check_whitelist(i.caller))) | |
235 | + | then throw("Caller not in whitelist") | |
236 | + | else { | |
237 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [AttachedPayment(fromBase58String(asset_id), 1)]) | |
238 | + | if ((burn0 == burn0)) | |
239 | + | then $Tuple2(nil, unit) | |
240 | + | else throw("Strict value is not equal to itself.") | |
241 | + | } | |
242 | + | ||
243 | + | ||
244 | + | ||
245 | + | @Callable(i) | |
246 | + | func burn () = if (!(check_whitelist(i.caller))) | |
247 | + | then throw("Caller not in whitelist") | |
248 | + | else { | |
249 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[0]]) | |
250 | + | if ((burn0 == burn0)) | |
251 | + | then $Tuple2(nil, unit) | |
252 | + | else throw("Strict value is not equal to itself.") | |
253 | + | } | |
254 | + | ||
255 | + | ||
256 | + | ||
257 | + | @Callable(i) | |
258 | + | func mint_song (name,parent_0,parent_1,bpm,bar_size,beat_size,tonality,chords,arpeggio,kick_instrument,snare_instrument,hihat_instrument,bass_instrument,back_instrument,lead_instrument,kick_rhythms,snare_rhythms,hihat_rhythms,bass_rhythms,back_rhythms,lead_rhythms) = if (!(check_whitelist(i.caller))) | |
259 | + | then throw("Caller not in whitelist") | |
125 | 260 | else if ((size(chords) != 8)) | |
126 | 261 | then throw("Wrong chords size") | |
127 | 262 | else if ((size(kick_rhythms) != 8)) | |
143 | 278 | case _ => | |
144 | 279 | 0 | |
145 | 280 | } | |
146 | - | let issue = Issue(take(name, 16), "Clef song.", 1, 0, false) | |
147 | - | let id = toBase58String(calculateAssetId(issue)) | |
148 | - | let key = to_key(n) | |
149 | - | $Tuple2([issue, IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), 1), StringEntry((key + "_SL"), name), IntegerEntry((key + "_SN"), 0), StringEntry((key + "_SP0"), parent_0), StringEntry((key + "_SP1"), parent_1), IntegerEntry((key + "_SB0"), bpm), IntegerEntry((key + "_SB1"), bar_size), IntegerEntry((key + "_SB2"), beat_size), IntegerEntry((key + "_ST"), tonality), StringEntry((key + "_SC0"), chords[0]), StringEntry((key + "_SC1"), chords[1]), StringEntry((key + "_SC2"), chords[2]), StringEntry((key + "_SC3"), chords[3]), StringEntry((key + "_SC4"), chords[4]), StringEntry((key + "_SC5"), chords[5]), StringEntry((key + "_SC6"), chords[6]), StringEntry((key + "_SC7"), chords[7]), StringEntry((key + "_SM"), melody), StringEntry((key + "_SI0"), kick_instrument), StringEntry((key + "_SI1"), snare_instrument), StringEntry((key + "_SI2"), hihat_instrument), StringEntry((key + "_SI3"), bass_instrument), StringEntry((key + "_SI4"), back_instrument), StringEntry((key + "_SI5"), lead_instrument), StringEntry((key + "_SI00"), kick_rhythms[0]), StringEntry((key + "_SI01"), kick_rhythms[1]), StringEntry((key + "_SI02"), kick_rhythms[2]), StringEntry((key + "_SI03"), kick_rhythms[3]), StringEntry((key + "_SI04"), kick_rhythms[4]), StringEntry((key + "_SI05"), kick_rhythms[5]), StringEntry((key + "_SI06"), kick_rhythms[6]), StringEntry((key + "_SI07"), kick_rhythms[7]), StringEntry((key + "_SI10"), snare_rhythms[0]), StringEntry((key + "_SI11"), snare_rhythms[1]), StringEntry((key + "_SI12"), snare_rhythms[2]), StringEntry((key + "_SI13"), snare_rhythms[3]), StringEntry((key + "_SI14"), snare_rhythms[4]), StringEntry((key + "_SI15"), snare_rhythms[5]), StringEntry((key + "_SI16"), snare_rhythms[6]), StringEntry((key + "_SI17"), snare_rhythms[7]), StringEntry((key + "_SI20"), hihat_rhythms[0]), StringEntry((key + "_SI21"), hihat_rhythms[1]), StringEntry((key + "_SI22"), hihat_rhythms[2]), StringEntry((key + "_SI23"), hihat_rhythms[3]), StringEntry((key + "_SI24"), hihat_rhythms[4]), StringEntry((key + "_SI25"), hihat_rhythms[5]), StringEntry((key + "_SI26"), hihat_rhythms[6]), StringEntry((key + "_SI27"), hihat_rhythms[7]), StringEntry((key + "_SI30"), bass_rhythms[0]), StringEntry((key + "_SI31"), bass_rhythms[1]), StringEntry((key + "_SI32"), bass_rhythms[2]), StringEntry((key + "_SI33"), bass_rhythms[3]), StringEntry((key + "_SI34"), bass_rhythms[4]), StringEntry((key + "_SI35"), bass_rhythms[5]), StringEntry((key + "_SI36"), bass_rhythms[6]), StringEntry((key + "_SI37"), bass_rhythms[7]), StringEntry((key + "_SI40"), back_rhythms[0]), StringEntry((key + "_SI41"), back_rhythms[1]), StringEntry((key + "_SI42"), back_rhythms[2]), StringEntry((key + "_SI43"), back_rhythms[3]), StringEntry((key + "_SI44"), back_rhythms[4]), StringEntry((key + "_SI45"), back_rhythms[5]), StringEntry((key + "_SI46"), back_rhythms[6]), StringEntry((key + "_SI47"), back_rhythms[7]), StringEntry((key + "_SI50"), lead_rhythms[0]), StringEntry((key + "_SI51"), lead_rhythms[1]), StringEntry((key + "_SI52"), lead_rhythms[2]), StringEntry((key + "_SI53"), lead_rhythms[3]), StringEntry((key + "_SI54"), lead_rhythms[4]), StringEntry((key + "_SI55"), lead_rhythms[5]), StringEntry((key + "_SI56"), lead_rhythms[6]), StringEntry((key + "_SI57"), lead_rhythms[7])], unit) | |
281 | + | let name_short = take(name, 16) | |
282 | + | let description = mint_description | |
283 | + | let collection = mint_collection | |
284 | + | let id = match invoke(nft_creation_address, "createNFT", [name_short, description, getStringValue("market_image_link"), collection], nil) { | |
285 | + | case x: String => | |
286 | + | x | |
287 | + | case _ => | |
288 | + | throw("NFT creation failed") | |
289 | + | } | |
290 | + | if ((id == id)) | |
291 | + | then { | |
292 | + | let key = to_key(n) | |
293 | + | let tx_transfer = if ((this != i.caller)) | |
294 | + | then [ScriptTransfer(Address(i.caller.bytes), 1, fromBase58String(id))] | |
295 | + | else nil | |
296 | + | $Tuple2(([IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), 1), StringEntry((key + "_SL"), name), IntegerEntry((key + "_SN"), 0), StringEntry((key + "_SP0"), parent_0), StringEntry((key + "_SP1"), parent_1), IntegerEntry((key + "_SB0"), bpm), IntegerEntry((key + "_SB1"), bar_size), IntegerEntry((key + "_SB2"), beat_size), IntegerEntry((key + "_ST"), tonality), StringEntry((key + "_SC0"), chords[0]), StringEntry((key + "_SC1"), chords[1]), StringEntry((key + "_SC2"), chords[2]), StringEntry((key + "_SC3"), chords[3]), StringEntry((key + "_SC4"), chords[4]), StringEntry((key + "_SC5"), chords[5]), StringEntry((key + "_SC6"), chords[6]), StringEntry((key + "_SC7"), chords[7]), StringEntry((key + "_SA"), arpeggio), StringEntry((key + "_SI0"), kick_instrument), StringEntry((key + "_SI1"), snare_instrument), StringEntry((key + "_SI2"), hihat_instrument), StringEntry((key + "_SI3"), bass_instrument), StringEntry((key + "_SI4"), back_instrument), StringEntry((key + "_SI5"), lead_instrument), StringEntry((key + "_SI00"), kick_rhythms[0]), StringEntry((key + "_SI01"), kick_rhythms[1]), StringEntry((key + "_SI02"), kick_rhythms[2]), StringEntry((key + "_SI03"), kick_rhythms[3]), StringEntry((key + "_SI04"), kick_rhythms[4]), StringEntry((key + "_SI05"), kick_rhythms[5]), StringEntry((key + "_SI06"), kick_rhythms[6]), StringEntry((key + "_SI07"), kick_rhythms[7]), StringEntry((key + "_SI10"), snare_rhythms[0]), StringEntry((key + "_SI11"), snare_rhythms[1]), StringEntry((key + "_SI12"), snare_rhythms[2]), StringEntry((key + "_SI13"), snare_rhythms[3]), StringEntry((key + "_SI14"), snare_rhythms[4]), StringEntry((key + "_SI15"), snare_rhythms[5]), StringEntry((key + "_SI16"), snare_rhythms[6]), StringEntry((key + "_SI17"), snare_rhythms[7]), StringEntry((key + "_SI20"), hihat_rhythms[0]), StringEntry((key + "_SI21"), hihat_rhythms[1]), StringEntry((key + "_SI22"), hihat_rhythms[2]), StringEntry((key + "_SI23"), hihat_rhythms[3]), StringEntry((key + "_SI24"), hihat_rhythms[4]), StringEntry((key + "_SI25"), hihat_rhythms[5]), StringEntry((key + "_SI26"), hihat_rhythms[6]), StringEntry((key + "_SI27"), hihat_rhythms[7]), StringEntry((key + "_SI30"), bass_rhythms[0]), StringEntry((key + "_SI31"), bass_rhythms[1]), StringEntry((key + "_SI32"), bass_rhythms[2]), StringEntry((key + "_SI33"), bass_rhythms[3]), StringEntry((key + "_SI34"), bass_rhythms[4]), StringEntry((key + "_SI35"), bass_rhythms[5]), StringEntry((key + "_SI36"), bass_rhythms[6]), StringEntry((key + "_SI37"), bass_rhythms[7]), StringEntry((key + "_SI40"), back_rhythms[0]), StringEntry((key + "_SI41"), back_rhythms[1]), StringEntry((key + "_SI42"), back_rhythms[2]), StringEntry((key + "_SI43"), back_rhythms[3]), StringEntry((key + "_SI44"), back_rhythms[4]), StringEntry((key + "_SI45"), back_rhythms[5]), StringEntry((key + "_SI46"), back_rhythms[6]), StringEntry((key + "_SI47"), back_rhythms[7]), StringEntry((key + "_SI50"), lead_rhythms[0]), StringEntry((key + "_SI51"), lead_rhythms[1]), StringEntry((key + "_SI52"), lead_rhythms[2]), StringEntry((key + "_SI53"), lead_rhythms[3]), StringEntry((key + "_SI54"), lead_rhythms[4]), StringEntry((key + "_SI55"), lead_rhythms[5]), StringEntry((key + "_SI56"), lead_rhythms[6]), StringEntry((key + "_SI57"), lead_rhythms[7])] ++ tx_transfer), unit) | |
297 | + | } | |
298 | + | else throw("Strict value is not equal to itself.") | |
150 | 299 | } | |
151 | 300 | ||
152 | 301 | ||
156 | 305 | let caller_addr = Address(i.caller.bytes) | |
157 | 306 | let song_0_id = fromBase58String(getStringValue(song_0)) | |
158 | 307 | let song_1_id = fromBase58String(getStringValue(song_1)) | |
159 | - | if (!(check_hybrid_payment(i))) | |
308 | + | let price_amount = getIntegerValue("price_hybrid_amount") | |
309 | + | let price_token = getStringValue("price_hybrid_token") | |
310 | + | let price_change = hybrid_calculate_change(i, price_token, price_amount) | |
311 | + | if ((0 > price_change)) | |
160 | 312 | then throw("Wrong payment") | |
161 | 313 | else if ((song_0_id == song_1_id)) | |
162 | 314 | then throw("Songs should be different") | |
164 | 316 | then throw("Caller do not own first song") | |
165 | 317 | else if ((1 > assetBalance(caller_addr, song_1_id))) | |
166 | 318 | then throw("Caller do not own second song") | |
167 | - | else $Tuple2(make_hybrid_tx(i, song_0, song_1), unit) | |
319 | + | else { | |
320 | + | let mint_count = match getInteger("mint_count") { | |
321 | + | case j: Int => | |
322 | + | j | |
323 | + | case _ => | |
324 | + | 0 | |
325 | + | } | |
326 | + | let price_count_inc = IntegerEntry("mint_count", (mint_count + 1)) | |
327 | + | let price_increase = if (((mint_count % price_increase_period) == (price_increase_period - 1))) | |
328 | + | then [price_count_inc, IntegerEntry("price_hybrid_amount", (price_amount + getIntegerValue("price_hybrid_increment")))] | |
329 | + | else [price_count_inc] | |
330 | + | if ((price_change > 0)) | |
331 | + | then $Tuple2(((make_hybrid_tx(i, song_0, song_1) ++ price_increase) ++ [ScriptTransfer(Address(i.caller.bytes), price_change, if ((price_token == "")) | |
332 | + | then unit | |
333 | + | else fromBase58String(price_token))]), unit) | |
334 | + | else $Tuple2((make_hybrid_tx(i, song_0, song_1) ++ price_increase), unit) | |
335 | + | } | |
168 | 336 | } | |
169 | 337 | ||
170 | 338 | ||
194 | 362 | else { | |
195 | 363 | let song_0 = getStringValue(toBase58String(song_0_id)) | |
196 | 364 | let song_1 = getStringValue(toBase58String(song_1_id)) | |
197 | - | $Tuple2((make_hybrid_tx(i, song_0, song_1) ++ [Burn(song_0_id, 1), Burn(song_1_id, 1)]), unit) | |
365 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[0]]) | |
366 | + | if ((burn0 == burn0)) | |
367 | + | then { | |
368 | + | let burn1 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[1]]) | |
369 | + | if ((burn1 == burn1)) | |
370 | + | then $Tuple2(make_hybrid_tx(i, song_0, song_1), unit) | |
371 | + | else throw("Strict value is not equal to itself.") | |
372 | + | } | |
373 | + | else throw("Strict value is not equal to itself.") | |
198 | 374 | } | |
199 | 375 | } | |
200 | 376 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let nft_creation_address = Address(base58'3NCbmjGV7YHKdkHEfWkfGhmZyXsJbymQ5Z5') | |
5 | + | ||
6 | + | let price_increase_period = 10 | |
7 | + | ||
8 | + | let mint_collection = "Clef genesis songs" | |
9 | + | ||
10 | + | let mint_description = "Genesis Clef song. This melody is crafted to become your electronic jam. Use it on clef.one 💚🤍" | |
11 | + | ||
12 | + | let hybrid_collection = "Clef mixes" | |
13 | + | ||
14 | + | let hybrid_description = "Clef mix. This melody was created by an algorithm. Enjoy this jam or use it on clef.one" | |
15 | + | ||
16 | + | let indices_20 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
17 | + | ||
4 | 18 | func to_key (n) = toBase58String(toBytes(n)) | |
5 | 19 | ||
6 | 20 | ||
7 | 21 | func unique_bytes (i) = ((((i.transactionId + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
8 | 22 | ||
9 | 23 | ||
10 | 24 | func random_uint (bytes,nonce) = { | |
11 | 25 | let n = toInt(sha256_16Kb((bytes + toBytes(nonce)))) | |
12 | 26 | if ((0 > n)) | |
13 | 27 | then -(n) | |
14 | 28 | else n | |
15 | 29 | } | |
16 | 30 | ||
17 | 31 | ||
18 | 32 | func pick_one (key_0,key_1,rand_int,bit_power) = if ((((rand_int / bit_power) % 2) == 0)) | |
19 | 33 | then key_0 | |
20 | 34 | else key_1 | |
21 | 35 | ||
22 | 36 | ||
23 | - | func | |
24 | - | then | |
37 | + | func hybrid_calculate_change (i,token,amount) = if ((size(i.payments) != 1)) | |
38 | + | then -1 | |
25 | 39 | else { | |
26 | 40 | let p = i.payments[0] | |
27 | 41 | let p_token = match p.assetId { | |
28 | 42 | case id: ByteVector => | |
29 | 43 | toBase58String(id) | |
30 | 44 | case _ => | |
31 | 45 | "" | |
32 | 46 | } | |
33 | - | let token = getStringValue("price_hybrid_token") | |
34 | - | let amount = getIntegerValue("price_hybrid_amount") | |
35 | 47 | if ((p_token != token)) | |
36 | - | then false | |
37 | - | else if ((amount != p.amount)) | |
38 | - | then false | |
39 | - | else true | |
48 | + | then -1 | |
49 | + | else (p.amount - amount) | |
40 | 50 | } | |
41 | 51 | ||
42 | 52 | ||
43 | 53 | func make_hybrid_tx (i,song_0,song_1) = { | |
44 | 54 | let n = match getInteger("count") { | |
45 | 55 | case j: Int => | |
46 | 56 | j | |
47 | 57 | case _ => | |
48 | 58 | 0 | |
49 | 59 | } | |
50 | - | let issue = Issue(("Clef " + toString(n)), "Clef song.", 1, 0, false) | |
51 | - | let id_b = calculateAssetId(issue) | |
52 | - | let id = toBase58String(id_b) | |
53 | - | let key = to_key(n) | |
54 | - | let bytes = unique_bytes(i) | |
55 | - | let rand_0 = random_uint(bytes, 0) | |
56 | - | let rand_1 = random_uint(bytes, 1) | |
57 | - | [issue, IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), (max([getIntegerValue((song_0 + "_G")), getIntegerValue((song_1 + "_G"))]) + 1)), StringEntry((key + "_SL"), ""), IntegerEntry((key + "_SN"), rand_0), StringEntry((key + "_SP0"), song_0), StringEntry((key + "_SP1"), song_1), IntegerEntry((key + "_SB0"), getIntegerValue((pick_one(song_0, song_1, rand_0, 1) + "_SB0"))), IntegerEntry((key + "_SB1"), getIntegerValue((pick_one(song_0, song_1, rand_0, 2) + "_SB1"))), IntegerEntry((key + "_SB2"), getIntegerValue((pick_one(song_0, song_1, rand_0, 4) + "_SB2"))), IntegerEntry((key + "_ST"), getIntegerValue((pick_one(song_0, song_1, rand_0, 8) + "_ST"))), StringEntry((key + "_SC0"), getStringValue((pick_one(song_0, song_1, rand_0, 16) + "_SC0"))), StringEntry((key + "_SC1"), getStringValue((pick_one(song_0, song_1, rand_0, 32) + "_SC1"))), StringEntry((key + "_SC2"), getStringValue((pick_one(song_0, song_1, rand_0, 64) + "_SC2"))), StringEntry((key + "_SC3"), getStringValue((pick_one(song_0, song_1, rand_0, 128) + "_SC3"))), StringEntry((key + "_SC4"), getStringValue((pick_one(song_0, song_1, rand_0, 512) + "_SC4"))), StringEntry((key + "_SC5"), getStringValue((pick_one(song_0, song_1, rand_0, 1024) + "_SC5"))), StringEntry((key + "_SC6"), getStringValue((pick_one(song_0, song_1, rand_0, 2048) + "_SC6"))), StringEntry((key + "_SC7"), getStringValue((pick_one(song_0, song_1, rand_0, 4096) + "_SC7"))), StringEntry((key + "_SM"), getStringValue((pick_one(song_0, song_1, rand_0, 8192) + "_SM"))), StringEntry((key + "_SI0"), getStringValue((pick_one(song_0, song_1, rand_0, 16384) + "_SI0"))), StringEntry((key + "_SI1"), getStringValue((pick_one(song_0, song_1, rand_0, 32768) + "_SI1"))), StringEntry((key + "_SI2"), getStringValue((pick_one(song_0, song_1, rand_0, 65536) + "_SI2"))), StringEntry((key + "_SI3"), getStringValue((pick_one(song_0, song_1, rand_0, 131072) + "_SI3"))), StringEntry((key + "_SI4"), getStringValue((pick_one(song_0, song_1, rand_0, 262144) + "_SI4"))), StringEntry((key + "_SI5"), getStringValue((pick_one(song_0, song_1, rand_0, 524288) + "_SI5"))), StringEntry((key + "_SI50"), getStringValue((pick_one(song_0, song_1, rand_0, 1048576) + "_SI50"))), StringEntry((key + "_SI51"), getStringValue((pick_one(song_0, song_1, rand_0, 2097152) + "_SI51"))), StringEntry((key + "_SI52"), getStringValue((pick_one(song_0, song_1, rand_0, 4194304) + "_SI52"))), StringEntry((key + "_SI53"), getStringValue((pick_one(song_0, song_1, rand_0, 8388608) + "_SI53"))), StringEntry((key + "_SI54"), getStringValue((pick_one(song_0, song_1, rand_0, 16777216) + "_SI54"))), StringEntry((key + "_SI55"), getStringValue((pick_one(song_0, song_1, rand_0, 33554432) + "_SI55"))), StringEntry((key + "_SI56"), getStringValue((pick_one(song_0, song_1, rand_0, 67108864) + "_SI56"))), StringEntry((key + "_SI57"), getStringValue((pick_one(song_0, song_1, rand_0, 134217728) + "_SI57"))), StringEntry((key + "_SI00"), getStringValue((pick_one(song_0, song_1, rand_0, 268435456) + "_SI00"))), StringEntry((key + "_SI01"), getStringValue((pick_one(song_0, song_1, rand_0, 536870912) + "_SI01"))), StringEntry((key + "_SI02"), getStringValue((pick_one(song_0, song_1, rand_0, 1073741824) + "_SI02"))), StringEntry((key + "_SI03"), getStringValue((pick_one(song_0, song_1, rand_0, 2147483648) + "_SI03"))), StringEntry((key + "_SI04"), getStringValue((pick_one(song_0, song_1, rand_0, 4294967296) + "_SI04"))), StringEntry((key + "_SI05"), getStringValue((pick_one(song_0, song_1, rand_0, 8589934592) + "_SI05"))), StringEntry((key + "_SI06"), getStringValue((pick_one(song_0, song_1, rand_1, 1) + "_SI06"))), StringEntry((key + "_SI07"), getStringValue((pick_one(song_0, song_1, rand_1, 2) + "_SI07"))), StringEntry((key + "_SI10"), getStringValue((pick_one(song_0, song_1, rand_1, 4) + "_SI10"))), StringEntry((key + "_SI11"), getStringValue((pick_one(song_0, song_1, rand_1, 8) + "_SI11"))), StringEntry((key + "_SI12"), getStringValue((pick_one(song_0, song_1, rand_1, 16) + "_SI12"))), StringEntry((key + "_SI13"), getStringValue((pick_one(song_0, song_1, rand_1, 32) + "_SI13"))), StringEntry((key + "_SI14"), getStringValue((pick_one(song_0, song_1, rand_1, 64) + "_SI14"))), StringEntry((key + "_SI15"), getStringValue((pick_one(song_0, song_1, rand_1, 128) + "_SI15"))), StringEntry((key + "_SI16"), getStringValue((pick_one(song_0, song_1, rand_1, 256) + "_SI16"))), StringEntry((key + "_SI17"), getStringValue((pick_one(song_0, song_1, rand_1, 512) + "_SI17"))), StringEntry((key + "_SI20"), getStringValue((pick_one(song_0, song_1, rand_1, 1024) + "_SI20"))), StringEntry((key + "_SI21"), getStringValue((pick_one(song_0, song_1, rand_1, 2048) + "_SI21"))), StringEntry((key + "_SI22"), getStringValue((pick_one(song_0, song_1, rand_1, 4096) + "_SI22"))), StringEntry((key + "_SI23"), getStringValue((pick_one(song_0, song_1, rand_1, 8192) + "_SI23"))), StringEntry((key + "_SI24"), getStringValue((pick_one(song_0, song_1, rand_1, 16384) + "_SI24"))), StringEntry((key + "_SI25"), getStringValue((pick_one(song_0, song_1, rand_1, 32768) + "_SI25"))), StringEntry((key + "_SI26"), getStringValue((pick_one(song_0, song_1, rand_1, 65536) + "_SI26"))), StringEntry((key + "_SI27"), getStringValue((pick_one(song_0, song_1, rand_1, 131072) + "_SI27"))), StringEntry((key + "_SI30"), getStringValue((pick_one(song_0, song_1, rand_1, 262144) + "_SI30"))), StringEntry((key + "_SI31"), getStringValue((pick_one(song_0, song_1, rand_1, 524288) + "_SI31"))), StringEntry((key + "_SI32"), getStringValue((pick_one(song_0, song_1, rand_1, 1048576) + "_SI32"))), StringEntry((key + "_SI33"), getStringValue((pick_one(song_0, song_1, rand_1, 2097152) + "_SI33"))), StringEntry((key + "_SI34"), getStringValue((pick_one(song_0, song_1, rand_1, 4194304) + "_SI34"))), StringEntry((key + "_SI35"), getStringValue((pick_one(song_0, song_1, rand_1, 8388608) + "_SI35"))), StringEntry((key + "_SI36"), getStringValue((pick_one(song_0, song_1, rand_1, 16777216) + "_SI36"))), StringEntry((key + "_SI37"), getStringValue((pick_one(song_0, song_1, rand_1, 33554432) + "_SI37"))), StringEntry((key + "_SI40"), getStringValue((pick_one(song_0, song_1, rand_1, 67108864) + "_SI40"))), StringEntry((key + "_SI41"), getStringValue((pick_one(song_0, song_1, rand_1, 134217728) + "_SI41"))), StringEntry((key + "_SI42"), getStringValue((pick_one(song_0, song_1, rand_1, 268435456) + "_SI42"))), StringEntry((key + "_SI43"), getStringValue((pick_one(song_0, song_1, rand_1, 536870912) + "_SI43"))), StringEntry((key + "_SI44"), getStringValue((pick_one(song_0, song_1, rand_1, 1073741824) + "_SI44"))), StringEntry((key + "_SI45"), getStringValue((pick_one(song_0, song_1, rand_1, 2147483648) + "_SI45"))), StringEntry((key + "_SI46"), getStringValue((pick_one(song_0, song_1, rand_1, 4294967296) + "_SI46"))), StringEntry((key + "_SI47"), getStringValue((pick_one(song_0, song_1, rand_1, 8589934592) + "_SI47"))), ScriptTransfer(Address(i.caller.bytes), 1, id_b)] | |
60 | + | let name_short = take(("Clef " + toString(n)), 16) | |
61 | + | let description = hybrid_description | |
62 | + | let collection = hybrid_collection | |
63 | + | let id = match invoke(nft_creation_address, "createNFT", [name_short, description, getStringValue("market_image_link"), collection], nil) { | |
64 | + | case x: String => | |
65 | + | x | |
66 | + | case _ => | |
67 | + | throw("NFT creation failed") | |
68 | + | } | |
69 | + | if ((id == id)) | |
70 | + | then { | |
71 | + | let id_b = fromBase58String(id) | |
72 | + | let key = to_key(n) | |
73 | + | let bytes = unique_bytes(i) | |
74 | + | let rand_0 = random_uint(bytes, 0) | |
75 | + | let rand_1 = random_uint(bytes, 1) | |
76 | + | [IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), (max([getIntegerValue((song_0 + "_G")), getIntegerValue((song_1 + "_G"))]) + 1)), StringEntry((key + "_SL"), ""), IntegerEntry((key + "_SN"), rand_0), StringEntry((key + "_SP0"), song_0), StringEntry((key + "_SP1"), song_1), IntegerEntry((key + "_SB0"), getIntegerValue((pick_one(song_0, song_1, rand_0, 1) + "_SB0"))), IntegerEntry((key + "_SB1"), getIntegerValue((pick_one(song_0, song_1, rand_0, 2) + "_SB1"))), IntegerEntry((key + "_SB2"), getIntegerValue((pick_one(song_0, song_1, rand_0, 4) + "_SB2"))), IntegerEntry((key + "_ST"), getIntegerValue((pick_one(song_0, song_1, rand_0, 8) + "_ST"))), StringEntry((key + "_SC0"), getStringValue((pick_one(song_0, song_1, rand_0, 16) + "_SC0"))), StringEntry((key + "_SC1"), getStringValue((pick_one(song_0, song_1, rand_0, 32) + "_SC1"))), StringEntry((key + "_SC2"), getStringValue((pick_one(song_0, song_1, rand_0, 64) + "_SC2"))), StringEntry((key + "_SC3"), getStringValue((pick_one(song_0, song_1, rand_0, 128) + "_SC3"))), StringEntry((key + "_SC4"), getStringValue((pick_one(song_0, song_1, rand_0, 512) + "_SC4"))), StringEntry((key + "_SC5"), getStringValue((pick_one(song_0, song_1, rand_0, 1024) + "_SC5"))), StringEntry((key + "_SC6"), getStringValue((pick_one(song_0, song_1, rand_0, 2048) + "_SC6"))), StringEntry((key + "_SC7"), getStringValue((pick_one(song_0, song_1, rand_0, 4096) + "_SC7"))), StringEntry((key + "_SA"), getStringValue((pick_one(song_0, song_1, rand_0, 8192) + "_SA"))), StringEntry((key + "_SI0"), getStringValue((pick_one(song_0, song_1, rand_0, 16384) + "_SI0"))), StringEntry((key + "_SI1"), getStringValue((pick_one(song_0, song_1, rand_0, 32768) + "_SI1"))), StringEntry((key + "_SI2"), getStringValue((pick_one(song_0, song_1, rand_0, 65536) + "_SI2"))), StringEntry((key + "_SI3"), getStringValue((pick_one(song_0, song_1, rand_0, 131072) + "_SI3"))), StringEntry((key + "_SI4"), getStringValue((pick_one(song_0, song_1, rand_0, 262144) + "_SI4"))), StringEntry((key + "_SI5"), getStringValue((pick_one(song_0, song_1, rand_0, 524288) + "_SI5"))), StringEntry((key + "_SI50"), getStringValue((pick_one(song_0, song_1, rand_0, 1048576) + "_SI50"))), StringEntry((key + "_SI51"), getStringValue((pick_one(song_0, song_1, rand_0, 2097152) + "_SI51"))), StringEntry((key + "_SI52"), getStringValue((pick_one(song_0, song_1, rand_0, 4194304) + "_SI52"))), StringEntry((key + "_SI53"), getStringValue((pick_one(song_0, song_1, rand_0, 8388608) + "_SI53"))), StringEntry((key + "_SI54"), getStringValue((pick_one(song_0, song_1, rand_0, 16777216) + "_SI54"))), StringEntry((key + "_SI55"), getStringValue((pick_one(song_0, song_1, rand_0, 33554432) + "_SI55"))), StringEntry((key + "_SI56"), getStringValue((pick_one(song_0, song_1, rand_0, 67108864) + "_SI56"))), StringEntry((key + "_SI57"), getStringValue((pick_one(song_0, song_1, rand_0, 134217728) + "_SI57"))), StringEntry((key + "_SI00"), getStringValue((pick_one(song_0, song_1, rand_0, 268435456) + "_SI00"))), StringEntry((key + "_SI01"), getStringValue((pick_one(song_0, song_1, rand_0, 536870912) + "_SI01"))), StringEntry((key + "_SI02"), getStringValue((pick_one(song_0, song_1, rand_0, 1073741824) + "_SI02"))), StringEntry((key + "_SI03"), getStringValue((pick_one(song_0, song_1, rand_0, 2147483648) + "_SI03"))), StringEntry((key + "_SI04"), getStringValue((pick_one(song_0, song_1, rand_0, 4294967296) + "_SI04"))), StringEntry((key + "_SI05"), getStringValue((pick_one(song_0, song_1, rand_0, 8589934592) + "_SI05"))), StringEntry((key + "_SI06"), getStringValue((pick_one(song_0, song_1, rand_1, 1) + "_SI06"))), StringEntry((key + "_SI07"), getStringValue((pick_one(song_0, song_1, rand_1, 2) + "_SI07"))), StringEntry((key + "_SI10"), getStringValue((pick_one(song_0, song_1, rand_1, 4) + "_SI10"))), StringEntry((key + "_SI11"), getStringValue((pick_one(song_0, song_1, rand_1, 8) + "_SI11"))), StringEntry((key + "_SI12"), getStringValue((pick_one(song_0, song_1, rand_1, 16) + "_SI12"))), StringEntry((key + "_SI13"), getStringValue((pick_one(song_0, song_1, rand_1, 32) + "_SI13"))), StringEntry((key + "_SI14"), getStringValue((pick_one(song_0, song_1, rand_1, 64) + "_SI14"))), StringEntry((key + "_SI15"), getStringValue((pick_one(song_0, song_1, rand_1, 128) + "_SI15"))), StringEntry((key + "_SI16"), getStringValue((pick_one(song_0, song_1, rand_1, 256) + "_SI16"))), StringEntry((key + "_SI17"), getStringValue((pick_one(song_0, song_1, rand_1, 512) + "_SI17"))), StringEntry((key + "_SI20"), getStringValue((pick_one(song_0, song_1, rand_1, 1024) + "_SI20"))), StringEntry((key + "_SI21"), getStringValue((pick_one(song_0, song_1, rand_1, 2048) + "_SI21"))), StringEntry((key + "_SI22"), getStringValue((pick_one(song_0, song_1, rand_1, 4096) + "_SI22"))), StringEntry((key + "_SI23"), getStringValue((pick_one(song_0, song_1, rand_1, 8192) + "_SI23"))), StringEntry((key + "_SI24"), getStringValue((pick_one(song_0, song_1, rand_1, 16384) + "_SI24"))), StringEntry((key + "_SI25"), getStringValue((pick_one(song_0, song_1, rand_1, 32768) + "_SI25"))), StringEntry((key + "_SI26"), getStringValue((pick_one(song_0, song_1, rand_1, 65536) + "_SI26"))), StringEntry((key + "_SI27"), getStringValue((pick_one(song_0, song_1, rand_1, 131072) + "_SI27"))), StringEntry((key + "_SI30"), getStringValue((pick_one(song_0, song_1, rand_1, 262144) + "_SI30"))), StringEntry((key + "_SI31"), getStringValue((pick_one(song_0, song_1, rand_1, 524288) + "_SI31"))), StringEntry((key + "_SI32"), getStringValue((pick_one(song_0, song_1, rand_1, 1048576) + "_SI32"))), StringEntry((key + "_SI33"), getStringValue((pick_one(song_0, song_1, rand_1, 2097152) + "_SI33"))), StringEntry((key + "_SI34"), getStringValue((pick_one(song_0, song_1, rand_1, 4194304) + "_SI34"))), StringEntry((key + "_SI35"), getStringValue((pick_one(song_0, song_1, rand_1, 8388608) + "_SI35"))), StringEntry((key + "_SI36"), getStringValue((pick_one(song_0, song_1, rand_1, 16777216) + "_SI36"))), StringEntry((key + "_SI37"), getStringValue((pick_one(song_0, song_1, rand_1, 33554432) + "_SI37"))), StringEntry((key + "_SI40"), getStringValue((pick_one(song_0, song_1, rand_1, 67108864) + "_SI40"))), StringEntry((key + "_SI41"), getStringValue((pick_one(song_0, song_1, rand_1, 134217728) + "_SI41"))), StringEntry((key + "_SI42"), getStringValue((pick_one(song_0, song_1, rand_1, 268435456) + "_SI42"))), StringEntry((key + "_SI43"), getStringValue((pick_one(song_0, song_1, rand_1, 536870912) + "_SI43"))), StringEntry((key + "_SI44"), getStringValue((pick_one(song_0, song_1, rand_1, 1073741824) + "_SI44"))), StringEntry((key + "_SI45"), getStringValue((pick_one(song_0, song_1, rand_1, 2147483648) + "_SI45"))), StringEntry((key + "_SI46"), getStringValue((pick_one(song_0, song_1, rand_1, 4294967296) + "_SI46"))), StringEntry((key + "_SI47"), getStringValue((pick_one(song_0, song_1, rand_1, 8589934592) + "_SI47"))), ScriptTransfer(Address(i.caller.bytes), 1, id_b)] | |
77 | + | } | |
78 | + | else throw("Strict value is not equal to itself.") | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func check_whitelist (caller) = if ((this == caller)) | |
83 | + | then true | |
84 | + | else match getBoolean(("W_" + toBase58String(caller.bytes))) { | |
85 | + | case x: Boolean => | |
86 | + | x | |
87 | + | case _ => | |
88 | + | false | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | func fold_set_rarity (accum,index) = { | |
93 | + | let $t098009837 = accum | |
94 | + | let entries = $t098009837._1 | |
95 | + | let assets = $t098009837._2 | |
96 | + | let values = $t098009837._3 | |
97 | + | if ((index >= size(assets))) | |
98 | + | then accum | |
99 | + | else if (if ((0 > values[index])) | |
100 | + | then true | |
101 | + | else (values[index] > 100)) | |
102 | + | then throw("Invalid rarity value (must be in range from 0 to 100)") | |
103 | + | else $Tuple3((entries :+ IntegerEntry(("rarity_" + assets[index]), values[index])), assets, values) | |
58 | 104 | } | |
59 | 105 | ||
60 | 106 | ||
61 | 107 | @Callable(i) | |
62 | - | func | |
108 | + | func whitelist_add (user) = if ((this != i.caller)) | |
63 | 109 | then throw("Caller is not dApp owner") | |
64 | - | else $Tuple2([ | |
110 | + | else $Tuple2([BooleanEntry(("W_" + user), true)], unit) | |
65 | 111 | ||
66 | 112 | ||
67 | 113 | ||
68 | 114 | @Callable(i) | |
69 | - | func | |
115 | + | func whitelist_remove (user) = if ((this != i.caller)) | |
70 | 116 | then throw("Caller is not dApp owner") | |
117 | + | else $Tuple2([DeleteEntry(("W_" + user))], unit) | |
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | @Callable(i) | |
122 | + | func set_daemon (address) = if ((this != i.caller)) | |
123 | + | then throw("Caller is not dApp owner") | |
124 | + | else $Tuple2([StringEntry("daemon", address)], unit) | |
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | @Callable(i) | |
129 | + | func set_rarity (assets,values) = if (match getString("daemon") { | |
130 | + | case x: String => | |
131 | + | (x != toBase58String(i.caller.bytes)) | |
132 | + | case _ => | |
133 | + | true | |
134 | + | }) | |
135 | + | then throw("Caller is not daemon") | |
136 | + | else if ((size(assets) == 0)) | |
137 | + | then throw("No assets") | |
138 | + | else if ((size(assets) > 20)) | |
139 | + | then throw("To many assets (must be no more than 20)") | |
140 | + | else if ((size(assets) != size(values))) | |
141 | + | then throw("Assets and values list size mismatch") | |
142 | + | else { | |
143 | + | let $t01114011235 = { | |
144 | + | let $l = indices_20 | |
145 | + | let $s = size($l) | |
146 | + | let $acc0 = $Tuple3(nil, assets, values) | |
147 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
148 | + | then $a | |
149 | + | else fold_set_rarity($a, $l[$i]) | |
150 | + | ||
151 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
152 | + | then $a | |
153 | + | else throw("List size exceeds 20") | |
154 | + | ||
155 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
156 | + | } | |
157 | + | let entries = $t01114011235._1 | |
158 | + | let assets_ = $t01114011235._2 | |
159 | + | let values_ = $t01114011235._3 | |
160 | + | $Tuple2(entries, unit) | |
161 | + | } | |
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | @Callable(i) | |
166 | + | func set_market_image (url) = if (!(check_whitelist(i.caller))) | |
167 | + | then throw("Caller not in whitelist") | |
168 | + | else $Tuple2([StringEntry("market_image_link", url)], unit) | |
169 | + | ||
170 | + | ||
171 | + | ||
172 | + | @Callable(i) | |
173 | + | func set_price_hybrid (token,amount,increment) = if (!(check_whitelist(i.caller))) | |
174 | + | then throw("Caller not in whitelist") | |
175 | + | else $Tuple2([StringEntry("price_hybrid_token", token), IntegerEntry("price_hybrid_amount", amount), IntegerEntry("price_hybrid_increment", increment)], unit) | |
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | @Callable(i) | |
180 | + | func mint_chord (index,name,notes) = if (!(check_whitelist(i.caller))) | |
181 | + | then throw("Caller not in whitelist") | |
71 | 182 | else if ((size(notes) != 5)) | |
72 | 183 | then throw("Wrong notes size") | |
73 | 184 | else { | |
74 | 185 | let n = match getInteger("count") { | |
75 | 186 | case j: Int => | |
76 | 187 | j | |
77 | 188 | case _ => | |
78 | 189 | 0 | |
79 | 190 | } | |
80 | - | let key = to_key( | |
81 | - | $Tuple2([IntegerEntry("count", ( | |
191 | + | let key = to_key(index) | |
192 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_CL"), name), IntegerEntry((key + "_C0"), notes[0]), IntegerEntry((key + "_C1"), notes[1]), IntegerEntry((key + "_C2"), notes[2]), IntegerEntry((key + "_C3"), notes[3]), IntegerEntry((key + "_C4"), notes[4])], unit) | |
82 | 193 | } | |
83 | 194 | ||
84 | 195 | ||
85 | 196 | ||
86 | 197 | @Callable(i) | |
87 | - | func mint_ | |
88 | - | then throw("Caller | |
198 | + | func mint_arpeggio (index,name,notes) = if (!(check_whitelist(i.caller))) | |
199 | + | then throw("Caller not in whitelist") | |
89 | 200 | else if ((size(notes) != 16)) | |
90 | 201 | then throw("Wrong notes size") | |
91 | 202 | else { | |
92 | 203 | let n = match getInteger("count") { | |
93 | 204 | case j: Int => | |
94 | 205 | j | |
95 | 206 | case _ => | |
96 | 207 | 0 | |
97 | 208 | } | |
98 | - | let key = to_key( | |
99 | - | $Tuple2([IntegerEntry("count", ( | |
209 | + | let key = to_key(index) | |
210 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_AL"), name), IntegerEntry((key + "_A00"), notes[0]), IntegerEntry((key + "_A01"), notes[1]), IntegerEntry((key + "_A02"), notes[2]), IntegerEntry((key + "_A03"), notes[3]), IntegerEntry((key + "_A04"), notes[4]), IntegerEntry((key + "_A05"), notes[5]), IntegerEntry((key + "_A06"), notes[6]), IntegerEntry((key + "_A07"), notes[7]), IntegerEntry((key + "_A08"), notes[8]), IntegerEntry((key + "_A09"), notes[9]), IntegerEntry((key + "_A10"), notes[10]), IntegerEntry((key + "_A11"), notes[11]), IntegerEntry((key + "_A12"), notes[12]), IntegerEntry((key + "_A13"), notes[13]), IntegerEntry((key + "_A14"), notes[14]), IntegerEntry((key + "_A15"), notes[15])], unit) | |
100 | 211 | } | |
101 | 212 | ||
102 | 213 | ||
103 | 214 | ||
104 | 215 | @Callable(i) | |
105 | - | func mint_rhythm (name,scale,notes) = if (( | |
106 | - | then throw("Caller | |
216 | + | func mint_rhythm (index,name,scale,notes) = if (!(check_whitelist(i.caller))) | |
217 | + | then throw("Caller not in whitelist") | |
107 | 218 | else if ((size(notes) != 16)) | |
108 | 219 | then throw("Wrong notes size") | |
109 | 220 | else { | |
110 | 221 | let n = match getInteger("count") { | |
111 | 222 | case j: Int => | |
112 | 223 | j | |
113 | 224 | case _ => | |
114 | 225 | 0 | |
115 | 226 | } | |
116 | - | let key = to_key( | |
117 | - | $Tuple2([IntegerEntry("count", ( | |
227 | + | let key = to_key(index) | |
228 | + | $Tuple2([IntegerEntry("count", max([(index + 1), n])), StringEntry((key + "_RL"), name), IntegerEntry((key + "_RS"), scale), IntegerEntry((key + "_R00"), notes[0]), IntegerEntry((key + "_R01"), notes[1]), IntegerEntry((key + "_R02"), notes[2]), IntegerEntry((key + "_R03"), notes[3]), IntegerEntry((key + "_R04"), notes[4]), IntegerEntry((key + "_R05"), notes[5]), IntegerEntry((key + "_R06"), notes[6]), IntegerEntry((key + "_R07"), notes[7]), IntegerEntry((key + "_R08"), notes[8]), IntegerEntry((key + "_R09"), notes[9]), IntegerEntry((key + "_R10"), notes[10]), IntegerEntry((key + "_R11"), notes[11]), IntegerEntry((key + "_R12"), notes[12]), IntegerEntry((key + "_R13"), notes[13]), IntegerEntry((key + "_R14"), notes[14]), IntegerEntry((key + "_R15"), notes[15])], unit) | |
118 | 229 | } | |
119 | 230 | ||
120 | 231 | ||
121 | 232 | ||
122 | 233 | @Callable(i) | |
123 | - | func mint_song (name,parent_0,parent_1,bpm,bar_size,beat_size,tonality,chords,melody,kick_instrument,snare_instrument,hihat_instrument,bass_instrument,back_instrument,lead_instrument,kick_rhythms,snare_rhythms,hihat_rhythms,bass_rhythms,back_rhythms,lead_rhythms) = if ((this != i.caller)) | |
124 | - | then throw("Caller is not dApp owner") | |
234 | + | func burn_internal (asset_id) = if (!(check_whitelist(i.caller))) | |
235 | + | then throw("Caller not in whitelist") | |
236 | + | else { | |
237 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [AttachedPayment(fromBase58String(asset_id), 1)]) | |
238 | + | if ((burn0 == burn0)) | |
239 | + | then $Tuple2(nil, unit) | |
240 | + | else throw("Strict value is not equal to itself.") | |
241 | + | } | |
242 | + | ||
243 | + | ||
244 | + | ||
245 | + | @Callable(i) | |
246 | + | func burn () = if (!(check_whitelist(i.caller))) | |
247 | + | then throw("Caller not in whitelist") | |
248 | + | else { | |
249 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[0]]) | |
250 | + | if ((burn0 == burn0)) | |
251 | + | then $Tuple2(nil, unit) | |
252 | + | else throw("Strict value is not equal to itself.") | |
253 | + | } | |
254 | + | ||
255 | + | ||
256 | + | ||
257 | + | @Callable(i) | |
258 | + | func mint_song (name,parent_0,parent_1,bpm,bar_size,beat_size,tonality,chords,arpeggio,kick_instrument,snare_instrument,hihat_instrument,bass_instrument,back_instrument,lead_instrument,kick_rhythms,snare_rhythms,hihat_rhythms,bass_rhythms,back_rhythms,lead_rhythms) = if (!(check_whitelist(i.caller))) | |
259 | + | then throw("Caller not in whitelist") | |
125 | 260 | else if ((size(chords) != 8)) | |
126 | 261 | then throw("Wrong chords size") | |
127 | 262 | else if ((size(kick_rhythms) != 8)) | |
128 | 263 | then throw("Wrong kick rhythms size") | |
129 | 264 | else if ((size(snare_rhythms) != 8)) | |
130 | 265 | then throw("Wrong snare rhythms size") | |
131 | 266 | else if ((size(hihat_rhythms) != 8)) | |
132 | 267 | then throw("Wrong hihat rhythms size") | |
133 | 268 | else if ((size(bass_rhythms) != 8)) | |
134 | 269 | then throw("Wrong bass rhythms size") | |
135 | 270 | else if ((size(back_rhythms) != 8)) | |
136 | 271 | then throw("Wrong back rhythms size") | |
137 | 272 | else if ((size(lead_rhythms) != 8)) | |
138 | 273 | then throw("Wrong lead rhythms size") | |
139 | 274 | else { | |
140 | 275 | let n = match getInteger("count") { | |
141 | 276 | case j: Int => | |
142 | 277 | j | |
143 | 278 | case _ => | |
144 | 279 | 0 | |
145 | 280 | } | |
146 | - | let issue = Issue(take(name, 16), "Clef song.", 1, 0, false) | |
147 | - | let id = toBase58String(calculateAssetId(issue)) | |
148 | - | let key = to_key(n) | |
149 | - | $Tuple2([issue, IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), 1), StringEntry((key + "_SL"), name), IntegerEntry((key + "_SN"), 0), StringEntry((key + "_SP0"), parent_0), StringEntry((key + "_SP1"), parent_1), IntegerEntry((key + "_SB0"), bpm), IntegerEntry((key + "_SB1"), bar_size), IntegerEntry((key + "_SB2"), beat_size), IntegerEntry((key + "_ST"), tonality), StringEntry((key + "_SC0"), chords[0]), StringEntry((key + "_SC1"), chords[1]), StringEntry((key + "_SC2"), chords[2]), StringEntry((key + "_SC3"), chords[3]), StringEntry((key + "_SC4"), chords[4]), StringEntry((key + "_SC5"), chords[5]), StringEntry((key + "_SC6"), chords[6]), StringEntry((key + "_SC7"), chords[7]), StringEntry((key + "_SM"), melody), StringEntry((key + "_SI0"), kick_instrument), StringEntry((key + "_SI1"), snare_instrument), StringEntry((key + "_SI2"), hihat_instrument), StringEntry((key + "_SI3"), bass_instrument), StringEntry((key + "_SI4"), back_instrument), StringEntry((key + "_SI5"), lead_instrument), StringEntry((key + "_SI00"), kick_rhythms[0]), StringEntry((key + "_SI01"), kick_rhythms[1]), StringEntry((key + "_SI02"), kick_rhythms[2]), StringEntry((key + "_SI03"), kick_rhythms[3]), StringEntry((key + "_SI04"), kick_rhythms[4]), StringEntry((key + "_SI05"), kick_rhythms[5]), StringEntry((key + "_SI06"), kick_rhythms[6]), StringEntry((key + "_SI07"), kick_rhythms[7]), StringEntry((key + "_SI10"), snare_rhythms[0]), StringEntry((key + "_SI11"), snare_rhythms[1]), StringEntry((key + "_SI12"), snare_rhythms[2]), StringEntry((key + "_SI13"), snare_rhythms[3]), StringEntry((key + "_SI14"), snare_rhythms[4]), StringEntry((key + "_SI15"), snare_rhythms[5]), StringEntry((key + "_SI16"), snare_rhythms[6]), StringEntry((key + "_SI17"), snare_rhythms[7]), StringEntry((key + "_SI20"), hihat_rhythms[0]), StringEntry((key + "_SI21"), hihat_rhythms[1]), StringEntry((key + "_SI22"), hihat_rhythms[2]), StringEntry((key + "_SI23"), hihat_rhythms[3]), StringEntry((key + "_SI24"), hihat_rhythms[4]), StringEntry((key + "_SI25"), hihat_rhythms[5]), StringEntry((key + "_SI26"), hihat_rhythms[6]), StringEntry((key + "_SI27"), hihat_rhythms[7]), StringEntry((key + "_SI30"), bass_rhythms[0]), StringEntry((key + "_SI31"), bass_rhythms[1]), StringEntry((key + "_SI32"), bass_rhythms[2]), StringEntry((key + "_SI33"), bass_rhythms[3]), StringEntry((key + "_SI34"), bass_rhythms[4]), StringEntry((key + "_SI35"), bass_rhythms[5]), StringEntry((key + "_SI36"), bass_rhythms[6]), StringEntry((key + "_SI37"), bass_rhythms[7]), StringEntry((key + "_SI40"), back_rhythms[0]), StringEntry((key + "_SI41"), back_rhythms[1]), StringEntry((key + "_SI42"), back_rhythms[2]), StringEntry((key + "_SI43"), back_rhythms[3]), StringEntry((key + "_SI44"), back_rhythms[4]), StringEntry((key + "_SI45"), back_rhythms[5]), StringEntry((key + "_SI46"), back_rhythms[6]), StringEntry((key + "_SI47"), back_rhythms[7]), StringEntry((key + "_SI50"), lead_rhythms[0]), StringEntry((key + "_SI51"), lead_rhythms[1]), StringEntry((key + "_SI52"), lead_rhythms[2]), StringEntry((key + "_SI53"), lead_rhythms[3]), StringEntry((key + "_SI54"), lead_rhythms[4]), StringEntry((key + "_SI55"), lead_rhythms[5]), StringEntry((key + "_SI56"), lead_rhythms[6]), StringEntry((key + "_SI57"), lead_rhythms[7])], unit) | |
281 | + | let name_short = take(name, 16) | |
282 | + | let description = mint_description | |
283 | + | let collection = mint_collection | |
284 | + | let id = match invoke(nft_creation_address, "createNFT", [name_short, description, getStringValue("market_image_link"), collection], nil) { | |
285 | + | case x: String => | |
286 | + | x | |
287 | + | case _ => | |
288 | + | throw("NFT creation failed") | |
289 | + | } | |
290 | + | if ((id == id)) | |
291 | + | then { | |
292 | + | let key = to_key(n) | |
293 | + | let tx_transfer = if ((this != i.caller)) | |
294 | + | then [ScriptTransfer(Address(i.caller.bytes), 1, fromBase58String(id))] | |
295 | + | else nil | |
296 | + | $Tuple2(([IntegerEntry("count", (n + 1)), StringEntry(id, key), StringEntry(key, id), IntegerEntry((key + "_G"), 1), StringEntry((key + "_SL"), name), IntegerEntry((key + "_SN"), 0), StringEntry((key + "_SP0"), parent_0), StringEntry((key + "_SP1"), parent_1), IntegerEntry((key + "_SB0"), bpm), IntegerEntry((key + "_SB1"), bar_size), IntegerEntry((key + "_SB2"), beat_size), IntegerEntry((key + "_ST"), tonality), StringEntry((key + "_SC0"), chords[0]), StringEntry((key + "_SC1"), chords[1]), StringEntry((key + "_SC2"), chords[2]), StringEntry((key + "_SC3"), chords[3]), StringEntry((key + "_SC4"), chords[4]), StringEntry((key + "_SC5"), chords[5]), StringEntry((key + "_SC6"), chords[6]), StringEntry((key + "_SC7"), chords[7]), StringEntry((key + "_SA"), arpeggio), StringEntry((key + "_SI0"), kick_instrument), StringEntry((key + "_SI1"), snare_instrument), StringEntry((key + "_SI2"), hihat_instrument), StringEntry((key + "_SI3"), bass_instrument), StringEntry((key + "_SI4"), back_instrument), StringEntry((key + "_SI5"), lead_instrument), StringEntry((key + "_SI00"), kick_rhythms[0]), StringEntry((key + "_SI01"), kick_rhythms[1]), StringEntry((key + "_SI02"), kick_rhythms[2]), StringEntry((key + "_SI03"), kick_rhythms[3]), StringEntry((key + "_SI04"), kick_rhythms[4]), StringEntry((key + "_SI05"), kick_rhythms[5]), StringEntry((key + "_SI06"), kick_rhythms[6]), StringEntry((key + "_SI07"), kick_rhythms[7]), StringEntry((key + "_SI10"), snare_rhythms[0]), StringEntry((key + "_SI11"), snare_rhythms[1]), StringEntry((key + "_SI12"), snare_rhythms[2]), StringEntry((key + "_SI13"), snare_rhythms[3]), StringEntry((key + "_SI14"), snare_rhythms[4]), StringEntry((key + "_SI15"), snare_rhythms[5]), StringEntry((key + "_SI16"), snare_rhythms[6]), StringEntry((key + "_SI17"), snare_rhythms[7]), StringEntry((key + "_SI20"), hihat_rhythms[0]), StringEntry((key + "_SI21"), hihat_rhythms[1]), StringEntry((key + "_SI22"), hihat_rhythms[2]), StringEntry((key + "_SI23"), hihat_rhythms[3]), StringEntry((key + "_SI24"), hihat_rhythms[4]), StringEntry((key + "_SI25"), hihat_rhythms[5]), StringEntry((key + "_SI26"), hihat_rhythms[6]), StringEntry((key + "_SI27"), hihat_rhythms[7]), StringEntry((key + "_SI30"), bass_rhythms[0]), StringEntry((key + "_SI31"), bass_rhythms[1]), StringEntry((key + "_SI32"), bass_rhythms[2]), StringEntry((key + "_SI33"), bass_rhythms[3]), StringEntry((key + "_SI34"), bass_rhythms[4]), StringEntry((key + "_SI35"), bass_rhythms[5]), StringEntry((key + "_SI36"), bass_rhythms[6]), StringEntry((key + "_SI37"), bass_rhythms[7]), StringEntry((key + "_SI40"), back_rhythms[0]), StringEntry((key + "_SI41"), back_rhythms[1]), StringEntry((key + "_SI42"), back_rhythms[2]), StringEntry((key + "_SI43"), back_rhythms[3]), StringEntry((key + "_SI44"), back_rhythms[4]), StringEntry((key + "_SI45"), back_rhythms[5]), StringEntry((key + "_SI46"), back_rhythms[6]), StringEntry((key + "_SI47"), back_rhythms[7]), StringEntry((key + "_SI50"), lead_rhythms[0]), StringEntry((key + "_SI51"), lead_rhythms[1]), StringEntry((key + "_SI52"), lead_rhythms[2]), StringEntry((key + "_SI53"), lead_rhythms[3]), StringEntry((key + "_SI54"), lead_rhythms[4]), StringEntry((key + "_SI55"), lead_rhythms[5]), StringEntry((key + "_SI56"), lead_rhythms[6]), StringEntry((key + "_SI57"), lead_rhythms[7])] ++ tx_transfer), unit) | |
297 | + | } | |
298 | + | else throw("Strict value is not equal to itself.") | |
150 | 299 | } | |
151 | 300 | ||
152 | 301 | ||
153 | 302 | ||
154 | 303 | @Callable(i) | |
155 | 304 | func mint_hybrid (song_0,song_1) = { | |
156 | 305 | let caller_addr = Address(i.caller.bytes) | |
157 | 306 | let song_0_id = fromBase58String(getStringValue(song_0)) | |
158 | 307 | let song_1_id = fromBase58String(getStringValue(song_1)) | |
159 | - | if (!(check_hybrid_payment(i))) | |
308 | + | let price_amount = getIntegerValue("price_hybrid_amount") | |
309 | + | let price_token = getStringValue("price_hybrid_token") | |
310 | + | let price_change = hybrid_calculate_change(i, price_token, price_amount) | |
311 | + | if ((0 > price_change)) | |
160 | 312 | then throw("Wrong payment") | |
161 | 313 | else if ((song_0_id == song_1_id)) | |
162 | 314 | then throw("Songs should be different") | |
163 | 315 | else if ((1 > assetBalance(caller_addr, song_0_id))) | |
164 | 316 | then throw("Caller do not own first song") | |
165 | 317 | else if ((1 > assetBalance(caller_addr, song_1_id))) | |
166 | 318 | then throw("Caller do not own second song") | |
167 | - | else $Tuple2(make_hybrid_tx(i, song_0, song_1), unit) | |
319 | + | else { | |
320 | + | let mint_count = match getInteger("mint_count") { | |
321 | + | case j: Int => | |
322 | + | j | |
323 | + | case _ => | |
324 | + | 0 | |
325 | + | } | |
326 | + | let price_count_inc = IntegerEntry("mint_count", (mint_count + 1)) | |
327 | + | let price_increase = if (((mint_count % price_increase_period) == (price_increase_period - 1))) | |
328 | + | then [price_count_inc, IntegerEntry("price_hybrid_amount", (price_amount + getIntegerValue("price_hybrid_increment")))] | |
329 | + | else [price_count_inc] | |
330 | + | if ((price_change > 0)) | |
331 | + | then $Tuple2(((make_hybrid_tx(i, song_0, song_1) ++ price_increase) ++ [ScriptTransfer(Address(i.caller.bytes), price_change, if ((price_token == "")) | |
332 | + | then unit | |
333 | + | else fromBase58String(price_token))]), unit) | |
334 | + | else $Tuple2((make_hybrid_tx(i, song_0, song_1) ++ price_increase), unit) | |
335 | + | } | |
168 | 336 | } | |
169 | 337 | ||
170 | 338 | ||
171 | 339 | ||
172 | 340 | @Callable(i) | |
173 | 341 | func mint_hybrid_and_burn () = if (if (if ((size(i.payments) != 2)) | |
174 | 342 | then true | |
175 | 343 | else (i.payments[0].amount != 1)) | |
176 | 344 | then true | |
177 | 345 | else (i.payments[1].amount != 1)) | |
178 | 346 | then throw("Wrong payment") | |
179 | 347 | else { | |
180 | 348 | let song_0_id = match i.payments[0].assetId { | |
181 | 349 | case b: ByteVector => | |
182 | 350 | b | |
183 | 351 | case _ => | |
184 | 352 | throw("Wrong payment") | |
185 | 353 | } | |
186 | 354 | let song_1_id = match i.payments[1].assetId { | |
187 | 355 | case b: ByteVector => | |
188 | 356 | b | |
189 | 357 | case _ => | |
190 | 358 | throw("Wrong payment") | |
191 | 359 | } | |
192 | 360 | if ((song_0_id == song_1_id)) | |
193 | 361 | then throw("Songs should be different") | |
194 | 362 | else { | |
195 | 363 | let song_0 = getStringValue(toBase58String(song_0_id)) | |
196 | 364 | let song_1 = getStringValue(toBase58String(song_1_id)) | |
197 | - | $Tuple2((make_hybrid_tx(i, song_0, song_1) ++ [Burn(song_0_id, 1), Burn(song_1_id, 1)]), unit) | |
365 | + | let burn0 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[0]]) | |
366 | + | if ((burn0 == burn0)) | |
367 | + | then { | |
368 | + | let burn1 = invoke(nft_creation_address, "burnNFT", nil, [i.payments[1]]) | |
369 | + | if ((burn1 == burn1)) | |
370 | + | then $Tuple2(make_hybrid_tx(i, song_0, song_1), unit) | |
371 | + | else throw("Strict value is not equal to itself.") | |
372 | + | } | |
373 | + | else throw("Strict value is not equal to itself.") | |
198 | 374 | } | |
199 | 375 | } | |
200 | 376 | ||
201 | 377 |
github/deemru/w8io/169f3d6 106.17 ms ◑