tx · 7At5dpMZZ2gyjnm6wrSaFSGoMBVj4pBV1azMnTVPAwZd

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.12.02 13:14 [2342595] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "7At5dpMZZ2gyjnm6wrSaFSGoMBVj4pBV1azMnTVPAwZd", "fee": 1000000, "feeAssetId": null, "timestamp": 1669976060695, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "4871Rhox3ojMNXH4mfVdSPyo9tjLH4MPmtfeLNc3D2JZ5QPgkJDVonWBkQ48aadgAgdJERjt17ww336thggNRJc6" ], "script": "base64:BgISCAISBAoCAQESAwoBCBIDCgEIAQASbWF4QXVjdGlvbkR1cmF0aW9uAAcDAWkBDHN0YXJ0QXVjdGlvbgIIZHVyYXRpb24Kc3RhcnRQcmljZQQJYXVjdGlvbklkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQECWVuZEhlaWdodAkAZAIIBQlsYXN0QmxvY2sGaGVpZ2h0BQhkdXJhdGlvbgQDcG10CQEFdmFsdWUBCQCRAwIIBQFpCHBheW1lbnRzAAADCQBmAgUIZHVyYXRpb24FEm1heEF1Y3Rpb25EdXJhdGlvbgkAAgEJAKwCAgIoRHVyYXRpb24gaXMgdG9vIGxvbmcuIE11c3QgYmUgbGVzcyB0aGFuIAkApAMBBRJtYXhBdWN0aW9uRHVyYXRpb24JAMwIAgkBDEludGVnZXJFbnRyeQIFCWF1Y3Rpb25JZAUJZW5kSGVpZ2h0CQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgpfb3JnYW5pemVyCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICB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m5lckFkZHIFCWxvdEFtb3VudAUIbG90QXNzZXQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUNb3JnYW5pemVyQWRkcgUJd2luQW1vdW50BQpwcmljZUFzc2V0BQNuaWwAwKXLEg==", "height": 2342595, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4WqTPsAurkDKw5Pw24HKqiqe5NAqsYYxzrQYnp7YWWFq Next: GqX7Wqar3CeW3K2XpXcyJNhtHBYqQGhsfKWtZqi63K8b Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = 7
5+
6+@Callable(b)
7+func startAuction (c,d) = {
8+ let e = toBase58String(b.transactionId)
9+ let f = (lastBlock.height + c)
10+ let g = value(b.payments[0])
11+ if ((c > a))
12+ then throw(("Duration is too long. Must be less than " + toString(a)))
13+ else [IntegerEntry(e, f), StringEntry((e + "_organizer"), toBase58String(b.caller.bytes)), StringEntry((e + "_lot_assetId"), if (isDefined(g.assetId))
14+ then toBase58String(value(g.assetId))
15+ else "WAVES"), IntegerEntry((e + "_lot_amount"), g.amount), IntegerEntry((e + "_startPrice"), d)]
16+ }
417
518
6-@Callable(a)
7-func bid (b) = {
8- let c = value(a.payments[0])
9- let d = if (isDefined(c.assetId))
10- then toBase58String(value(c.assetId))
19+
20+@Callable(b)
21+func bid (e) = {
22+ let g = value(b.payments[0])
23+ let h = if (isDefined(g.assetId))
24+ then toBase58String(value(g.assetId))
1125 else "WAVES"
12- let e = toBase58String(a.caller.bytes)
13- let f = getIntegerValue(this, b)
14- let g = getIntegerValue(this, (b + "_startPrice"))
15- let h = getStringValue(this, (b + "_priceAssetId"))
16- let i = getInteger(this, (b + "_winAmount"))
17- let j = getString(this, (b + "_winner"))
18- let k = if (isDefined(j))
19- then (value(j) == e)
26+ let i = toBase58String(b.caller.bytes)
27+ let f = getIntegerValue(this, e)
28+ let d = getIntegerValue(this, (e + "_startPrice"))
29+ let j = getStringValue(this, (e + "_priceAssetId"))
30+ let k = getInteger(this, (e + "_winAmount"))
31+ let l = getString(this, (e + "_winner"))
32+ let m = if (isDefined(l))
33+ then (value(l) == i)
2034 else false
21- let l = (c.amount + (if (k)
22- then value(i)
35+ let n = (g.amount + (if (m)
36+ then value(k)
2337 else 0))
2438 if ((lastBlock.height >= f))
2539 then throw("Auction already finished")
26- else if ((h != d))
27- then throw((("Bid must be in asset '" + h) + "'"))
28- else if (if (if (isDefined(i))
29- then (value(i) >= l)
40+ else if ((j != h))
41+ then throw((("Bid must be in asset '" + j) + "'"))
42+ else if (if (if (isDefined(k))
43+ then (value(k) >= n)
3044 else false)
3145 then true
32- else if (!(isDefined(i)))
33- then (g >= l)
46+ else if (!(isDefined(k)))
47+ then (d >= n)
3448 else false)
35- then throw(("Bid must be more then " + toString(if (isDefined(i))
36- then value(i)
37- else g)))
38- else if (if (k)
49+ then throw(("Bid must be more then " + toString(if (isDefined(k))
50+ then value(k)
51+ else d)))
52+ else if (if (m)
3953 then true
40- else !(isDefined(j)))
41- then [StringEntry((b + "_winner"), e), IntegerEntry((b + "_winAmount"), l)]
54+ else !(isDefined(l)))
55+ then [StringEntry((e + "_winner"), i), IntegerEntry((e + "_winAmount"), n)]
4256 else {
43- let m = addressFromStringValue(value(j))
44- let n = if (if ((h == "WAVES"))
57+ let o = addressFromStringValue(value(l))
58+ let p = if (if ((j == "WAVES"))
4559 then true
46- else (h == ""))
60+ else (j == ""))
4761 then unit
48- else fromBase58String(h)
49-[StringEntry((b + "_winner"), e), IntegerEntry((b + "_winAmount"), l), ScriptTransfer(m, value(i), n)]
62+ else fromBase58String(j)
63+[StringEntry((e + "_winner"), i), IntegerEntry((e + "_winAmount"), n), ScriptTransfer(o, value(k), p)]
5064 }
65+ }
66+
67+
68+
69+@Callable(b)
70+func withdraw (e) = {
71+ let g = value(b.payments[0])
72+ let h = if (isDefined(g.assetId))
73+ then toBase58String(value(g.assetId))
74+ else "WAVES"
75+ let i = toBase58String(b.caller.bytes)
76+ let f = getIntegerValue(this, e)
77+ let q = getStringValue(this, (e + "_organizer"))
78+ let l = getString(this, (e + "_winner"))
79+ let r = getStringValue(this, (e + "_lot_assetId"))
80+ let s = getIntegerValue(this, (e + "_lot_amount"))
81+ let j = getStringValue(this, (e + "_priceAssetId"))
82+ let k = getIntegerValue(this, (e + "_winAmount"))
83+ let t = if ((r == "WAVES"))
84+ then unit
85+ else fromBase58String(r)
86+ let p = if (if ((j == "WAVES"))
87+ then true
88+ else (j == ""))
89+ then unit
90+ else fromBase58String(j)
91+ let u = addressFromStringValue(value(l))
92+ let v = addressFromStringValue(value(q))
93+ let w = getInteger(this, ((e + "_bidder_") + i))
94+ if ((f > lastBlock.height))
95+ then throw("Auction is not finished yet")
96+ else if (!(isDefined(l)))
97+ then if (isDefined(getString(this, (e + "_lot_passed"))))
98+ then throw("Organizer has already got his lot back")
99+ else [StringEntry((e + "_lot_passed"), q), ScriptTransfer(v, s, t)]
100+ else if (isDefined(getString(this, (e + "_lot_passed"))))
101+ then throw("Lot is already passed to the winner, and organizer got his reward")
102+ else [StringEntry((e + "_lot_passed"), toBase58String(u.bytes)), ScriptTransfer(u, s, t), ScriptTransfer(v, k, p)]
51103 }
52104
53105

github/deemru/w8io/026f985 
33.28 ms