tx · Cj3eCYBCQQR69jyZFbRswDyPEx3xcpFudoG7tLwVi5SD 3N4Ez9CB4yK1rgE8rezTEqNp77egqT9mWSM: -0.01000000 Waves 2022.05.28 22:15 [2071923] smart account 3N4Ez9CB4yK1rgE8rezTEqNp77egqT9mWSM > SELF 0.00000000 Waves
{ "type": 13, "id": "Cj3eCYBCQQR69jyZFbRswDyPEx3xcpFudoG7tLwVi5SD", "fee": 1000000, "feeAssetId": null, "timestamp": 1653765324117, "version": 2, "chainId": 84, "sender": "3N4Ez9CB4yK1rgE8rezTEqNp77egqT9mWSM", "senderPublicKey": "483MxoikV3ZhGhnDEG8EvxJvFR57gFgjWeLXiRajiCk5", "proofs": [ "2ZHL2owYhVwxYRVWXrNKWpRnZErwS9yZcQfbP84fcAP6s1aMUJ5PY4izw6TeyU4nS8rwXFPeMXhdyDuQpD42P8HE" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAACAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAACEC2CHEd/Lh6STHVfzd2tbwUyHKq5pUFxEe9gnef0luZykJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0CQAB9wAAAAEFAAAABHJhbmQBAAAACnN0YXJ0TG90dG8AAAABAAAAA2ludgQAAAAJcGxheUxpbWl0CQAAaAAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzAAAAAAAAAAPoBAAAAAdwYXltZW50CQEAAAAHZXh0cmFjdAAAAAEIBQAAAANpbnYAAAAHcGF5bWVudAQAAAAIcmFuZGhhc2gJAQAAAApyYW5kb21pemVyAAAAAQUAAAADaW52BAAAAAt3aW5UcmFuc2ZlcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAADaW52AAAABmNhbGxlcgkAAGgAAAACCAUAAAAHcGF5bWVudAAAAAZhbW91bnQAAAAAAAAAAAIFAAAABHVuaXQFAAAAA25pbAQAAAANd3JpdGVMYXN0UGxheQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAIbGFzdFBsYXkFAAAACHJhbmRoYXNoBQAAAANuaWwDCQAAZgAAAAIAAAAAAAAAASwJAABqAAAAAgkABLEAAAABBQAAAAhyYW5kaGFzaAAAAAAAAAAD6AkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAADXdyaXRlTGFzdFBsYXkFAAAAC3dpblRyYW5zZmVyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAANd3JpdGVMYXN0UGxheQkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAgAAAANpbnYBAAAABWxvdHRvAAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAADaW52AQAAAAdkZWZhdWx0AAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAAAtYZiiA==", "height": 2071923, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: Gq71tFHB1WeHcAuQL3QzZj994bLmzR4V8XVak8HDzfLu Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
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'r1KfkRCCrJYaLzSkbtCciTxSbSL8GWgoCdQQf11o7z2U' | |
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) | |
15 | + | } | |
16 | + | ||
17 | + | ||
18 | + | func startLotto (inv) = { | |
19 | + | let playLimit = (wavesBalance(this) * 1000) | |
20 | + | let payment = extract(inv.payment) | |
21 | + | let randhash = randomizer(inv) | |
22 | + | let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 2), unit)]) | |
23 | + | let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)]) | |
24 | + | if ((300 > (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 | + | ||
38 | + |
github/deemru/w8io/169f3d6 21.62 ms ◑