tx · HKuWBqEqxcrVDx1rMyKCq978L2pUUFcrFKGkQvoFKT78

3NCnz63Wq3UgikV5jJfQpG5snnibGbfUHR1:  -0.00500000 Waves

2023.03.25 18:13 [2505689] smart account 3NCnz63Wq3UgikV5jJfQpG5snnibGbfUHR1 > SELF 0.00000000 Waves

{ "type": 13, "id": "HKuWBqEqxcrVDx1rMyKCq978L2pUUFcrFKGkQvoFKT78", "fee": 500000, "feeAssetId": null, "timestamp": 1679757299816, "version": 2, "chainId": 84, "sender": "3NCnz63Wq3UgikV5jJfQpG5snnibGbfUHR1", "senderPublicKey": "4aqyXQp8dTe3bcQoReatzejrngYuQvyooFPeNe8925zb", "proofs": [ "2gmbMCYdpb6rcD3fTnEFiGtw2MmpJcYg823giojoGj1ZuQDZ6Mn5J9PbS4Z6NaJhisF9e8iqh8KoBH3feYDP85Mr" ], "script": "base64:BgIECAISAAIABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgEOYWRkU3RyaW5nRW50cnkCBWFjY3VtCW5leHRWYWx1ZQQJJHQwMjI4MjUxBQVhY2N1bQQGcmVzdWx0CAUJJHQwMjI4MjUxAl8xBAFqCAUJJHQwMjI4MjUxAl8yCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgIES2V5XwUJbmV4dFZhbHVlBQluZXh0VmFsdWUFA25pbAEBaQEGYnV5TmZ0AAQGdmFsdWVzCQDMCAICIzNON1N5NFFSZ0xyaGpXQ2hicGl5RnhhUnJZdFROUkd1TlVzCQDMCAICIzNOODVZVzZOWjlwTFl2U2R0MUFTTVFUR3h2bmNuVTF2VU54BQNuaWwEBnJlc3VsdAoAAiRsBQZ2YWx1ZXMKAAIkcwkAkAMBBQIkbAoABSRhY2MwCQCUCgIFA25pbAAACgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQ5hZGRTdHJpbmdFbnRyeQIFAiRhCQCRAwIFAiRsBQIkaQoBBSRmMF8yAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQACAQIUTGlzdCBzaXplIGV4Y2VlZHMgMTAJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgUDbmlsABZjWDI=", "height": 2505689, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2ahX4xouADVtE1NRxHmKuGHD7FLvGzJWiUTHcSkTKCjR Next: 3jFCwJFyNzuWnNhnETDo6wH8NdE83YxRWq84c9AcmnEb Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "_"
4+let a = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
55
6-let b = "buy"
7-
8-let c = "price"
9-
10-let d = "sell"
11-
12-let e = 7
13-
14-let f = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
15-
16-let g = base58''
17-
18-let h = "bid"
19-
20-let i = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
21-
22-let j = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
23-
24-func k (l) = {
25- let m = assetInfo(l)
26- if ($isInstanceOf(m, "Asset"))
27- then {
28- let n = m
29- if (if ((n.decimals == 0))
30- then (n.quantity == 1)
31- else false)
32- then (n.reissuable == false)
33- else false
34- }
35- else false
6+func b (c,d) = {
7+ let e = c
8+ let f = e._1
9+ let g = e._2
10+[StringEntry(("Key_" + d), d)]
3611 }
3712
3813
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))]
14+@Callable(h)
15+func buyNft () = {
16+ let i = ["3N7Sy4QRgLrhjWChbpiyFxaRrYtTNRGuNUs", "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx"]
17+ let f = {
18+ let j = i
19+ let k = size(j)
20+ let l = $Tuple2(nil, 0)
21+ func m (n,o) = if ((o >= k))
22+ then n
23+ else b(n, j[o])
24+
25+ func p (n,o) = if ((o >= k))
26+ then n
27+ else throw("List size exceeds 10")
28+
29+ p(m(m(m(m(m(m(m(m(m(m(l, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
30+ }
31+ nil
4532 }
46-
47-
48-
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)))
57- then throw("Token is not NFT")
58- else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), (B + C)), StringEntry(((toString(o.caller) + a) + d), (((toBase58String(F) + a) + toString(G)) + C))]
59- }
60-
61-
62-
63-@Callable(o)
64-func buyNFT (H,I) = {
65- let l = fromBase58String(H)
66- let J = value(o.payments[0].amount)
67- let K = {
68- let m = getString(this, (("nft_" + I) + "_owner"))
69- if ($isInstanceOf(m, "String"))
70- then {
71- let L = m
72- L
73- }
74- else false
75- }
76- let B = getStringValue(((((c + a) + H) + "_") + I))
77- if ((I == toString(o.caller)))
78- then throw("current Owner of NFT not able to purchase")
79- else if ((o.payments[0].assetId == f))
80- then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), J, f), 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))]
81- else if ((o.payments[0].assetId == unit))
82- then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(I)), J, unit), 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 nil
84- }
85-
86-
87-
88-@Callable(o)
89-func cancelSell (M) = {
90- let A = toBase58String(o.transactionId)
91- let D = o.caller.bytes
92-[StringEntry(((A + M) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(D), 1, fromBase58String(M))]
93- }
94-
95-
96-
97-@Callable(o)
98-func addAuction (N,O,P,Q,C) = {
99- let A = toBase58String(o.transactionId)
100- let M = value(o.payments[0].assetId)
101- let B = value(P)
102- let R = (lastBlock.height + Q)
103- let S = o.caller.bytes
104- let T = {
105- let m = getString(this, (((toBase58String(M) + a) + "nft_status_") + toBase58String(S)))
106- if ($isInstanceOf(m, "String"))
107- then {
108- let L = m
109- true
110- }
111- else false
112- }
113- if ((T == true))
114- then throw("Already in auction list")
115- else if ((Q > e))
116- then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e)))
117- else if ((o.payments[0].assetId == unit))
118- then throw("NFT not attached")
119- else if ((o.payments[0].assetId == f))
120- then throw("NFT not attached")
121- else [StringEntry(((A + "nft_start_auction_date") + toBase58String(S)), N), StringEntry(((A + "nft_end_auction_date") + toBase58String(S)), O), StringEntry((A + "_nft_start_price"), (P + C)), StringEntry((A + "_nft_owner"), toString(o.caller)), StringEntry((A + "_nft_on_auction"), toBase58String(M)), 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")]
122- }
123-
124-
125-
126-@Callable(o)
127-func placeBid (U,M,q,P,V) = {
128- let A = toBase58String(o.transactionId)
129- let S = o.caller.bytes
130- let l = fromBase58String(M)
131- let W = o.payments[0].amount
132- let X = getStringValue(this, (U + "_highest_bid"))
133- let Y = getString(this, (U + "_previous_bidder"))
134- let Z = getStringValue(this, (U + "_bidder_count"))
135- let aa = getStringValue(this, (U + "_winner_of_nft"))
136- let T = getStringValue(this, (U + "_nft_status"))
137- if ((T != "OPEN"))
138- then throw("Not open for auction")
139- else if ((parseIntValue(X) >= W))
140- then throw("Bid is less then starting/highest Bid")
141- else if ((X == "0"))
142- then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(l)), StringEntry((U + "_nft_owner"), q), StringEntry((((A + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((A + "_") + U) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((A + "_") + U) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + U) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(S)), StringEntry((A + "_bid_price_place"), V), StringEntry((A + "_previous_bid_amount_refund_to_address"), aa), StringEntry((A + "_prevoius_bid_amount_refund"), X)]
143- else if ((o.payments[0].assetId == unit))
144- then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(l)), StringEntry((U + "_nft_owner"), q), StringEntry((((A + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((A + "_") + U) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((A + "_") + U) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + U) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(S)), StringEntry((A + "_bid_price_place"), V), StringEntry((A + "_previous_bid_amount_refund_to_address"), aa), StringEntry((A + "_prevoius_bid_amount_refund"), X), ScriptTransfer(Address(fromBase58String(aa)), parseIntValue(X), unit)]
145- else if ((o.payments[0].assetId == f))
146- then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(o.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(l)), StringEntry((U + "_nft_owner"), q), StringEntry((((A + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((A + "_") + U) + "_winner"), toBase58String(o.caller.bytes)), StringEntry((((A + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((A + "_") + U) + "_nft_id"), toBase58String(l)), StringEntry((((A + "_") + U) + "_nft_owner"), q), StringEntry((A + "_bid_for_nft_by"), toBase58String(S)), StringEntry((A + "_bid_price_place"), V), StringEntry((A + "_previous_bid_amount_refund_to_address"), aa), StringEntry((A + "_prevoius_bid_amount_refund"), X), ScriptTransfer(Address(fromBase58String(aa)), parseIntValue(X), f)]
147- else nil
148- }
149-
150-
151-
152-@Callable(o)
153-func acceptBidOffer (U,M,ab) = {
154- let A = toBase58String(o.transactionId)
155- let S = o.caller.bytes
156- let l = fromBase58String(M)
157- let ac = getStringValue(this, (U + "_highest_bid"))
158- let ad = getStringValue(this, (U + "_winner_of_nft"))
159-[ScriptTransfer(Address(S), parseIntValue(ac), f), ScriptTransfer(Address(fromBase58String(ad)), 1, l), StringEntry((A + "_amount_paid_to_owner"), ac), StringEntry((A + "_nft_transfer_to"), ad), StringEntry((A + "_nft_status"), "REWARDED"), StringEntry((U + "_amount_paid_to_owner"), ac), StringEntry((U + "_nft_transfer_to"), ad), StringEntry((U + "_nft_status"), "REWARDED")]
160- }
161-
162-
163-
164-@Callable(o)
165-func cancelAuction (U) = {
166- let A = toBase58String(o.transactionId)
167- let S = o.caller.bytes
168- let ae = getStringValue(this, (U + "_nft_status"))
169- let af = getStringValue(this, (U + "_winner_of_nft"))
170- let ag = getStringValue(this, (U + "_nft_owner"))
171- let M = getStringValue(this, (U + "_nft_on_auction"))
172- let ah = getStringValue(this, (U + "_highest_bid"))
173- if ((af == "0"))
174- then [StringEntry(((A + U) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(M))]
175- else if ((o.payments[0].assetId == unit))
176- then [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry((A + "_nft_status"), "CANCELED"), StringEntry((A + "_previous_bid_amount_refund_to_address"), af), StringEntry((A + "_prevoius_bid_amount_refund"), ah), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(M)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ah), unit)]
177- else if ((o.payments[0].assetId == f))
178- then [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry((A + "_nft_status"), "CANCELED"), StringEntry((A + "_previous_bid_amount_refund_to_address"), af), StringEntry((A + "_prevoius_bid_amount_refund"), ah), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(M)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ah), f)]
179- else nil
180- }
181-
182-
183-
184-@Callable(o)
185-func withdrawBid (ai) = {
186- let S = o.caller.bytes
187- let aj = getStringValue(this, (ai + "_highest_bid"))
188- let ak = getStringValue(this, (ai + "_winner"))
189- let al = getStringValue(this, (ai + "_nft_id"))
190- if ((toBase58String(S) != ak))
191- then throw("No bid")
192- else [StringEntry((ai + "_nft_bid"), "WITHDRAW"), StringEntry((ai + "_nft_id"), al), StringEntry((ai + "_bidding_price_refund_amount"), aj), ScriptTransfer(o.caller, parseIntValue(aj), unit)]
193- }
194-
195-
196-
197-@Callable(o)
198-func manualFundTransfer (am,an) = {
199- let S = o.caller.bytes
200- let ao = fromBase58String(am)
201- let J = o.payments[0].amount
202- if ((o.payments[0].assetId == unit))
203- then [IntegerEntry((toBase58String(S) + "_transfer"), J), StringEntry((toBase58String(S) + "_transfer_to"), am), ScriptTransfer(Address(ao), J, unit)]
204- else if ((o.payments[0].assetId == f))
205- then [IntegerEntry((toBase58String(S) + "_transfer"), J), StringEntry((toBase58String(S) + "_transfer_to"), am), ScriptTransfer(Address(ao), J, f)]
206- else nil
207- }
208-
209-
210-
211-@Callable(o)
212-func testBid (ap) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")]
21333
21434

github/deemru/w8io/026f985 
35.60 ms