tx · HdkmyngesycDaLJw2uAZkdgF1MFAXHCjDEo7B938N63H 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx: -0.10000000 Waves 2022.12.26 11:00 [2376988] smart account 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx > SELF 0.00000000 Waves
{ "type": 13, "id": "HdkmyngesycDaLJw2uAZkdgF1MFAXHCjDEo7B938N63H", "fee": 10000000, "feeAssetId": null, "timestamp": 1672041647329, "version": 2, "chainId": 84, "sender": "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx", "senderPublicKey": "EKZmHJ5bK3qKKgRdq8rAamt9qrDbVMLARzRqXoQW258v", "proofs": [ "24mATc299Ya8YX4nErVP9GJjSm8gaTySR6HCmg7hDRvGoeznCFTwhk4gDLPNMfyGpCXGcWLVDgQgCAg3KJUhxk2F" ], "script": "base64:BgI9CAISCAoGCAgBCAgIEgMKAQESBAoCCAgSBgoECAgIARIGCgQICAgIEgUKAwgICBIDCgEIEgMKAQgSAwoBCCkACXNlcGFyYXRvcgIBXwAIa0F1Y3Rpb24CB2F1Y3Rpb24ABWtTZWxsAgRzZWxsAAhrVHJ1c3RlZAIHdHJ1c3RlZAAGa1ByaWNlAgVwcmljZQEKZ2V0U2xvdEtleQIGcHJlZml4BW5mdElkCQCsAgIJAKwCAgUGcHJlZml4BQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBC2dldFByaWNlS2V5AQVuZnRJZAkArAICCQCsAgIFBmtQcmljZQUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQpnZXRTZWxsS2V5AQVuZnRJZAkArAICCQCsAgIFBWtTZWxsBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldEF1Y3Rpb25LZXkBBW5mdElkCQCsAgIJAKwCAgUIa0F1Y3Rpb24FCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0VHJ1c3RlZEtleQEGaXNzdWVyCQCsAgIJAKwCAgUIa1RydXN0ZWQFCXNlc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YmlkZGluZ19wcmljZV9yZWZ1bmRfYW1vdW50BQhiaWRQcmljZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAQ1wYXJzZUludFZhbHVlAQUIYmlkUHJpY2UFBHVuaXQFA25pbAFpAQd0ZXN0QmlkAQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQICOEU4a2tGQllDeTQ0SkphcTZwQVo2S2l6c3VSZXNpNVVLTmhiRDFXTlp3aGhZX2hpZ2hlc3RfYmlkAgEwBQNuaWwA3y7KnQ==", "height": 2376988, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C636reYDtfQB332tA8L4yHMVV3wipw5Xs74Zr8tZoWAM Next: 3XpAqhH5GK8jeXwqGwu114pqGjbhXfV9KrCRiMa4yoYn Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | - | let b = " | |
6 | + | let b = "auction" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "sell" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "trusted" | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = "price" | |
13 | 13 | ||
14 | - | ||
14 | + | func f (g,h) = ((g + a) + toBase58String(h)) | |
15 | 15 | ||
16 | - | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
17 | 16 | ||
18 | - | ||
17 | + | func i (h) = ((e + a) + toBase58String(h)) | |
19 | 18 | ||
20 | - | func i (j) = { | |
21 | - | let k = assetInfo(j) | |
22 | - | if ($isInstanceOf(k, "Asset")) | |
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)")) | |
23 | 130 | then { | |
24 | - | let l = k | |
25 | - | if (if ((l.decimals == 0)) | |
26 | - | then (l.quantity == 1) | |
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) | |
27 | 181 | else false) | |
28 | - | then ( | |
182 | + | then (ae.reissuable == false) | |
29 | 183 | else false | |
30 | 184 | } | |
31 | 185 | else false | |
32 | 186 | } | |
33 | 187 | ||
34 | 188 | ||
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))] | |
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))] | |
41 | 272 | } | |
42 | 273 | ||
43 | 274 | ||
44 | 275 | ||
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))) | |
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)) | |
53 | 283 | then throw("Token is not NFT") | |
54 | - | else [StringEntry((( | |
284 | + | else [StringEntry(((e + a) + toBase58String(value(aI.payments[0].assetId))), toString(P)), StringEntry(((toString(aI.caller) + a) + c), ((toBase58String(aT) + a) + toString(aU)))] | |
55 | 285 | } | |
56 | 286 | ||
57 | 287 | ||
58 | 288 | ||
59 | - | @Callable( | |
60 | - | func buyNFT ( | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | if ($isInstanceOf( | |
289 | + | @Callable(aI) | |
290 | + | func buyNFT (aV,aW) = { | |
291 | + | let T = fromBase58String(aW) | |
292 | + | let aX = value(aI.payments[0].amount) | |
293 | + | let aY = { | |
294 | + | let F = getString(this, (("nft_" + aW) + "_owner")) | |
295 | + | if ($isInstanceOf(F, "String")) | |
66 | 296 | then { | |
67 | - | let | |
68 | - | | |
297 | + | let aZ = F | |
298 | + | aZ | |
69 | 299 | } | |
70 | - | else | |
300 | + | else true | |
71 | 301 | } | |
72 | - | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | - | if ((m.payments[0].assetId != unit)) | |
302 | + | let P = getStringValue(((((e + a) + aV) + "_") + aW)) | |
303 | + | let ba = valueOrErrorMessage(getStringValue((a + "Owner")), "No owner") | |
304 | + | if ((aI.payments[0].assetId != unit)) | |
74 | 305 | then throw("Pay in waves") | |
75 | - | else if (( | |
76 | - | then throw(" | |
77 | - | else [ | |
306 | + | else if ((aY == toString(aI.caller))) | |
307 | + | then throw("Owner of NFT not able to purchase") | |
308 | + | else [StringEntry(((toString(aI.caller) + a) + aE), (aV + a)), DeleteEntry((("nft_" + aW) + "_owner"))] | |
78 | 309 | } | |
79 | 310 | ||
80 | 311 | ||
81 | 312 | ||
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")) | |
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")) | |
92 | 322 | then { | |
93 | - | let | |
323 | + | let aZ = F | |
94 | 324 | true | |
95 | 325 | } | |
96 | 326 | else false | |
97 | 327 | } | |
98 | - | if (( | |
328 | + | if ((aI.payments[0].assetId == unit)) | |
99 | 329 | then throw("NFT not attached") | |
100 | - | else if (( | |
330 | + | else if ((bc == true)) | |
101 | 331 | then throw("Already in auction list") | |
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")] | |
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")] | |
105 | 333 | } | |
106 | 334 | ||
107 | 335 | ||
108 | 336 | ||
109 | - | @Callable( | |
110 | - | func | |
111 | - | let | |
112 | - | let | |
113 | - | let | |
114 | - | let | |
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | let | |
119 | - | let | |
120 | - | if (( | |
337 | + | @Callable(aI) | |
338 | + | func iqplace (bd,h,be,bf) = { | |
339 | + | let aR = toBase58String(aI.transactionId) | |
340 | + | let am = aI.caller.bytes | |
341 | + | let T = fromBase64String(h) | |
342 | + | let bg = aI.payments[1].amount | |
343 | + | let bh = getStringValue(this, (bd + "_highest_bid")) | |
344 | + | let bi = getString(this, (bd + "_previous_bidder")) | |
345 | + | let bj = getStringValue(this, (bd + "_bidder_count")) | |
346 | + | let bk = getStringValue(this, (bd + "_winner_of_nft")) | |
347 | + | let bc = getStringValue(this, (bd + "_nft_status")) | |
348 | + | if ((aI.payments[0].assetId != unit)) | |
121 | 349 | then throw("Pay in waves") | |
122 | - | else if (( | |
350 | + | else if ((bc != "OPEN")) | |
123 | 351 | then throw("Not open for auction") | |
124 | - | else if ((parseIntValue( | |
352 | + | else if ((parseIntValue(bh) >= bg)) | |
125 | 353 | then throw("Bid is less then starting/highest Bid") | |
126 | - | else if (( | |
127 | - | then [StringEntry(( | |
128 | - | else [StringEntry(( | |
354 | + | else if ((bh == "3")) | |
355 | + | then [StringEntry((bd + "_highest_bid"), toString(bg)), StringEntry((bd + "_winner_of_nft"), toBase58String(aI.caller.bytes)), StringEntry((bd + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((bd + "_nft_id"), toBase58String(T)), StringEntry((bd + "_nft_owner"), be), StringEntry((((aR + "_") + bd) + "_highest_bid"), toString(bg)), StringEntry((((aR + "_") + bd) + "_winner"), toBase58String(aI.caller.bytes)), StringEntry((((aR + "_") + bd) + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((((aR + "_") + bd) + "_nft_id"), toBase58String(T)), StringEntry((((aR + "_") + bd) + "_nft_owner"), be), StringEntry((aR + "_bid_for_nft_by"), toBase58String(am)), StringEntry((aR + "_bid_price_place"), bf), StringEntry((aR + "_previous_bid_amount_refund_to_address"), bk), StringEntry((aR + "_prevoius_bid_amount_refund"), bh)] | |
356 | + | else [StringEntry((bd + "_highest_bid"), toString(bg)), StringEntry((bd + "_winner_of_nft"), toBase58String(aI.caller.bytes)), StringEntry((bd + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((bd + "_nft_id"), toBase58String(T)), StringEntry((bd + "_nft_owner"), be), StringEntry((((aR + "_") + bd) + "_highest_bid"), toString(bg)), StringEntry((((aR + "_") + bd) + "_winner"), toBase58String(aI.caller.bytes)), StringEntry((((aR + "_") + bd) + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((((aR + "_") + bd) + "_nft_id"), toBase58String(T)), StringEntry((((aR + "_") + bd) + "_nft_owner"), be), StringEntry((aR + "_bid_for_nft_by"), toBase58String(am)), StringEntry((aR + "_bid_price_place"), bf), StringEntry((aR + "_previous_bid_amount_refund_to_address"), bk), StringEntry((aR + "_prevoius_bid_amount_refund"), bh), ScriptTransfer(Address(fromBase58String(bk)), parseIntValue(bh), unit)] | |
129 | 357 | } | |
130 | 358 | ||
131 | 359 | ||
132 | 360 | ||
133 | - | @Callable( | |
134 | - | func acceptBidOffer ( | |
135 | - | let | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | [ScriptTransfer(Address( | |
361 | + | @Callable(aI) | |
362 | + | func acceptBidOffer (bd,h,bl) = { | |
363 | + | let aR = toBase58String(aI.transactionId) | |
364 | + | let am = aI.caller.bytes | |
365 | + | let T = fromBase58String(h) | |
366 | + | let bm = getStringValue(this, (bd + "_highest_bid")) | |
367 | + | let bn = getStringValue(this, (bd + "_winner_of_nft")) | |
368 | + | [ScriptTransfer(Address(am), parseIntValue(bm), unit), StringEntry((aR + "_amount_paid_to_owner"), bm), StringEntry((aR + "_nft_status"), "REWARDED"), StringEntry((bd + "_amount_paid_to_owner"), bm), StringEntry((bd + "_nft_transfer_to"), bn), StringEntry((bd + "_nft_status"), "REWARDED")] | |
141 | 369 | } | |
142 | 370 | ||
143 | 371 | ||
144 | 372 | ||
145 | - | @Callable( | |
146 | - | func | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | if (( | |
155 | - | then [ | |
156 | - | else [StringEntry(( | |
373 | + | @Callable(aI) | |
374 | + | func cancel1Auction (bd) = { | |
375 | + | let aR = toBase64String(aI.transactionId) | |
376 | + | let am = aI.caller.bytes | |
377 | + | let bo = getStringValue(this, (bd + "_nft_status")) | |
378 | + | let bp = getStringValue(this, (bd + "_winner_of_nft")) | |
379 | + | let bq = getStringValue(this, (bd + "_nft_owner")) | |
380 | + | let h = getStringValue(this, (bd + "_nft_on_auction")) | |
381 | + | let br = getStringValue(this, (bd + "_highest_bid")) | |
382 | + | if ((bp == "0")) | |
383 | + | then [ScriptTransfer(Address(fromBase58String(bq)), 1, fromBase58String(h))] | |
384 | + | else [StringEntry((bd + "_nft_status"), "CANCELED"), StringEntry((bd + "_previous_bid_amount_refund_to_address"), bp), StringEntry((bd + "_prevoius_bid_amount_refund"), br), StringEntry((aR + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(bq)), 1, fromBase58String(h)), ScriptTransfer(Address(fromBase58String(bp)), parseIntValue(br), unit)] | |
157 | 385 | } | |
158 | 386 | ||
159 | 387 | ||
160 | 388 | ||
161 | - | @Callable( | |
162 | - | func | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
167 | - | if (( | |
389 | + | @Callable(aI) | |
390 | + | func WITH (bs) = { | |
391 | + | let am = aI.caller.bytes | |
392 | + | let bt = getStringValue(this, (bs + "_highest_bid")) | |
393 | + | let bu = getStringValue(this, (bs + "_winner")) | |
394 | + | let bv = getStringValue(this, (bs + "_nft_id")) | |
395 | + | if ((toBase64String(am) != bu)) | |
168 | 396 | then throw("No bid") | |
169 | - | else [StringEntry(( | |
397 | + | else [StringEntry((bs + "_nft_id"), bv), StringEntry((bs + "_bidding_price_refund_amount"), bt), ScriptTransfer(aI.caller, parseIntValue(bt), unit)] | |
170 | 398 | } | |
171 | 399 | ||
172 | 400 | ||
173 | 401 | ||
174 | - | @Callable( | |
175 | - | func testBid ( | |
402 | + | @Callable(aI) | |
403 | + | func testBid (bw) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
176 | 404 | ||
177 | 405 |
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 = "auction" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "sell" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "trusted" | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = "price" | |
13 | 13 | ||
14 | - | ||
14 | + | func f (g,h) = ((g + a) + toBase58String(h)) | |
15 | 15 | ||
16 | - | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
17 | 16 | ||
18 | - | ||
17 | + | func i (h) = ((e + a) + toBase58String(h)) | |
19 | 18 | ||
20 | - | func i (j) = { | |
21 | - | let k = assetInfo(j) | |
22 | - | if ($isInstanceOf(k, "Asset")) | |
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)")) | |
23 | 130 | then { | |
24 | - | let l = k | |
25 | - | if (if ((l.decimals == 0)) | |
26 | - | then (l.quantity == 1) | |
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) | |
27 | 181 | else false) | |
28 | - | then ( | |
182 | + | then (ae.reissuable == false) | |
29 | 183 | else false | |
30 | 184 | } | |
31 | 185 | else false | |
32 | 186 | } | |
33 | 187 | ||
34 | 188 | ||
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))] | |
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))] | |
41 | 272 | } | |
42 | 273 | ||
43 | 274 | ||
44 | 275 | ||
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))) | |
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)) | |
53 | 283 | then throw("Token is not NFT") | |
54 | - | else [StringEntry((( | |
284 | + | else [StringEntry(((e + a) + toBase58String(value(aI.payments[0].assetId))), toString(P)), StringEntry(((toString(aI.caller) + a) + c), ((toBase58String(aT) + a) + toString(aU)))] | |
55 | 285 | } | |
56 | 286 | ||
57 | 287 | ||
58 | 288 | ||
59 | - | @Callable( | |
60 | - | func buyNFT ( | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | if ($isInstanceOf( | |
289 | + | @Callable(aI) | |
290 | + | func buyNFT (aV,aW) = { | |
291 | + | let T = fromBase58String(aW) | |
292 | + | let aX = value(aI.payments[0].amount) | |
293 | + | let aY = { | |
294 | + | let F = getString(this, (("nft_" + aW) + "_owner")) | |
295 | + | if ($isInstanceOf(F, "String")) | |
66 | 296 | then { | |
67 | - | let | |
68 | - | | |
297 | + | let aZ = F | |
298 | + | aZ | |
69 | 299 | } | |
70 | - | else | |
300 | + | else true | |
71 | 301 | } | |
72 | - | let z = getStringValue(((((c + a) + E) + "_") + F)) | |
73 | - | if ((m.payments[0].assetId != unit)) | |
302 | + | let P = getStringValue(((((e + a) + aV) + "_") + aW)) | |
303 | + | let ba = valueOrErrorMessage(getStringValue((a + "Owner")), "No owner") | |
304 | + | if ((aI.payments[0].assetId != unit)) | |
74 | 305 | then throw("Pay in waves") | |
75 | - | else if (( | |
76 | - | then throw(" | |
77 | - | else [ | |
306 | + | else if ((aY == toString(aI.caller))) | |
307 | + | then throw("Owner of NFT not able to purchase") | |
308 | + | else [StringEntry(((toString(aI.caller) + a) + aE), (aV + a)), DeleteEntry((("nft_" + aW) + "_owner"))] | |
78 | 309 | } | |
79 | 310 | ||
80 | 311 | ||
81 | 312 | ||
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")) | |
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")) | |
92 | 322 | then { | |
93 | - | let | |
323 | + | let aZ = F | |
94 | 324 | true | |
95 | 325 | } | |
96 | 326 | else false | |
97 | 327 | } | |
98 | - | if (( | |
328 | + | if ((aI.payments[0].assetId == unit)) | |
99 | 329 | then throw("NFT not attached") | |
100 | - | else if (( | |
330 | + | else if ((bc == true)) | |
101 | 331 | then throw("Already in auction list") | |
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")] | |
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")] | |
105 | 333 | } | |
106 | 334 | ||
107 | 335 | ||
108 | 336 | ||
109 | - | @Callable( | |
110 | - | func | |
111 | - | let | |
112 | - | let | |
113 | - | let | |
114 | - | let | |
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | let | |
119 | - | let | |
120 | - | if (( | |
337 | + | @Callable(aI) | |
338 | + | func iqplace (bd,h,be,bf) = { | |
339 | + | let aR = toBase58String(aI.transactionId) | |
340 | + | let am = aI.caller.bytes | |
341 | + | let T = fromBase64String(h) | |
342 | + | let bg = aI.payments[1].amount | |
343 | + | let bh = getStringValue(this, (bd + "_highest_bid")) | |
344 | + | let bi = getString(this, (bd + "_previous_bidder")) | |
345 | + | let bj = getStringValue(this, (bd + "_bidder_count")) | |
346 | + | let bk = getStringValue(this, (bd + "_winner_of_nft")) | |
347 | + | let bc = getStringValue(this, (bd + "_nft_status")) | |
348 | + | if ((aI.payments[0].assetId != unit)) | |
121 | 349 | then throw("Pay in waves") | |
122 | - | else if (( | |
350 | + | else if ((bc != "OPEN")) | |
123 | 351 | then throw("Not open for auction") | |
124 | - | else if ((parseIntValue( | |
352 | + | else if ((parseIntValue(bh) >= bg)) | |
125 | 353 | then throw("Bid is less then starting/highest Bid") | |
126 | - | else if (( | |
127 | - | then [StringEntry(( | |
128 | - | else [StringEntry(( | |
354 | + | else if ((bh == "3")) | |
355 | + | then [StringEntry((bd + "_highest_bid"), toString(bg)), StringEntry((bd + "_winner_of_nft"), toBase58String(aI.caller.bytes)), StringEntry((bd + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((bd + "_nft_id"), toBase58String(T)), StringEntry((bd + "_nft_owner"), be), StringEntry((((aR + "_") + bd) + "_highest_bid"), toString(bg)), StringEntry((((aR + "_") + bd) + "_winner"), toBase58String(aI.caller.bytes)), StringEntry((((aR + "_") + bd) + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((((aR + "_") + bd) + "_nft_id"), toBase58String(T)), StringEntry((((aR + "_") + bd) + "_nft_owner"), be), StringEntry((aR + "_bid_for_nft_by"), toBase58String(am)), StringEntry((aR + "_bid_price_place"), bf), StringEntry((aR + "_previous_bid_amount_refund_to_address"), bk), StringEntry((aR + "_prevoius_bid_amount_refund"), bh)] | |
356 | + | else [StringEntry((bd + "_highest_bid"), toString(bg)), StringEntry((bd + "_winner_of_nft"), toBase58String(aI.caller.bytes)), StringEntry((bd + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((bd + "_nft_id"), toBase58String(T)), StringEntry((bd + "_nft_owner"), be), StringEntry((((aR + "_") + bd) + "_highest_bid"), toString(bg)), StringEntry((((aR + "_") + bd) + "_winner"), toBase58String(aI.caller.bytes)), StringEntry((((aR + "_") + bd) + "_bidder_count"), toString((parseIntValue(bj) + 1))), StringEntry((((aR + "_") + bd) + "_nft_id"), toBase58String(T)), StringEntry((((aR + "_") + bd) + "_nft_owner"), be), StringEntry((aR + "_bid_for_nft_by"), toBase58String(am)), StringEntry((aR + "_bid_price_place"), bf), StringEntry((aR + "_previous_bid_amount_refund_to_address"), bk), StringEntry((aR + "_prevoius_bid_amount_refund"), bh), ScriptTransfer(Address(fromBase58String(bk)), parseIntValue(bh), unit)] | |
129 | 357 | } | |
130 | 358 | ||
131 | 359 | ||
132 | 360 | ||
133 | - | @Callable( | |
134 | - | func acceptBidOffer ( | |
135 | - | let | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | [ScriptTransfer(Address( | |
361 | + | @Callable(aI) | |
362 | + | func acceptBidOffer (bd,h,bl) = { | |
363 | + | let aR = toBase58String(aI.transactionId) | |
364 | + | let am = aI.caller.bytes | |
365 | + | let T = fromBase58String(h) | |
366 | + | let bm = getStringValue(this, (bd + "_highest_bid")) | |
367 | + | let bn = getStringValue(this, (bd + "_winner_of_nft")) | |
368 | + | [ScriptTransfer(Address(am), parseIntValue(bm), unit), StringEntry((aR + "_amount_paid_to_owner"), bm), StringEntry((aR + "_nft_status"), "REWARDED"), StringEntry((bd + "_amount_paid_to_owner"), bm), StringEntry((bd + "_nft_transfer_to"), bn), StringEntry((bd + "_nft_status"), "REWARDED")] | |
141 | 369 | } | |
142 | 370 | ||
143 | 371 | ||
144 | 372 | ||
145 | - | @Callable( | |
146 | - | func | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | if (( | |
155 | - | then [ | |
156 | - | else [StringEntry(( | |
373 | + | @Callable(aI) | |
374 | + | func cancel1Auction (bd) = { | |
375 | + | let aR = toBase64String(aI.transactionId) | |
376 | + | let am = aI.caller.bytes | |
377 | + | let bo = getStringValue(this, (bd + "_nft_status")) | |
378 | + | let bp = getStringValue(this, (bd + "_winner_of_nft")) | |
379 | + | let bq = getStringValue(this, (bd + "_nft_owner")) | |
380 | + | let h = getStringValue(this, (bd + "_nft_on_auction")) | |
381 | + | let br = getStringValue(this, (bd + "_highest_bid")) | |
382 | + | if ((bp == "0")) | |
383 | + | then [ScriptTransfer(Address(fromBase58String(bq)), 1, fromBase58String(h))] | |
384 | + | else [StringEntry((bd + "_nft_status"), "CANCELED"), StringEntry((bd + "_previous_bid_amount_refund_to_address"), bp), StringEntry((bd + "_prevoius_bid_amount_refund"), br), StringEntry((aR + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(bq)), 1, fromBase58String(h)), ScriptTransfer(Address(fromBase58String(bp)), parseIntValue(br), unit)] | |
157 | 385 | } | |
158 | 386 | ||
159 | 387 | ||
160 | 388 | ||
161 | - | @Callable( | |
162 | - | func | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
167 | - | if (( | |
389 | + | @Callable(aI) | |
390 | + | func WITH (bs) = { | |
391 | + | let am = aI.caller.bytes | |
392 | + | let bt = getStringValue(this, (bs + "_highest_bid")) | |
393 | + | let bu = getStringValue(this, (bs + "_winner")) | |
394 | + | let bv = getStringValue(this, (bs + "_nft_id")) | |
395 | + | if ((toBase64String(am) != bu)) | |
168 | 396 | then throw("No bid") | |
169 | - | else [StringEntry(( | |
397 | + | else [StringEntry((bs + "_nft_id"), bv), StringEntry((bs + "_bidding_price_refund_amount"), bt), ScriptTransfer(aI.caller, parseIntValue(bt), unit)] | |
170 | 398 | } | |
171 | 399 | ||
172 | 400 | ||
173 | 401 | ||
174 | - | @Callable( | |
175 | - | func testBid ( | |
402 | + | @Callable(aI) | |
403 | + | func testBid (bw) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
176 | 404 | ||
177 | 405 |
github/deemru/w8io/169f3d6 120.27 ms ◑