tx · FD7G7Z3QBrb63cpHzHGgYW9DMybNvU2qQtzeAm4hrViq 3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9: -0.01400000 Waves 2019.07.28 11:41 [605684] smart account 3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9 > SELF 0.00000000 Waves
{ "type": 13, "id": "FD7G7Z3QBrb63cpHzHGgYW9DMybNvU2qQtzeAm4hrViq", "fee": 1400000, "feeAssetId": null, "timestamp": 1564303304267, "version": 1, "sender": "3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9", "senderPublicKey": "BUuYfkh9hHixwVUQvqzkLkLbWrQYnWpJ8FXVjZUPxBcm", "proofs": [ "3nv45j3iPyvNLVRyaewSfiUF8bnhUd9qt5QMXFh7udVeeVwGSaPEhq5GAntaSJd1AsWxfydYg63KrgyhSQKgnK5U" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAAAAAAlzbG90Q291bnQAAAAAAAAAAGQAAAAABXNsb3RzCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAA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Ftb3VudAAAAAAAAAAF8AAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsAwMDCQAAAAAAAAIFAAAABHNtdDEAAAAAAAAAAAUJAAAAAAAAAgUAAAAEc210MgAAAAAAAAAABQcJAAAAAAAAAgUAAAAEc210MwAAAAAAAAAABQcJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABXNsb3QxAgAAAAFfBQAAAAVzbG90MgIAAAABXwUAAAAFc2xvdDMJAAEsAAAAAgkAASwAAAACBQAAAAZwbGF5ZXICAAAAAV8FAAAACXRpbWVzdGFtcAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAANpbnYAAAAGY2FsbGVyCQAAaQAAAAIJAABoAAAAAggFAAAAB3BheW1lbnQAAAAGYW1vdW50AAAAAAAAAAvgAAAAAAAAAABkBQAAAAR1bml0BQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABXNsb3QxAgAAAAFfBQAAAAVzbG90MgIAAAABXwUAAAAFc2xvdDMJAAEsAAAAAgkAASwAAAACBQAAAAZwbGF5ZXICAAAAAV8FAAAACXRpbWVzdGFtcAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAABAAAAA2ludgEAAAAFbG90dG8AAAAACQEAAAAKc3RhcnRMb3R0bwAAAAEFAAAAA2ludgAAAAA+1SMf", "chainId": 84, "height": 605684, "spentComplexity": 0 } View: original | compacted Prev: 9sc3kgzBMgdmoWRRQ124cw9gpL5mqbZzdqrSYLdspddK Next: NPHVCU4ueyMUpqB4HN7KF1UShseidy8GpBcNX5dTaFS Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | then (smt3 == 1) | |
58 | 58 | else false) | |
59 | 59 | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)])) | |
60 | - | else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil)) | |
60 | + | else if (if (if ((smt1 == 2)) | |
61 | + | then (smt2 == 2) | |
62 | + | else false) | |
63 | + | then (smt3 == 2) | |
64 | + | else false) | |
65 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 380) / 100), unit)])) | |
66 | + | else if (if (if ((smt1 == 3)) | |
67 | + | then (smt2 == 3) | |
68 | + | else false) | |
69 | + | then (smt3 == 3) | |
70 | + | else false) | |
71 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 760) / 100), unit)])) | |
72 | + | else if (if (if ((smt1 == 4)) | |
73 | + | then (smt2 == 4) | |
74 | + | else false) | |
75 | + | then (smt3 == 4) | |
76 | + | else false) | |
77 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 1520) / 100), unit)])) | |
78 | + | else if (if (if ((smt1 == 5)) | |
79 | + | then (smt2 == 5) | |
80 | + | else false) | |
81 | + | then (smt3 == 5) | |
82 | + | else false) | |
83 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 3040) / 100), unit)])) | |
84 | + | else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil)) | |
61 | 85 | } | |
62 | 86 | } | |
63 | 87 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let slotCount = 100 | |
5 | 5 | ||
6 | 6 | let slots = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5] | |
7 | 7 | ||
8 | 8 | func randomizer (inv) = { | |
9 | 9 | let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
10 | 10 | sha256(rand) | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getSlot1 (inv) = { | |
15 | 15 | let hash = sha256(((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))) | |
16 | 16 | let index = toInt(hash) | |
17 | 17 | slots[(index % slotCount)] | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func getSlot2 (inv) = { | |
22 | 22 | let hash = sha256(((((inv.transactionId + lastBlock.generationSignature) + inv.callerPublicKey) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))) | |
23 | 23 | let index = toInt(hash) | |
24 | 24 | slots[(index % slotCount)] | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getSlot3 (inv) = { | |
29 | 29 | let hash = sha256(((((inv.callerPublicKey + inv.transactionId) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))) | |
30 | 30 | let index = toInt(hash) | |
31 | 31 | slots[(index % slotCount)] | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func startLotto (inv) = { | |
36 | 36 | let MaxBet = (wavesBalance(this) / 100) | |
37 | 37 | let payment = extract(inv.payment) | |
38 | 38 | let slot1 = toString(getSlot1(inv)) | |
39 | 39 | let slot2 = toString(getSlot2(inv)) | |
40 | 40 | let slot3 = toString(getSlot3(inv)) | |
41 | 41 | let smt1 = getSlot1(inv) | |
42 | 42 | let smt2 = getSlot2(inv) | |
43 | 43 | let smt3 = getSlot3(inv) | |
44 | 44 | if (!(isDefined(inv.payment))) | |
45 | 45 | then throw("Should be with Payment in Waves") | |
46 | 46 | else if (isDefined(payment.assetId)) | |
47 | 47 | then throw("Payment should be in Waves") | |
48 | 48 | else if ((payment.amount > MaxBet)) | |
49 | 49 | then throw(("Payment should be less than " + toString(MaxBet))) | |
50 | 50 | else { | |
51 | 51 | let player = toBase58String(inv.caller.bytes) | |
52 | 52 | let randhash = randomizer(inv) | |
53 | 53 | let timestamp = toString(lastBlock.timestamp) | |
54 | 54 | if (if (if ((smt1 == 1)) | |
55 | 55 | then (smt2 == 1) | |
56 | 56 | else false) | |
57 | 57 | then (smt3 == 1) | |
58 | 58 | else false) | |
59 | 59 | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)])) | |
60 | - | else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil)) | |
60 | + | else if (if (if ((smt1 == 2)) | |
61 | + | then (smt2 == 2) | |
62 | + | else false) | |
63 | + | then (smt3 == 2) | |
64 | + | else false) | |
65 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 380) / 100), unit)])) | |
66 | + | else if (if (if ((smt1 == 3)) | |
67 | + | then (smt2 == 3) | |
68 | + | else false) | |
69 | + | then (smt3 == 3) | |
70 | + | else false) | |
71 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 760) / 100), unit)])) | |
72 | + | else if (if (if ((smt1 == 4)) | |
73 | + | then (smt2 == 4) | |
74 | + | else false) | |
75 | + | then (smt3 == 4) | |
76 | + | else false) | |
77 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 1520) / 100), unit)])) | |
78 | + | else if (if (if ((smt1 == 5)) | |
79 | + | then (smt2 == 5) | |
80 | + | else false) | |
81 | + | then (smt3 == 5) | |
82 | + | else false) | |
83 | + | then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 3040) / 100), unit)])) | |
84 | + | else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil)) | |
61 | 85 | } | |
62 | 86 | } | |
63 | 87 | ||
64 | 88 | ||
65 | 89 | @Callable(inv) | |
66 | 90 | func lotto () = startLotto(inv) | |
67 | 91 | ||
68 | 92 |
github/deemru/w8io/026f985 31.47 ms ◑