tx · 6kFw4Jzs7MRGxFJuhf7kVR5YDvTQxeozuLAWoxFjFYVb 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy: -0.01400000 Waves 2022.05.08 03:29 [2041969] smart account 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy > SELF 0.00000000 Waves
{ "type": 13, "id": "6kFw4Jzs7MRGxFJuhf7kVR5YDvTQxeozuLAWoxFjFYVb", "fee": 1400000, "feeAssetId": null, "timestamp": 1651969818969, "version": 2, "chainId": 84, "sender": "3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy", "senderPublicKey": "BfMBEE7fb4c1RcjEUzpvNjTpjoKMmDRef15igPkstvRm", "proofs": [ "4RiBWSgw5KCLUf63xapPnDGzobUL5epwKJGzhTEFBBzfrmd1FyavLrLVnF7Pn8BZP5rfFZd4P4ChSC7iteVineuu" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAACAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0CQAB9wAAAAEFAAAABHJhbmQBAAAACnN0YXJ0TG90dG8AAAABAAAAA2ludgQAAAAJcGxheUxpbWl0CQAAaQAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzAAAAAAAAAABkBAAAAAdwYXltZW50CQEAAAAHZXh0cmFjdAAAAAEIBQAAAANpbnYAAAAHcGF5bWVudAQAAAAIcmFuZGhhc2gJAQAAAApyYW5kb21pemVyAAAAAQUAAAADaW52BAAAAAt3aW5UcmFuc2ZlcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAADaW52AAAABmNhbGxlcgkAAGkAAAACCQAAaAAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAAAAAAAAAAAvgAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsBAAAAA13cml0ZUxhc3RQbGF5CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAhsYXN0UGxheQUAAAAIcmFuZGhhc2gFAAAAA25pbAMJAABmAAAAAgAAAAAAAAAB9AkAAGoAAAACCQAEsQAAAAEFAAAACHJhbmRoYXNoAAAAAAAAAAPoCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAANd3JpdGVMYXN0UGxheQUAAAALd2luVHJhbnNmZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAA13cml0ZUxhc3RQbGF5CQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAACAAAAA2ludgEAAAAFbG90dG8AAAAACQEAAAAKc3RhcnRMb3R0bwAAAAEFAAAAA2ludgAAAANpbnYBAAAAB2RlZmF1bHQAAAAACQEAAAAKc3RhcnRMb3R0bwAAAAEFAAAAA2ludgAAAADoDFns", "height": 2041969, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2WcKtfYpVXP8EmKGsLw67gidv9DiHjNXLeEVrC1afDyy Next: 93tsGC2cStdmUsZczxYVaYHhSqXXNFCPiSpZHmfqzCvD Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
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)] | |
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) | |
11 | 15 | } | |
12 | 16 | ||
13 | 17 | ||
14 | - | @Verifier(tx) | |
15 | - | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
18 | + | func startLotto (inv) = { | |
19 | + | let playLimit = (wavesBalance(this) / 100) | |
20 | + | let payment = extract(inv.payment) | |
21 | + | let randhash = randomizer(inv) | |
22 | + | let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]) | |
23 | + | let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)]) | |
24 | + | if ((500 > (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 | + | ||
16 | 38 |
github/deemru/w8io/169f3d6 38.22 ms ◑