tx · Db4PnE5XGWNjgATGPUxpWim8cvEq5MBDEFiqL9UPAxay

3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J:  -0.01000000 Waves

2021.09.26 19:13 [1720150] smart account 3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J > SELF 0.00000000 Waves

{ "type": 13, "id": "Db4PnE5XGWNjgATGPUxpWim8cvEq5MBDEFiqL9UPAxay", "fee": 1000000, "feeAssetId": null, "timestamp": 1632672890020, "version": 2, "chainId": 84, "sender": "3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J", "senderPublicKey": "EkHiMGjZnobhmra42ocG6pxLtFnuq8oPJw2cR7hVSTM1", "proofs": [ "rsEQC6SZ2fLbdwnBgWeqNFnbBfYXeqmRGijbQ3m4eojsxzkxRr6sCJMtcF4R1zvaPvwjh5pJBnbF9C1HkWhwEFx" ], "script": "base64:AAIFAAAAAAAAAKoIAhIAGhAKAmExEgpyYW5kb21pemVyGgkKAmEyEgNpbnYaDgoCYTMSCGxhc3RQbGF5Gg0KAmE0EgckbWF0Y2gwGgcKAmE1EgFzGgoKAmE2EgRyYW5kGg4KAmE3EghyYW5kaGFzaBoKCgJhOBIEdHlwZRoPCgJhORIJY2FyZEluZGV4GgoKAmIxEgRjYXJkGgsKAmIyEgVhc3NldBoNCgJiMxIHYXNzZXRJZAAAAAEBAAAAAmExAAAAAQAAAAJhMgQAAAACYTMEAAAAAmE0CQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAJhNAIAAAAKQnl0ZVZlY3RvcgQAAAACYTUFAAAAAmE0BQAAAAJhNQMJAAABAAAAAgUAAAACYTQCAAAABFVuaXQBAAAADFdhdmVzTG90dG9WMgkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAACYTYJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAJhMwgFAAAAAmEyAAAADXRyYW5zYWN0aW9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JhOAUAAAADbmlsAgAAAAEgCQAEuQAAAAIJAARMAAAAAgIAAAAEQ2FyZAkABEwAAAACBQAAAAJiMQkABEwAAAACBQAAAAJhOAUAAAADbmlsAgAAAAEgAAAAAAAAAAABAAAAAAAAAAAABwUAAAAEdW5pdAUAAAAGaGVpZ2h0BAAAAAJiMwkABDgAAAABBQAAAAJiMgkABEwAAAACCQEAAAALQmluYXJ5RW50cnkAAAACAgAAAAhsYXN0UGxheQUAAAACYTcJAARMAAAAAgUAAAACYjIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmEyAAAABmNhbGxlcgAAAAAAAAAAAQUAAAACYjMFAAAAA25pbAAAAAC7Y7Ix", "height": 1720150, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bygu5BMVAKYsdUETsm2JFCArtJcigMp9X5GK6Uo9zmiB Next: none Diff:
OldNewDifferences
2222 then throw("Should be with Payment in Waves")
2323 else {
2424 let randhash = randomizer(inv)
25- if ((500 > (toInt(randhash) % 1000)))
26- then {
27- let asset = Issue("Unique Asset", "10 ♣ ♤ ♥ ♦", 1, 0, false, unit, height)
28- let assetId = calculateAssetId(asset)
25+ let type = match ((toInt(randhash) / 13) % 4) {
26+ case _ =>
27+ if ((0 == $match0))
28+ then "♣"
29+ else if ((1 == $match0))
30+ then "♥"
31+ else if ((2 == $match0))
32+ then "♦"
33+ else "♤"
34+ }
35+ let cardIndex = ((toInt(randhash) % 13) + 1)
36+ let card = match cardIndex {
37+ case _ =>
38+ if ((1 == $match0))
39+ then "A"
40+ else if ((11 == $match0))
41+ then "J"
42+ else if ((12 == $match0))
43+ then "D"
44+ else if ((13 == $match0))
45+ then "K"
46+ else toString(cardIndex)
47+ }
48+ let asset = Issue(makeString([card, type], " "), makeString(["Card", card, type], " "), 1, 0, false, unit, height)
49+ let assetId = calculateAssetId(asset)
2950 [BinaryEntry("lastPlay", randhash), asset, ScriptTransfer(inv.caller, 1, assetId)]
30- }
31- else [BinaryEntry("lastPlay", randhash)]
3251 }
3352
3453
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func randomizer (inv) = {
55 let lastPlay = match getBinary(this, "lastPlay") {
66 case s: ByteVector =>
77 s
88 case _: Unit =>
99 base58'2ee4oFDYriWJ9EMeR'
1010 case _ =>
1111 throw("Match error")
1212 }
1313 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1414 sha256(rand)
1515 }
1616
1717
1818 @Callable(inv)
1919 func default () = if (if ((size(inv.payments) == 0))
2020 then true
2121 else isDefined(inv.payments[0].assetId))
2222 then throw("Should be with Payment in Waves")
2323 else {
2424 let randhash = randomizer(inv)
25- if ((500 > (toInt(randhash) % 1000)))
26- then {
27- let asset = Issue("Unique Asset", "10 ♣ ♤ ♥ ♦", 1, 0, false, unit, height)
28- let assetId = calculateAssetId(asset)
25+ let type = match ((toInt(randhash) / 13) % 4) {
26+ case _ =>
27+ if ((0 == $match0))
28+ then "♣"
29+ else if ((1 == $match0))
30+ then "♥"
31+ else if ((2 == $match0))
32+ then "♦"
33+ else "♤"
34+ }
35+ let cardIndex = ((toInt(randhash) % 13) + 1)
36+ let card = match cardIndex {
37+ case _ =>
38+ if ((1 == $match0))
39+ then "A"
40+ else if ((11 == $match0))
41+ then "J"
42+ else if ((12 == $match0))
43+ then "D"
44+ else if ((13 == $match0))
45+ then "K"
46+ else toString(cardIndex)
47+ }
48+ let asset = Issue(makeString([card, type], " "), makeString(["Card", card, type], " "), 1, 0, false, unit, height)
49+ let assetId = calculateAssetId(asset)
2950 [BinaryEntry("lastPlay", randhash), asset, ScriptTransfer(inv.caller, 1, assetId)]
30- }
31- else [BinaryEntry("lastPlay", randhash)]
3251 }
3352
3453

github/deemru/w8io/026f985 
27.83 ms