tx · 9wDCCbs1kes3bu1iiV7S9gKk8Qz3fiEJN9hi6YAZZger
3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J: -0.01000000 Waves
2021.09.25 21:35 [1718848] smart account 3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J > SELF 0.00000000 Waves
{
"type": 13,
"id": "9wDCCbs1kes3bu1iiV7S9gKk8Qz3fiEJN9hi6YAZZger",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1632595028549,
"version": 2,
"chainId": 84,
"sender": "3N8vbCi8fbBq4cY8L3AWqQeq7VJR5FxvR7J",
"senderPublicKey": "EkHiMGjZnobhmra42ocG6pxLtFnuq8oPJw2cR7hVSTM1",
"proofs": [
"dAwwSCkCczGJs863mSF9mRFEcLcFQwSs9moBAwtWqWkY9q1ix8kQDkHwNGFeA3n73JiRfX9SdSeARVnJcirYbGN"
],
"script": "base64:AAIFAAAAAAAAAIEIAhIAGhAKAmExEgpyYW5kb21pemVyGgkKAmEyEgNpbnYaDgoCYTMSCGxhc3RQbGF5Gg0KAmE0EgckbWF0Y2gwGgcKAmE1EgFzGgoKAmE2EgRyYW5kGg4KAmE3EghyYW5kaGFzaBoLCgJhOBIFYXNzZXQaDQoCYTkSB2Fzc2V0SWQAAAABAQAAAAJhMQAAAAEAAAACYTIEAAAAAmEzBAAAAAJhNAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAACYTQCAAAACkJ5dGVWZWN0b3IEAAAAAmE1BQAAAAJhNAUAAAACYTUDCQAAAQAAAAIFAAAAAmE0AgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAAAmE2CQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAACYTMIBQAAAAJhMgAAAA10cmFuc2FjdGlvbklkCAUAAAACYTIAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAH3AAAAAQUAAAACYTYAAAABAAAAAmEyAQAAAAVsb3R0bwAAAAADAwkAAAAAAAACCQABkAAAAAEIBQAAAAJhMgAAAAhwYXltZW50cwAAAAAAAAAAAAYJAQAAAAlpc0RlZmluZWQAAAABCQABkQAAAAIIBQAAAAJhMgAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAAB9TaG91bGQgYmUgd2l0aCBQYXltZW50IGluIFdhdmVzBAAAAAJhNwkBAAAAAmExAAAAAQUAAAACYTIDCQAAZgAAAAIAAAAAAAAAAfQJAABqAAAAAgkABLEAAAABBQAAAAJhNwAAAAAAAAAD6AQAAAACYTgJAARDAAAABwIAAAAMVW5pcXVlIEFzc2V0AgAAAAhUZXN0IE5GVAAAAAAAAAAAAQAAAAAAAAAAAAcFAAAABHVuaXQFAAAABmhlaWdodAQAAAACYTkJAAQ4AAAAAQUAAAACYTgJAARMAAAAAgkBAAAAC0JpbmFyeUVudHJ5AAAAAgIAAAAIbGFzdFBsYXkFAAAAAmE3CQAETAAAAAIFAAAAAmE4CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMgAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAAmE5BQAAAANuaWwJAARMAAAAAgkBAAAAC0JpbmFyeUVudHJ5AAAAAgIAAAAIbGFzdFBsYXkFAAAAAmE3BQAAAANuaWwAAAAA8gtbSg==",
"height": 1718848,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: GgFxgiMzCKujQfjVKzady9R5uk1gag4PDtYNb1XmTnsm
Next: 6qdn8hyP3gFUsGczQrQ6E7BsXefPSMeXGdDmoyQQoNUE
Diff:
Old | New | | Differences |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | 18 | | @Callable(inv) |
---|
19 | | - | func lotto () = if (if ((size(inv.payments) != 1)) |
---|
| 19 | + | func lotto () = if (if ((size(inv.payments) == 0)) |
---|
20 | 20 | | then true |
---|
21 | 21 | | else isDefined(inv.payments[0])) |
---|
22 | 22 | | then throw("Should be with Payment in Waves") |
---|
Full:
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 | | - | func lotto () = if (if ((size(inv.payments) != 1)) |
---|
| 19 | + | func lotto () = if (if ((size(inv.payments) == 0)) |
---|
20 | 20 | | then true |
---|
21 | 21 | | else isDefined(inv.payments[0])) |
---|
22 | 22 | | then throw("Should be with Payment in Waves") |
---|
23 | 23 | | else { |
---|
24 | 24 | | let randhash = randomizer(inv) |
---|
25 | 25 | | if ((500 > (toInt(randhash) % 1000))) |
---|
26 | 26 | | then { |
---|
27 | 27 | | let asset = Issue("Unique Asset", "Test NFT", 1, 0, false, unit, height) |
---|
28 | 28 | | let assetId = calculateAssetId(asset) |
---|
29 | 29 | | [BinaryEntry("lastPlay", randhash), asset, ScriptTransfer(inv.caller, 1, assetId)] |
---|
30 | 30 | | } |
---|
31 | 31 | | else [BinaryEntry("lastPlay", randhash)] |
---|
32 | 32 | | } |
---|
33 | 33 | | |
---|
34 | 34 | | |
---|