tx · 2nkzLJDqh3ymhpCfHhJ9iP9GFCa9oVPuAyPgjNiUqRqd

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.12.05 16:58 [2347139] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "2nkzLJDqh3ymhpCfHhJ9iP9GFCa9oVPuAyPgjNiUqRqd", "fee": 1000000, "feeAssetId": null, "timestamp": 1670248695091, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "gWfTjkkcoQ85Vaygj4rCW96qjV8NCQ2i28WH5BBNSHQ9budEx6naH2QoD1ZSA5VV2ErGaTg6pP1uoJ5se6uHMae" ], "script": "base64:BgIJCAISBQoDCAgBAAEBaQEOYWNjZXB0QmlkT2ZmZXIDCWF1Y3Rpb25JZAVuZnRJZBRiaWRfYW1vdW50X2Zyb21fdXNlcgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAZjYWxsZXIICAUBaQZjYWxsZXIFYnl0ZXMEB2Fzc2V0SWQJANkEAQUFbmZ0SWQEEmdldE5mdFdpbm5pbmdQcmljZQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCDF9oaWdoZXN0X2JpZAQQZ2V0QXVjdGlvbldpbm5lcgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCDl93aW5uZXJfb2ZfbmZ0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEFEmdldE5mdFdpbm5pbmdQcmljZQUEdW5pdAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUQZ2V0QXVjdGlvbldpbm5lcgABBQdhc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUEdHhJZAIVX2Ftb3VudF9wYWlkX3RvX293bmVyBRJnZXROZnRXaW5uaW5nUHJpY2UJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQR0eElkAhBfbmZ0X3RyYW5zZmVyX3RvBRBnZXRBdWN0aW9uV2lubmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUEdHhJZAILX25mdF9zdGF0dXMCCFJFV0FSREVECQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAhVfYW1vdW50X3BhaWRfdG9fb3duZXIFEmdldE5mdFdpbm5pbmdQcmljZQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIQX25mdF90cmFuc2Zlcl90bwUQZ2V0QXVjdGlvbldpbm5lcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAILX25mdF9zdGF0dXMCCFJFV0FSREVEBQNuaWwATcK1Cg==", "height": 2347139, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 91R6WV5PTyPjx6qWAWaLzZ8jk7Hip8HQjEfDapQpxKJp Next: 3n1vxLuqcksFLo2Gyvm74rPdbxnTc5pDmxXc4hVSqfDr Diff:
OldNewDifferences
44
55
66 @Callable(a)
7-func startAuction (b,c) = {
8- let d = toBase58String(a.transactionId)
9- let e = value(a.payments[0])
10-[StringEntry((d + "_organizer"), toBase58String(a.caller.bytes)), IntegerEntry((d + "_amount"), e.amount), IntegerEntry((d + "_startPrice"), c)]
11- }
12-
13-
14-
15-@Callable(a)
16-func bid () = {
17- let d = toBase58String(a.transactionId)
18- let e = value(a.payments[0])
19- let f = toBase58String(value(e.assetId))
20- let g = toBase58String(a.caller.bytes)
21- let c = getIntegerValue(this, (d + "_startPrice"))
22- let h = getStringValue(this, (d + "_priceAssetId"))
23- let i = getInteger(this, (d + "_winAmount"))
24- let j = getString(this, (d + "_winner"))
25- let k = if (isDefined(j))
26- then (value(j) == g)
27- else false
28- let l = (e.amount + (if (k)
29- then value(i)
30- else 0))
31- if ((h != f))
32- then throw((("Bid must be in asset '" + h) + "'"))
33- else if (if (if (isDefined(i))
34- then (value(i) >= l)
35- else false)
36- then true
37- else if (!(isDefined(i)))
38- then (c >= l)
39- else false)
40- then throw(("Bid must be more then " + toString(if (isDefined(i))
41- then value(i)
42- else c)))
43- else if (if (k)
44- then true
45- else !(isDefined(j)))
46- then [StringEntry((d + "_winner"), g), IntegerEntry((d + "_winAmount"), l)]
47- else {
48- let m = addressFromStringValue(value(j))
49- let n = if (if ((h == "WAVES"))
50- then true
51- else (h == ""))
52- then unit
53- else fromBase58String(h)
54-[StringEntry((d + "_winner"), g), IntegerEntry((d + "_winAmount"), l), ScriptTransfer(m, value(i), n)]
55- }
7+func acceptBidOffer (b,c,d) = {
8+ let e = toBase58String(a.transactionId)
9+ let f = a.caller.bytes
10+ let g = fromBase58String(c)
11+ let h = getStringValue(this, (b + "_highest_bid"))
12+ let i = getStringValue(this, (b + "_winner_of_nft"))
13+[ScriptTransfer(Address(f), parseIntValue(h), unit), ScriptTransfer(Address(fromBase58String(i)), 1, g), StringEntry((e + "_amount_paid_to_owner"), h), StringEntry((e + "_nft_transfer_to"), i), StringEntry((e + "_nft_status"), "REWARDED"), StringEntry((b + "_amount_paid_to_owner"), h), StringEntry((b + "_nft_transfer_to"), i), StringEntry((b + "_nft_status"), "REWARDED")]
5614 }
5715
5816
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
7-func startAuction (b,c) = {
8- let d = toBase58String(a.transactionId)
9- let e = value(a.payments[0])
10-[StringEntry((d + "_organizer"), toBase58String(a.caller.bytes)), IntegerEntry((d + "_amount"), e.amount), IntegerEntry((d + "_startPrice"), c)]
11- }
12-
13-
14-
15-@Callable(a)
16-func bid () = {
17- let d = toBase58String(a.transactionId)
18- let e = value(a.payments[0])
19- let f = toBase58String(value(e.assetId))
20- let g = toBase58String(a.caller.bytes)
21- let c = getIntegerValue(this, (d + "_startPrice"))
22- let h = getStringValue(this, (d + "_priceAssetId"))
23- let i = getInteger(this, (d + "_winAmount"))
24- let j = getString(this, (d + "_winner"))
25- let k = if (isDefined(j))
26- then (value(j) == g)
27- else false
28- let l = (e.amount + (if (k)
29- then value(i)
30- else 0))
31- if ((h != f))
32- then throw((("Bid must be in asset '" + h) + "'"))
33- else if (if (if (isDefined(i))
34- then (value(i) >= l)
35- else false)
36- then true
37- else if (!(isDefined(i)))
38- then (c >= l)
39- else false)
40- then throw(("Bid must be more then " + toString(if (isDefined(i))
41- then value(i)
42- else c)))
43- else if (if (k)
44- then true
45- else !(isDefined(j)))
46- then [StringEntry((d + "_winner"), g), IntegerEntry((d + "_winAmount"), l)]
47- else {
48- let m = addressFromStringValue(value(j))
49- let n = if (if ((h == "WAVES"))
50- then true
51- else (h == ""))
52- then unit
53- else fromBase58String(h)
54-[StringEntry((d + "_winner"), g), IntegerEntry((d + "_winAmount"), l), ScriptTransfer(m, value(i), n)]
55- }
7+func acceptBidOffer (b,c,d) = {
8+ let e = toBase58String(a.transactionId)
9+ let f = a.caller.bytes
10+ let g = fromBase58String(c)
11+ let h = getStringValue(this, (b + "_highest_bid"))
12+ let i = getStringValue(this, (b + "_winner_of_nft"))
13+[ScriptTransfer(Address(f), parseIntValue(h), unit), ScriptTransfer(Address(fromBase58String(i)), 1, g), StringEntry((e + "_amount_paid_to_owner"), h), StringEntry((e + "_nft_transfer_to"), i), StringEntry((e + "_nft_status"), "REWARDED"), StringEntry((b + "_amount_paid_to_owner"), h), StringEntry((b + "_nft_transfer_to"), i), StringEntry((b + "_nft_status"), "REWARDED")]
5614 }
5715
5816

github/deemru/w8io/026f985 
23.29 ms