tx · 3XpAqhH5GK8jeXwqGwu114pqGjbhXfV9KrCRiMa4yoYn 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx: -0.01000000 Waves 2023.01.05 08:58 [2391264] smart account 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx > SELF 0.00000000 Waves
{ "type": 13, "id": "3XpAqhH5GK8jeXwqGwu114pqGjbhXfV9KrCRiMa4yoYn", "fee": 1000000, "feeAssetId": null, "timestamp": 1672898365658, "version": 2, "chainId": 84, "sender": "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx", "senderPublicKey": "EKZmHJ5bK3qKKgRdq8rAamt9qrDbVMLARzRqXoQW258v", "proofs": [ "2nAeMK8JhmF9SUNp3KG8AA9V7Q66QvNkHh7hBG2aCWZ1Tc1aC2dwKteH9o2KfP84bDBYG3o48XVEFfQSSkLrNYHD" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgSBgoECAgIARIGCgQICAgIEgUKAwgIARIDCgEIEgMKAQgSAwoBCAkACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAZrUHJpY2UCBXByaWNlAAVrU2VsbAIEc2VsbAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMJAAACCAUFdG9rZW4IZGVjaW1hbHMAAAkAAAIIBQV0b2tlbghxdWFudGl0eQABBwkAAAIIBQV0b2tlbgpyZWlzc3VhYmxlBwcHCQFpAQljcmVhdGVOZnQJCG5mdF9uYW1lCW5mdF9vd25lcg9uZnRfZEFwcE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QdiaWRUeElkAgxfaGlnaGVzdF9iaWQECGFzQmlkZGVyCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzCQCsAgIFB2JpZFR4SWQCB193aW5uZXIECWJpZEZvck5GVAkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwkArAICBQdiaWRUeElkAgdfbmZ0X2lkAwkBAiE9AgkA2AQBBQZjYWxsZXIFCGFzQmlkZGVyCQACAQIGTm8gYmlkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIIX25mdF9iaWQCCFdJVEhEUkFXCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIHX25mdF9pZAUJYmlkRm9yTkZUCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIcX2JpZGRpbmdfcHJpY2VfcmVmdW5kX2Ftb3VudAUIYmlkUHJpY2UJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEFCGJpZFByaWNlBQR1bml0BQNuaWwBaQEHdGVzdEJpZAEEZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCAjhFOGtrRkJZQ3k0NEpKYXE2cEFaNktpenN1UmVzaTVVS05oYkQxV05ad2hoWV9oaWdoZXN0X2JpZAIBMAUDbmlsAHva3W8=", "height": 2391264, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HdkmyngesycDaLJw2uAZkdgF1MFAXHCjDEo7B938N63H Next: BZaLPBEPKS3bH7CUbYfFz15pNmLHgeK4Bcy26Nq4sArV Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | - | let b = " | |
6 | + | let b = "buy" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "price" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "sell" | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 7 | |
13 | 13 | ||
14 | - | ||
14 | + | let f = "bid" | |
15 | 15 | ||
16 | + | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
16 | 17 | ||
17 | - | ||
18 | + | let h = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
18 | 19 | ||
19 | - | ||
20 | - | func j (h) = ((c + a) + toBase58String(h)) | |
21 | - | ||
22 | - | ||
23 | - | func k (h) = ((b + a) + toBase58String(h)) | |
24 | - | ||
25 | - | ||
26 | - | func l (m) = ((d + a) + toString(m)) | |
27 | - | ||
28 | - | ||
29 | - | func n (o,p) = (o ++ [p]) | |
30 | - | ||
31 | - | ||
32 | - | func q (r) = { | |
33 | - | let s = size(r) | |
34 | - | if ((s == 0)) | |
35 | - | then throw("Empty params") | |
36 | - | else if ((s == 1)) | |
37 | - | then makeString({ | |
38 | - | let t = r | |
39 | - | let u = size(t) | |
40 | - | let v = nil | |
41 | - | func w (x,y) = if ((y >= u)) | |
42 | - | then x | |
43 | - | else n(x, t[y]) | |
44 | - | ||
45 | - | func z (x,y) = if ((y >= u)) | |
46 | - | then x | |
47 | - | else throw("List size exceeds 1") | |
48 | - | ||
49 | - | z(w(v, 0), 1) | |
50 | - | }, a) | |
51 | - | else if ((s == 2)) | |
52 | - | then makeString({ | |
53 | - | let t = r | |
54 | - | let u = size(t) | |
55 | - | let v = nil | |
56 | - | func w (x,y) = if ((y >= u)) | |
57 | - | then x | |
58 | - | else n(x, t[y]) | |
59 | - | ||
60 | - | func z (x,y) = if ((y >= u)) | |
61 | - | then x | |
62 | - | else throw("List size exceeds 2") | |
63 | - | ||
64 | - | z(w(w(v, 0), 1), 2) | |
65 | - | }, a) | |
66 | - | else if ((s == 3)) | |
67 | - | then makeString({ | |
68 | - | let t = r | |
69 | - | let u = size(t) | |
70 | - | let v = nil | |
71 | - | func w (x,y) = if ((y >= u)) | |
72 | - | then x | |
73 | - | else n(x, t[y]) | |
74 | - | ||
75 | - | func z (x,y) = if ((y >= u)) | |
76 | - | then x | |
77 | - | else throw("List size exceeds 3") | |
78 | - | ||
79 | - | z(w(w(w(v, 0), 1), 2), 3) | |
80 | - | }, a) | |
81 | - | else if ((s == 4)) | |
82 | - | then makeString({ | |
83 | - | let t = r | |
84 | - | let u = size(t) | |
85 | - | let v = nil | |
86 | - | func w (x,y) = if ((y >= u)) | |
87 | - | then x | |
88 | - | else n(x, t[y]) | |
89 | - | ||
90 | - | func z (x,y) = if ((y >= u)) | |
91 | - | then x | |
92 | - | else throw("List size exceeds 4") | |
93 | - | ||
94 | - | z(w(w(w(w(v, 0), 1), 2), 3), 4) | |
95 | - | }, a) | |
96 | - | else if ((s == 5)) | |
97 | - | then makeString({ | |
98 | - | let t = r | |
99 | - | let u = size(t) | |
100 | - | let v = nil | |
101 | - | func w (x,y) = if ((y >= u)) | |
102 | - | then x | |
103 | - | else n(x, t[y]) | |
104 | - | ||
105 | - | func z (x,y) = if ((y >= u)) | |
106 | - | then x | |
107 | - | else throw("List size exceeds 5") | |
108 | - | ||
109 | - | z(w(w(w(w(w(v, 0), 1), 2), 3), 4), 5) | |
110 | - | }, a) | |
111 | - | else throw("Max number of parameters exceeded") | |
112 | - | } | |
113 | - | ||
114 | - | ||
115 | - | func A (B) = { | |
116 | - | let C = split(B, a) | |
117 | - | $Tuple5(addressFromStringValue(C[0]), parseIntValue(C[1]), parseIntValue(C[2]), parseIntValue(C[3]), parseIntValue(C[4])) | |
118 | - | } | |
119 | - | ||
120 | - | ||
121 | - | func D (B) = { | |
122 | - | let C = split(B, a) | |
123 | - | $Tuple2(addressFromStringValue(C[0]), parseIntValue(C[1])) | |
124 | - | } | |
125 | - | ||
126 | - | ||
127 | - | func E (r) = { | |
128 | - | let F = r | |
129 | - | if ($isInstanceOf(F, "(Address, Int, String, String)")) | |
20 | + | func i (j) = { | |
21 | + | let k = assetInfo(j) | |
22 | + | if ($isInstanceOf(k, "Asset")) | |
130 | 23 | then { | |
131 | - | let G = F | |
132 | - | q([toString(G._1), toString(G._2), G._3, G._4]) | |
133 | - | } | |
134 | - | else if ($isInstanceOf(F, "(Address, Int)")) | |
135 | - | then { | |
136 | - | let H = F | |
137 | - | q([toString(H._1), toString(H._2)]) | |
138 | - | } | |
139 | - | else throw("Wrong params tupple") | |
140 | - | } | |
141 | - | ||
142 | - | ||
143 | - | func I (J,h,K,L,M) = StringEntry(k(h), E($Tuple4(J, K, L, M))) | |
144 | - | ||
145 | - | ||
146 | - | func N (h,O,P) = StringEntry(j(h), E($Tuple2(O, P))) | |
147 | - | ||
148 | - | ||
149 | - | func Q (h) = value(getString(this, k(h))) | |
150 | - | ||
151 | - | ||
152 | - | func R (h) = value(getString(this, j(h))) | |
153 | - | ||
154 | - | ||
155 | - | func S (T,U) = { | |
156 | - | let B = Q(T) | |
157 | - | let V = A(B) | |
158 | - | let J = V._1 | |
159 | - | let W = V._2 | |
160 | - | let X = V._3 | |
161 | - | let Y = V._4 | |
162 | - | let Z = V._5 | |
163 | - | if ((U >= Z)) | |
164 | - | then $Tuple2(J, X) | |
165 | - | else { | |
166 | - | let aa = (W - X) | |
167 | - | let ab = (Z - Y) | |
168 | - | let ac = (U - Y) | |
169 | - | $Tuple2(J, (W - fraction(ac, aa, ab))) | |
170 | - | } | |
171 | - | } | |
172 | - | ||
173 | - | ||
174 | - | func ad (T) = { | |
175 | - | let F = assetInfo(T) | |
176 | - | if ($isInstanceOf(F, "Asset")) | |
177 | - | then { | |
178 | - | let ae = F | |
179 | - | if (if ((ae.decimals == 0)) | |
180 | - | then (ae.quantity == 1) | |
24 | + | let l = k | |
25 | + | if (if ((l.decimals == 0)) | |
26 | + | then (l.quantity == 1) | |
181 | 27 | else false) | |
182 | - | then ( | |
28 | + | then (l.reissuable == false) | |
183 | 29 | else false | |
184 | 30 | } | |
185 | 31 | else false | |
186 | 32 | } | |
187 | 33 | ||
188 | 34 | ||
189 | - | func af (T) = { | |
190 | - | let m = value(assetInfo(T)).issuer | |
191 | - | valueOrElse(getBoolean(this, l(m)), false) | |
192 | - | } | |
193 | - | ||
194 | - | ||
195 | - | func ag (T) = isDefined(getString(this, j(T))) | |
196 | - | ||
197 | - | ||
198 | - | func ah (T) = isDefined(getString(this, k(T))) | |
199 | - | ||
200 | - | ||
201 | - | func ai (P) = (P > 0) | |
202 | - | ||
203 | - | ||
204 | - | func aj (K,ak) = (K > ak) | |
205 | - | ||
206 | - | ||
207 | - | func al (am) = (am == this) | |
208 | - | ||
209 | - | ||
210 | - | func an (am,J) = if ((am == this)) | |
211 | - | then true | |
212 | - | else (am == J) | |
213 | - | ||
214 | - | ||
215 | - | func ao (ap,M) = (ap > M) | |
216 | - | ||
217 | - | ||
218 | - | func aq (ar,as) = (ar >= as) | |
219 | - | ||
220 | - | ||
221 | - | func at (T) = (T == unit) | |
222 | - | ||
223 | - | ||
224 | - | func au (h) = if (!(ad(h))) | |
225 | - | then throw("Token is not Nft") | |
226 | - | else if (ag(h)) | |
227 | - | then throw("Sell already exists") | |
228 | - | else if (ah(h)) | |
229 | - | then throw("Auction already exists") | |
230 | - | else unit | |
231 | - | ||
232 | - | ||
233 | - | func av (aw,ax,P) = if (!(at(aw))) | |
234 | - | then throw("Payment must be at WAVES") | |
235 | - | else if (!(aq(ax, P))) | |
236 | - | then throw("Not enough funds") | |
237 | - | else unit | |
238 | - | ||
239 | - | ||
240 | - | func ay () = 0 | |
241 | - | ||
242 | - | ||
243 | - | func az () = 0 | |
244 | - | ||
245 | - | ||
246 | - | func aA (aB,ax,aC) = if (aB) | |
247 | - | then $Tuple2((aC - az()), (ax - aC)) | |
248 | - | else $Tuple2((aC - ay()), (ax - aC)) | |
249 | - | ||
250 | - | ||
251 | - | func aD (h) = if (ag(h)) | |
252 | - | then $Tuple2(c, R(h)) | |
253 | - | else if (ah(h)) | |
254 | - | then $Tuple2(b, Q(h)) | |
255 | - | else throw("Slot doesn`t exist") | |
256 | - | ||
257 | - | ||
258 | - | let aE = "buy" | |
259 | - | ||
260 | - | let aF = "bid" | |
261 | - | ||
262 | - | let aG = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
263 | - | ||
264 | - | let aH = base58'3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx' | |
265 | - | ||
266 | - | @Callable(aI) | |
267 | - | func createNft (aJ,aK,aL,aM,aN,aO) = { | |
268 | - | let aP = Issue(aJ, aM, 1, 0, false) | |
269 | - | let aQ = calculateAssetId(aP) | |
270 | - | let aR = aI.transactionId | |
271 | - | [aP, ScriptTransfer(aI.caller, 1, aQ), StringEntry(((toBase58String(aQ) + a) + "nft_dAppAddress"), aK), IntegerEntry(((toBase58String(aQ) + a) + "nft_selling_price"), aL), StringEntry(((toBase58String(aQ) + a) + "nft_onSell"), aN), StringEntry(((toBase58String(aQ) + a) + "nft_data"), aO), StringEntry(((toBase58String(aR) + a) + "issue_nft"), toBase58String(aQ))] | |
35 | + | @Callable(m) | |
36 | + | func createNft (n,o,p,q,r,s,t,u,v) = { | |
37 | + | let w = Issue(n, t, 1, 0, false) | |
38 | + | let x = calculateAssetId(w) | |
39 | + | let y = m.transactionId | |
40 | + | [w, ScriptTransfer(m.caller, 1, x), StringEntry(((toBase58String(x) + a) + "Owner"), toString(m.caller)), StringEntry(((toBase58String(x) + a) + "nft_type"), q), StringEntry(((toBase58String(x) + a) + "nft_tags"), r), StringEntry(((toBase58String(x) + a) + "nft_dAppAddress"), p), IntegerEntry(((toBase58String(x) + a) + "nft_selling_price"), s), StringEntry(((toBase58String(x) + a) + "nft_onSell"), u), StringEntry(((toBase58String(x) + a) + "nft_data"), v), StringEntry(((toBase58String(y) + a) + "issue_nft"), toBase58String(x))] | |
272 | 41 | } | |
273 | 42 | ||
274 | 43 | ||
275 | 44 | ||
276 | - | @Callable(aI) | |
277 | - | func sellNFT (P) = { | |
278 | - | let aR = aI.transactionId | |
279 | - | let aS = $Tuple2(value(aI.payments[0].assetId), value(aI.payments[0].amount)) | |
280 | - | let aT = aS._1 | |
281 | - | let aU = aS._2 | |
282 | - | if (ad(aT)) | |
45 | + | @Callable(m) | |
46 | + | func sellNFT (z) = { | |
47 | + | let y = m.transactionId | |
48 | + | let A = m.caller.bytes | |
49 | + | let B = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
50 | + | let C = B._1 | |
51 | + | let D = B._2 | |
52 | + | if (!(i(C))) | |
283 | 53 | then throw("Token is not NFT") | |
284 | - | else [StringEntry((( | |
54 | + | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(C) + a) + toString(D)))] | |
285 | 55 | } | |
286 | 56 | ||
287 | 57 | ||
288 | 58 | ||
289 | - | @Callable( | |
290 | - | func buyNFT ( | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | if ($isInstanceOf( | |
59 | + | @Callable(m) | |
60 | + | func buyNFT (E,F) = { | |
61 | + | let j = fromBase58String(E) | |
62 | + | let G = value(m.payments[0].amount) | |
63 | + | let H = { | |
64 | + | let k = getString(this, (("nft_" + F) + "_owner")) | |
65 | + | if ($isInstanceOf(k, "String")) | |
296 | 66 | then { | |
297 | - | let | |
298 | - | | |
67 | + | let I = k | |
68 | + | I | |
299 | 69 | } | |
300 | - | else | |
70 | + | else false | |
301 | 71 | } | |
302 | - | let P = getStringValue(((((e + a) + aV) + "_") + aW)) | |
303 | - | let ba = valueOrErrorMessage(getStringValue((a + "Owner")), "No owner") | |
304 | - | if ((aI.payments[0].assetId != unit)) | |
72 | + | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | + | if ((m.payments[0].assetId != unit)) | |
305 | 74 | then throw("Pay in waves") | |
306 | - | else if (( | |
307 | - | then throw("Owner of NFT not able to purchase") | |
308 | - | else [StringEntry(((toString( | |
75 | + | else if ((F == toString(m.caller))) | |
76 | + | then throw("current Owner of NFT not able to purchase") | |
77 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(F)), G, unit), StringEntry(((toString(m.caller) + a) + b), ((E + a) + toString(G))), DeleteEntry((("nft_" + F) + "_owner")), StringEntry((("nft_" + F) + "_owner"), toString(m.caller)), StringEntry(((E + a) + "_owner"), toString(m.caller))] | |
309 | 78 | } | |
310 | 79 | ||
311 | 80 | ||
312 | 81 | ||
313 | - | @Callable(aI) | |
314 | - | func sellauction (L,M,K,bb) = { | |
315 | - | let aR = toBase58String(aI.transactionId) | |
316 | - | let h = value(aI.payments[1].assetId) | |
317 | - | let P = value(K) | |
318 | - | let am = aI.caller.bytes | |
319 | - | let bc = { | |
320 | - | let F = getString(this, (((toBase58String(h) + a) + "nft_status_") + toBase58String(am))) | |
321 | - | if ($isInstanceOf(F, "String")) | |
82 | + | @Callable(m) | |
83 | + | func addAuction (J,K,L,M) = { | |
84 | + | let y = toBase58String(m.transactionId) | |
85 | + | let N = value(m.payments[0].assetId) | |
86 | + | let z = value(L) | |
87 | + | let O = (lastBlock.height + M) | |
88 | + | let P = m.caller.bytes | |
89 | + | let Q = { | |
90 | + | let k = getString(this, (((toBase58String(N) + a) + "nft_status_") + toBase58String(P))) | |
91 | + | if ($isInstanceOf(k, "String")) | |
322 | 92 | then { | |
323 | - | let | |
93 | + | let I = k | |
324 | 94 | true | |
325 | 95 | } | |
326 | 96 | else false | |
327 | 97 | } | |
328 | - | if (( | |
98 | + | if ((m.payments[0].assetId == unit)) | |
329 | 99 | then throw("NFT not attached") | |
330 | - | else if (( | |
100 | + | else if ((Q == true)) | |
331 | 101 | then throw("Already in auction list") | |
332 | - | else [StringEntry(((aR + "_nft_start_auction_date_") + toBase58String(am)), L), StringEntry(((aR + "_nft_end_auction_date_") + toBase58String(am)), M), StringEntry((aR + "_nft_start_price"), K), IntegerEntry((aR + "duration_of_auction"), bb), StringEntry((aR + "_nft_owner"), toString(aI.caller)), StringEntry((aR + "_nft_on_auction"), toBase58String(h)), StringEntry((aR + "_previous_bidder"), "none"), StringEntry((aR + "_highest_bid"), "0"), StringEntry((aR + "_winner_of_nft"), "0"), StringEntry((aR + "_bidder_count"), "0"), StringEntry((aR + "_nft_status"), "OPEN")] | |
102 | + | else if ((M > e)) | |
103 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
104 | + | else [StringEntry(((y + "_nft_start_auction_date_") + toBase58String(P)), J), StringEntry(((y + "_nft_end_auction_date_") + toBase58String(P)), K), StringEntry((y + "_nft_start_price"), L), StringEntry((y + "_nft_owner"), toString(m.caller)), StringEntry((y + "_nft_on_auction"), toBase58String(N)), StringEntry((y + "_previous_bidder"), "none"), StringEntry((y + "_highest_bid"), "0"), StringEntry((y + "_winner_of_nft"), "0"), StringEntry((y + "_bidder_count"), "0"), StringEntry((y + "_nft_status"), "OPEN")] | |
333 | 105 | } | |
334 | 106 | ||
335 | 107 | ||
336 | 108 | ||
337 | - | @Callable( | |
338 | - | func | |
339 | - | let | |
340 | - | let | |
341 | - | let | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | let | |
347 | - | let | |
348 | - | if (( | |
109 | + | @Callable(m) | |
110 | + | func placeBid (R,N,o,S) = { | |
111 | + | let y = toBase58String(m.transactionId) | |
112 | + | let P = m.caller.bytes | |
113 | + | let j = fromBase58String(N) | |
114 | + | let T = m.payments[0].amount | |
115 | + | let U = getStringValue(this, (R + "_highest_bid")) | |
116 | + | let V = getString(this, (R + "_previous_bidder")) | |
117 | + | let W = getStringValue(this, (R + "_bidder_count")) | |
118 | + | let X = getStringValue(this, (R + "_winner_of_nft")) | |
119 | + | let Q = getStringValue(this, (R + "_nft_status")) | |
120 | + | if ((m.payments[0].assetId != unit)) | |
349 | 121 | then throw("Pay in waves") | |
350 | - | else if (( | |
122 | + | else if ((Q != "OPEN")) | |
351 | 123 | then throw("Not open for auction") | |
352 | - | else if ((parseIntValue( | |
124 | + | else if ((parseIntValue(U) >= T)) | |
353 | 125 | then throw("Bid is less then starting/highest Bid") | |
354 | - | else if (( | |
355 | - | then [StringEntry(( | |
356 | - | else [StringEntry(( | |
126 | + | else if ((U == "0")) | |
127 | + | then [StringEntry((R + "_highest_bid"), toString(T)), StringEntry((R + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((R + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((R + "_nft_id"), toBase58String(j)), StringEntry((R + "_nft_owner"), o), StringEntry((((y + "_") + R) + "_highest_bid"), toString(T)), StringEntry((((y + "_") + R) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((y + "_") + R) + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((((y + "_") + R) + "_nft_id"), toBase58String(j)), StringEntry((((y + "_") + R) + "_nft_owner"), o), StringEntry((y + "_bid_for_nft_by"), toBase58String(P)), StringEntry((y + "_bid_price_place"), S), StringEntry((y + "_previous_bid_amount_refund_to_address"), X), StringEntry((y + "_prevoius_bid_amount_refund"), U)] | |
128 | + | else [StringEntry((R + "_highest_bid"), toString(T)), StringEntry((R + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((R + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((R + "_nft_id"), toBase58String(j)), StringEntry((R + "_nft_owner"), o), StringEntry((((y + "_") + R) + "_highest_bid"), toString(T)), StringEntry((((y + "_") + R) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((y + "_") + R) + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((((y + "_") + R) + "_nft_id"), toBase58String(j)), StringEntry((((y + "_") + R) + "_nft_owner"), o), StringEntry((y + "_bid_for_nft_by"), toBase58String(P)), StringEntry((y + "_bid_price_place"), S), StringEntry((y + "_previous_bid_amount_refund_to_address"), X), StringEntry((y + "_prevoius_bid_amount_refund"), U), ScriptTransfer(Address(fromBase58String(X)), parseIntValue(U), unit)] | |
357 | 129 | } | |
358 | 130 | ||
359 | 131 | ||
360 | 132 | ||
361 | - | @Callable( | |
362 | - | func acceptBidOffer ( | |
363 | - | let | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | [ScriptTransfer(Address( | |
133 | + | @Callable(m) | |
134 | + | func acceptBidOffer (R,N,Y) = { | |
135 | + | let y = toBase58String(m.transactionId) | |
136 | + | let P = m.caller.bytes | |
137 | + | let j = fromBase58String(N) | |
138 | + | let Z = getStringValue(this, (R + "_highest_bid")) | |
139 | + | let aa = getStringValue(this, (R + "_winner_of_nft")) | |
140 | + | [ScriptTransfer(Address(P), parseIntValue(Z), unit), ScriptTransfer(Address(fromBase58String(aa)), 1, j), StringEntry((y + "_amount_paid_to_owner"), Z), StringEntry((y + "_nft_transfer_to"), aa), StringEntry((y + "_nft_status"), "REWARDED"), StringEntry((R + "_amount_paid_to_owner"), Z), StringEntry((R + "_nft_transfer_to"), aa), StringEntry((R + "_nft_status"), "REWARDED")] | |
369 | 141 | } | |
370 | 142 | ||
371 | 143 | ||
372 | 144 | ||
373 | - | @Callable( | |
374 | - | func | |
375 | - | let | |
376 | - | let | |
377 | - | let | |
378 | - | let | |
379 | - | let | |
380 | - | let | |
381 | - | let | |
382 | - | if (( | |
383 | - | then [ScriptTransfer(Address(fromBase58String( | |
384 | - | else [StringEntry(( | |
145 | + | @Callable(m) | |
146 | + | func cancelAuction (R) = { | |
147 | + | let y = toBase58String(m.transactionId) | |
148 | + | let P = m.caller.bytes | |
149 | + | let ab = getStringValue(this, (R + "_nft_status")) | |
150 | + | let ac = getStringValue(this, (R + "_winner_of_nft")) | |
151 | + | let ad = getStringValue(this, (R + "_nft_owner")) | |
152 | + | let N = getStringValue(this, (R + "_nft_on_auction")) | |
153 | + | let ae = getStringValue(this, (R + "_highest_bid")) | |
154 | + | if ((ac == "0")) | |
155 | + | then [StringEntry(((y + R) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ad)), 1, fromBase58String(N))] | |
156 | + | else [StringEntry((R + "_nft_status"), "CANCELED"), StringEntry((R + "_previous_bid_amount_refund_to_address"), ac), StringEntry((R + "_prevoius_bid_amount_refund"), ae), StringEntry((y + "_nft_status"), "CANCELED"), StringEntry((y + "_previous_bid_amount_refund_to_address"), ac), StringEntry((y + "_prevoius_bid_amount_refund"), ae), ScriptTransfer(Address(fromBase58String(ad)), 1, fromBase58String(N)), ScriptTransfer(Address(fromBase58String(ac)), parseIntValue(ae), unit)] | |
385 | 157 | } | |
386 | 158 | ||
387 | 159 | ||
388 | 160 | ||
389 | - | @Callable( | |
390 | - | func | |
391 | - | let | |
392 | - | let | |
393 | - | let | |
394 | - | let | |
395 | - | if (( | |
161 | + | @Callable(m) | |
162 | + | func withdrawBid (af) = { | |
163 | + | let P = m.caller.bytes | |
164 | + | let ag = getStringValue(this, (af + "_highest_bid")) | |
165 | + | let ah = getStringValue(this, (af + "_winner")) | |
166 | + | let ai = getStringValue(this, (af + "_nft_id")) | |
167 | + | if ((toBase58String(P) != ah)) | |
396 | 168 | then throw("No bid") | |
397 | - | else [StringEntry(( | |
169 | + | else [StringEntry((af + "_nft_bid"), "WITHDRAW"), StringEntry((af + "_nft_id"), ai), StringEntry((af + "_bidding_price_refund_amount"), ag), ScriptTransfer(m.caller, parseIntValue(ag), unit)] | |
398 | 170 | } | |
399 | 171 | ||
400 | 172 | ||
401 | 173 | ||
402 | - | @Callable( | |
403 | - | func testBid ( | |
174 | + | @Callable(m) | |
175 | + | func testBid (aj) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
404 | 176 | ||
405 | 177 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | - | let b = " | |
6 | + | let b = "buy" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "price" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "sell" | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 7 | |
13 | 13 | ||
14 | - | ||
14 | + | let f = "bid" | |
15 | 15 | ||
16 | + | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
16 | 17 | ||
17 | - | ||
18 | + | let h = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
18 | 19 | ||
19 | - | ||
20 | - | func j (h) = ((c + a) + toBase58String(h)) | |
21 | - | ||
22 | - | ||
23 | - | func k (h) = ((b + a) + toBase58String(h)) | |
24 | - | ||
25 | - | ||
26 | - | func l (m) = ((d + a) + toString(m)) | |
27 | - | ||
28 | - | ||
29 | - | func n (o,p) = (o ++ [p]) | |
30 | - | ||
31 | - | ||
32 | - | func q (r) = { | |
33 | - | let s = size(r) | |
34 | - | if ((s == 0)) | |
35 | - | then throw("Empty params") | |
36 | - | else if ((s == 1)) | |
37 | - | then makeString({ | |
38 | - | let t = r | |
39 | - | let u = size(t) | |
40 | - | let v = nil | |
41 | - | func w (x,y) = if ((y >= u)) | |
42 | - | then x | |
43 | - | else n(x, t[y]) | |
44 | - | ||
45 | - | func z (x,y) = if ((y >= u)) | |
46 | - | then x | |
47 | - | else throw("List size exceeds 1") | |
48 | - | ||
49 | - | z(w(v, 0), 1) | |
50 | - | }, a) | |
51 | - | else if ((s == 2)) | |
52 | - | then makeString({ | |
53 | - | let t = r | |
54 | - | let u = size(t) | |
55 | - | let v = nil | |
56 | - | func w (x,y) = if ((y >= u)) | |
57 | - | then x | |
58 | - | else n(x, t[y]) | |
59 | - | ||
60 | - | func z (x,y) = if ((y >= u)) | |
61 | - | then x | |
62 | - | else throw("List size exceeds 2") | |
63 | - | ||
64 | - | z(w(w(v, 0), 1), 2) | |
65 | - | }, a) | |
66 | - | else if ((s == 3)) | |
67 | - | then makeString({ | |
68 | - | let t = r | |
69 | - | let u = size(t) | |
70 | - | let v = nil | |
71 | - | func w (x,y) = if ((y >= u)) | |
72 | - | then x | |
73 | - | else n(x, t[y]) | |
74 | - | ||
75 | - | func z (x,y) = if ((y >= u)) | |
76 | - | then x | |
77 | - | else throw("List size exceeds 3") | |
78 | - | ||
79 | - | z(w(w(w(v, 0), 1), 2), 3) | |
80 | - | }, a) | |
81 | - | else if ((s == 4)) | |
82 | - | then makeString({ | |
83 | - | let t = r | |
84 | - | let u = size(t) | |
85 | - | let v = nil | |
86 | - | func w (x,y) = if ((y >= u)) | |
87 | - | then x | |
88 | - | else n(x, t[y]) | |
89 | - | ||
90 | - | func z (x,y) = if ((y >= u)) | |
91 | - | then x | |
92 | - | else throw("List size exceeds 4") | |
93 | - | ||
94 | - | z(w(w(w(w(v, 0), 1), 2), 3), 4) | |
95 | - | }, a) | |
96 | - | else if ((s == 5)) | |
97 | - | then makeString({ | |
98 | - | let t = r | |
99 | - | let u = size(t) | |
100 | - | let v = nil | |
101 | - | func w (x,y) = if ((y >= u)) | |
102 | - | then x | |
103 | - | else n(x, t[y]) | |
104 | - | ||
105 | - | func z (x,y) = if ((y >= u)) | |
106 | - | then x | |
107 | - | else throw("List size exceeds 5") | |
108 | - | ||
109 | - | z(w(w(w(w(w(v, 0), 1), 2), 3), 4), 5) | |
110 | - | }, a) | |
111 | - | else throw("Max number of parameters exceeded") | |
112 | - | } | |
113 | - | ||
114 | - | ||
115 | - | func A (B) = { | |
116 | - | let C = split(B, a) | |
117 | - | $Tuple5(addressFromStringValue(C[0]), parseIntValue(C[1]), parseIntValue(C[2]), parseIntValue(C[3]), parseIntValue(C[4])) | |
118 | - | } | |
119 | - | ||
120 | - | ||
121 | - | func D (B) = { | |
122 | - | let C = split(B, a) | |
123 | - | $Tuple2(addressFromStringValue(C[0]), parseIntValue(C[1])) | |
124 | - | } | |
125 | - | ||
126 | - | ||
127 | - | func E (r) = { | |
128 | - | let F = r | |
129 | - | if ($isInstanceOf(F, "(Address, Int, String, String)")) | |
20 | + | func i (j) = { | |
21 | + | let k = assetInfo(j) | |
22 | + | if ($isInstanceOf(k, "Asset")) | |
130 | 23 | then { | |
131 | - | let G = F | |
132 | - | q([toString(G._1), toString(G._2), G._3, G._4]) | |
133 | - | } | |
134 | - | else if ($isInstanceOf(F, "(Address, Int)")) | |
135 | - | then { | |
136 | - | let H = F | |
137 | - | q([toString(H._1), toString(H._2)]) | |
138 | - | } | |
139 | - | else throw("Wrong params tupple") | |
140 | - | } | |
141 | - | ||
142 | - | ||
143 | - | func I (J,h,K,L,M) = StringEntry(k(h), E($Tuple4(J, K, L, M))) | |
144 | - | ||
145 | - | ||
146 | - | func N (h,O,P) = StringEntry(j(h), E($Tuple2(O, P))) | |
147 | - | ||
148 | - | ||
149 | - | func Q (h) = value(getString(this, k(h))) | |
150 | - | ||
151 | - | ||
152 | - | func R (h) = value(getString(this, j(h))) | |
153 | - | ||
154 | - | ||
155 | - | func S (T,U) = { | |
156 | - | let B = Q(T) | |
157 | - | let V = A(B) | |
158 | - | let J = V._1 | |
159 | - | let W = V._2 | |
160 | - | let X = V._3 | |
161 | - | let Y = V._4 | |
162 | - | let Z = V._5 | |
163 | - | if ((U >= Z)) | |
164 | - | then $Tuple2(J, X) | |
165 | - | else { | |
166 | - | let aa = (W - X) | |
167 | - | let ab = (Z - Y) | |
168 | - | let ac = (U - Y) | |
169 | - | $Tuple2(J, (W - fraction(ac, aa, ab))) | |
170 | - | } | |
171 | - | } | |
172 | - | ||
173 | - | ||
174 | - | func ad (T) = { | |
175 | - | let F = assetInfo(T) | |
176 | - | if ($isInstanceOf(F, "Asset")) | |
177 | - | then { | |
178 | - | let ae = F | |
179 | - | if (if ((ae.decimals == 0)) | |
180 | - | then (ae.quantity == 1) | |
24 | + | let l = k | |
25 | + | if (if ((l.decimals == 0)) | |
26 | + | then (l.quantity == 1) | |
181 | 27 | else false) | |
182 | - | then ( | |
28 | + | then (l.reissuable == false) | |
183 | 29 | else false | |
184 | 30 | } | |
185 | 31 | else false | |
186 | 32 | } | |
187 | 33 | ||
188 | 34 | ||
189 | - | func af (T) = { | |
190 | - | let m = value(assetInfo(T)).issuer | |
191 | - | valueOrElse(getBoolean(this, l(m)), false) | |
192 | - | } | |
193 | - | ||
194 | - | ||
195 | - | func ag (T) = isDefined(getString(this, j(T))) | |
196 | - | ||
197 | - | ||
198 | - | func ah (T) = isDefined(getString(this, k(T))) | |
199 | - | ||
200 | - | ||
201 | - | func ai (P) = (P > 0) | |
202 | - | ||
203 | - | ||
204 | - | func aj (K,ak) = (K > ak) | |
205 | - | ||
206 | - | ||
207 | - | func al (am) = (am == this) | |
208 | - | ||
209 | - | ||
210 | - | func an (am,J) = if ((am == this)) | |
211 | - | then true | |
212 | - | else (am == J) | |
213 | - | ||
214 | - | ||
215 | - | func ao (ap,M) = (ap > M) | |
216 | - | ||
217 | - | ||
218 | - | func aq (ar,as) = (ar >= as) | |
219 | - | ||
220 | - | ||
221 | - | func at (T) = (T == unit) | |
222 | - | ||
223 | - | ||
224 | - | func au (h) = if (!(ad(h))) | |
225 | - | then throw("Token is not Nft") | |
226 | - | else if (ag(h)) | |
227 | - | then throw("Sell already exists") | |
228 | - | else if (ah(h)) | |
229 | - | then throw("Auction already exists") | |
230 | - | else unit | |
231 | - | ||
232 | - | ||
233 | - | func av (aw,ax,P) = if (!(at(aw))) | |
234 | - | then throw("Payment must be at WAVES") | |
235 | - | else if (!(aq(ax, P))) | |
236 | - | then throw("Not enough funds") | |
237 | - | else unit | |
238 | - | ||
239 | - | ||
240 | - | func ay () = 0 | |
241 | - | ||
242 | - | ||
243 | - | func az () = 0 | |
244 | - | ||
245 | - | ||
246 | - | func aA (aB,ax,aC) = if (aB) | |
247 | - | then $Tuple2((aC - az()), (ax - aC)) | |
248 | - | else $Tuple2((aC - ay()), (ax - aC)) | |
249 | - | ||
250 | - | ||
251 | - | func aD (h) = if (ag(h)) | |
252 | - | then $Tuple2(c, R(h)) | |
253 | - | else if (ah(h)) | |
254 | - | then $Tuple2(b, Q(h)) | |
255 | - | else throw("Slot doesn`t exist") | |
256 | - | ||
257 | - | ||
258 | - | let aE = "buy" | |
259 | - | ||
260 | - | let aF = "bid" | |
261 | - | ||
262 | - | let aG = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
263 | - | ||
264 | - | let aH = base58'3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx' | |
265 | - | ||
266 | - | @Callable(aI) | |
267 | - | func createNft (aJ,aK,aL,aM,aN,aO) = { | |
268 | - | let aP = Issue(aJ, aM, 1, 0, false) | |
269 | - | let aQ = calculateAssetId(aP) | |
270 | - | let aR = aI.transactionId | |
271 | - | [aP, ScriptTransfer(aI.caller, 1, aQ), StringEntry(((toBase58String(aQ) + a) + "nft_dAppAddress"), aK), IntegerEntry(((toBase58String(aQ) + a) + "nft_selling_price"), aL), StringEntry(((toBase58String(aQ) + a) + "nft_onSell"), aN), StringEntry(((toBase58String(aQ) + a) + "nft_data"), aO), StringEntry(((toBase58String(aR) + a) + "issue_nft"), toBase58String(aQ))] | |
35 | + | @Callable(m) | |
36 | + | func createNft (n,o,p,q,r,s,t,u,v) = { | |
37 | + | let w = Issue(n, t, 1, 0, false) | |
38 | + | let x = calculateAssetId(w) | |
39 | + | let y = m.transactionId | |
40 | + | [w, ScriptTransfer(m.caller, 1, x), StringEntry(((toBase58String(x) + a) + "Owner"), toString(m.caller)), StringEntry(((toBase58String(x) + a) + "nft_type"), q), StringEntry(((toBase58String(x) + a) + "nft_tags"), r), StringEntry(((toBase58String(x) + a) + "nft_dAppAddress"), p), IntegerEntry(((toBase58String(x) + a) + "nft_selling_price"), s), StringEntry(((toBase58String(x) + a) + "nft_onSell"), u), StringEntry(((toBase58String(x) + a) + "nft_data"), v), StringEntry(((toBase58String(y) + a) + "issue_nft"), toBase58String(x))] | |
272 | 41 | } | |
273 | 42 | ||
274 | 43 | ||
275 | 44 | ||
276 | - | @Callable(aI) | |
277 | - | func sellNFT (P) = { | |
278 | - | let aR = aI.transactionId | |
279 | - | let aS = $Tuple2(value(aI.payments[0].assetId), value(aI.payments[0].amount)) | |
280 | - | let aT = aS._1 | |
281 | - | let aU = aS._2 | |
282 | - | if (ad(aT)) | |
45 | + | @Callable(m) | |
46 | + | func sellNFT (z) = { | |
47 | + | let y = m.transactionId | |
48 | + | let A = m.caller.bytes | |
49 | + | let B = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
50 | + | let C = B._1 | |
51 | + | let D = B._2 | |
52 | + | if (!(i(C))) | |
283 | 53 | then throw("Token is not NFT") | |
284 | - | else [StringEntry((( | |
54 | + | else [StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(C) + a) + toString(D)))] | |
285 | 55 | } | |
286 | 56 | ||
287 | 57 | ||
288 | 58 | ||
289 | - | @Callable( | |
290 | - | func buyNFT ( | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | if ($isInstanceOf( | |
59 | + | @Callable(m) | |
60 | + | func buyNFT (E,F) = { | |
61 | + | let j = fromBase58String(E) | |
62 | + | let G = value(m.payments[0].amount) | |
63 | + | let H = { | |
64 | + | let k = getString(this, (("nft_" + F) + "_owner")) | |
65 | + | if ($isInstanceOf(k, "String")) | |
296 | 66 | then { | |
297 | - | let | |
298 | - | | |
67 | + | let I = k | |
68 | + | I | |
299 | 69 | } | |
300 | - | else | |
70 | + | else false | |
301 | 71 | } | |
302 | - | let P = getStringValue(((((e + a) + aV) + "_") + aW)) | |
303 | - | let ba = valueOrErrorMessage(getStringValue((a + "Owner")), "No owner") | |
304 | - | if ((aI.payments[0].assetId != unit)) | |
72 | + | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | + | if ((m.payments[0].assetId != unit)) | |
305 | 74 | then throw("Pay in waves") | |
306 | - | else if (( | |
307 | - | then throw("Owner of NFT not able to purchase") | |
308 | - | else [StringEntry(((toString( | |
75 | + | else if ((F == toString(m.caller))) | |
76 | + | then throw("current Owner of NFT not able to purchase") | |
77 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(F)), G, unit), StringEntry(((toString(m.caller) + a) + b), ((E + a) + toString(G))), DeleteEntry((("nft_" + F) + "_owner")), StringEntry((("nft_" + F) + "_owner"), toString(m.caller)), StringEntry(((E + a) + "_owner"), toString(m.caller))] | |
309 | 78 | } | |
310 | 79 | ||
311 | 80 | ||
312 | 81 | ||
313 | - | @Callable(aI) | |
314 | - | func sellauction (L,M,K,bb) = { | |
315 | - | let aR = toBase58String(aI.transactionId) | |
316 | - | let h = value(aI.payments[1].assetId) | |
317 | - | let P = value(K) | |
318 | - | let am = aI.caller.bytes | |
319 | - | let bc = { | |
320 | - | let F = getString(this, (((toBase58String(h) + a) + "nft_status_") + toBase58String(am))) | |
321 | - | if ($isInstanceOf(F, "String")) | |
82 | + | @Callable(m) | |
83 | + | func addAuction (J,K,L,M) = { | |
84 | + | let y = toBase58String(m.transactionId) | |
85 | + | let N = value(m.payments[0].assetId) | |
86 | + | let z = value(L) | |
87 | + | let O = (lastBlock.height + M) | |
88 | + | let P = m.caller.bytes | |
89 | + | let Q = { | |
90 | + | let k = getString(this, (((toBase58String(N) + a) + "nft_status_") + toBase58String(P))) | |
91 | + | if ($isInstanceOf(k, "String")) | |
322 | 92 | then { | |
323 | - | let | |
93 | + | let I = k | |
324 | 94 | true | |
325 | 95 | } | |
326 | 96 | else false | |
327 | 97 | } | |
328 | - | if (( | |
98 | + | if ((m.payments[0].assetId == unit)) | |
329 | 99 | then throw("NFT not attached") | |
330 | - | else if (( | |
100 | + | else if ((Q == true)) | |
331 | 101 | then throw("Already in auction list") | |
332 | - | else [StringEntry(((aR + "_nft_start_auction_date_") + toBase58String(am)), L), StringEntry(((aR + "_nft_end_auction_date_") + toBase58String(am)), M), StringEntry((aR + "_nft_start_price"), K), IntegerEntry((aR + "duration_of_auction"), bb), StringEntry((aR + "_nft_owner"), toString(aI.caller)), StringEntry((aR + "_nft_on_auction"), toBase58String(h)), StringEntry((aR + "_previous_bidder"), "none"), StringEntry((aR + "_highest_bid"), "0"), StringEntry((aR + "_winner_of_nft"), "0"), StringEntry((aR + "_bidder_count"), "0"), StringEntry((aR + "_nft_status"), "OPEN")] | |
102 | + | else if ((M > e)) | |
103 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
104 | + | else [StringEntry(((y + "_nft_start_auction_date_") + toBase58String(P)), J), StringEntry(((y + "_nft_end_auction_date_") + toBase58String(P)), K), StringEntry((y + "_nft_start_price"), L), StringEntry((y + "_nft_owner"), toString(m.caller)), StringEntry((y + "_nft_on_auction"), toBase58String(N)), StringEntry((y + "_previous_bidder"), "none"), StringEntry((y + "_highest_bid"), "0"), StringEntry((y + "_winner_of_nft"), "0"), StringEntry((y + "_bidder_count"), "0"), StringEntry((y + "_nft_status"), "OPEN")] | |
333 | 105 | } | |
334 | 106 | ||
335 | 107 | ||
336 | 108 | ||
337 | - | @Callable( | |
338 | - | func | |
339 | - | let | |
340 | - | let | |
341 | - | let | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | let | |
347 | - | let | |
348 | - | if (( | |
109 | + | @Callable(m) | |
110 | + | func placeBid (R,N,o,S) = { | |
111 | + | let y = toBase58String(m.transactionId) | |
112 | + | let P = m.caller.bytes | |
113 | + | let j = fromBase58String(N) | |
114 | + | let T = m.payments[0].amount | |
115 | + | let U = getStringValue(this, (R + "_highest_bid")) | |
116 | + | let V = getString(this, (R + "_previous_bidder")) | |
117 | + | let W = getStringValue(this, (R + "_bidder_count")) | |
118 | + | let X = getStringValue(this, (R + "_winner_of_nft")) | |
119 | + | let Q = getStringValue(this, (R + "_nft_status")) | |
120 | + | if ((m.payments[0].assetId != unit)) | |
349 | 121 | then throw("Pay in waves") | |
350 | - | else if (( | |
122 | + | else if ((Q != "OPEN")) | |
351 | 123 | then throw("Not open for auction") | |
352 | - | else if ((parseIntValue( | |
124 | + | else if ((parseIntValue(U) >= T)) | |
353 | 125 | then throw("Bid is less then starting/highest Bid") | |
354 | - | else if (( | |
355 | - | then [StringEntry(( | |
356 | - | else [StringEntry(( | |
126 | + | else if ((U == "0")) | |
127 | + | then [StringEntry((R + "_highest_bid"), toString(T)), StringEntry((R + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((R + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((R + "_nft_id"), toBase58String(j)), StringEntry((R + "_nft_owner"), o), StringEntry((((y + "_") + R) + "_highest_bid"), toString(T)), StringEntry((((y + "_") + R) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((y + "_") + R) + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((((y + "_") + R) + "_nft_id"), toBase58String(j)), StringEntry((((y + "_") + R) + "_nft_owner"), o), StringEntry((y + "_bid_for_nft_by"), toBase58String(P)), StringEntry((y + "_bid_price_place"), S), StringEntry((y + "_previous_bid_amount_refund_to_address"), X), StringEntry((y + "_prevoius_bid_amount_refund"), U)] | |
128 | + | else [StringEntry((R + "_highest_bid"), toString(T)), StringEntry((R + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((R + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((R + "_nft_id"), toBase58String(j)), StringEntry((R + "_nft_owner"), o), StringEntry((((y + "_") + R) + "_highest_bid"), toString(T)), StringEntry((((y + "_") + R) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((y + "_") + R) + "_bidder_count"), toString((parseIntValue(W) + 1))), StringEntry((((y + "_") + R) + "_nft_id"), toBase58String(j)), StringEntry((((y + "_") + R) + "_nft_owner"), o), StringEntry((y + "_bid_for_nft_by"), toBase58String(P)), StringEntry((y + "_bid_price_place"), S), StringEntry((y + "_previous_bid_amount_refund_to_address"), X), StringEntry((y + "_prevoius_bid_amount_refund"), U), ScriptTransfer(Address(fromBase58String(X)), parseIntValue(U), unit)] | |
357 | 129 | } | |
358 | 130 | ||
359 | 131 | ||
360 | 132 | ||
361 | - | @Callable( | |
362 | - | func acceptBidOffer ( | |
363 | - | let | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | [ScriptTransfer(Address( | |
133 | + | @Callable(m) | |
134 | + | func acceptBidOffer (R,N,Y) = { | |
135 | + | let y = toBase58String(m.transactionId) | |
136 | + | let P = m.caller.bytes | |
137 | + | let j = fromBase58String(N) | |
138 | + | let Z = getStringValue(this, (R + "_highest_bid")) | |
139 | + | let aa = getStringValue(this, (R + "_winner_of_nft")) | |
140 | + | [ScriptTransfer(Address(P), parseIntValue(Z), unit), ScriptTransfer(Address(fromBase58String(aa)), 1, j), StringEntry((y + "_amount_paid_to_owner"), Z), StringEntry((y + "_nft_transfer_to"), aa), StringEntry((y + "_nft_status"), "REWARDED"), StringEntry((R + "_amount_paid_to_owner"), Z), StringEntry((R + "_nft_transfer_to"), aa), StringEntry((R + "_nft_status"), "REWARDED")] | |
369 | 141 | } | |
370 | 142 | ||
371 | 143 | ||
372 | 144 | ||
373 | - | @Callable( | |
374 | - | func | |
375 | - | let | |
376 | - | let | |
377 | - | let | |
378 | - | let | |
379 | - | let | |
380 | - | let | |
381 | - | let | |
382 | - | if (( | |
383 | - | then [ScriptTransfer(Address(fromBase58String( | |
384 | - | else [StringEntry(( | |
145 | + | @Callable(m) | |
146 | + | func cancelAuction (R) = { | |
147 | + | let y = toBase58String(m.transactionId) | |
148 | + | let P = m.caller.bytes | |
149 | + | let ab = getStringValue(this, (R + "_nft_status")) | |
150 | + | let ac = getStringValue(this, (R + "_winner_of_nft")) | |
151 | + | let ad = getStringValue(this, (R + "_nft_owner")) | |
152 | + | let N = getStringValue(this, (R + "_nft_on_auction")) | |
153 | + | let ae = getStringValue(this, (R + "_highest_bid")) | |
154 | + | if ((ac == "0")) | |
155 | + | then [StringEntry(((y + R) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ad)), 1, fromBase58String(N))] | |
156 | + | else [StringEntry((R + "_nft_status"), "CANCELED"), StringEntry((R + "_previous_bid_amount_refund_to_address"), ac), StringEntry((R + "_prevoius_bid_amount_refund"), ae), StringEntry((y + "_nft_status"), "CANCELED"), StringEntry((y + "_previous_bid_amount_refund_to_address"), ac), StringEntry((y + "_prevoius_bid_amount_refund"), ae), ScriptTransfer(Address(fromBase58String(ad)), 1, fromBase58String(N)), ScriptTransfer(Address(fromBase58String(ac)), parseIntValue(ae), unit)] | |
385 | 157 | } | |
386 | 158 | ||
387 | 159 | ||
388 | 160 | ||
389 | - | @Callable( | |
390 | - | func | |
391 | - | let | |
392 | - | let | |
393 | - | let | |
394 | - | let | |
395 | - | if (( | |
161 | + | @Callable(m) | |
162 | + | func withdrawBid (af) = { | |
163 | + | let P = m.caller.bytes | |
164 | + | let ag = getStringValue(this, (af + "_highest_bid")) | |
165 | + | let ah = getStringValue(this, (af + "_winner")) | |
166 | + | let ai = getStringValue(this, (af + "_nft_id")) | |
167 | + | if ((toBase58String(P) != ah)) | |
396 | 168 | then throw("No bid") | |
397 | - | else [StringEntry(( | |
169 | + | else [StringEntry((af + "_nft_bid"), "WITHDRAW"), StringEntry((af + "_nft_id"), ai), StringEntry((af + "_bidding_price_refund_amount"), ag), ScriptTransfer(m.caller, parseIntValue(ag), unit)] | |
398 | 170 | } | |
399 | 171 | ||
400 | 172 | ||
401 | 173 | ||
402 | - | @Callable( | |
403 | - | func testBid ( | |
174 | + | @Callable(m) | |
175 | + | func testBid (aj) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
404 | 176 | ||
405 | 177 |
github/deemru/w8io/169f3d6 140.73 ms ◑