tx · 3PATYRBvW1eqntrTjwRhPxJMQ2udWogCfqHBX88Esp1J

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.11.30 17:50 [2339974] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "3PATYRBvW1eqntrTjwRhPxJMQ2udWogCfqHBX88Esp1J", "fee": 1000000, "feeAssetId": null, "timestamp": 1669819792833, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "3hvLC48DUQp6JSttkwB7zT9v7DTzDuho5RsJ2SnVacmAZieonafhJ6stRW2E2r4hPCUb9nx1XcCCreTvgJXXiwAW" ], "script": "base64:BgIECAISAAMACHNyY1Rva2VuASDrDORiL78bfnLZD9yQPcKtl1WDneElHcPWa5Q89KYjBQAIZHN0VG9rZW4BIHuQGmnVEyOcsKL8y7H43/pBbyVsZO5cGLxU2tkA8570AAdtZXNzYWdlAiFUaGFuayB5b3UgZm9yIHVzaW5nIHRoZSBTV0FQIERBcHABAWkBBHN3YXAABANwbXQJAQV2YWx1ZQEJAJEDAggFAWkIcGF5bWVudHMAAAMJAQIhPQIIBQNwbXQHYXNzZXRJZAUIc3JjVG9rZW4JAAIBAhdJbmNvcnJlY3QgYXNzZXQgcGFzc2VkLgkAzAgCCQELU3RyaW5nRW50cnkCAgdtZXNzYWdlCQCsAgIJAKwCAgIfPGgxPllvdSBkaWQgYSBzd2FwITwvaDE+PGJyPjxwPgUHbWVzc2FnZQIDPHA+CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcggFA3BtdAZhbW91bnQFCGRzdFRva2VuBQNuaWwBAnR4AQZ2ZXJpZnkABAckbWF0Y2gwBQJ0eAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlea/5pv4=", "height": 2339974, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bgkz9vQtpSJv2EoTS7GBsMyHQFA1qwK9YfgBcUgRJ6mt Next: CFX9BLfo98YfWYQdqrLAPxQvSuMs2ohhSUQUurdAE532 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 7
4+let a = base58'GpYDEF3wvpq8eGtk8EA5nUTWrpYnAnHmkrFoHAa1exf6'
55
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)]
6+let b = base58'9KLbMrNFxAToNzXvm517165sbNjmKdTNMvjgoxEyx62F'
7+
8+let c = "Thank you for using the SWAP DApp"
9+
10+@Callable(d)
11+func swap () = {
12+ let e = value(d.payments[0])
13+ if ((e.assetId != a))
14+ then throw("Incorrect asset passed.")
15+ else [StringEntry("message", (("<h1>You did a swap!</h1><br><p>" + c) + "<p>")), ScriptTransfer(d.caller, e.amount, b)]
1616 }
1717
1818
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))
25- else "WAVES"
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)
34- else false
35- let n = (g.amount + (if (m)
36- then value(k)
37- else 0))
38- if ((lastBlock.height >= f))
39- then throw("Auction already finished")
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)
44- else false)
45- then true
46- else if (!(isDefined(k)))
47- then (d >= n)
48- else false)
49- then throw(("Bid must be more then " + toString(if (isDefined(k))
50- then value(k)
51- else d)))
52- else if (if (m)
53- then true
54- else !(isDefined(l)))
55- then [StringEntry((e + "_winner"), i), IntegerEntry((e + "_winAmount"), n)]
56- else {
57- let o = addressFromStringValue(value(l))
58- let p = if (if ((j == "WAVES"))
59- then true
60- else (j == ""))
61- then unit
62- else fromBase58String(j)
63-[StringEntry((e + "_winner"), i), IntegerEntry((e + "_winAmount"), n), ScriptTransfer(o, value(k), p)]
64- }
19+@Verifier(f)
20+func g () = {
21+ let h = f
22+ sigVerify(f.bodyBytes, f.proofs[0], f.senderPublicKey)
6523 }
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)]
103- }
104-
10524

github/deemru/w8io/026f985 
29.31 ms