tx · 2jgZgg5SmxTVjhHVWbU9ofWSDxn1Ys7buzbGkK2pURAi

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.12.06 17:38 [2348617] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "2jgZgg5SmxTVjhHVWbU9ofWSDxn1Ys7buzbGkK2pURAi", "fee": 1000000, "feeAssetId": null, "timestamp": 1670337449041, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "4yfQGi4z4HvvNxphf93S83czcYstXNsv1aV7trc8Atpoadf2Wf5zdFN36VRwoQVYrjyQrPEKVpsaCguLvuRnGhZ4" ], "script": "base64:BgIKCAISBgoECAgIAQEAEm1heEF1Y3Rpb25EdXJhdGlvbgAHAQFpAQphZGRBdWN0aW9uBAVzdGFydANlbmQKc3RhcnRQcmljZQhkdXJhdGlvbgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAVuZnRJZAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBAVwcmljZQkBBXZhbHVlAQUKc3RhcnRQcmljZQQJZW5kSGVpZ2h0CQBkAggFCWxhc3RCbG9jawZoZWlnaHQFCGR1cmF0aW9uBAZjYWxsZXIICAUBaQZjYWxsZXIFYnl0ZXMEEWNoZWNrTmZ0QXVjdGlvbmVkBAckbWF0Y2gwCQCdCAIFBHRoaXMJAKwCAgkArAICCQDYBAEFBW5mdElkAgtuZnRfc3RhdHVzXwkA2AQBBQZjYWxsZXIDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBgcDCQAAAggJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBQR1bml0CQACAQIQTkZUIG5vdCBhdHRhY2hlZAMJAAACBRFjaG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View: original | compacted Prev: 4sQD51tUVf6UUb2zLJozZTGucZzPYPRVFzZviQXwFDUo Next: CHsvREfCBsemVaShopucsz5AHmprXPsaxSabXs7fDaf Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "_"
4+let a = 7
55
6-let b = "buy"
7-
8-let c = "price"
9-
10-let d = "sell"
11-
12-let e = "bid"
13-
14-let f = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
15-
16-let g = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
17-
18-func h (i) = {
19- let j = assetInfo(i)
20- if ($isInstanceOf(j, "Asset"))
21- then {
22- let k = j
23- if (if ((k.decimals == 0))
24- then (k.quantity == 1)
25- else false)
26- then (k.reissuable == false)
27- else false
28- }
29- else false
30- }
31-
32-
33-@Callable(l)
34-func createNft (m,n,o,p,q,r,s,t,u) = {
35- let v = Issue(m, s, 1, 0, false)
36- let w = calculateAssetId(v)
37- let x = l.transactionId
38-[v, ScriptTransfer(l.caller, 1, w), StringEntry(((toBase58String(w) + a) + "Owner"), toString(l.caller)), StringEntry(((toBase58String(w) + a) + "nft_type"), p), StringEntry(((toBase58String(w) + a) + "nft_tags"), q), StringEntry(((toBase58String(w) + a) + "nft_dAppAddress"), o), IntegerEntry(((toBase58String(w) + a) + "nft_selling_price"), r), StringEntry(((toBase58String(w) + a) + "nft_onSell"), t), StringEntry(((toBase58String(w) + a) + "nft_data"), u), StringEntry(((toBase58String(x) + a) + "issue_nft"), toBase58String(w))]
39- }
40-
41-
42-
43-@Callable(l)
44-func sellNFT (y) = {
45- let x = l.transactionId
46- let z = l.caller.bytes
47- let A = $Tuple2(value(l.payments[0].assetId), value(l.payments[0].amount))
48- let B = A._1
49- let C = A._2
50- if (!(h(B)))
51- then throw("Token is not NFT")
52- else [StringEntry(((c + a) + toBase58String(value(l.payments[0].assetId))), toString(y)), StringEntry(((toString(l.caller) + a) + d), ((toBase58String(B) + a) + toString(C)))]
53- }
54-
55-
56-
57-@Callable(l)
58-func buyNFT (D,E) = {
59- let i = fromBase58String(D)
60- let F = value(l.payments[0].amount)
61- let G = {
62- let j = getString(this, (("nft_" + E) + "_owner"))
63- if ($isInstanceOf(j, "String"))
6+@Callable(b)
7+func addAuction (c,d,e,f) = {
8+ let g = toBase58String(b.transactionId)
9+ let h = value(b.payments[0].assetId)
10+ let i = value(e)
11+ let j = (lastBlock.height + f)
12+ let k = b.caller.bytes
13+ let l = {
14+ let m = getString(this, ((toBase58String(h) + "nft_status_") + toBase58String(k)))
15+ if ($isInstanceOf(m, "String"))
6416 then {
65- let H = j
66- H
67- }
68- else false
69- }
70- let y = getStringValue(((((c + a) + D) + "_") + E))
71- let I = valueOrErrorMessage(getStringValue(((D + a) + "Owner")), "No owner")
72- if ((l.payments[0].assetId != unit))
73- then throw("Pay in waves")
74- else if ((G == toString(l.caller)))
75- then throw("Owner of NFT not able to purchase")
76- else [ScriptTransfer(l.caller, 1, i), ScriptTransfer(Address(fromBase58String(I)), F, unit), StringEntry(((toString(l.caller) + a) + b), ((D + a) + toString(F))), DeleteEntry((("nft_" + E) + "_owner"))]
77- }
78-
79-
80-
81-@Callable(l)
82-func addAuction (J,K,L,M) = {
83- let x = toBase58String(l.transactionId)
84- let N = value(l.payments[0].assetId)
85- let y = value(L)
86- let O = l.caller.bytes
87- let P = {
88- let j = getString(this, (((toBase58String(N) + a) + "nft_status_") + toBase58String(O)))
89- if ($isInstanceOf(j, "String"))
90- then {
91- let H = j
17+ let n = m
9218 true
9319 }
9420 else false
9521 }
96- if ((l.payments[0].assetId == unit))
22+ if ((b.payments[0].assetId == unit))
9723 then throw("NFT not attached")
98- else if ((P == true))
24+ else if ((l == true))
9925 then throw("Already in auction list")
100- else [StringEntry(((x + "_nft_start_auction_date_") + toBase58String(O)), J), StringEntry(((x + "_nft_end_auction_date_") + toBase58String(O)), K), StringEntry((x + "_nft_start_price"), L), StringEntry((x + "duration_of_auction"), M), StringEntry((x + "_nft_owner"), toString(l.caller)), StringEntry((x + "_nft_on_auction"), toBase58String(N)), StringEntry((x + "_previous_bidder"), "none"), StringEntry((x + "_highest_bid"), "0"), StringEntry((x + "_winner_of_nft"), "0"), StringEntry((x + "_bidder_count"), "0"), StringEntry((x + "_nft_status"), "OPEN")]
26+ else if ((f > a))
27+ then throw(("Duration is too long. Must be less than or equal to 7 " + toString(a)))
28+ else [StringEntry(((g + "_nft_start_auction_date_") + toBase58String(k)), c), StringEntry(((g + "_nft_end_auction_date_") + toBase58String(k)), d), StringEntry((g + "_nft_start_price"), e), StringEntry((g + "_nft_owner"), toString(b.caller)), StringEntry((g + "_nft_on_auction"), toBase58String(h)), StringEntry((g + "_previous_bidder"), "none"), StringEntry((g + "_highest_bid"), "0"), StringEntry((g + "_winner_of_nft"), "0"), StringEntry((g + "_bidder_count"), "0"), StringEntry((g + "_nft_status"), "OPEN")]
10129 }
102-
103-
104-
105-@Callable(l)
106-func placeBid (Q,N,n,R) = {
107- let x = toBase58String(l.transactionId)
108- let O = l.caller.bytes
109- let i = fromBase58String(N)
110- let S = l.payments[0].amount
111- let T = getStringValue(this, (Q + "_highest_bid"))
112- let U = getString(this, (Q + "_previous_bidder"))
113- let V = getStringValue(this, (Q + "_bidder_count"))
114- let W = getStringValue(this, (Q + "_winner_of_nft"))
115- let P = getStringValue(this, (Q + "_nft_status"))
116- if ((l.payments[0].assetId != unit))
117- then throw("Pay in waves")
118- else if ((P != "OPEN"))
119- then throw("Not open for auction")
120- else if ((parseIntValue(T) >= S))
121- then throw("Bid is less then starting/highest Bid")
122- else if ((T == "0"))
123- then [StringEntry((Q + "_highest_bid"), toString(S)), StringEntry((Q + "_winner_of_nft"), toBase58String(l.caller.bytes)), StringEntry((Q + "_bidder_count"), toString((parseIntValue(V) + 1))), StringEntry((Q + "_nft_id"), toBase58String(i)), StringEntry((Q + "_nft_owner"), n), StringEntry((((x + "_") + Q) + "_highest_bid"), toString(S)), StringEntry((((x + "_") + Q) + "_winner"), toBase58String(l.caller.bytes)), StringEntry((((x + "_") + Q) + "_bidder_count"), toString((parseIntValue(V) + 1))), StringEntry((((x + "_") + Q) + "_nft_id"), toBase58String(i)), StringEntry((((x + "_") + Q) + "_nft_owner"), n), StringEntry((x + "_bid_for_nft_by"), toBase58String(O)), StringEntry((x + "_bid_price_place"), R), StringEntry((x + "_previous_bid_amount_refund_to_address"), W), StringEntry((x + "_prevoius_bid_amount_refund"), T)]
124- else [StringEntry((Q + "_highest_bid"), toString(S)), StringEntry((Q + "_winner_of_nft"), toBase58String(l.caller.bytes)), StringEntry((Q + "_bidder_count"), toString((parseIntValue(V) + 1))), StringEntry((Q + "_nft_id"), toBase58String(i)), StringEntry((Q + "_nft_owner"), n), StringEntry((((x + "_") + Q) + "_highest_bid"), toString(S)), StringEntry((((x + "_") + Q) + "_winner"), toBase58String(l.caller.bytes)), StringEntry((((x + "_") + Q) + "_bidder_count"), toString((parseIntValue(V) + 1))), StringEntry((((x + "_") + Q) + "_nft_id"), toBase58String(i)), StringEntry((((x + "_") + Q) + "_nft_owner"), n), StringEntry((x + "_bid_for_nft_by"), toBase58String(O)), StringEntry((x + "_bid_price_place"), R), StringEntry((x + "_previous_bid_amount_refund_to_address"), W), StringEntry((x + "_prevoius_bid_amount_refund"), T), ScriptTransfer(Address(fromBase58String(W)), parseIntValue(T), unit)]
125- }
126-
127-
128-
129-@Callable(l)
130-func acceptBidOffer (Q,N,X) = {
131- let x = toBase58String(l.transactionId)
132- let O = l.caller.bytes
133- let i = fromBase58String(N)
134- let Y = getStringValue(this, (Q + "_highest_bid"))
135- let Z = getStringValue(this, (Q + "_winner_of_nft"))
136-[ScriptTransfer(Address(O), parseIntValue(Y), unit), ScriptTransfer(Address(fromBase58String(Z)), 1, i), StringEntry((x + "_amount_paid_to_owner"), Y), StringEntry((x + "_nft_transfer_to"), Z), StringEntry((x + "_nft_status"), "REWARDED"), StringEntry((Q + "_amount_paid_to_owner"), Y), StringEntry((Q + "_nft_transfer_to"), Z), StringEntry((Q + "_nft_status"), "REWARDED")]
137- }
138-
139-
140-
141-@Callable(l)
142-func cancelAuction (Q) = {
143- let x = toBase58String(l.transactionId)
144- let O = l.caller.bytes
145- let aa = getStringValue(this, (Q + "_nft_status"))
146- let ab = getStringValue(this, (Q + "_winner_of_nft"))
147- let ac = getStringValue(this, (Q + "_nft_owner"))
148- let N = getStringValue(this, (Q + "_nft_on_auction"))
149- let ad = getStringValue(this, (Q + "_highest_bid"))
150- if ((ab == "0"))
151- then [StringEntry(((x + Q) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ac)), 1, fromBase58String(N))]
152- else [StringEntry((Q + "_nft_status"), "CANCELED"), StringEntry((Q + "_previous_bid_amount_refund_to_address"), ab), StringEntry((Q + "_prevoius_bid_amount_refund"), ad), StringEntry((x + "_nft_status"), "CANCELED"), StringEntry((x + "_previous_bid_amount_refund_to_address"), ab), StringEntry((x + "_prevoius_bid_amount_refund"), ad), ScriptTransfer(Address(fromBase58String(ac)), 1, fromBase58String(N)), ScriptTransfer(Address(fromBase58String(ab)), parseIntValue(ad), unit)]
153- }
154-
155-
156-
157-@Callable(l)
158-func withdrawBid (ae) = {
159- let O = l.caller.bytes
160- let af = getStringValue(this, (ae + "_highest_bid"))
161- let ag = getStringValue(this, (ae + "_winner"))
162- let ah = getStringValue(this, (ae + "_nft_id"))
163- if ((toBase58String(O) != ag))
164- then throw("No bid")
165- else [StringEntry((ae + "_nft_bid"), "WITHDRAW"), StringEntry((ae + "_nft_id"), ah), StringEntry((ae + "_bidding_price_refund_amount"), af), ScriptTransfer(l.caller, parseIntValue(af), unit)]
166- }
167-
168-
169-
170-@Callable(l)
171-func testBid (ai) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")]
17230
17331

github/deemru/w8io/026f985 
29.80 ms