tx · FoJNUch4bHidwq3B1167mNorBoeDK467y96S288aqcmW 3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J: -0.01000000 Waves 2021.09.25 21:27 [1718839] smart account 3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J > SELF 0.00000000 Waves
{ "type": 13, "id": "FoJNUch4bHidwq3B1167mNorBoeDK467y96S288aqcmW", "fee": 1000000, "feeAssetId": null, "timestamp": 1632594502034, "version": 2, "chainId": 84, "sender": "3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J", "senderPublicKey": "EkHiMGjZnobhmra42ocG6pxLtFnuq8oPJw2cR7hVSTM1", "proofs": [ "3ydwuzAg5JY2bT892Ce78byFQB5FDhDdmr2Vna9tJSGvb3vT7pbJQ3qUoQCZMU82d6hrbPX3WzrJ44D5yQAnqhbB" ], "script": "base64:AAIFAAAAAAAAAKEIAhIAGhAKAmExEgpyYW5kb21pemVyGgkKAmEyEgNpbnYaDgoCYTMSCGxhc3RQbGF5Gg0KAmE0EgckbWF0Y2gwGgcKAmE1EgFzGgoKAmE2EgRyYW5kGg8KAmE3EglwbGF5TGltaXQaDQoCYTgSB3BheW1lbnQaDgoCYTkSCHJhbmRoYXNoGgsKAmIxEgVhc3NldBoNCgJiMhIHYXNzZXRJZAAAAAEBAAAAAmExAAAAAQAAAAJhMgQAAAACYTMEAAAAAmE0CQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAJhNAIAAAAKQnl0ZVZlY3RvcgQAAAACYTUFAAAAAmE0BQAAAAJhNQMJAAABAAAAAgUAAAACYTQCAAAABFVuaXQBAAAADFdhdmVzTG90dG9WMgkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAACYTYJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAJhMwgFAAAAAmEyAAAADXRyYW5zYWN0aW9uSWQIBQAAAAJhMgAAAA9jYWxsZXJQ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AkABEwAAAACCQEAAAALQmluYXJ5RW50cnkAAAACAgAAAAhsYXN0UGxheQUAAAACYTkFAAAAA25pbAAAAABstt8z", "height": 1718839, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8jCSC1JHw6BFJkCAbBaVvTRRYDmNCbmw2Dh8SRnWmDcv Next: 8ePMUgEEDzUN3Nyws2mPh1RMkzEADnCXNjJcojfVsaxJ Diff:
Old | New | Differences | |
---|---|---|---|
31 | 31 | then { | |
32 | 32 | let asset = Issue("Unique Asset", "Test NFT", 1, 0, false, unit, height) | |
33 | 33 | let assetId = calculateAssetId(asset) | |
34 | - | [ | |
34 | + | [BinaryEntry("lastPlay", randhash), asset, ScriptTransfer(inv.caller, 1, assetId)] | |
35 | 35 | } | |
36 | - | else [ | |
36 | + | else [BinaryEntry("lastPlay", randhash)] | |
37 | 37 | } | |
38 | 38 | } | |
39 | 39 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func randomizer (inv) = { | |
5 | 5 | let lastPlay = match getBinary(this, "lastPlay") { | |
6 | 6 | case s: ByteVector => | |
7 | 7 | s | |
8 | 8 | case _: Unit => | |
9 | 9 | base58'2ee4oFDYriWJ9EMeR' | |
10 | 10 | case _ => | |
11 | 11 | throw("Match error") | |
12 | 12 | } | |
13 | 13 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
14 | 14 | sha256(rand) | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | @Callable(inv) | |
19 | 19 | func lotto () = { | |
20 | 20 | let playLimit = wavesBalance(this).available | |
21 | 21 | let payment = inv.payments[0] | |
22 | 22 | if (!(isDefined(payment))) | |
23 | 23 | then throw("Should be with Payment in Waves") | |
24 | 24 | else if (isDefined(payment.assetId)) | |
25 | 25 | then throw("Payment should be in Waves") | |
26 | 26 | else if ((payment.amount > playLimit)) | |
27 | 27 | then throw(("Payment should be less than " + toString(playLimit))) | |
28 | 28 | else { | |
29 | 29 | let randhash = randomizer(inv) | |
30 | 30 | if ((500 > (toInt(randhash) % 1000))) | |
31 | 31 | then { | |
32 | 32 | let asset = Issue("Unique Asset", "Test NFT", 1, 0, false, unit, height) | |
33 | 33 | let assetId = calculateAssetId(asset) | |
34 | - | [ | |
34 | + | [BinaryEntry("lastPlay", randhash), asset, ScriptTransfer(inv.caller, 1, assetId)] | |
35 | 35 | } | |
36 | - | else [ | |
36 | + | else [BinaryEntry("lastPlay", randhash)] | |
37 | 37 | } | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 |
github/deemru/w8io/026f985 41.03 ms ◑