tx · 6Td6sXKS2z8xyu3MAiLg3A4Uffs6o3pHdQMvhdTc7g1Y

3N9hD7PnazZB7wbwFmr7fw28UKXj593YmTR:  -0.01400000 Waves

2022.08.18 21:10 [2190262] smart account 3N9hD7PnazZB7wbwFmr7fw28UKXj593YmTR > SELF 0.00000000 Waves

{ "type": 13, "id": "6Td6sXKS2z8xyu3MAiLg3A4Uffs6o3pHdQMvhdTc7g1Y", "fee": 1400000, "feeAssetId": null, "timestamp": 1660846285530, "version": 2, "chainId": 84, "sender": "3N9hD7PnazZB7wbwFmr7fw28UKXj593YmTR", "senderPublicKey": "FpRE1aaMXMppRqybhnDRqxp6bkwMczDupk9vbqJHddyr", "proofs": [ "2oEP46B4pv72zTK2QjBBZKpKiEAdcGSFYbYsok6187J4jsVJeNUXPGEa37t4J79s6YgVAwYSHJtyVGQ8inR3Uoz7" ], "script": null, "height": 2190262, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: cVKR6ECmRVLz7wY73EKrDqFqqTxB1pnznVpfhhZ4ppe Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let a = base58'3MxZPzVdHQYNjp99N7VRuR4RLmJUqnDg9ok'
5-
6-let b = base58'4MhpjsP1MPpC49v6zBr7eAAEPZdmHWcrSqcSv8tZcpjo'
7-
8-func c (d) = {
9- let e = getInteger(this, d)
10- if ($isInstanceOf(e, "Int"))
11- then {
12- let f = e
13- f
14- }
15- else 0
16- }
17-
18-
19-func g (d) = {
20- let e = getBoolean(this, d)
21- if ($isInstanceOf(e, "Boolean"))
22- then {
23- let f = e
24- f
25- }
26- else false
27- }
28-
29-
30-func h (i) = {
31- let e = i
32- if ($isInstanceOf(e, "ByteVector"))
33- then {
34- let f = e
35- toBase58String(f)
36- }
37- else "WAVES"
38- }
39-
40-
41-func j (d) = {
42- let e = getString(this, d)
43- if ($isInstanceOf(e, "String"))
44- then {
45- let f = e
46- f
47- }
48- else ""
49- }
50-
51-
52-func k (d) = {
53- let e = getBinary(this, d)
54- if ($isInstanceOf(e, "ByteVector"))
55- then {
56- let f = e
57- f
58- }
59- else base58''
60- }
61-
62-
63-func l (m) = if ((m == "WAVES"))
64- then unit
65- else fromBase58String(m)
66-
67-
68-@Callable(n)
69-func createFurnace (o) = if ((toBase58String(n.caller.bytes) != toBase58String(a)))
70- then throw("You cannot create furnace")
71- else if ((size(n.payments) != 1))
72- then throw("You should to provide reward")
73- else {
74- let p = n.payments[0].amount
75- let q = n.payments[0].assetId
76- let r = (c("global_furnacesAmount") + 1)
77- let s = toString(r)
78-[IntegerEntry("global_furnacesAmount", r), IntegerEntry((("furnace_" + s) + "_lifetime"), o), IntegerEntry((("furnace_" + s) + "_rewardAmount"), p), StringEntry((("furnace_" + s) + "_rewardAssetId"), h(q))]
79- }
80-
81-
82-
83-@Callable(n)
84-func burn (s) = {
85- let t = g((("furnace_" + s) + "_finished"))
86- let o = c((("furnace_" + s) + "_lifetime"))
87- let u = c((("furnace_" + s) + "_lastBurn"))
88- let v = (u + o)
89- if (t)
90- then throw("Already finished")
91- else if ((o == 0))
92- then throw("Cannot find furnace")
93- else if (if ((u > 0))
94- then (height >= v)
95- else false)
96- then throw("Time is run out")
97- else if ((size(n.payments) != 1))
98- then throw("You should to provide payment")
99- else if ((n.payments[0].assetId != b))
100- then throw("Invalid coal")
101- else if ((n.payments[0].amount != 1))
102- then throw("You can burn only 1 coal")
103- else {
104- let w = toBase58String(n.caller.bytes)
105-[Burn(b, n.payments[0].amount), IntegerEntry((("furnace_" + s) + "_lastBurn"), height), StringEntry((("furnace_" + s) + "_lastStoker"), w)]
106- }
107- }
108-
109-
110-
111-@Callable(n)
112-func claim (s) = {
113- let t = g((("furnace_" + s) + "_finished"))
114- let o = c((("furnace_" + s) + "_lifetime"))
115- let u = c((("furnace_" + s) + "_lastBurn"))
116- let x = j((("furnace_" + s) + "_rewardAssetId"))
117- let y = j((("furnace_" + s) + "_lastStoker"))
118- let p = c((("furnace_" + s) + "_rewardAmount"))
119- let z = (u + o)
120- if (t)
121- then throw("Already finished")
122- else if ((o == 0))
123- then throw("Cannot find furnace")
124- else if ((u == 0))
125- then throw("Furnace not found")
126- else if ((z > height))
127- then throw("Time has not run out")
128- else if ((x == ""))
129- then throw("Cannot find reward asset")
130- else if ((y == ""))
131- then throw("Cannot find last stoker")
132- else if ((p == 0))
133- then throw("Reward already sent to winner")
134- else [BooleanEntry((("furnace_" + s) + "_finished"), true), ScriptTransfer(Address(fromBase58String(y)), p, l(x))]
135- }
136-
137-
138-@Verifier(A)
139-func B () = sigVerify(A.bodyBytes, A.proofs[0], A.senderPublicKey)
140-
1+# no script

github/deemru/w8io/03bedc9 
38.90 ms