tx · BaQqwX4aH7B2UPZjo9RZihEjpugvHK1trz2udKkUMr1p 3N9rn6oHDHVvfENDBwYm5P2LGuQkBLL4sVE: -0.01870000 Waves 2020.10.04 01:16 [1204965] smart account 3N9rn6oHDHVvfENDBwYm5P2LGuQkBLL4sVE > SELF 0.00000000 Waves
{ "type": 13, "id": "BaQqwX4aH7B2UPZjo9RZihEjpugvHK1trz2udKkUMr1p", "fee": 1870000, "feeAssetId": null, "timestamp": 1601763291671, "version": 2, "chainId": 84, "sender": "3N9rn6oHDHVvfENDBwYm5P2LGuQkBLL4sVE", "senderPublicKey": "8dXboB91BfUTr4CrHZCqQR1g5SPMGtAQKRGFmPtcokrZ", "proofs": [ "4fG48LMc5UXf6XVAYMDNzUPbbyt9wdVqMXjGiC7wrruJy12M6JaBc3rxp6CwWYtck6YG8L8bMr5iu6cYQYd4zmEL" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAACAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAABFBsYXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQEAAAAAWEFAAAAByRtYXRjaDABAAAADFdhdmVzTG90dG9WMgkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIFAAAACGxhc3RQbGF5CAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RC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AAPoCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAANd3JpdGVMYXN0UGxheQUAAAALd2luVHJhbnNmZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAA13cml0ZUxhc3RQbGF5CQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAACAAAAA2ludgEAAAAFbG90dG8AAAAACQEAAAAKc3RhcnRMb3R0bwAAAAEFAAAAA2ludgAAAANpbnYBAAAAB2RlZmF1bHQAAAAACQEAAAAKc3RhcnRMb3R0bwAAAAEFAAAAA2ludgAAAABi+Do+", "height": 1204965, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HHswXFZ258qfg3V4edTCvf6Vp12MY9SiEBSrXMb4m9Lm Next: none Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func randomizer (inv) = { | |
5 | - | let lastPlay = match getBinary(this, " | |
5 | + | let lastPlay = match getBinary(this, "Play") { | |
6 | 6 | case s: ByteVector => | |
7 | 7 | s | |
8 | 8 | case a: Unit => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func randomizer (inv) = { | |
5 | - | let lastPlay = match getBinary(this, " | |
5 | + | let lastPlay = match getBinary(this, "Play") { | |
6 | 6 | case s: ByteVector => | |
7 | 7 | s | |
8 | 8 | case a: 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 | func startLotto (inv) = { | |
19 | 19 | let playLimit = (wavesBalance(this) / 100) | |
20 | 20 | let payment = extract(inv.payment) | |
21 | 21 | if (!(isDefined(inv.payment))) | |
22 | 22 | then throw("Should be with Payment in Waves") | |
23 | 23 | else if (isDefined(payment.assetId)) | |
24 | 24 | then throw("Payment should be in Waves") | |
25 | 25 | else if ((payment.amount > playLimit)) | |
26 | 26 | then throw(("Payment should be less than " + toString(playLimit))) | |
27 | 27 | else { | |
28 | 28 | let randhash = randomizer(inv) | |
29 | 29 | let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]) | |
30 | 30 | let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)]) | |
31 | 31 | if ((500 > (toInt(randhash) % 1000))) | |
32 | 32 | then ScriptResult(writeLastPlay, winTransfer) | |
33 | 33 | else ScriptResult(writeLastPlay, TransferSet(nil)) | |
34 | 34 | } | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(inv) | |
39 | 39 | func lotto () = startLotto(inv) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(inv) | |
44 | 44 | func default () = startLotto(inv) | |
45 | 45 | ||
46 | 46 |
github/deemru/w8io/169f3d6 20.62 ms ◑