tx · 2WcKtfYpVXP8EmKGsLw67gidv9DiHjNXLeEVrC1afDyy 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy: -0.01000000 Waves 2022.03.27 19:30 [1982574] smart account 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy > SELF 0.00000000 Waves
{ "type": 13, "id": "2WcKtfYpVXP8EmKGsLw67gidv9DiHjNXLeEVrC1afDyy", "fee": 1000000, "feeAssetId": null, "timestamp": 1648398613530, "version": 2, "chainId": 84, "sender": "3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy", "senderPublicKey": "BfMBEE7fb4c1RcjEUzpvNjTpjoKMmDRef15igPkstvRm", "proofs": [ "2XUnvswV2UyR6DrPnsAepLhWzijPRcVAgxR1DTnHyeiCXdm9KchvftYGG6FJsvEkDmji8LxpV9KKmTun2VzKu7fz" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAABWFzc2V0CQAEQwAAAAcCAAAABUFzc2V0AgAAAARURVNUAAAAAAAAACcQAAAAAAAAAAAABgUAAAAEdW5pdAAAAAAAAAAAAAQAAAAHYXNzZXRJZAkABDgAAAABBQAAAAVhc3NldAkABEwAAAACCQEAAAALQmluYXJ5RW50cnkAAAACAgAAAANiaW4BAAAAAAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgIAAAAEYm9vbAYJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAA2ludAAAAAAAAAAAAQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAANzdHICAAAAAAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABAgAAAANzdHIJAARMAAAAAgUAAAAFYXNzZXQJAARMAAAAAgkBAAAAB1JlaXNzdWUAAAADBQAAAAdhc3NldElkAAAAAAAAAAABBwkABEwAAAACCQEAAAAEQnVybgAAAAIFAAAAB2Fzc2V0SWQAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebRaDrM=", "height": 1982574, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5e8TdrNgTzX1AVkVCEb2cdCWaJgxskZqXsPZyLqDfgmX Next: 6kFw4Jzs7MRGxFJuhf7kVR5YDvTQxeozuLAWoxFjFYVb Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func randomizer (inv) = { | |
5 | - | let lastPlay = match getBinary(this, "lastPlay") { | |
6 | - | case s: ByteVector => | |
7 | - | s | |
8 | - | case _: Unit => | |
9 | - | base58'2ee4oFDYriWJ9EMeR' | |
10 | - | case _ => | |
11 | - | throw("Match error") | |
12 | - | } | |
13 | - | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
14 | - | sha256(rand) | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func call () = { | |
8 | + | let asset = Issue("Asset", "TEST", 10000, 0, true, unit, 0) | |
9 | + | let assetId = calculateAssetId(asset) | |
10 | + | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)] | |
15 | 11 | } | |
16 | 12 | ||
17 | 13 | ||
18 | - | func startLotto (inv) = { | |
19 | - | let playLimit = (wavesBalance(this) * 10000) | |
20 | - | let payment = extract(inv.payment) | |
21 | - | let randhash = randomizer(inv) | |
22 | - | let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 1) / 10000), unit)]) | |
23 | - | let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)]) | |
24 | - | if ((100 > (toInt(randhash) % 1000))) | |
25 | - | then ScriptResult(writeLastPlay, winTransfer) | |
26 | - | else ScriptResult(writeLastPlay, TransferSet(nil)) | |
27 | - | } | |
28 | - | ||
29 | - | ||
30 | - | @Callable(inv) | |
31 | - | func lotto () = startLotto(inv) | |
32 | - | ||
33 | - | ||
34 | - | ||
35 | - | @Callable(inv) | |
36 | - | func default () = startLotto(inv) | |
37 | - | ||
14 | + | @Verifier(tx) | |
15 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
38 | 16 |
github/deemru/w8io/169f3d6 23.00 ms ◑