tx · 3VssaqgX31BCvDCi9fx94qky9wAkU14okyZzEMJJuAko 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq: -0.05000000 Waves 2022.12.15 10:21 [2361115] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves
{ "type": 13, "id": "3VssaqgX31BCvDCi9fx94qky9wAkU14okyZzEMJJuAko", "fee": 5000000, "feeAssetId": null, "timestamp": 1671088909663, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "5ebZV6RZx94MGoHH4E8xnZzXwBMA3CMnL8phrZT9RsJdgN3zTh2AQSnJFAzYrwusALXGaYWsP5ZoB9UoSzwdUvmk" ], "script": "base64:BgJBCAISCwoJCAgICAgBCAgIEgQKAggIEgQKAggIEgYKBAgICAESBgoECAgICBIFCgMICAESAwoBCBIDCgEIEgMKAQgJAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwAEm1heEF1Y3Rpb25EdXJhdGlvbgAHAARrQmlkAgNiaWQADHN0YXR1c0Zvck5GVAkAlgoEAgRPUEVOAgZDTE9TRUQCCFJFV0FSREVEAghDQU5DRUxFRAALZEFwcEFkZHJlc3MBGgFUSrhPbN7C2pPt9I7pSjb41U9/ldVVW12gAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwkBaQEJY3JlYXRlTmZ0CQhuZnRfbmFtZQluZnRfb3duZXIPbmZ0X2RBcHBBZGRyZXN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AgkBC1N0cmluZ0VudHJ5AgkArAICBQdiaWRUeElkAhxfYmlkZGluZ19wcmljZV9yZWZ1bmRfYW1vdW50BQhiaWRQcmljZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAQ1wYXJzZUludFZhbHVlAQUIYmlkUHJpY2UFBHVuaXQFA25pbAFpAQd0ZXN0QmlkAQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQICOEU4a2tGQllDeTQ0SkphcTZwQVo2S2l6c3VSZXNpNVVLTmhiRDFXTlp3aGhZX2hpZ2hlc3RfYmlkAgEwBQNuaWwAIcNXKQ==", "height": 2361115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6MTypCYKNsJew3s8rUUzXw7EBG6VRAxA3QDjJzYr3C1x Next: 8ERcviQkRa4qnQft6YLqYV4eYBQPb7wrTHrF2Ve61Ked Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(m) | |
61 | - | func buyNFT (F | |
61 | + | func buyNFT (A,F) = { | |
62 | 62 | let j = fromBase58String(F) | |
63 | - | let H = value(m.payments[0].amount) | |
64 | - | let I = { | |
65 | - | let k = getString(this, (("nft_" + G) + "_owner")) | |
66 | - | if ($isInstanceOf(k, "String")) | |
67 | - | then { | |
68 | - | let J = k | |
69 | - | J | |
70 | - | } | |
71 | - | else false | |
72 | - | } | |
73 | - | let z = getStringValue(((((c + a) + F) + "_") + G)) | |
74 | - | let K = valueOrErrorMessage(getStringValue(((F + a) + "Owner")), "No owner") | |
63 | + | let G = m.transactionId | |
64 | + | let H = getStringValue(this, (A + "_owner")) | |
65 | + | let I = value(m.payments[0].amount) | |
66 | + | let z = getStringValue(((((c + a) + F) + "_") + H)) | |
67 | + | let J = valueOrErrorMessage(getStringValue(((F + a) + "Owner")), "No owner") | |
75 | 68 | if ((m.payments[0].assetId != unit)) | |
76 | 69 | then throw("Pay in waves") | |
77 | - | else if ((G == toString(m.caller))) | |
78 | - | then throw("current Owner of NFT not able to purchase") | |
79 | - | else if ((K == toString(m.caller))) | |
80 | - | then throw("owner never buy after sell") | |
81 | - | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(K)), H, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(H))), DeleteEntry((("nft_" + G) + "_owner")), StringEntry((("nft_" + G) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
70 | + | else if ((H == toString(m.caller))) | |
71 | + | then throw("Not eligible to buy as you are owner") | |
72 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(J)), I, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
82 | 73 | } | |
83 | 74 | ||
84 | 75 | ||
85 | 76 | ||
86 | 77 | @Callable(m) | |
87 | - | func addAuction (L,M,N | |
88 | - | let | |
89 | - | let | |
90 | - | let z = value( | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let k = getString(this, (((toBase58String( | |
78 | + | func addAuction (K,L,M,N) = { | |
79 | + | let O = toBase58String(m.transactionId) | |
80 | + | let P = value(m.payments[0].assetId) | |
81 | + | let z = value(M) | |
82 | + | let Q = (lastBlock.height + N) | |
83 | + | let R = m.caller.bytes | |
84 | + | let S = { | |
85 | + | let k = getString(this, (((toBase58String(P) + a) + "nft_status_") + toBase58String(R))) | |
95 | 86 | if ($isInstanceOf(k, "String")) | |
96 | 87 | then { | |
97 | - | let | |
88 | + | let T = k | |
98 | 89 | true | |
99 | 90 | } | |
100 | 91 | else false | |
101 | 92 | } | |
102 | 93 | if ((m.payments[0].assetId == unit)) | |
103 | 94 | then throw("NFT not attached") | |
104 | - | else if (( | |
95 | + | else if ((S == true)) | |
105 | 96 | then throw("Already in auction list") | |
106 | - | else if (( | |
97 | + | else if ((N > e)) | |
107 | 98 | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
108 | - | else [StringEntry((( | |
99 | + | else [StringEntry(((O + "nft_start_auction_date") + toBase58String(R)), K), StringEntry(((O + "nft_end_auction_date") + toBase58String(R)), L), StringEntry((O + "_nft_start_price"), M), StringEntry((O + "_nft_owner"), toString(m.caller)), StringEntry((O + "_nft_on_auction"), toBase58String(P)), StringEntry((O + "_previous_bidder"), "none"), StringEntry((O + "_highest_bid"), "0"), StringEntry((O + "_winner_of_nft"), "0"), StringEntry((O + "_bidder_count"), "0"), StringEntry((O + "_nft_status"), "OPEN")] | |
109 | 100 | } | |
110 | 101 | ||
111 | 102 | ||
112 | 103 | ||
113 | 104 | @Callable(m) | |
114 | - | func placeBid (U, | |
115 | - | let | |
116 | - | let | |
117 | - | let j = fromBase58String( | |
105 | + | func placeBid (U,P,o,V) = { | |
106 | + | let O = toBase58String(m.transactionId) | |
107 | + | let R = m.caller.bytes | |
108 | + | let j = fromBase58String(P) | |
118 | 109 | let W = m.payments[0].amount | |
119 | 110 | let X = getStringValue(this, (U + "_highest_bid")) | |
120 | 111 | let Y = getString(this, (U + "_previous_bidder")) | |
121 | 112 | let Z = getStringValue(this, (U + "_bidder_count")) | |
122 | 113 | let aa = getStringValue(this, (U + "_winner_of_nft")) | |
123 | - | let | |
114 | + | let S = getStringValue(this, (U + "_nft_status")) | |
124 | 115 | if ((m.payments[0].assetId != unit)) | |
125 | 116 | then throw("Pay in waves") | |
126 | - | else if (( | |
117 | + | else if ((S != "OPEN")) | |
127 | 118 | then throw("Not open for auction") | |
128 | 119 | else if ((parseIntValue(X) >= W)) | |
129 | 120 | then throw("Bid is less then starting/highest Bid") | |
130 | 121 | else if ((X == "0")) | |
131 | - | then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry(((( | |
132 | - | else [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry(((( | |
122 | + | then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry((((O + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((O + "_") + U) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((O + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((O + "_") + U) + "_nft_id"), toBase58String(j)), StringEntry((((O + "_") + U) + "_nft_owner"), o), StringEntry((O + "_bid_for_nft_by"), toBase58String(R)), StringEntry((O + "_bid_price_place"), V), StringEntry((O + "_previous_bid_amount_refund_to_address"), aa), StringEntry((O + "_prevoius_bid_amount_refund"), X)] | |
123 | + | else [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry((((O + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((O + "_") + U) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((O + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((O + "_") + U) + "_nft_id"), toBase58String(j)), StringEntry((((O + "_") + U) + "_nft_owner"), o), StringEntry((O + "_bid_for_nft_by"), toBase58String(R)), StringEntry((O + "_bid_price_place"), V), StringEntry((O + "_previous_bid_amount_refund_to_address"), aa), StringEntry((O + "_prevoius_bid_amount_refund"), X), ScriptTransfer(Address(fromBase58String(aa)), parseIntValue(X), unit)] | |
133 | 124 | } | |
134 | 125 | ||
135 | 126 | ||
136 | 127 | ||
137 | 128 | @Callable(m) | |
138 | - | func acceptBidOffer (U, | |
139 | - | let | |
140 | - | let | |
141 | - | let j = fromBase58String( | |
129 | + | func acceptBidOffer (U,P,ab) = { | |
130 | + | let O = toBase58String(m.transactionId) | |
131 | + | let R = m.caller.bytes | |
132 | + | let j = fromBase58String(P) | |
142 | 133 | let ac = getStringValue(this, (U + "_highest_bid")) | |
143 | 134 | let ad = getStringValue(this, (U + "_winner_of_nft")) | |
144 | - | [ScriptTransfer(Address( | |
135 | + | [ScriptTransfer(Address(R), parseIntValue(ac), unit), ScriptTransfer(Address(fromBase58String(ad)), 1, j), StringEntry((O + "_amount_paid_to_owner"), ac), StringEntry((O + "_nft_transfer_to"), ad), StringEntry((O + "_nft_status"), "REWARDED"), StringEntry((U + "_amount_paid_to_owner"), ac), StringEntry((U + "_nft_transfer_to"), ad), StringEntry((U + "_nft_status"), "REWARDED")] | |
145 | 136 | } | |
146 | 137 | ||
147 | 138 | ||
148 | 139 | ||
149 | 140 | @Callable(m) | |
150 | 141 | func cancelAuction (U) = { | |
151 | - | let | |
152 | - | let | |
142 | + | let O = toBase58String(m.transactionId) | |
143 | + | let R = m.caller.bytes | |
153 | 144 | let ae = getStringValue(this, (U + "_nft_status")) | |
154 | 145 | let af = getStringValue(this, (U + "_winner_of_nft")) | |
155 | 146 | let ag = getStringValue(this, (U + "_nft_owner")) | |
156 | - | let | |
147 | + | let P = getStringValue(this, (U + "_nft_on_auction")) | |
157 | 148 | let ah = getStringValue(this, (U + "_highest_bid")) | |
158 | 149 | if ((af == "0")) | |
159 | - | then [StringEntry((( | |
160 | - | else [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry(( | |
150 | + | then [StringEntry(((O + U) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(P))] | |
151 | + | else [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry((O + "_nft_status"), "CANCELED"), StringEntry((O + "_previous_bid_amount_refund_to_address"), af), StringEntry((O + "_prevoius_bid_amount_refund"), ah), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ah), unit)] | |
161 | 152 | } | |
162 | 153 | ||
163 | 154 | ||
164 | 155 | ||
165 | 156 | @Callable(m) | |
166 | 157 | func withdrawBid (ai) = { | |
167 | - | let | |
158 | + | let R = m.caller.bytes | |
168 | 159 | let aj = getStringValue(this, (ai + "_highest_bid")) | |
169 | 160 | let ak = getStringValue(this, (ai + "_winner")) | |
170 | 161 | let al = getStringValue(this, (ai + "_nft_id")) | |
171 | - | if ((toBase58String( | |
162 | + | if ((toBase58String(R) != ak)) | |
172 | 163 | then throw("No bid") | |
173 | 164 | else [StringEntry((ai + "_nft_bid"), "WITHDRAW"), StringEntry((ai + "_nft_id"), al), StringEntry((ai + "_bidding_price_refund_amount"), aj), ScriptTransfer(m.caller, parseIntValue(aj), unit)] | |
174 | 165 | } |
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 = 7 | |
13 | 13 | ||
14 | 14 | let f = "bid" | |
15 | 15 | ||
16 | 16 | let g = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
17 | 17 | ||
18 | 18 | let h = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
19 | 19 | ||
20 | 20 | func i (j) = { | |
21 | 21 | let k = assetInfo(j) | |
22 | 22 | if ($isInstanceOf(k, "Asset")) | |
23 | 23 | then { | |
24 | 24 | let l = k | |
25 | 25 | if (if ((l.decimals == 0)) | |
26 | 26 | then (l.quantity == 1) | |
27 | 27 | else false) | |
28 | 28 | then (l.reissuable == false) | |
29 | 29 | else false | |
30 | 30 | } | |
31 | 31 | else false | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(m) | |
36 | 36 | func createNft (n,o,p,q,r,s,t,u,v) = { | |
37 | 37 | let w = Issue(n, t, 1, 0, false) | |
38 | 38 | let x = calculateAssetId(w) | |
39 | 39 | let y = m.transactionId | |
40 | 40 | [w, ScriptTransfer(m.caller, 1, x), StringEntry(((toBase58String(y) + a) + "owner"), toString(m.caller)), StringEntry((toBase58String(x) + "_owner"), toString(m.caller)), StringEntry(((toBase58String(y) + a) + "nft_type"), q), StringEntry(((toBase58String(y) + a) + "nft_tags"), r), StringEntry(((toBase58String(y) + a) + "nft_dAppAddress"), p), IntegerEntry(((toBase58String(y) + a) + "nft_selling_price"), s), StringEntry(((toBase58String(y) + a) + "nft_onSell"), u), StringEntry(((toBase58String(y) + a) + "nft_data"), v), StringEntry(((toBase58String(y) + a) + "issue_nft"), toBase58String(x))] | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(m) | |
46 | 46 | func sellNFT (y,z) = { | |
47 | 47 | let A = m.transactionId | |
48 | 48 | let j = getStringValue(this, (y + "_owner")) | |
49 | 49 | let B = m.caller.bytes | |
50 | 50 | let C = $Tuple2(value(m.payments[0].assetId), value(m.payments[0].amount)) | |
51 | 51 | let D = C._1 | |
52 | 52 | let E = C._2 | |
53 | 53 | if (!(i(D))) | |
54 | 54 | then throw("Token is not NFT") | |
55 | 55 | else [StringEntry((toBase58String(A) + "_owner"), toString(m.caller)), StringEntry((toBase58String(A) + "_nft_selling_price"), z), StringEntry((toBase58String(A) + "_nft_puton_sell"), j), StringEntry(((c + a) + toBase58String(value(m.payments[0].assetId))), z), StringEntry(((toString(m.caller) + a) + d), ((toBase58String(D) + a) + toString(E)))] | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(m) | |
61 | - | func buyNFT (F | |
61 | + | func buyNFT (A,F) = { | |
62 | 62 | let j = fromBase58String(F) | |
63 | - | let H = value(m.payments[0].amount) | |
64 | - | let I = { | |
65 | - | let k = getString(this, (("nft_" + G) + "_owner")) | |
66 | - | if ($isInstanceOf(k, "String")) | |
67 | - | then { | |
68 | - | let J = k | |
69 | - | J | |
70 | - | } | |
71 | - | else false | |
72 | - | } | |
73 | - | let z = getStringValue(((((c + a) + F) + "_") + G)) | |
74 | - | let K = valueOrErrorMessage(getStringValue(((F + a) + "Owner")), "No owner") | |
63 | + | let G = m.transactionId | |
64 | + | let H = getStringValue(this, (A + "_owner")) | |
65 | + | let I = value(m.payments[0].amount) | |
66 | + | let z = getStringValue(((((c + a) + F) + "_") + H)) | |
67 | + | let J = valueOrErrorMessage(getStringValue(((F + a) + "Owner")), "No owner") | |
75 | 68 | if ((m.payments[0].assetId != unit)) | |
76 | 69 | then throw("Pay in waves") | |
77 | - | else if ((G == toString(m.caller))) | |
78 | - | then throw("current Owner of NFT not able to purchase") | |
79 | - | else if ((K == toString(m.caller))) | |
80 | - | then throw("owner never buy after sell") | |
81 | - | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(K)), H, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(H))), DeleteEntry((("nft_" + G) + "_owner")), StringEntry((("nft_" + G) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
70 | + | else if ((H == toString(m.caller))) | |
71 | + | then throw("Not eligible to buy as you are owner") | |
72 | + | else [ScriptTransfer(m.caller, 1, j), ScriptTransfer(Address(fromBase58String(J)), I, unit), StringEntry(((toString(m.caller) + a) + b), ((F + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(m.caller)), StringEntry(((F + a) + "_owner"), toString(m.caller))] | |
82 | 73 | } | |
83 | 74 | ||
84 | 75 | ||
85 | 76 | ||
86 | 77 | @Callable(m) | |
87 | - | func addAuction (L,M,N | |
88 | - | let | |
89 | - | let | |
90 | - | let z = value( | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let k = getString(this, (((toBase58String( | |
78 | + | func addAuction (K,L,M,N) = { | |
79 | + | let O = toBase58String(m.transactionId) | |
80 | + | let P = value(m.payments[0].assetId) | |
81 | + | let z = value(M) | |
82 | + | let Q = (lastBlock.height + N) | |
83 | + | let R = m.caller.bytes | |
84 | + | let S = { | |
85 | + | let k = getString(this, (((toBase58String(P) + a) + "nft_status_") + toBase58String(R))) | |
95 | 86 | if ($isInstanceOf(k, "String")) | |
96 | 87 | then { | |
97 | - | let | |
88 | + | let T = k | |
98 | 89 | true | |
99 | 90 | } | |
100 | 91 | else false | |
101 | 92 | } | |
102 | 93 | if ((m.payments[0].assetId == unit)) | |
103 | 94 | then throw("NFT not attached") | |
104 | - | else if (( | |
95 | + | else if ((S == true)) | |
105 | 96 | then throw("Already in auction list") | |
106 | - | else if (( | |
97 | + | else if ((N > e)) | |
107 | 98 | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(e))) | |
108 | - | else [StringEntry((( | |
99 | + | else [StringEntry(((O + "nft_start_auction_date") + toBase58String(R)), K), StringEntry(((O + "nft_end_auction_date") + toBase58String(R)), L), StringEntry((O + "_nft_start_price"), M), StringEntry((O + "_nft_owner"), toString(m.caller)), StringEntry((O + "_nft_on_auction"), toBase58String(P)), StringEntry((O + "_previous_bidder"), "none"), StringEntry((O + "_highest_bid"), "0"), StringEntry((O + "_winner_of_nft"), "0"), StringEntry((O + "_bidder_count"), "0"), StringEntry((O + "_nft_status"), "OPEN")] | |
109 | 100 | } | |
110 | 101 | ||
111 | 102 | ||
112 | 103 | ||
113 | 104 | @Callable(m) | |
114 | - | func placeBid (U, | |
115 | - | let | |
116 | - | let | |
117 | - | let j = fromBase58String( | |
105 | + | func placeBid (U,P,o,V) = { | |
106 | + | let O = toBase58String(m.transactionId) | |
107 | + | let R = m.caller.bytes | |
108 | + | let j = fromBase58String(P) | |
118 | 109 | let W = m.payments[0].amount | |
119 | 110 | let X = getStringValue(this, (U + "_highest_bid")) | |
120 | 111 | let Y = getString(this, (U + "_previous_bidder")) | |
121 | 112 | let Z = getStringValue(this, (U + "_bidder_count")) | |
122 | 113 | let aa = getStringValue(this, (U + "_winner_of_nft")) | |
123 | - | let | |
114 | + | let S = getStringValue(this, (U + "_nft_status")) | |
124 | 115 | if ((m.payments[0].assetId != unit)) | |
125 | 116 | then throw("Pay in waves") | |
126 | - | else if (( | |
117 | + | else if ((S != "OPEN")) | |
127 | 118 | then throw("Not open for auction") | |
128 | 119 | else if ((parseIntValue(X) >= W)) | |
129 | 120 | then throw("Bid is less then starting/highest Bid") | |
130 | 121 | else if ((X == "0")) | |
131 | - | then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry(((( | |
132 | - | else [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry(((( | |
122 | + | then [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry((((O + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((O + "_") + U) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((O + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((O + "_") + U) + "_nft_id"), toBase58String(j)), StringEntry((((O + "_") + U) + "_nft_owner"), o), StringEntry((O + "_bid_for_nft_by"), toBase58String(R)), StringEntry((O + "_bid_price_place"), V), StringEntry((O + "_previous_bid_amount_refund_to_address"), aa), StringEntry((O + "_prevoius_bid_amount_refund"), X)] | |
123 | + | else [StringEntry((U + "_highest_bid"), toString(W)), StringEntry((U + "_winner_of_nft"), toBase58String(m.caller.bytes)), StringEntry((U + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((U + "_nft_id"), toBase58String(j)), StringEntry((U + "_nft_owner"), o), StringEntry((((O + "_") + U) + "_highest_bid"), toString(W)), StringEntry((((O + "_") + U) + "_winner"), toBase58String(m.caller.bytes)), StringEntry((((O + "_") + U) + "_bidder_count"), toString((parseIntValue(Z) + 1))), StringEntry((((O + "_") + U) + "_nft_id"), toBase58String(j)), StringEntry((((O + "_") + U) + "_nft_owner"), o), StringEntry((O + "_bid_for_nft_by"), toBase58String(R)), StringEntry((O + "_bid_price_place"), V), StringEntry((O + "_previous_bid_amount_refund_to_address"), aa), StringEntry((O + "_prevoius_bid_amount_refund"), X), ScriptTransfer(Address(fromBase58String(aa)), parseIntValue(X), unit)] | |
133 | 124 | } | |
134 | 125 | ||
135 | 126 | ||
136 | 127 | ||
137 | 128 | @Callable(m) | |
138 | - | func acceptBidOffer (U, | |
139 | - | let | |
140 | - | let | |
141 | - | let j = fromBase58String( | |
129 | + | func acceptBidOffer (U,P,ab) = { | |
130 | + | let O = toBase58String(m.transactionId) | |
131 | + | let R = m.caller.bytes | |
132 | + | let j = fromBase58String(P) | |
142 | 133 | let ac = getStringValue(this, (U + "_highest_bid")) | |
143 | 134 | let ad = getStringValue(this, (U + "_winner_of_nft")) | |
144 | - | [ScriptTransfer(Address( | |
135 | + | [ScriptTransfer(Address(R), parseIntValue(ac), unit), ScriptTransfer(Address(fromBase58String(ad)), 1, j), StringEntry((O + "_amount_paid_to_owner"), ac), StringEntry((O + "_nft_transfer_to"), ad), StringEntry((O + "_nft_status"), "REWARDED"), StringEntry((U + "_amount_paid_to_owner"), ac), StringEntry((U + "_nft_transfer_to"), ad), StringEntry((U + "_nft_status"), "REWARDED")] | |
145 | 136 | } | |
146 | 137 | ||
147 | 138 | ||
148 | 139 | ||
149 | 140 | @Callable(m) | |
150 | 141 | func cancelAuction (U) = { | |
151 | - | let | |
152 | - | let | |
142 | + | let O = toBase58String(m.transactionId) | |
143 | + | let R = m.caller.bytes | |
153 | 144 | let ae = getStringValue(this, (U + "_nft_status")) | |
154 | 145 | let af = getStringValue(this, (U + "_winner_of_nft")) | |
155 | 146 | let ag = getStringValue(this, (U + "_nft_owner")) | |
156 | - | let | |
147 | + | let P = getStringValue(this, (U + "_nft_on_auction")) | |
157 | 148 | let ah = getStringValue(this, (U + "_highest_bid")) | |
158 | 149 | if ((af == "0")) | |
159 | - | then [StringEntry((( | |
160 | - | else [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry(( | |
150 | + | then [StringEntry(((O + U) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(P))] | |
151 | + | else [StringEntry((U + "_nft_status"), "CANCELED"), StringEntry((U + "_previous_bid_amount_refund_to_address"), af), StringEntry((U + "_prevoius_bid_amount_refund"), ah), StringEntry((O + "_nft_status"), "CANCELED"), StringEntry((O + "_previous_bid_amount_refund_to_address"), af), StringEntry((O + "_prevoius_bid_amount_refund"), ah), ScriptTransfer(Address(fromBase58String(ag)), 1, fromBase58String(P)), ScriptTransfer(Address(fromBase58String(af)), parseIntValue(ah), unit)] | |
161 | 152 | } | |
162 | 153 | ||
163 | 154 | ||
164 | 155 | ||
165 | 156 | @Callable(m) | |
166 | 157 | func withdrawBid (ai) = { | |
167 | - | let | |
158 | + | let R = m.caller.bytes | |
168 | 159 | let aj = getStringValue(this, (ai + "_highest_bid")) | |
169 | 160 | let ak = getStringValue(this, (ai + "_winner")) | |
170 | 161 | let al = getStringValue(this, (ai + "_nft_id")) | |
171 | - | if ((toBase58String( | |
162 | + | if ((toBase58String(R) != ak)) | |
172 | 163 | then throw("No bid") | |
173 | 164 | else [StringEntry((ai + "_nft_bid"), "WITHDRAW"), StringEntry((ai + "_nft_id"), al), StringEntry((ai + "_bidding_price_refund_amount"), aj), ScriptTransfer(m.caller, parseIntValue(aj), unit)] | |
174 | 165 | } | |
175 | 166 | ||
176 | 167 | ||
177 | 168 | ||
178 | 169 | @Callable(m) | |
179 | 170 | func testBid (am) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
180 | 171 | ||
181 | 172 |
github/deemru/w8io/169f3d6 123.66 ms ◑