tx · 4HnJUdhRFsoCD9ymTfmfSDQbJXFayBp3Gh6Cu9aCggR4

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.15 19:58 [1614989] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "4HnJUdhRFsoCD9ymTfmfSDQbJXFayBp3Gh6Cu9aCggR4", "fee": 1000000, "feeAssetId": null, "timestamp": 1626368328191, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "4LVx2i9zs9GYfGC4iaQb3NBttR1ioJo8tnmCAAkJRbCRtKJXgE7W4JpumPLwLmHTkpkdko6Va1mS8Y8aXqRFct5U" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAlCTE9DS1NURVAAAAAAAAAAAAoAAAAACUlOR09UQ09TVAAAAAAAAAAACgAAAAADUkVTAQAAACD3MI5LvZDW9hdsE5mwaJiKnQDcPy9bxLj3SQ9cNYQcswEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAEAAAAOR29sZE1pbmVyczIwMjEJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3R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EAAAAAAAAAAAAHCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAADUkVTAAAAAAAAAAAKCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAADbmZ0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxpbmdvdHNfY291bnQFAAAACW5ld0luZ290cwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAABmluZ290XwkAAaQAAAABBQAAAAluZXdJbmdvdHMJAAJYAAAAAQUAAAADbmZ0BQAAAANuaWwAAAAAUmuXVw==", "height": 1614989, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9p3A64kThR1jptuYhX8eTKvY4t1sgsLkHoD676d7dNRy Next: FwZQ6ea5UhPUtCnr3doyWupnW42F2tgFR4UATXKjPm3d Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 10
55
6-let b = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
6+let b = 10
77
8-func c (d) = {
9- let e = {
10- let f = getBinary(this, "lastPlay")
11- if ($isInstanceOf(f, "ByteVector"))
8+let c = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
9+
10+func d (e) = {
11+ let f = {
12+ let g = getBinary(this, "lastPlay")
13+ if ($isInstanceOf(g, "ByteVector"))
1214 then {
13- let g = f
14- g
15+ let h = g
16+ h
1517 }
16- else if ($isInstanceOf(f, "Unit"))
18+ else if ($isInstanceOf(g, "Unit"))
1719 then base58'TGCTLFoHxJ8U7rcUofN'
1820 else throw("Match error")
1921 }
20- let h = (((((e + d.transactionId) + d.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
21- sha256(h)
22+ let i = (((((f + e.transactionId) + e.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
23+ sha256(i)
2224 }
2325
2426
25-@Callable(i)
27+@Callable(j)
2628 func goToMine () = {
27- let j = toBase58String(i.caller.bytes)
28- let k = {
29- let f = getInteger(this, ("wait_" + j))
30- if ($isInstanceOf(f, "Int"))
29+ let k = toBase58String(j.caller.bytes)
30+ let l = {
31+ let g = getInteger(this, ("wait_" + k))
32+ if ($isInstanceOf(g, "Int"))
3133 then {
32- let l = f
33- l
34+ let m = g
35+ m
3436 }
3537 else 0
3638 }
37- let m = (lastBlock.height + a)
38- let n = c(i)
39- let o = (toInt(n) % 1000)
40- if ((k > lastBlock.height))
39+ let n = (lastBlock.height + a)
40+ let o = d(j)
41+ let p = (toInt(o) % 1000)
42+ if ((l > lastBlock.height))
4143 then throw((("Still wait block " + toString(lastBlock.height)) + " for mining"))
42- else [IntegerEntry(("wait_" + j), m), ScriptTransfer(i.caller, o, b)]
44+ else [IntegerEntry(("wait_" + k), n), ScriptTransfer(j.caller, p, c)]
4345 }
4446
4547
4648
47-@Callable(i)
49+@Callable(j)
4850 func craftIngot () = {
49- let j = toBase58String(i.caller.bytes)
50- let p = {
51- let f = getInteger(this, ("craft_" + j))
52- if ($isInstanceOf(f, "Int"))
51+ let k = toBase58String(j.caller.bytes)
52+ let q = {
53+ let g = getInteger(this, ("craft_" + k))
54+ if ($isInstanceOf(g, "Int"))
5355 then {
54- let l = f
55- l
56+ let m = g
57+ m
5658 }
5759 else 0
5860 }
59- let q = {
60- let f = getInteger(this, "ingots_count")
61- if ($isInstanceOf(f, "Int"))
61+ let r = {
62+ let g = getInteger(this, "ingots_count")
63+ if ($isInstanceOf(g, "Int"))
6264 then {
63- let l = f
64- l
65+ let m = g
66+ m
6567 }
6668 else 0
6769 }
68- let r = (q + 1)
69- let s = assetBalance(i.caller, b)
70- if ((10 > s))
71- then throw("Not enough, need 1000 pieces")
70+ let s = (r + 1)
71+ if ((size(j.payments) == 0))
72+ then throw("Payment not attached")
7273 else {
73- let t = Issue("DEMO", "DEMO", 1, 0, false)
74- let u = calculateAssetId(t)
75-[Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, u), IntegerEntry("ingots_count", r), StringEntry(("ingot_" + toString(r)), toBase58String(u))]
74+ let t = j.payments[0]
75+ if ((t.assetId != c))
76+ then throw("PAY IN RES TOKEN ONLY")
77+ else if ((t.amount != b))
78+ then throw((("PAY " + toString(b)) + " RES TOKEN ONLY"))
79+ else {
80+ let u = Issue("DEMO", "DEMO", 1, 0, false)
81+ let v = calculateAssetId(u)
82+[Issue(("INGOT" + toString(s)), ("INGOT" + toString(s)), 1, 0, false), Burn(c, 10), ScriptTransfer(j.caller, 1, v), IntegerEntry("ingots_count", s), StringEntry(("ingot_" + toString(s)), toBase58String(v))]
83+ }
7684 }
7785 }
7886
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 10
55
6-let b = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
6+let b = 10
77
8-func c (d) = {
9- let e = {
10- let f = getBinary(this, "lastPlay")
11- if ($isInstanceOf(f, "ByteVector"))
8+let c = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
9+
10+func d (e) = {
11+ let f = {
12+ let g = getBinary(this, "lastPlay")
13+ if ($isInstanceOf(g, "ByteVector"))
1214 then {
13- let g = f
14- g
15+ let h = g
16+ h
1517 }
16- else if ($isInstanceOf(f, "Unit"))
18+ else if ($isInstanceOf(g, "Unit"))
1719 then base58'TGCTLFoHxJ8U7rcUofN'
1820 else throw("Match error")
1921 }
20- let h = (((((e + d.transactionId) + d.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
21- sha256(h)
22+ let i = (((((f + e.transactionId) + e.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
23+ sha256(i)
2224 }
2325
2426
25-@Callable(i)
27+@Callable(j)
2628 func goToMine () = {
27- let j = toBase58String(i.caller.bytes)
28- let k = {
29- let f = getInteger(this, ("wait_" + j))
30- if ($isInstanceOf(f, "Int"))
29+ let k = toBase58String(j.caller.bytes)
30+ let l = {
31+ let g = getInteger(this, ("wait_" + k))
32+ if ($isInstanceOf(g, "Int"))
3133 then {
32- let l = f
33- l
34+ let m = g
35+ m
3436 }
3537 else 0
3638 }
37- let m = (lastBlock.height + a)
38- let n = c(i)
39- let o = (toInt(n) % 1000)
40- if ((k > lastBlock.height))
39+ let n = (lastBlock.height + a)
40+ let o = d(j)
41+ let p = (toInt(o) % 1000)
42+ if ((l > lastBlock.height))
4143 then throw((("Still wait block " + toString(lastBlock.height)) + " for mining"))
42- else [IntegerEntry(("wait_" + j), m), ScriptTransfer(i.caller, o, b)]
44+ else [IntegerEntry(("wait_" + k), n), ScriptTransfer(j.caller, p, c)]
4345 }
4446
4547
4648
47-@Callable(i)
49+@Callable(j)
4850 func craftIngot () = {
49- let j = toBase58String(i.caller.bytes)
50- let p = {
51- let f = getInteger(this, ("craft_" + j))
52- if ($isInstanceOf(f, "Int"))
51+ let k = toBase58String(j.caller.bytes)
52+ let q = {
53+ let g = getInteger(this, ("craft_" + k))
54+ if ($isInstanceOf(g, "Int"))
5355 then {
54- let l = f
55- l
56+ let m = g
57+ m
5658 }
5759 else 0
5860 }
59- let q = {
60- let f = getInteger(this, "ingots_count")
61- if ($isInstanceOf(f, "Int"))
61+ let r = {
62+ let g = getInteger(this, "ingots_count")
63+ if ($isInstanceOf(g, "Int"))
6264 then {
63- let l = f
64- l
65+ let m = g
66+ m
6567 }
6668 else 0
6769 }
68- let r = (q + 1)
69- let s = assetBalance(i.caller, b)
70- if ((10 > s))
71- then throw("Not enough, need 1000 pieces")
70+ let s = (r + 1)
71+ if ((size(j.payments) == 0))
72+ then throw("Payment not attached")
7273 else {
73- let t = Issue("DEMO", "DEMO", 1, 0, false)
74- let u = calculateAssetId(t)
75-[Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, u), IntegerEntry("ingots_count", r), StringEntry(("ingot_" + toString(r)), toBase58String(u))]
74+ let t = j.payments[0]
75+ if ((t.assetId != c))
76+ then throw("PAY IN RES TOKEN ONLY")
77+ else if ((t.amount != b))
78+ then throw((("PAY " + toString(b)) + " RES TOKEN ONLY"))
79+ else {
80+ let u = Issue("DEMO", "DEMO", 1, 0, false)
81+ let v = calculateAssetId(u)
82+[Issue(("INGOT" + toString(s)), ("INGOT" + toString(s)), 1, 0, false), Burn(c, 10), ScriptTransfer(j.caller, 1, v), IntegerEntry("ingots_count", s), StringEntry(("ingot_" + toString(s)), toBase58String(v))]
83+ }
7684 }
7785 }
7886
7987

github/deemru/w8io/169f3d6 
39.61 ms