tx · ExKBYU8N9FURKa5xxPjK3MvydBi5ewxyoJAG1V2EQ1FK 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx: -0.02500000 Waves 2023.03.28 17:51 [2509946] smart account 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx > SELF 0.00000000 Waves
{ "type": 13, "id": "ExKBYU8N9FURKa5xxPjK3MvydBi5ewxyoJAG1V2EQ1FK", "fee": 2500000, "feeAssetId": null, "timestamp": 1680015236864, "version": 2, "chainId": 84, "sender": "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx", "senderPublicKey": "EKZmHJ5bK3qKKgRdq8rAamt9qrDbVMLARzRqXoQW258v", "proofs": [ "2fMkgyeDfBVn9nZWawAnezHfWWJEUjJ6Xdb6Fqhwzoma7yKXPh4NooMwGjs7eovuZrStEYPBxasJgSMbGiz2SWcm" ], "script": "base64:BgJRCAISCwoJCAgICAgBCAgIEgQKAggIEgQKAggIEgMKAQgSBwoFCAgIAQISBwoFCAgICAISBgoECAgICBIECgIICBIECgIICBIDCgEIEgQKAggICwAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABmtQcmljZQIFcHJpY2UABWtTZWxsAgRzZWxsABJtYXhBdWN0aW9uRHVyYXRpb24AHgAFdGVhbXMBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+AAVXQVZFUwEAAARrQmlkAgNiaWQADHN0YXR1c0Zvck5GVAkAlgoEAgRPUEVOAgZDTE9TRUQCCFJFV0FSREVEAghDQU5DRUxFRAALZEFwcEFkZHJlc3MBGgFUSrhPbN7C2pPt9I7pSjb41U9/ldVVW12gAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVp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AQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkBDXBhcnNlSW50VmFsdWUBBQhiaWRQcmljZQUKYW1vdW50VW5pdAUDbmlsAwkAAAIFEGN1cnJlbnRfY3VycmVuY3kCBVdBVkVTCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIIX25mdF9iaWQCCFdJVEhEUkFXCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIHX25mdF9pZAUJYmlkRm9yTkZUCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYmlkVHhJZAIcX2JpZGRpbmdfcHJpY2VfcmVmdW5kX2Ftb3VudAUIYmlkUHJpY2UJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEFCGJpZFByaWNlBQR1bml0BQNuaWwFA25pbAARi8vP", "height": 2509946, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JBqMPQ7HeyzvXh4ASXDSCs6q7DRmHBKnjbivUwBzrsmG Next: 7e7drXjcddLtvaHiaAwEumFDcbzWQH7noiiBSosG4GtE Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | ||
18 | 18 | let h = "bid" | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
23 | 23 | ||
24 | - | let k = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
25 | - | ||
26 | - | func l (m) = { | |
27 | - | let n = assetInfo(m) | |
28 | - | if ($isInstanceOf(n, "Asset")) | |
24 | + | func k (l) = { | |
25 | + | let m = assetInfo(l) | |
26 | + | if ($isInstanceOf(m, "Asset")) | |
29 | 27 | then { | |
30 | - | let | |
31 | - | if (if (( | |
32 | - | then ( | |
28 | + | let n = m | |
29 | + | if (if ((n.decimals == 0)) | |
30 | + | then (n.quantity == 1) | |
33 | 31 | else false) | |
34 | - | then ( | |
32 | + | then (n.reissuable == false) | |
35 | 33 | else false | |
36 | 34 | } | |
37 | 35 | else false | |
38 | 36 | } | |
39 | 37 | ||
40 | 38 | ||
41 | - | @Callable( | |
42 | - | func createNft (q,r,s,t,u,v,w,x | |
43 | - | let | |
44 | - | let | |
45 | - | let | |
46 | - | [ | |
39 | + | @Callable(o) | |
40 | + | func createNft (p,q,r,s,t,u,v,w,x) = { | |
41 | + | let y = Issue(p, v, 1, 0, false) | |
42 | + | let z = calculateAssetId(y) | |
43 | + | let A = o.transactionId | |
44 | + | [y, ScriptTransfer(o.caller, 1, z), StringEntry(((toBase58String(z) + a) + "Owner"), toString(o.caller)), StringEntry(((toBase58String(z) + a) + "nft_type"), s), StringEntry(((toBase58String(z) + a) + "nft_tags"), t), StringEntry(((toBase58String(z) + a) + "nft_dAppAddress"), r), IntegerEntry(((toBase58String(z) + a) + "nft_selling_price"), u), StringEntry(((toBase58String(z) + a) + "nft_onSell"), w), StringEntry(((toBase58String(z) + a) + "nft_data"), x), StringEntry(((toBase58String(A) + a) + "issue_nft"), toBase58String(z))] | |
47 | 45 | } | |
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | - | @Callable( | |
52 | - | func sellNFT (C | |
53 | - | let | |
54 | - | let | |
55 | - | let | |
56 | - | let | |
57 | - | let | |
58 | - | if (!( | |
49 | + | @Callable(o) | |
50 | + | func sellNFT (B,C) = { | |
51 | + | let A = o.transactionId | |
52 | + | let D = o.caller.bytes | |
53 | + | let E = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
54 | + | let F = E._1 | |
55 | + | let G = E._2 | |
56 | + | if (!(k(F))) | |
59 | 57 | then throw("Token is not NFT") | |
60 | - | else [StringEntry(((c + a) + toBase58String(value( | |
58 | + | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), (((toBase58String(F) + a) + toString(G)) + C))] | |
61 | 59 | } | |
62 | 60 | ||
63 | 61 | ||
64 | 62 | ||
65 | - | @Callable(p) | |
66 | - | func buyNFT (I,J) = { | |
67 | - | let m = fromBase58String(I) | |
63 | + | @Callable(o) | |
64 | + | func buyNFT (H,I) = { | |
65 | + | let l = fromBase58String(H) | |
66 | + | let J = value(o.payments[0].amount) | |
68 | 67 | let K = { | |
69 | - | let | |
70 | - | if ($isInstanceOf( | |
68 | + | let m = getString(this, (("nft_" + I) + "_owner")) | |
69 | + | if ($isInstanceOf(m, "String")) | |
71 | 70 | then { | |
72 | - | let L = | |
71 | + | let L = m | |
73 | 72 | L | |
74 | 73 | } | |
75 | 74 | else false | |
76 | 75 | } | |
77 | - | let C = getStringValue(((((c + a) + I) + "_") + J)) | |
78 | - | let M = value(p.payments[0].amount) | |
79 | - | let N = (M - ((M / 1000) * 25)) | |
80 | - | let O = (M - N) | |
81 | - | if ((J == toString(p.caller))) | |
76 | + | let B = getStringValue(((((c + a) + H) + "_") + I)) | |
77 | + | let M = ((J / 1000) * 975) | |
78 | + | let N = ((J / 1000) * 25) | |
79 | + | if ((I == toString(o.caller))) | |
82 | 80 | then throw("current Owner of NFT not able to purchase") | |
83 | - | else if (( | |
84 | - | then [ScriptTransfer( | |
85 | - | else if (( | |
86 | - | then [ScriptTransfer( | |
81 | + | else if ((o.payments[0].assetId == f)) | |
82 | + | then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), M, f), StringEntry((("nft_" + H) + "platform_fee"), toString(N)), StringEntry(((toString(o.caller) + a) + b), ((H + a) + toString(J))), DeleteEntry((("nft_" + I) + "_owner")), StringEntry((("nft_" + I) + "_owner"), toString(o.caller)), StringEntry(((H + a) + "_owner"), toString(o.caller))] | |
83 | + | else if ((o.payments[0].assetId == unit)) | |
84 | + | then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), M, unit), StringEntry((("nft_" + H) + "platform_fee"), toString(N)), StringEntry(((toString(o.caller) + a) + b), ((H + a) + toString(J))), DeleteEntry((("nft_" + I) + "_owner")), StringEntry((("nft_" + I) + "_owner"), toString(o.caller)), StringEntry(((H + a) + "_owner"), toString(o.caller))] | |
87 | 85 | else nil | |
88 | 86 | } | |
89 | 87 | ||
90 | 88 | ||
91 | 89 | ||
92 | - | @Callable( | |
93 | - | func cancelSell ( | |
94 | - | let | |
95 | - | let | |
96 | - | [StringEntry((( | |
90 | + | @Callable(o) | |
91 | + | func cancelSell (O) = { | |
92 | + | let A = toBase58String(o.transactionId) | |
93 | + | let D = o.caller.bytes | |
94 | + | [StringEntry(((A + O) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(D), 1, fromBase58String(O))] | |
97 | 95 | } | |
98 | 96 | ||
99 | 97 | ||
100 | 98 | ||
101 | - | @Callable( | |
102 | - | func addAuction (Q,R,S, | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | let | |
110 | - | if ($isInstanceOf( | |
99 | + | @Callable(o) | |
100 | + | func addAuction (P,Q,R,S,C) = { | |
101 | + | let A = toBase58String(o.transactionId) | |
102 | + | let O = value(o.payments[0].assetId) | |
103 | + | let B = value(R) | |
104 | + | let T = (lastBlock.height + S) | |
105 | + | let U = o.caller.bytes | |
106 | + | let V = { | |
107 | + | let m = getString(this, (((toBase58String(O) + a) + "nft_status_") + toBase58String(U))) | |
108 | + | if ($isInstanceOf(m, "String")) | |
111 | 109 | then { | |
112 | - | let L = | |
110 | + | let L = m | |
113 | 111 | true | |
114 | 112 | } | |
115 | 113 | else false | |
116 | 114 | } | |
117 | - | if (( | |
115 | + | if ((V == true)) | |
118 | 116 | then throw("Already in auction list") | |
119 | - | else if (( | |
120 | - | then throw(("Duration is too long. Must be less than or equal to | |
121 | - | else if (( | |
117 | + | else if ((S > e)) | |
118 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
119 | + | else if ((o.payments[0].assetId == unit)) | |
122 | 120 | then throw("NFT not attached") | |
123 | - | else if (( | |
121 | + | else if ((o.payments[0].assetId == f)) | |
124 | 122 | then throw("NFT not attached") | |
125 | - | else [StringEntry((( | |
123 | + | else [StringEntry(((A + "nft_start_auction_date") + toBase58String(U)), P), StringEntry(((A + "nft_end_auction_date") + toBase58String(U)), Q), StringEntry((A + "_nft_start_price"), R), StringEntry((A + "_nft_owner"), toString(o.caller)), StringEntry((A + "_nft_on_auction"), toBase58String(O)), StringEntry((A + "_previous_bidder"), "none"), StringEntry((A + "_highest_bid"), "0"), StringEntry((A + "_winner_of_nft"), "0"), StringEntry((A + "_bidder_count"), "0"), StringEntry((A + "_nft_status"), "OPEN")] | |
126 | 124 | } | |
127 | 125 | ||
128 | 126 | ||
129 | 127 | ||
130 | - | @Callable( | |
131 | - | func placeBid (X, | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | let | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | let | |
141 | - | let | |
142 | - | if (( | |
128 | + | @Callable(o) | |
129 | + | func placeBid (W,O,q,X,Y) = { | |
130 | + | let A = toBase58String(o.transactionId) | |
131 | + | let U = o.caller.bytes | |
132 | + | let l = fromBase58String(O) | |
133 | + | let Z = o.payments[0].assetId | |
134 | + | let aa = o.payments[0].amount | |
135 | + | let ab = getStringValue(this, (W + "_highest_bid")) | |
136 | + | let ac = getString(this, (W + "_previous_bidder")) | |
137 | + | let ad = getStringValue(this, (W + "_bidder_count")) | |
138 | + | let ae = getStringValue(this, (W + "_winner_of_nft")) | |
139 | + | let V = getStringValue(this, (W + "_nft_status")) | |
140 | + | if ((V != "OPEN")) | |
143 | 141 | then throw("Not open for auction") | |
144 | - | else if ((parseIntValue( | |
142 | + | else if ((parseIntValue(ab) >= aa)) | |
145 | 143 | then throw("Bid is less then starting/highest Bid") | |
146 | - | else if (( | |
147 | - | then [StringEntry(( | |
148 | - | else if (( | |
149 | - | then [ScriptTransfer(Address(fromBase58String( | |
144 | + | else if ((ab == "0")) | |
145 | + | then [StringEntry((W + "_highest_bid"), toString(aa)), StringEntry((W + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((W + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((W + "_nft_id"), toBase58String(l)), StringEntry((W + "_nft_owner"), q), StringEntry((((A + "_") + W) + "_highest_bid"), toString(aa)), StringEntry((((A + "_") + W) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + W) + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((((A + "_") + W) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + W) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(U)), StringEntry((A + "_bid_price_place"), X), StringEntry((A + "_previous_bid_amount_refund_to_address"), ae), StringEntry((A + "_prevoius_bid_amount_refund"), ab)] | |
146 | + | else if ((ab != "0")) | |
147 | + | then [ScriptTransfer(Address(fromBase58String(ae)), parseIntValue(ab), Z), StringEntry((A + "_previous_bid_amount_refund_to_address"), ae), StringEntry((A + "_prevoius_bid_amount_refund"), ab), StringEntry((W + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((W + "_highest_bid"), toString(aa)), StringEntry((W + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((W + "_nft_id"), toBase58String(l)), StringEntry((W + "_nft_owner"), q), StringEntry((((A + "_") + W) + "_highest_bid"), toString(aa)), StringEntry((((A + "_") + W) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + W) + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((((A + "_") + W) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + W) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(U)), StringEntry((A + "_bid_price_place"), X)] | |
150 | 148 | else nil | |
151 | 149 | } | |
152 | 150 | ||
153 | 151 | ||
154 | 152 | ||
155 | - | @Callable( | |
156 | - | func acceptBidOffer ( | |
157 | - | let | |
158 | - | let | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | if (( | |
167 | - | then [ScriptTransfer(Address( | |
168 | - | else if (( | |
169 | - | then [ScriptTransfer(Address( | |
153 | + | @Callable(o) | |
154 | + | func acceptBidOffer (W,O,af,Y) = { | |
155 | + | let ag = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
156 | + | let A = toBase58String(o.transactionId) | |
157 | + | let ah = fromBase58String(Y) | |
158 | + | let U = o.caller.bytes | |
159 | + | let l = fromBase58String(O) | |
160 | + | let ai = getStringValue(this, (W + "_highest_bid")) | |
161 | + | let aj = ((parseIntValue(ai) / 1000) * 975) | |
162 | + | let N = ((parseIntValue(ai) / 1000) * 25) | |
163 | + | let ak = getStringValue(this, (W + "_winner_of_nft")) | |
164 | + | if ((Y == ag)) | |
165 | + | then [ScriptTransfer(Address(U), aj, ah), ScriptTransfer(Address(fromBase58String(ak)), 1, l), StringEntry("platform_fee", toString(N)), StringEntry((A + "_amount_paid_to_owner"), ai), StringEntry((A + "_nft_transfer_to"), ak), StringEntry((A + "_nft_status"), "REWARDED"), StringEntry((W + "_amount_paid_to_owner"), ai), StringEntry((W + "_nft_transfer_to"), ak), StringEntry((W + "_nft_status"), "REWARDED")] | |
166 | + | else if ((Y == "WAVES")) | |
167 | + | then [ScriptTransfer(Address(U), aj, unit), ScriptTransfer(Address(fromBase58String(ak)), 1, l), StringEntry("platform_fee", toString(N)), StringEntry((A + "_amount_paid_to_owner"), ai), StringEntry((A + "_nft_transfer_to"), ak), StringEntry((A + "_nft_status"), "REWARDED"), StringEntry((W + "_amount_paid_to_owner"), ai), StringEntry((W + "_nft_transfer_to"), ak), StringEntry((W + "_nft_status"), "REWARDED")] | |
170 | 168 | else nil | |
171 | 169 | } | |
172 | 170 | ||
173 | 171 | ||
174 | 172 | ||
175 | - | @Callable( | |
176 | - | func cancelAuction ( | |
177 | - | let | |
178 | - | let | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | if (( | |
185 | - | then [StringEntry((( | |
186 | - | else if (( | |
173 | + | @Callable(o) | |
174 | + | func cancelAuction (W,Y) = { | |
175 | + | let A = toBase58String(o.transactionId) | |
176 | + | let U = o.caller.bytes | |
177 | + | let al = getStringValue(this, (W + "_nft_status")) | |
178 | + | let am = getStringValue(this, (W + "_winner_of_nft")) | |
179 | + | let an = getStringValue(this, (W + "_nft_owner")) | |
180 | + | let O = getStringValue(this, (W + "_nft_on_auction")) | |
181 | + | let ao = getStringValue(this, (W + "_highest_bid")) | |
182 | + | if ((am == "0")) | |
183 | + | then [StringEntry(((A + W) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(an)), 1, fromBase58String(O))] | |
184 | + | else if ((am != "0")) | |
187 | 185 | then throw("soory you can't cancel it because already auction placed by someone") | |
188 | 186 | else nil | |
189 | 187 | } | |
190 | 188 | ||
191 | 189 | ||
192 | 190 | ||
193 | - | @Callable(p) | |
194 | - | func manualFundTransfer (aq,ar) = { | |
195 | - | let as = p.caller.bytes | |
196 | - | let at = fromBase58String(aq) | |
197 | - | let M = p.payments[0].amount | |
198 | - | let au = parseIntValue(ar) | |
199 | - | let O = ((M / 1000) * 25) | |
200 | - | let av = (M + O) | |
201 | - | if ((av != M)) | |
202 | - | then throw("please submit the sum of actual amount and platform") | |
203 | - | else if ((p.payments[0].assetId == unit)) | |
204 | - | then [IntegerEntry((toBase58String(as) + "_transfer"), M), StringEntry("platform_fee", toString(O)), StringEntry((toBase58String(as) + "_transfer_to"), aq), ScriptTransfer(Address(at), au, unit)] | |
205 | - | else if ((p.payments[0].assetId == f)) | |
206 | - | then [IntegerEntry((toBase58String(as) + "_transfer"), M), StringEntry("platform_fee", toString(O)), StringEntry((toBase58String(as) + "_transfer_to"), aq), ScriptTransfer(Address(at), au, f)] | |
207 | - | else nil | |
208 | - | } | |
209 | - | ||
210 | - | ||
211 | - | ||
212 | - | @Callable(p) | |
213 | - | func backValue (X) = { | |
214 | - | let V = p.caller.bytes | |
215 | - | let P = getStringValue(this, (X + "_nft_on_auction")) | |
216 | - | let ao = getStringValue(this, (X + "_nft_owner")) | |
217 | - | [StringEntry((X + "_nft_status"), "Auction_time over"), ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P))] | |
218 | - | } | |
219 | - | ||
220 | - | ||
221 | - | ||
222 | - | @Callable(p) | |
223 | - | func withdrawBid (aw,Z) = { | |
224 | - | let V = p.caller.bytes | |
225 | - | let ah = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
226 | - | let B = toBase58String(p.transactionId) | |
227 | - | let ai = fromBase58String(Z) | |
228 | - | let ax = getStringValue(this, (aw + "_highest_bid")) | |
229 | - | let ay = getStringValue(this, (aw + "_winner")) | |
230 | - | let az = getStringValue(this, (aw + "_nft_id")) | |
231 | - | if ((Z == ah)) | |
232 | - | then [StringEntry((aw + "_nft_bid"), "WITHDRAW"), StringEntry((aw + "_nft_id"), az), StringEntry((aw + "_bidding_price_refund_amount"), ax), ScriptTransfer(p.caller, parseIntValue(ax), ai)] | |
233 | - | else if ((Z == "WAVES")) | |
234 | - | then [StringEntry((aw + "_nft_bid"), "WITHDRAW"), StringEntry((aw + "_nft_id"), az), StringEntry((aw + "_bidding_price_refund_amount"), ax), ScriptTransfer(p.caller, parseIntValue(ax), unit)] | |
191 | + | @Callable(o) | |
192 | + | func manualFundTransfer (ap,aq) = { | |
193 | + | let U = o.caller.bytes | |
194 | + | let ar = fromBase58String(ap) | |
195 | + | let J = o.payments[0].amount | |
196 | + | let as = ((J / 1000) * 975) | |
197 | + | let N = ((J / 1000) * 25) | |
198 | + | if ((o.payments[0].assetId == unit)) | |
199 | + | then [IntegerEntry((toBase58String(U) + "_transfer"), J), StringEntry("platform_fee", toString(N)), StringEntry((toBase58String(U) + "_transfer_to"), ap), ScriptTransfer(Address(ar), as, unit)] | |
200 | + | else if ((o.payments[0].assetId == f)) | |
201 | + | then [IntegerEntry((toBase58String(U) + "_transfer"), J), StringEntry("platform_fee", toString(N)), StringEntry((toBase58String(U) + "_transfer_to"), ap), ScriptTransfer(Address(ar), as, f)] | |
235 | 202 | else nil | |
236 | 203 | } | |
237 | 204 | ||
238 | 205 | ||
239 | 206 | ||
240 | - | @Callable(p) | |
241 | - | func automateFunction (X,Z) = { | |
242 | - | let V = p.caller.bytes | |
243 | - | let P = getStringValue(this, (X + "_nft_on_auction")) | |
244 | - | let ao = getStringValue(this, (X + "_nft_owner")) | |
245 | - | let ah = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
246 | - | let ai = fromBase58String(Z) | |
247 | - | let ac = getStringValue(this, (X + "_highest_bid")) | |
248 | - | let af = getStringValue(this, (X + "_winner_of_nft")) | |
249 | - | let an = getStringValue(this, (X + "_winner_of_nft")) | |
250 | - | if ((an == "0")) | |
251 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P))] | |
252 | - | else if (if ((an != "0")) | |
253 | - | then (Z == ah) | |
254 | - | else false) | |
255 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ac), ai)] | |
256 | - | else if (if ((an != "0")) | |
257 | - | then (Z == "WAVES") | |
258 | - | else false) | |
259 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ac), unit)] | |
260 | - | else nil | |
207 | + | @Callable(o) | |
208 | + | func backValue (W) = { | |
209 | + | let U = o.caller.bytes | |
210 | + | let O = getStringValue(this, (W + "_nft_on_auction")) | |
211 | + | let an = getStringValue(this, (W + "_nft_owner")) | |
212 | + | [StringEntry((W + "_nft_status"), "Auction_time over"), ScriptTransfer(Address(fromBase58String(an)), 1, fromBase58String(O))] | |
261 | 213 | } | |
262 | 214 | ||
263 | 215 | ||
264 | 216 | ||
265 | - | @Callable(p) | |
266 | - | func buyAllProducts_asimi (aA,aB) = { | |
267 | - | let aC = p.caller | |
268 | - | let aD = assetBalance(aC, f) | |
269 | - | let M = value(p.payments[0].amount) | |
270 | - | let av = parseIntValue(aB) | |
271 | - | let aE = ((av / 1000) * 25) | |
272 | - | let aF = (av + aE) | |
273 | - | let aG = split(aA[0], "_") | |
274 | - | let aH = split(aA[1], "_") | |
275 | - | let aI = split(aA[2], "_") | |
276 | - | let aJ = split(aA[3], "_") | |
277 | - | let aK = split(aA[4], "_") | |
278 | - | if ((aF > M)) | |
279 | - | then throw("your paying amount is wrong ") | |
280 | - | else if ((M > aD)) | |
281 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
282 | - | else if ((size(aA) == 1)) | |
283 | - | then [StringEntry((("first_nft_Info=" + "nftId") + aG[0]), ("buyer" + toString(aC))), StringEntry((("first_nft_Info=" + "seller_address") + aG[1]), ("price" + aG[2])), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f)] | |
284 | - | else if ((size(aA) == 2)) | |
285 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f)] | |
286 | - | else if ((size(aA) == 3)) | |
287 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f)] | |
288 | - | else if ((size(aA) == 4)) | |
289 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aJ[1])), (parseIntValue(aJ[2]) * 100), f)] | |
290 | - | else if ((size(aA) == 5)) | |
291 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), StringEntry((((((("fifth_nft_Info=" + "nftId") + aK[0]) + "seller_address") + aK[1]) + "price") + aK[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(aC, 1, fromBase58String(aK[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aJ[1])), (parseIntValue(aJ[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aK[1])), (parseIntValue(aK[2]) * 100), f)] | |
292 | - | else if ((size(aA) > 5)) | |
293 | - | then throw("sorry! maximum limit of your cart is 5 items") | |
294 | - | else nil | |
295 | - | } | |
296 | - | ||
297 | - | ||
298 | - | ||
299 | - | @Callable(p) | |
300 | - | func buyAllProducts_waves (aA,aB) = { | |
301 | - | let aC = p.caller | |
302 | - | let aD = assetBalance(aC, g) | |
303 | - | let M = value(p.payments[0].amount) | |
304 | - | let av = parseIntValue(aB) | |
305 | - | let aE = ((av / 1000) * 25) | |
306 | - | let aF = (av + aE) | |
307 | - | let aG = split(aA[0], "_") | |
308 | - | let aH = split(aA[1], "_") | |
309 | - | let aI = split(aA[2], "_") | |
310 | - | let aJ = split(aA[3], "_") | |
311 | - | let aK = split(aA[4], "_") | |
312 | - | if ((aF > M)) | |
313 | - | then throw("your paying amount is wrong ") | |
314 | - | else if ((M > aD)) | |
315 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
316 | - | else if ((size(aA) == 1)) | |
317 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit)] | |
318 | - | else if ((size(aA) == 2)) | |
319 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit)] | |
320 | - | else if ((size(aA) == 3)) | |
321 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit)] | |
322 | - | else if ((size(aA) == 4)) | |
323 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit), ScriptTransfer(Address(fromBase58String(aJ[1])), parseIntValue(aJ[2]), unit)] | |
324 | - | else if ((size(aA) == 5)) | |
325 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), StringEntry((((((("fifth_nft_Info=" + "nftId") + aK[0]) + "seller_address") + aK[1]) + "price") + aK[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(aC, 1, fromBase58String(aK[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit), ScriptTransfer(Address(fromBase58String(aJ[1])), parseIntValue(aJ[2]), unit), ScriptTransfer(Address(fromBase58String(aK[1])), parseIntValue(aK[2]), unit)] | |
326 | - | else if ((size(aA) > 5)) | |
327 | - | then throw("sorry! maximum limit of your cart is 5 items") | |
328 | - | else nil | |
217 | + | @Callable(o) | |
218 | + | func withdrawBid (at,Y) = { | |
219 | + | let U = o.caller.bytes | |
220 | + | let ag = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
221 | + | let A = toBase58String(o.transactionId) | |
222 | + | let ah = fromBase58String(Y) | |
223 | + | let au = getStringValue(this, (at + "_highest_bid")) | |
224 | + | let av = getStringValue(this, (at + "_winner")) | |
225 | + | let aw = getStringValue(this, (at + "_nft_id")) | |
226 | + | if ((Y == ag)) | |
227 | + | then [StringEntry((at + "_nft_bid"), "WITHDRAW"), StringEntry((at + "_nft_id"), aw), StringEntry((at + "_bidding_price_refund_amount"), au), ScriptTransfer(o.caller, parseIntValue(au), ah)] | |
228 | + | else if ((Y == "WAVES")) | |
229 | + | then [StringEntry((at + "_nft_bid"), "WITHDRAW"), StringEntry((at + "_nft_id"), aw), StringEntry((at + "_bidding_price_refund_amount"), au), ScriptTransfer(o.caller, parseIntValue(au), unit)] | |
230 | + | else nil | |
329 | 231 | } | |
330 | 232 | ||
331 | 233 |
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 | 6 | let b = "buy" | |
7 | 7 | ||
8 | 8 | let c = "price" | |
9 | 9 | ||
10 | 10 | let d = "sell" | |
11 | 11 | ||
12 | 12 | let e = 30 | |
13 | 13 | ||
14 | 14 | let f = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
15 | 15 | ||
16 | 16 | let g = base58'' | |
17 | 17 | ||
18 | 18 | let h = "bid" | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
23 | 23 | ||
24 | - | let k = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
25 | - | ||
26 | - | func l (m) = { | |
27 | - | let n = assetInfo(m) | |
28 | - | if ($isInstanceOf(n, "Asset")) | |
24 | + | func k (l) = { | |
25 | + | let m = assetInfo(l) | |
26 | + | if ($isInstanceOf(m, "Asset")) | |
29 | 27 | then { | |
30 | - | let | |
31 | - | if (if (( | |
32 | - | then ( | |
28 | + | let n = m | |
29 | + | if (if ((n.decimals == 0)) | |
30 | + | then (n.quantity == 1) | |
33 | 31 | else false) | |
34 | - | then ( | |
32 | + | then (n.reissuable == false) | |
35 | 33 | else false | |
36 | 34 | } | |
37 | 35 | else false | |
38 | 36 | } | |
39 | 37 | ||
40 | 38 | ||
41 | - | @Callable( | |
42 | - | func createNft (q,r,s,t,u,v,w,x | |
43 | - | let | |
44 | - | let | |
45 | - | let | |
46 | - | [ | |
39 | + | @Callable(o) | |
40 | + | func createNft (p,q,r,s,t,u,v,w,x) = { | |
41 | + | let y = Issue(p, v, 1, 0, false) | |
42 | + | let z = calculateAssetId(y) | |
43 | + | let A = o.transactionId | |
44 | + | [y, ScriptTransfer(o.caller, 1, z), StringEntry(((toBase58String(z) + a) + "Owner"), toString(o.caller)), StringEntry(((toBase58String(z) + a) + "nft_type"), s), StringEntry(((toBase58String(z) + a) + "nft_tags"), t), StringEntry(((toBase58String(z) + a) + "nft_dAppAddress"), r), IntegerEntry(((toBase58String(z) + a) + "nft_selling_price"), u), StringEntry(((toBase58String(z) + a) + "nft_onSell"), w), StringEntry(((toBase58String(z) + a) + "nft_data"), x), StringEntry(((toBase58String(A) + a) + "issue_nft"), toBase58String(z))] | |
47 | 45 | } | |
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | - | @Callable( | |
52 | - | func sellNFT (C | |
53 | - | let | |
54 | - | let | |
55 | - | let | |
56 | - | let | |
57 | - | let | |
58 | - | if (!( | |
49 | + | @Callable(o) | |
50 | + | func sellNFT (B,C) = { | |
51 | + | let A = o.transactionId | |
52 | + | let D = o.caller.bytes | |
53 | + | let E = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
54 | + | let F = E._1 | |
55 | + | let G = E._2 | |
56 | + | if (!(k(F))) | |
59 | 57 | then throw("Token is not NFT") | |
60 | - | else [StringEntry(((c + a) + toBase58String(value( | |
58 | + | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), (((toBase58String(F) + a) + toString(G)) + C))] | |
61 | 59 | } | |
62 | 60 | ||
63 | 61 | ||
64 | 62 | ||
65 | - | @Callable(p) | |
66 | - | func buyNFT (I,J) = { | |
67 | - | let m = fromBase58String(I) | |
63 | + | @Callable(o) | |
64 | + | func buyNFT (H,I) = { | |
65 | + | let l = fromBase58String(H) | |
66 | + | let J = value(o.payments[0].amount) | |
68 | 67 | let K = { | |
69 | - | let | |
70 | - | if ($isInstanceOf( | |
68 | + | let m = getString(this, (("nft_" + I) + "_owner")) | |
69 | + | if ($isInstanceOf(m, "String")) | |
71 | 70 | then { | |
72 | - | let L = | |
71 | + | let L = m | |
73 | 72 | L | |
74 | 73 | } | |
75 | 74 | else false | |
76 | 75 | } | |
77 | - | let C = getStringValue(((((c + a) + I) + "_") + J)) | |
78 | - | let M = value(p.payments[0].amount) | |
79 | - | let N = (M - ((M / 1000) * 25)) | |
80 | - | let O = (M - N) | |
81 | - | if ((J == toString(p.caller))) | |
76 | + | let B = getStringValue(((((c + a) + H) + "_") + I)) | |
77 | + | let M = ((J / 1000) * 975) | |
78 | + | let N = ((J / 1000) * 25) | |
79 | + | if ((I == toString(o.caller))) | |
82 | 80 | then throw("current Owner of NFT not able to purchase") | |
83 | - | else if (( | |
84 | - | then [ScriptTransfer( | |
85 | - | else if (( | |
86 | - | then [ScriptTransfer( | |
81 | + | else if ((o.payments[0].assetId == f)) | |
82 | + | then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), M, f), StringEntry((("nft_" + H) + "platform_fee"), toString(N)), StringEntry(((toString(o.caller) + a) + b), ((H + a) + toString(J))), DeleteEntry((("nft_" + I) + "_owner")), StringEntry((("nft_" + I) + "_owner"), toString(o.caller)), StringEntry(((H + a) + "_owner"), toString(o.caller))] | |
83 | + | else if ((o.payments[0].assetId == unit)) | |
84 | + | then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), M, unit), StringEntry((("nft_" + H) + "platform_fee"), toString(N)), StringEntry(((toString(o.caller) + a) + b), ((H + a) + toString(J))), DeleteEntry((("nft_" + I) + "_owner")), StringEntry((("nft_" + I) + "_owner"), toString(o.caller)), StringEntry(((H + a) + "_owner"), toString(o.caller))] | |
87 | 85 | else nil | |
88 | 86 | } | |
89 | 87 | ||
90 | 88 | ||
91 | 89 | ||
92 | - | @Callable( | |
93 | - | func cancelSell ( | |
94 | - | let | |
95 | - | let | |
96 | - | [StringEntry((( | |
90 | + | @Callable(o) | |
91 | + | func cancelSell (O) = { | |
92 | + | let A = toBase58String(o.transactionId) | |
93 | + | let D = o.caller.bytes | |
94 | + | [StringEntry(((A + O) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(D), 1, fromBase58String(O))] | |
97 | 95 | } | |
98 | 96 | ||
99 | 97 | ||
100 | 98 | ||
101 | - | @Callable( | |
102 | - | func addAuction (Q,R,S, | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | let | |
110 | - | if ($isInstanceOf( | |
99 | + | @Callable(o) | |
100 | + | func addAuction (P,Q,R,S,C) = { | |
101 | + | let A = toBase58String(o.transactionId) | |
102 | + | let O = value(o.payments[0].assetId) | |
103 | + | let B = value(R) | |
104 | + | let T = (lastBlock.height + S) | |
105 | + | let U = o.caller.bytes | |
106 | + | let V = { | |
107 | + | let m = getString(this, (((toBase58String(O) + a) + "nft_status_") + toBase58String(U))) | |
108 | + | if ($isInstanceOf(m, "String")) | |
111 | 109 | then { | |
112 | - | let L = | |
110 | + | let L = m | |
113 | 111 | true | |
114 | 112 | } | |
115 | 113 | else false | |
116 | 114 | } | |
117 | - | if (( | |
115 | + | if ((V == true)) | |
118 | 116 | then throw("Already in auction list") | |
119 | - | else if (( | |
120 | - | then throw(("Duration is too long. Must be less than or equal to | |
121 | - | else if (( | |
117 | + | else if ((S > e)) | |
118 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
119 | + | else if ((o.payments[0].assetId == unit)) | |
122 | 120 | then throw("NFT not attached") | |
123 | - | else if (( | |
121 | + | else if ((o.payments[0].assetId == f)) | |
124 | 122 | then throw("NFT not attached") | |
125 | - | else [StringEntry((( | |
123 | + | else [StringEntry(((A + "nft_start_auction_date") + toBase58String(U)), P), StringEntry(((A + "nft_end_auction_date") + toBase58String(U)), Q), StringEntry((A + "_nft_start_price"), R), StringEntry((A + "_nft_owner"), toString(o.caller)), StringEntry((A + "_nft_on_auction"), toBase58String(O)), StringEntry((A + "_previous_bidder"), "none"), StringEntry((A + "_highest_bid"), "0"), StringEntry((A + "_winner_of_nft"), "0"), StringEntry((A + "_bidder_count"), "0"), StringEntry((A + "_nft_status"), "OPEN")] | |
126 | 124 | } | |
127 | 125 | ||
128 | 126 | ||
129 | 127 | ||
130 | - | @Callable( | |
131 | - | func placeBid (X, | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | let | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | let | |
141 | - | let | |
142 | - | if (( | |
128 | + | @Callable(o) | |
129 | + | func placeBid (W,O,q,X,Y) = { | |
130 | + | let A = toBase58String(o.transactionId) | |
131 | + | let U = o.caller.bytes | |
132 | + | let l = fromBase58String(O) | |
133 | + | let Z = o.payments[0].assetId | |
134 | + | let aa = o.payments[0].amount | |
135 | + | let ab = getStringValue(this, (W + "_highest_bid")) | |
136 | + | let ac = getString(this, (W + "_previous_bidder")) | |
137 | + | let ad = getStringValue(this, (W + "_bidder_count")) | |
138 | + | let ae = getStringValue(this, (W + "_winner_of_nft")) | |
139 | + | let V = getStringValue(this, (W + "_nft_status")) | |
140 | + | if ((V != "OPEN")) | |
143 | 141 | then throw("Not open for auction") | |
144 | - | else if ((parseIntValue( | |
142 | + | else if ((parseIntValue(ab) >= aa)) | |
145 | 143 | then throw("Bid is less then starting/highest Bid") | |
146 | - | else if (( | |
147 | - | then [StringEntry(( | |
148 | - | else if (( | |
149 | - | then [ScriptTransfer(Address(fromBase58String( | |
144 | + | else if ((ab == "0")) | |
145 | + | then [StringEntry((W + "_highest_bid"), toString(aa)), StringEntry((W + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((W + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((W + "_nft_id"), toBase58String(l)), StringEntry((W + "_nft_owner"), q), StringEntry((((A + "_") + W) + "_highest_bid"), toString(aa)), StringEntry((((A + "_") + W) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + W) + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((((A + "_") + W) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + W) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(U)), StringEntry((A + "_bid_price_place"), X), StringEntry((A + "_previous_bid_amount_refund_to_address"), ae), StringEntry((A + "_prevoius_bid_amount_refund"), ab)] | |
146 | + | else if ((ab != "0")) | |
147 | + | then [ScriptTransfer(Address(fromBase58String(ae)), parseIntValue(ab), Z), StringEntry((A + "_previous_bid_amount_refund_to_address"), ae), StringEntry((A + "_prevoius_bid_amount_refund"), ab), StringEntry((W + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((W + "_highest_bid"), toString(aa)), StringEntry((W + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((W + "_nft_id"), toBase58String(l)), StringEntry((W + "_nft_owner"), q), StringEntry((((A + "_") + W) + "_highest_bid"), toString(aa)), StringEntry((((A + "_") + W) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + W) + "_bidder_count"), toString((parseIntValue(ad) + 1))), StringEntry((((A + "_") + W) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + W) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(U)), StringEntry((A + "_bid_price_place"), X)] | |
150 | 148 | else nil | |
151 | 149 | } | |
152 | 150 | ||
153 | 151 | ||
154 | 152 | ||
155 | - | @Callable( | |
156 | - | func acceptBidOffer ( | |
157 | - | let | |
158 | - | let | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | if (( | |
167 | - | then [ScriptTransfer(Address( | |
168 | - | else if (( | |
169 | - | then [ScriptTransfer(Address( | |
153 | + | @Callable(o) | |
154 | + | func acceptBidOffer (W,O,af,Y) = { | |
155 | + | let ag = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
156 | + | let A = toBase58String(o.transactionId) | |
157 | + | let ah = fromBase58String(Y) | |
158 | + | let U = o.caller.bytes | |
159 | + | let l = fromBase58String(O) | |
160 | + | let ai = getStringValue(this, (W + "_highest_bid")) | |
161 | + | let aj = ((parseIntValue(ai) / 1000) * 975) | |
162 | + | let N = ((parseIntValue(ai) / 1000) * 25) | |
163 | + | let ak = getStringValue(this, (W + "_winner_of_nft")) | |
164 | + | if ((Y == ag)) | |
165 | + | then [ScriptTransfer(Address(U), aj, ah), ScriptTransfer(Address(fromBase58String(ak)), 1, l), StringEntry("platform_fee", toString(N)), StringEntry((A + "_amount_paid_to_owner"), ai), StringEntry((A + "_nft_transfer_to"), ak), StringEntry((A + "_nft_status"), "REWARDED"), StringEntry((W + "_amount_paid_to_owner"), ai), StringEntry((W + "_nft_transfer_to"), ak), StringEntry((W + "_nft_status"), "REWARDED")] | |
166 | + | else if ((Y == "WAVES")) | |
167 | + | then [ScriptTransfer(Address(U), aj, unit), ScriptTransfer(Address(fromBase58String(ak)), 1, l), StringEntry("platform_fee", toString(N)), StringEntry((A + "_amount_paid_to_owner"), ai), StringEntry((A + "_nft_transfer_to"), ak), StringEntry((A + "_nft_status"), "REWARDED"), StringEntry((W + "_amount_paid_to_owner"), ai), StringEntry((W + "_nft_transfer_to"), ak), StringEntry((W + "_nft_status"), "REWARDED")] | |
170 | 168 | else nil | |
171 | 169 | } | |
172 | 170 | ||
173 | 171 | ||
174 | 172 | ||
175 | - | @Callable( | |
176 | - | func cancelAuction ( | |
177 | - | let | |
178 | - | let | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | if (( | |
185 | - | then [StringEntry((( | |
186 | - | else if (( | |
173 | + | @Callable(o) | |
174 | + | func cancelAuction (W,Y) = { | |
175 | + | let A = toBase58String(o.transactionId) | |
176 | + | let U = o.caller.bytes | |
177 | + | let al = getStringValue(this, (W + "_nft_status")) | |
178 | + | let am = getStringValue(this, (W + "_winner_of_nft")) | |
179 | + | let an = getStringValue(this, (W + "_nft_owner")) | |
180 | + | let O = getStringValue(this, (W + "_nft_on_auction")) | |
181 | + | let ao = getStringValue(this, (W + "_highest_bid")) | |
182 | + | if ((am == "0")) | |
183 | + | then [StringEntry(((A + W) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(an)), 1, fromBase58String(O))] | |
184 | + | else if ((am != "0")) | |
187 | 185 | then throw("soory you can't cancel it because already auction placed by someone") | |
188 | 186 | else nil | |
189 | 187 | } | |
190 | 188 | ||
191 | 189 | ||
192 | 190 | ||
193 | - | @Callable(p) | |
194 | - | func manualFundTransfer (aq,ar) = { | |
195 | - | let as = p.caller.bytes | |
196 | - | let at = fromBase58String(aq) | |
197 | - | let M = p.payments[0].amount | |
198 | - | let au = parseIntValue(ar) | |
199 | - | let O = ((M / 1000) * 25) | |
200 | - | let av = (M + O) | |
201 | - | if ((av != M)) | |
202 | - | then throw("please submit the sum of actual amount and platform") | |
203 | - | else if ((p.payments[0].assetId == unit)) | |
204 | - | then [IntegerEntry((toBase58String(as) + "_transfer"), M), StringEntry("platform_fee", toString(O)), StringEntry((toBase58String(as) + "_transfer_to"), aq), ScriptTransfer(Address(at), au, unit)] | |
205 | - | else if ((p.payments[0].assetId == f)) | |
206 | - | then [IntegerEntry((toBase58String(as) + "_transfer"), M), StringEntry("platform_fee", toString(O)), StringEntry((toBase58String(as) + "_transfer_to"), aq), ScriptTransfer(Address(at), au, f)] | |
207 | - | else nil | |
208 | - | } | |
209 | - | ||
210 | - | ||
211 | - | ||
212 | - | @Callable(p) | |
213 | - | func backValue (X) = { | |
214 | - | let V = p.caller.bytes | |
215 | - | let P = getStringValue(this, (X + "_nft_on_auction")) | |
216 | - | let ao = getStringValue(this, (X + "_nft_owner")) | |
217 | - | [StringEntry((X + "_nft_status"), "Auction_time over"), ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P))] | |
218 | - | } | |
219 | - | ||
220 | - | ||
221 | - | ||
222 | - | @Callable(p) | |
223 | - | func withdrawBid (aw,Z) = { | |
224 | - | let V = p.caller.bytes | |
225 | - | let ah = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
226 | - | let B = toBase58String(p.transactionId) | |
227 | - | let ai = fromBase58String(Z) | |
228 | - | let ax = getStringValue(this, (aw + "_highest_bid")) | |
229 | - | let ay = getStringValue(this, (aw + "_winner")) | |
230 | - | let az = getStringValue(this, (aw + "_nft_id")) | |
231 | - | if ((Z == ah)) | |
232 | - | then [StringEntry((aw + "_nft_bid"), "WITHDRAW"), StringEntry((aw + "_nft_id"), az), StringEntry((aw + "_bidding_price_refund_amount"), ax), ScriptTransfer(p.caller, parseIntValue(ax), ai)] | |
233 | - | else if ((Z == "WAVES")) | |
234 | - | then [StringEntry((aw + "_nft_bid"), "WITHDRAW"), StringEntry((aw + "_nft_id"), az), StringEntry((aw + "_bidding_price_refund_amount"), ax), ScriptTransfer(p.caller, parseIntValue(ax), unit)] | |
191 | + | @Callable(o) | |
192 | + | func manualFundTransfer (ap,aq) = { | |
193 | + | let U = o.caller.bytes | |
194 | + | let ar = fromBase58String(ap) | |
195 | + | let J = o.payments[0].amount | |
196 | + | let as = ((J / 1000) * 975) | |
197 | + | let N = ((J / 1000) * 25) | |
198 | + | if ((o.payments[0].assetId == unit)) | |
199 | + | then [IntegerEntry((toBase58String(U) + "_transfer"), J), StringEntry("platform_fee", toString(N)), StringEntry((toBase58String(U) + "_transfer_to"), ap), ScriptTransfer(Address(ar), as, unit)] | |
200 | + | else if ((o.payments[0].assetId == f)) | |
201 | + | then [IntegerEntry((toBase58String(U) + "_transfer"), J), StringEntry("platform_fee", toString(N)), StringEntry((toBase58String(U) + "_transfer_to"), ap), ScriptTransfer(Address(ar), as, f)] | |
235 | 202 | else nil | |
236 | 203 | } | |
237 | 204 | ||
238 | 205 | ||
239 | 206 | ||
240 | - | @Callable(p) | |
241 | - | func automateFunction (X,Z) = { | |
242 | - | let V = p.caller.bytes | |
243 | - | let P = getStringValue(this, (X + "_nft_on_auction")) | |
244 | - | let ao = getStringValue(this, (X + "_nft_owner")) | |
245 | - | let ah = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
246 | - | let ai = fromBase58String(Z) | |
247 | - | let ac = getStringValue(this, (X + "_highest_bid")) | |
248 | - | let af = getStringValue(this, (X + "_winner_of_nft")) | |
249 | - | let an = getStringValue(this, (X + "_winner_of_nft")) | |
250 | - | if ((an == "0")) | |
251 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P))] | |
252 | - | else if (if ((an != "0")) | |
253 | - | then (Z == ah) | |
254 | - | else false) | |
255 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ac), ai)] | |
256 | - | else if (if ((an != "0")) | |
257 | - | then (Z == "WAVES") | |
258 | - | else false) | |
259 | - | then [ScriptTransfer(Address(fromBase58String(ao)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ac), unit)] | |
260 | - | else nil | |
207 | + | @Callable(o) | |
208 | + | func backValue (W) = { | |
209 | + | let U = o.caller.bytes | |
210 | + | let O = getStringValue(this, (W + "_nft_on_auction")) | |
211 | + | let an = getStringValue(this, (W + "_nft_owner")) | |
212 | + | [StringEntry((W + "_nft_status"), "Auction_time over"), ScriptTransfer(Address(fromBase58String(an)), 1, fromBase58String(O))] | |
261 | 213 | } | |
262 | 214 | ||
263 | 215 | ||
264 | 216 | ||
265 | - | @Callable(p) | |
266 | - | func buyAllProducts_asimi (aA,aB) = { | |
267 | - | let aC = p.caller | |
268 | - | let aD = assetBalance(aC, f) | |
269 | - | let M = value(p.payments[0].amount) | |
270 | - | let av = parseIntValue(aB) | |
271 | - | let aE = ((av / 1000) * 25) | |
272 | - | let aF = (av + aE) | |
273 | - | let aG = split(aA[0], "_") | |
274 | - | let aH = split(aA[1], "_") | |
275 | - | let aI = split(aA[2], "_") | |
276 | - | let aJ = split(aA[3], "_") | |
277 | - | let aK = split(aA[4], "_") | |
278 | - | if ((aF > M)) | |
279 | - | then throw("your paying amount is wrong ") | |
280 | - | else if ((M > aD)) | |
281 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
282 | - | else if ((size(aA) == 1)) | |
283 | - | then [StringEntry((("first_nft_Info=" + "nftId") + aG[0]), ("buyer" + toString(aC))), StringEntry((("first_nft_Info=" + "seller_address") + aG[1]), ("price" + aG[2])), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f)] | |
284 | - | else if ((size(aA) == 2)) | |
285 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f)] | |
286 | - | else if ((size(aA) == 3)) | |
287 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f)] | |
288 | - | else if ((size(aA) == 4)) | |
289 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aJ[1])), (parseIntValue(aJ[2]) * 100), f)] | |
290 | - | else if ((size(aA) == 5)) | |
291 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), StringEntry((((((("fifth_nft_Info=" + "nftId") + aK[0]) + "seller_address") + aK[1]) + "price") + aK[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(aC, 1, fromBase58String(aK[0])), ScriptTransfer(Address(fromBase58String(aG[1])), (parseIntValue(aG[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aH[1])), (parseIntValue(aH[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aI[1])), (parseIntValue(aI[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aJ[1])), (parseIntValue(aJ[2]) * 100), f), ScriptTransfer(Address(fromBase58String(aK[1])), (parseIntValue(aK[2]) * 100), f)] | |
292 | - | else if ((size(aA) > 5)) | |
293 | - | then throw("sorry! maximum limit of your cart is 5 items") | |
294 | - | else nil | |
295 | - | } | |
296 | - | ||
297 | - | ||
298 | - | ||
299 | - | @Callable(p) | |
300 | - | func buyAllProducts_waves (aA,aB) = { | |
301 | - | let aC = p.caller | |
302 | - | let aD = assetBalance(aC, g) | |
303 | - | let M = value(p.payments[0].amount) | |
304 | - | let av = parseIntValue(aB) | |
305 | - | let aE = ((av / 1000) * 25) | |
306 | - | let aF = (av + aE) | |
307 | - | let aG = split(aA[0], "_") | |
308 | - | let aH = split(aA[1], "_") | |
309 | - | let aI = split(aA[2], "_") | |
310 | - | let aJ = split(aA[3], "_") | |
311 | - | let aK = split(aA[4], "_") | |
312 | - | if ((aF > M)) | |
313 | - | then throw("your paying amount is wrong ") | |
314 | - | else if ((M > aD)) | |
315 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
316 | - | else if ((size(aA) == 1)) | |
317 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit)] | |
318 | - | else if ((size(aA) == 2)) | |
319 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit)] | |
320 | - | else if ((size(aA) == 3)) | |
321 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit)] | |
322 | - | else if ((size(aA) == 4)) | |
323 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit), ScriptTransfer(Address(fromBase58String(aJ[1])), parseIntValue(aJ[2]), unit)] | |
324 | - | else if ((size(aA) == 5)) | |
325 | - | then [StringEntry((((((("first_nft_Info=" + "nftId") + aG[0]) + "seller_address") + aG[1]) + "price") + aG[2]), ("buyer" + toString(aC))), StringEntry((((((("second_nft_Info=" + "nftId") + aH[0]) + "seller_address") + aH[1]) + "price") + aH[2]), ("buyer" + toString(aC))), StringEntry((((((("third_nft_Info=" + "nftId") + aI[0]) + "seller_address") + aI[1]) + "price") + aI[2]), ("buyer" + toString(aC))), StringEntry((((((("fourth_nft_Info=" + "nftId") + aJ[0]) + "seller_address") + aJ[1]) + "price") + aJ[2]), ("buyer" + toString(aC))), StringEntry((((((("fifth_nft_Info=" + "nftId") + aK[0]) + "seller_address") + aK[1]) + "price") + aK[2]), ("buyer" + toString(aC))), ScriptTransfer(aC, 1, fromBase58String(aG[0])), ScriptTransfer(aC, 1, fromBase58String(aH[0])), ScriptTransfer(aC, 1, fromBase58String(aI[0])), ScriptTransfer(aC, 1, fromBase58String(aJ[0])), ScriptTransfer(aC, 1, fromBase58String(aK[0])), ScriptTransfer(Address(fromBase58String(aG[1])), parseIntValue(aG[2]), unit), ScriptTransfer(Address(fromBase58String(aH[1])), parseIntValue(aH[2]), unit), ScriptTransfer(Address(fromBase58String(aI[1])), parseIntValue(aI[2]), unit), ScriptTransfer(Address(fromBase58String(aJ[1])), parseIntValue(aJ[2]), unit), ScriptTransfer(Address(fromBase58String(aK[1])), parseIntValue(aK[2]), unit)] | |
326 | - | else if ((size(aA) > 5)) | |
327 | - | then throw("sorry! maximum limit of your cart is 5 items") | |
328 | - | else nil | |
217 | + | @Callable(o) | |
218 | + | func withdrawBid (at,Y) = { | |
219 | + | let U = o.caller.bytes | |
220 | + | let ag = "9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq" | |
221 | + | let A = toBase58String(o.transactionId) | |
222 | + | let ah = fromBase58String(Y) | |
223 | + | let au = getStringValue(this, (at + "_highest_bid")) | |
224 | + | let av = getStringValue(this, (at + "_winner")) | |
225 | + | let aw = getStringValue(this, (at + "_nft_id")) | |
226 | + | if ((Y == ag)) | |
227 | + | then [StringEntry((at + "_nft_bid"), "WITHDRAW"), StringEntry((at + "_nft_id"), aw), StringEntry((at + "_bidding_price_refund_amount"), au), ScriptTransfer(o.caller, parseIntValue(au), ah)] | |
228 | + | else if ((Y == "WAVES")) | |
229 | + | then [StringEntry((at + "_nft_bid"), "WITHDRAW"), StringEntry((at + "_nft_id"), aw), StringEntry((at + "_bidding_price_refund_amount"), au), ScriptTransfer(o.caller, parseIntValue(au), unit)] | |
230 | + | else nil | |
329 | 231 | } | |
330 | 232 | ||
331 | 233 |
github/deemru/w8io/169f3d6 162.49 ms ◑