tx · 6xctEujtSLfCNQALaaFT3bXnPmTUaqCzagwrCzX73QAf 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh: -0.01000000 Waves 2021.07.15 20:30 [1615019] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves
{ "type": 13, "id": "6xctEujtSLfCNQALaaFT3bXnPmTUaqCzagwrCzX73QAf", "fee": 1000000, "feeAssetId": null, "timestamp": 1626370263255, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "5XSEYqWPXYzpZeNzKu4CJxAA8pYS3RsvaGM86zM38oXZv6UxPDnCuNdxTE1gTwuQp8JK4AjoJZMSmDPsjfYFL4LM" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAlCTE9DS1NURVAAAAAAAAAAAAoAAAAACUlOR09UQ09TVAAAAAAAAAAACgAAAAADUkVTAQAAACD3MI5LvZDW9hdsE5mwaJiKnQDcPy9bxLj3SQ9cNYQcswEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAEAAAAOR29sZE1pbmVyczIwMjEJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABN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kdPVAkAAaQAAAABBQAAAAluZXdJbmdvdHMJAAEsAAAAAgIAAAAFSU5HT1QJAAGkAAAAAQUAAAAJbmV3SW5nb3RzAAAAAAAAAAABAAAAAAAAAAAABwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAA25mdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMaW5nb3RzX2NvdW50BQAAAAluZXdJbmdvdHMJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAAZpbmdvdF8JAAGkAAAAAQUAAAAJbmV3SW5nb3RzCQACWAAAAAEFAAAAA25mdAUAAAADbmlsAAAAAOWf0gQ=", "height": 1615019, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FwZQ6ea5UhPUtCnr3doyWupnW42F2tgFR4UATXKjPm3d Next: GSNYATbMQHiuL8haQzBnZ6rdzSDovVvmCJ44RNq5XfuW Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | let randhash = randomizer(i) | |
35 | 35 | let count = (toInt(randhash) % 1000) | |
36 | 36 | if ((wait > lastBlock.height)) | |
37 | - | then throw((("Still wait block " + toString( | |
37 | + | then throw((("Still wait block " + toString(newWait)) + " for mining")) | |
38 | 38 | else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, RES)] | |
39 | 39 | } | |
40 | 40 | ||
67 | 67 | else { | |
68 | 68 | let issue = Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false) | |
69 | 69 | let nft = calculateAssetId(issue) | |
70 | - | [Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false | |
70 | + | [Burn(RES, 10), Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))] | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let BLOCKSTEP = 10 | |
5 | 5 | ||
6 | 6 | let INGOTCOST = 10 | |
7 | 7 | ||
8 | 8 | let RES = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4' | |
9 | 9 | ||
10 | 10 | func randomizer (inv) = { | |
11 | 11 | let lastPlay = match getBinary(this, "lastPlay") { | |
12 | 12 | case s: ByteVector => | |
13 | 13 | s | |
14 | 14 | case _: Unit => | |
15 | 15 | base58'TGCTLFoHxJ8U7rcUofN' | |
16 | 16 | case _ => | |
17 | 17 | throw("Match error") | |
18 | 18 | } | |
19 | 19 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
20 | 20 | sha256(rand) | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func goToMine () = { | |
26 | 26 | let caller = toBase58String(i.caller.bytes) | |
27 | 27 | let wait = match getInteger(this, ("wait_" + caller)) { | |
28 | 28 | case a: Int => | |
29 | 29 | a | |
30 | 30 | case _ => | |
31 | 31 | 0 | |
32 | 32 | } | |
33 | 33 | let newWait = (lastBlock.height + BLOCKSTEP) | |
34 | 34 | let randhash = randomizer(i) | |
35 | 35 | let count = (toInt(randhash) % 1000) | |
36 | 36 | if ((wait > lastBlock.height)) | |
37 | - | then throw((("Still wait block " + toString( | |
37 | + | then throw((("Still wait block " + toString(newWait)) + " for mining")) | |
38 | 38 | else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, RES)] | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func craftIngot () = { | |
45 | 45 | let caller = toBase58String(i.caller.bytes) | |
46 | 46 | let craft = match getInteger(this, ("craft_" + caller)) { | |
47 | 47 | case a: Int => | |
48 | 48 | a | |
49 | 49 | case _ => | |
50 | 50 | 0 | |
51 | 51 | } | |
52 | 52 | let ingots = match getInteger(this, "ingots_count") { | |
53 | 53 | case a: Int => | |
54 | 54 | a | |
55 | 55 | case _ => | |
56 | 56 | 0 | |
57 | 57 | } | |
58 | 58 | let newIngots = (ingots + 1) | |
59 | 59 | if ((size(i.payments) == 0)) | |
60 | 60 | then throw("Payment not attached") | |
61 | 61 | else { | |
62 | 62 | let payment = i.payments[0] | |
63 | 63 | if ((payment.assetId != RES)) | |
64 | 64 | then throw("PAY IN RES TOKEN ONLY") | |
65 | 65 | else if ((payment.amount != INGOTCOST)) | |
66 | 66 | then throw((("PAY " + toString(INGOTCOST)) + " RES TOKEN ONLY")) | |
67 | 67 | else { | |
68 | 68 | let issue = Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false) | |
69 | 69 | let nft = calculateAssetId(issue) | |
70 | - | [Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false | |
70 | + | [Burn(RES, 10), Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))] | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 |
github/deemru/w8io/026f985 24.10 ms ◑