19 | | - | func i (j) = ((((j.transactionId + j.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
20 | | - | |
---|
21 | | - | |
---|
22 | | - | func k (l,m) = { |
---|
23 | | - | let h = toInt(sha256_16Kb((l + toBytes(m)))) |
---|
24 | | - | if ((0 > h)) |
---|
25 | | - | then -(h) |
---|
26 | | - | else h |
---|
27 | | - | } |
---|
28 | | - | |
---|
29 | | - | |
---|
30 | | - | func n (o,p,q,r) = if ((((q / r) % 2) == 0)) |
---|
31 | | - | then o |
---|
32 | | - | else p |
---|
33 | | - | |
---|
34 | | - | |
---|
35 | | - | func s (j,t,u) = if ((size(j.payments) != 1)) |
---|
36 | | - | then -1 |
---|
37 | | - | else { |
---|
38 | | - | let v = j.payments[0] |
---|
39 | | - | let w = { |
---|
40 | | - | let x = v.assetId |
---|
41 | | - | if ($isInstanceOf(x, "ByteVector")) |
---|
42 | | - | then { |
---|
43 | | - | let y = x |
---|
44 | | - | toBase58String(y) |
---|
45 | | - | } |
---|
46 | | - | else "" |
---|
47 | | - | } |
---|
48 | | - | if ((w != t)) |
---|
49 | | - | then -1 |
---|
50 | | - | else (v.amount - u) |
---|
51 | | - | } |
---|
52 | | - | |
---|
53 | | - | |
---|
54 | | - | func z (j,A,B) = { |
---|
55 | | - | let h = { |
---|
56 | | - | let x = getInteger("count") |
---|
57 | | - | if ($isInstanceOf(x, "Int")) |
---|
58 | | - | then { |
---|
59 | | - | let C = x |
---|
60 | | - | C |
---|
61 | | - | } |
---|
62 | | - | else 0 |
---|
63 | | - | } |
---|
64 | | - | let D = take(("Clef " + toString(h)), 16) |
---|
65 | | - | let E = f |
---|
66 | | - | let F = e |
---|
67 | | - | let y = { |
---|
68 | | - | let x = invoke(a, "createNFT", [D, E, getStringValue("market_image_link"), F], nil) |
---|
69 | | - | if ($isInstanceOf(x, "String")) |
---|
70 | | - | then { |
---|
71 | | - | let G = x |
---|
72 | | - | G |
---|
73 | | - | } |
---|
74 | | - | else throw("NFT creation failed") |
---|
75 | | - | } |
---|
76 | | - | if ((y == y)) |
---|
77 | | - | then { |
---|
78 | | - | let H = fromBase58String(y) |
---|
79 | | - | let I = g(h) |
---|
80 | | - | let l = i(j) |
---|
81 | | - | let J = k(l, 0) |
---|
82 | | - | let K = k(l, 1) |
---|
83 | | - | [IntegerEntry("count", (h + 1)), StringEntry(y, I), StringEntry(I, y), IntegerEntry((I + "_G"), (max([getIntegerValue((A + "_G")), getIntegerValue((B + "_G"))]) + 1)), StringEntry((I + "_SL"), ""), IntegerEntry((I + "_SN"), J), StringEntry((I + "_SP0"), A), StringEntry((I + "_SP1"), B), IntegerEntry((I + "_SB0"), getIntegerValue((n(A, B, J, 1) + "_SB0"))), IntegerEntry((I + "_SB1"), getIntegerValue((n(A, B, J, 2) + "_SB1"))), IntegerEntry((I + "_SB2"), getIntegerValue((n(A, B, J, 4) + "_SB2"))), IntegerEntry((I + "_ST"), getIntegerValue((n(A, B, J, 8) + "_ST"))), StringEntry((I + "_SC0"), getStringValue((n(A, B, J, 16) + "_SC0"))), StringEntry((I + "_SC1"), getStringValue((n(A, B, J, 32) + "_SC1"))), StringEntry((I + "_SC2"), getStringValue((n(A, B, J, 64) + "_SC2"))), StringEntry((I + "_SC3"), getStringValue((n(A, B, J, 128) + "_SC3"))), StringEntry((I + "_SC4"), getStringValue((n(A, B, J, 512) + "_SC4"))), StringEntry((I + "_SC5"), getStringValue((n(A, B, J, 1024) + "_SC5"))), StringEntry((I + "_SC6"), getStringValue((n(A, B, J, 2048) + "_SC6"))), StringEntry((I + "_SC7"), getStringValue((n(A, B, J, 4096) + "_SC7"))), StringEntry((I + "_SA"), getStringValue((n(A, B, J, 8192) + "_SA"))), StringEntry((I + "_SI0"), getStringValue((n(A, B, J, 16384) + "_SI0"))), StringEntry((I + "_SI1"), getStringValue((n(A, B, J, 32768) + "_SI1"))), StringEntry((I + "_SI2"), getStringValue((n(A, B, J, 65536) + "_SI2"))), StringEntry((I + "_SI3"), getStringValue((n(A, B, J, 131072) + "_SI3"))), StringEntry((I + "_SI4"), getStringValue((n(A, B, J, 262144) + "_SI4"))), StringEntry((I + "_SI5"), getStringValue((n(A, B, J, 524288) + "_SI5"))), StringEntry((I + "_SI50"), getStringValue((n(A, B, J, 1048576) + "_SI50"))), StringEntry((I + "_SI51"), getStringValue((n(A, B, J, 2097152) + "_SI51"))), StringEntry((I + "_SI52"), getStringValue((n(A, B, J, 4194304) + "_SI52"))), StringEntry((I + "_SI53"), getStringValue((n(A, B, J, 8388608) + "_SI53"))), StringEntry((I + "_SI54"), getStringValue((n(A, B, J, 16777216) + "_SI54"))), StringEntry((I + "_SI55"), getStringValue((n(A, B, J, 33554432) + "_SI55"))), StringEntry((I + "_SI56"), getStringValue((n(A, B, J, 67108864) + "_SI56"))), StringEntry((I + "_SI57"), getStringValue((n(A, B, J, 134217728) + "_SI57"))), StringEntry((I + "_SI00"), getStringValue((n(A, B, J, 268435456) + "_SI00"))), StringEntry((I + "_SI01"), getStringValue((n(A, B, J, 536870912) + "_SI01"))), StringEntry((I + "_SI02"), getStringValue((n(A, B, J, 1073741824) + "_SI02"))), StringEntry((I + "_SI03"), getStringValue((n(A, B, J, 2147483648) + "_SI03"))), StringEntry((I + "_SI04"), getStringValue((n(A, B, J, 4294967296) + "_SI04"))), StringEntry((I + "_SI05"), getStringValue((n(A, B, J, 8589934592) + "_SI05"))), StringEntry((I + "_SI06"), getStringValue((n(A, B, K, 1) + "_SI06"))), StringEntry((I + "_SI07"), getStringValue((n(A, B, K, 2) + "_SI07"))), StringEntry((I + "_SI10"), getStringValue((n(A, B, K, 4) + "_SI10"))), StringEntry((I + "_SI11"), getStringValue((n(A, B, K, 8) + "_SI11"))), StringEntry((I + "_SI12"), getStringValue((n(A, B, K, 16) + "_SI12"))), StringEntry((I + "_SI13"), getStringValue((n(A, B, K, 32) + "_SI13"))), StringEntry((I + "_SI14"), getStringValue((n(A, B, K, 64) + "_SI14"))), StringEntry((I + "_SI15"), getStringValue((n(A, B, K, 128) + "_SI15"))), StringEntry((I + "_SI16"), getStringValue((n(A, B, K, 256) + "_SI16"))), StringEntry((I + "_SI17"), getStringValue((n(A, B, K, 512) + "_SI17"))), StringEntry((I + "_SI20"), getStringValue((n(A, B, K, 1024) + "_SI20"))), StringEntry((I + "_SI21"), getStringValue((n(A, B, K, 2048) + "_SI21"))), StringEntry((I + "_SI22"), getStringValue((n(A, B, K, 4096) + "_SI22"))), StringEntry((I + "_SI23"), getStringValue((n(A, B, K, 8192) + "_SI23"))), StringEntry((I + "_SI24"), getStringValue((n(A, B, K, 16384) + "_SI24"))), StringEntry((I + "_SI25"), getStringValue((n(A, B, K, 32768) + "_SI25"))), StringEntry((I + "_SI26"), getStringValue((n(A, B, K, 65536) + "_SI26"))), StringEntry((I + "_SI27"), getStringValue((n(A, B, K, 131072) + "_SI27"))), StringEntry((I + "_SI30"), getStringValue((n(A, B, K, 262144) + "_SI30"))), StringEntry((I + "_SI31"), getStringValue((n(A, B, K, 524288) + "_SI31"))), StringEntry((I + "_SI32"), getStringValue((n(A, B, K, 1048576) + "_SI32"))), StringEntry((I + "_SI33"), getStringValue((n(A, B, K, 2097152) + "_SI33"))), StringEntry((I + "_SI34"), getStringValue((n(A, B, K, 4194304) + "_SI34"))), StringEntry((I + "_SI35"), getStringValue((n(A, B, K, 8388608) + "_SI35"))), StringEntry((I + "_SI36"), getStringValue((n(A, B, K, 16777216) + "_SI36"))), StringEntry((I + "_SI37"), getStringValue((n(A, B, K, 33554432) + "_SI37"))), StringEntry((I + "_SI40"), getStringValue((n(A, B, K, 67108864) + "_SI40"))), StringEntry((I + "_SI41"), getStringValue((n(A, B, K, 134217728) + "_SI41"))), StringEntry((I + "_SI42"), getStringValue((n(A, B, K, 268435456) + "_SI42"))), StringEntry((I + "_SI43"), getStringValue((n(A, B, K, 536870912) + "_SI43"))), StringEntry((I + "_SI44"), getStringValue((n(A, B, K, 1073741824) + "_SI44"))), StringEntry((I + "_SI45"), getStringValue((n(A, B, K, 2147483648) + "_SI45"))), StringEntry((I + "_SI46"), getStringValue((n(A, B, K, 4294967296) + "_SI46"))), StringEntry((I + "_SI47"), getStringValue((n(A, B, K, 8589934592) + "_SI47"))), ScriptTransfer(Address(j.caller.bytes), 1, H)] |
---|
84 | | - | } |
---|
85 | | - | else throw("Strict value is not equal to itself.") |
---|
86 | | - | } |
---|
87 | | - | |
---|
88 | | - | |
---|
89 | | - | func L (M) = if ((this == M)) |
---|
90 | | - | then true |
---|
91 | | - | else { |
---|
92 | | - | let x = getBoolean(("W_" + toBase58String(M.bytes))) |
---|
93 | | - | if ($isInstanceOf(x, "Boolean")) |
---|
94 | | - | then { |
---|
95 | | - | let G = x |
---|
96 | | - | G |
---|
97 | | - | } |
---|
98 | | - | else false |
---|
99 | | - | } |
---|
100 | | - | |
---|
101 | | - | |
---|
102 | | - | @Callable(j) |
---|
103 | | - | func whitelist_add (N) = if ((this != j.caller)) |
---|
104 | | - | then throw("Caller is not dApp owner") |
---|
105 | | - | else $Tuple2([BooleanEntry(("W_" + N), true)], unit) |
---|
106 | | - | |
---|
107 | | - | |
---|
108 | | - | |
---|
109 | | - | @Callable(j) |
---|
110 | | - | func whitelist_remove (N) = if ((this != j.caller)) |
---|
111 | | - | then throw("Caller is not dApp owner") |
---|
112 | | - | else $Tuple2([DeleteEntry(("W_" + N))], unit) |
---|
113 | | - | |
---|
114 | | - | |
---|
115 | | - | |
---|
116 | | - | @Callable(j) |
---|
117 | | - | func set_market_image (O) = if (!(L(j.caller))) |
---|
118 | | - | then throw("Caller not in whitelist") |
---|
119 | | - | else $Tuple2([StringEntry("market_image_link", O)], unit) |
---|
120 | | - | |
---|
121 | | - | |
---|
122 | | - | |
---|
123 | | - | @Callable(j) |
---|
124 | | - | func set_price_hybrid (t,u,P) = if (!(L(j.caller))) |
---|
125 | | - | then throw("Caller not in whitelist") |
---|
126 | | - | else $Tuple2([StringEntry("price_hybrid_token", t), IntegerEntry("price_hybrid_amount", u), IntegerEntry("price_hybrid_increment", P)], unit) |
---|
127 | | - | |
---|
128 | | - | |
---|
129 | | - | |
---|
130 | | - | @Callable(j) |
---|
131 | | - | func mint_chord (Q,R,S) = if (!(L(j.caller))) |
---|
132 | | - | then throw("Caller not in whitelist") |
---|
133 | | - | else if ((size(S) != 5)) |
---|
134 | | - | then throw("Wrong notes size") |
---|
135 | | - | else { |
---|
136 | | - | let h = { |
---|
137 | | - | let x = getInteger("count") |
---|
138 | | - | if ($isInstanceOf(x, "Int")) |
---|
139 | | - | then { |
---|
140 | | - | let C = x |
---|
141 | | - | C |
---|
142 | | - | } |
---|
143 | | - | else 0 |
---|
144 | | - | } |
---|
145 | | - | let I = g(Q) |
---|
146 | | - | $Tuple2([IntegerEntry("count", max([(Q + 1), h])), StringEntry((I + "_CL"), R), IntegerEntry((I + "_C0"), S[0]), IntegerEntry((I + "_C1"), S[1]), IntegerEntry((I + "_C2"), S[2]), IntegerEntry((I + "_C3"), S[3]), IntegerEntry((I + "_C4"), S[4])], unit) |
---|
147 | | - | } |
---|
148 | | - | |
---|
149 | | - | |
---|
150 | | - | |
---|
151 | | - | @Callable(j) |
---|
152 | | - | func mint_arpeggio (Q,R,S) = if (!(L(j.caller))) |
---|
153 | | - | then throw("Caller not in whitelist") |
---|
154 | | - | else if ((size(S) != 16)) |
---|
155 | | - | then throw("Wrong notes size") |
---|
156 | | - | else { |
---|
157 | | - | let h = { |
---|
158 | | - | let x = getInteger("count") |
---|
159 | | - | if ($isInstanceOf(x, "Int")) |
---|
160 | | - | then { |
---|
161 | | - | let C = x |
---|
162 | | - | C |
---|
163 | | - | } |
---|
164 | | - | else 0 |
---|
165 | | - | } |
---|
166 | | - | let I = g(Q) |
---|
167 | | - | $Tuple2([IntegerEntry("count", max([(Q + 1), h])), StringEntry((I + "_AL"), R), IntegerEntry((I + "_A00"), S[0]), IntegerEntry((I + "_A01"), S[1]), IntegerEntry((I + "_A02"), S[2]), IntegerEntry((I + "_A03"), S[3]), IntegerEntry((I + "_A04"), S[4]), IntegerEntry((I + "_A05"), S[5]), IntegerEntry((I + "_A06"), S[6]), IntegerEntry((I + "_A07"), S[7]), IntegerEntry((I + "_A08"), S[8]), IntegerEntry((I + "_A09"), S[9]), IntegerEntry((I + "_A10"), S[10]), IntegerEntry((I + "_A11"), S[11]), IntegerEntry((I + "_A12"), S[12]), IntegerEntry((I + "_A13"), S[13]), IntegerEntry((I + "_A14"), S[14]), IntegerEntry((I + "_A15"), S[15])], unit) |
---|
168 | | - | } |
---|
169 | | - | |
---|
170 | | - | |
---|
171 | | - | |
---|
172 | | - | @Callable(j) |
---|
173 | | - | func mint_rhythm (Q,R,T,S) = if (!(L(j.caller))) |
---|
174 | | - | then throw("Caller not in whitelist") |
---|
175 | | - | else if ((size(S) != 16)) |
---|
176 | | - | then throw("Wrong notes size") |
---|
177 | | - | else { |
---|
178 | | - | let h = { |
---|
179 | | - | let x = getInteger("count") |
---|
180 | | - | if ($isInstanceOf(x, "Int")) |
---|
181 | | - | then { |
---|
182 | | - | let C = x |
---|
183 | | - | C |
---|
184 | | - | } |
---|
185 | | - | else 0 |
---|
186 | | - | } |
---|
187 | | - | let I = g(Q) |
---|
188 | | - | $Tuple2([IntegerEntry("count", max([(Q + 1), h])), StringEntry((I + "_RL"), R), IntegerEntry((I + "_RS"), T), IntegerEntry((I + "_R00"), S[0]), IntegerEntry((I + "_R01"), S[1]), IntegerEntry((I + "_R02"), S[2]), IntegerEntry((I + "_R03"), S[3]), IntegerEntry((I + "_R04"), S[4]), IntegerEntry((I + "_R05"), S[5]), IntegerEntry((I + "_R06"), S[6]), IntegerEntry((I + "_R07"), S[7]), IntegerEntry((I + "_R08"), S[8]), IntegerEntry((I + "_R09"), S[9]), IntegerEntry((I + "_R10"), S[10]), IntegerEntry((I + "_R11"), S[11]), IntegerEntry((I + "_R12"), S[12]), IntegerEntry((I + "_R13"), S[13]), IntegerEntry((I + "_R14"), S[14]), IntegerEntry((I + "_R15"), S[15])], unit) |
---|
189 | | - | } |
---|
190 | | - | |
---|
191 | | - | |
---|
192 | | - | |
---|
193 | | - | @Callable(j) |
---|
194 | | - | func burn_internal (U) = if (!(L(j.caller))) |
---|
195 | | - | then throw("Caller not in whitelist") |
---|
196 | | - | else { |
---|
197 | | - | let V = invoke(a, "burnNFT", nil, [AttachedPayment(fromBase58String(U), 1)]) |
---|
198 | | - | if ((V == V)) |
---|
199 | | - | then $Tuple2(nil, unit) |
---|
200 | | - | else throw("Strict value is not equal to itself.") |
---|
201 | | - | } |
---|
202 | | - | |
---|
203 | | - | |
---|
204 | | - | |
---|
205 | | - | @Callable(j) |
---|
206 | | - | func burn () = if (!(L(j.caller))) |
---|
207 | | - | then throw("Caller not in whitelist") |
---|
208 | | - | else { |
---|
209 | | - | let V = invoke(a, "burnNFT", nil, [j.payments[0]]) |
---|
210 | | - | if ((V == V)) |
---|
211 | | - | then $Tuple2(nil, unit) |
---|
212 | | - | else throw("Strict value is not equal to itself.") |
---|
213 | | - | } |
---|
214 | | - | |
---|
215 | | - | |
---|
216 | | - | |
---|
217 | | - | @Callable(j) |
---|
218 | | - | func mint_song (R,W,X,Y,Z,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap) = if (!(L(j.caller))) |
---|
219 | | - | then throw("Caller not in whitelist") |
---|
220 | | - | else if ((size(ac) != 8)) |
---|
221 | | - | then throw("Wrong chords size") |
---|
222 | | - | else if ((size(ak) != 8)) |
---|
223 | | - | then throw("Wrong kick rhythms size") |
---|
224 | | - | else if ((size(al) != 8)) |
---|
225 | | - | then throw("Wrong snare rhythms size") |
---|
226 | | - | else if ((size(am) != 8)) |
---|
227 | | - | then throw("Wrong hihat rhythms size") |
---|
228 | | - | else if ((size(an) != 8)) |
---|
229 | | - | then throw("Wrong bass rhythms size") |
---|
230 | | - | else if ((size(ao) != 8)) |
---|
231 | | - | then throw("Wrong back rhythms size") |
---|
232 | | - | else if ((size(ap) != 8)) |
---|
233 | | - | then throw("Wrong lead rhythms size") |
---|
234 | | - | else { |
---|
235 | | - | let h = { |
---|
236 | | - | let x = getInteger("count") |
---|
237 | | - | if ($isInstanceOf(x, "Int")) |
---|
238 | | - | then { |
---|
239 | | - | let C = x |
---|
240 | | - | C |
---|
241 | | - | } |
---|
242 | | - | else 0 |
---|
243 | | - | } |
---|
244 | | - | let D = take(R, 16) |
---|
245 | | - | let E = d |
---|
246 | | - | let F = c |
---|
247 | | - | let y = { |
---|
248 | | - | let x = invoke(a, "createNFT", [D, E, getStringValue("market_image_link"), F], nil) |
---|
249 | | - | if ($isInstanceOf(x, "String")) |
---|
250 | | - | then { |
---|
251 | | - | let G = x |
---|
252 | | - | G |
---|
253 | | - | } |
---|
254 | | - | else throw("NFT creation failed") |
---|
255 | | - | } |
---|
256 | | - | if ((y == y)) |
---|
257 | | - | then { |
---|
258 | | - | let I = g(h) |
---|
259 | | - | let aq = if ((this != j.caller)) |
---|
260 | | - | then [ScriptTransfer(Address(j.caller.bytes), 1, fromBase58String(y))] |
---|
261 | | - | else nil |
---|
262 | | - | $Tuple2(([IntegerEntry("count", (h + 1)), StringEntry(y, I), StringEntry(I, y), IntegerEntry((I + "_G"), 1), StringEntry((I + "_SL"), R), IntegerEntry((I + "_SN"), 0), StringEntry((I + "_SP0"), W), StringEntry((I + "_SP1"), X), IntegerEntry((I + "_SB0"), Y), IntegerEntry((I + "_SB1"), Z), IntegerEntry((I + "_SB2"), aa), IntegerEntry((I + "_ST"), ab), StringEntry((I + "_SC0"), ac[0]), StringEntry((I + "_SC1"), ac[1]), StringEntry((I + "_SC2"), ac[2]), StringEntry((I + "_SC3"), ac[3]), StringEntry((I + "_SC4"), ac[4]), StringEntry((I + "_SC5"), ac[5]), StringEntry((I + "_SC6"), ac[6]), StringEntry((I + "_SC7"), ac[7]), StringEntry((I + "_SA"), ad), StringEntry((I + "_SI0"), ae), StringEntry((I + "_SI1"), af), StringEntry((I + "_SI2"), ag), StringEntry((I + "_SI3"), ah), StringEntry((I + "_SI4"), ai), StringEntry((I + "_SI5"), aj), StringEntry((I + "_SI00"), ak[0]), StringEntry((I + "_SI01"), ak[1]), StringEntry((I + "_SI02"), ak[2]), StringEntry((I + "_SI03"), ak[3]), StringEntry((I + "_SI04"), ak[4]), StringEntry((I + "_SI05"), ak[5]), StringEntry((I + "_SI06"), ak[6]), StringEntry((I + "_SI07"), ak[7]), StringEntry((I + "_SI10"), al[0]), StringEntry((I + "_SI11"), al[1]), StringEntry((I + "_SI12"), al[2]), StringEntry((I + "_SI13"), al[3]), StringEntry((I + "_SI14"), al[4]), StringEntry((I + "_SI15"), al[5]), StringEntry((I + "_SI16"), al[6]), StringEntry((I + "_SI17"), al[7]), StringEntry((I + "_SI20"), am[0]), StringEntry((I + "_SI21"), am[1]), StringEntry((I + "_SI22"), am[2]), StringEntry((I + "_SI23"), am[3]), StringEntry((I + "_SI24"), am[4]), StringEntry((I + "_SI25"), am[5]), StringEntry((I + "_SI26"), am[6]), StringEntry((I + "_SI27"), am[7]), StringEntry((I + "_SI30"), an[0]), StringEntry((I + "_SI31"), an[1]), StringEntry((I + "_SI32"), an[2]), StringEntry((I + "_SI33"), an[3]), StringEntry((I + "_SI34"), an[4]), StringEntry((I + "_SI35"), an[5]), StringEntry((I + "_SI36"), an[6]), StringEntry((I + "_SI37"), an[7]), StringEntry((I + "_SI40"), ao[0]), StringEntry((I + "_SI41"), ao[1]), StringEntry((I + "_SI42"), ao[2]), StringEntry((I + "_SI43"), ao[3]), StringEntry((I + "_SI44"), ao[4]), StringEntry((I + "_SI45"), ao[5]), StringEntry((I + "_SI46"), ao[6]), StringEntry((I + "_SI47"), ao[7]), StringEntry((I + "_SI50"), ap[0]), StringEntry((I + "_SI51"), ap[1]), StringEntry((I + "_SI52"), ap[2]), StringEntry((I + "_SI53"), ap[3]), StringEntry((I + "_SI54"), ap[4]), StringEntry((I + "_SI55"), ap[5]), StringEntry((I + "_SI56"), ap[6]), StringEntry((I + "_SI57"), ap[7])] ++ aq), unit) |
---|
263 | | - | } |
---|
264 | | - | else throw("Strict value is not equal to itself.") |
---|
265 | | - | } |
---|
266 | | - | |
---|
267 | | - | |
---|
268 | | - | |
---|
269 | | - | @Callable(j) |
---|
270 | | - | func mint_hybrid (A,B) = { |
---|
271 | | - | let ar = Address(j.caller.bytes) |
---|
272 | | - | let as = fromBase58String(getStringValue(A)) |
---|
273 | | - | let at = fromBase58String(getStringValue(B)) |
---|
274 | | - | let au = getIntegerValue("price_hybrid_amount") |
---|
275 | | - | let av = getStringValue("price_hybrid_token") |
---|
276 | | - | let aw = s(j, av, au) |
---|
277 | | - | if ((0 > aw)) |
---|
278 | | - | then throw("Wrong payment") |
---|
279 | | - | else if ((as == at)) |
---|
280 | | - | then throw("Songs should be different") |
---|
281 | | - | else if ((1 > assetBalance(ar, as))) |
---|
282 | | - | then throw("Caller do not own first song") |
---|
283 | | - | else if ((1 > assetBalance(ar, at))) |
---|
284 | | - | then throw("Caller do not own second song") |
---|
285 | | - | else { |
---|
286 | | - | let ax = { |
---|
287 | | - | let x = getInteger("mint_count") |
---|
288 | | - | if ($isInstanceOf(x, "Int")) |
---|
289 | | - | then { |
---|
290 | | - | let C = x |
---|
291 | | - | C |
---|
292 | | - | } |
---|
293 | | - | else 0 |
---|
294 | | - | } |
---|
295 | | - | let ay = IntegerEntry("mint_count", (ax + 1)) |
---|
296 | | - | let az = if (((ax % b) == (b - 1))) |
---|
297 | | - | then [ay, IntegerEntry("price_hybrid_amount", (au + getIntegerValue("price_hybrid_increment")))] |
---|
298 | | - | else [ay] |
---|
299 | | - | if ((aw > 0)) |
---|
300 | | - | then $Tuple2(((z(j, A, B) ++ az) ++ [ScriptTransfer(Address(j.caller.bytes), aw, if ((av == "")) |
---|
301 | | - | then unit |
---|
302 | | - | else fromBase58String(av))]), unit) |
---|
303 | | - | else $Tuple2((z(j, A, B) ++ az), unit) |
---|
304 | | - | } |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func createNFT (b,c,d,e) = { |
---|
| 8 | + | let f = Issue(b, c, 1, 0, false, unit, 0) |
---|
| 9 | + | let g = calculateAssetId(f) |
---|
| 10 | + | $Tuple2([f, ScriptTransfer(a.caller, 1, g)], toBase58String(g)) |
---|