tx · 9sc3kgzBMgdmoWRRQ124cw9gpL5mqbZzdqrSYLdspddK

3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9:  -0.01400000 Waves

2019.07.27 18:19 [604644] smart account 3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9 > SELF 0.00000000 Waves

{ "type": 13, "id": "9sc3kgzBMgdmoWRRQ124cw9gpL5mqbZzdqrSYLdspddK", "fee": 1400000, "feeAssetId": null, "timestamp": 1564240800440, "version": 1, "sender": "3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9", "senderPublicKey": "BUuYfkh9hHixwVUQvqzkLkLbWrQYnWpJ8FXVjZUPxBcm", "proofs": [ "4sJ9A1M9ZW5xwuLbEhHGbwGUFJD5djSCajPcHS6v2JHtjGeUKMdoyv9VJLzg9yGCRA6Q5BwdeFmocRaa9BiGuaSE" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAAAAAAlzbG90Q291bnQAAAAAAAAAAGQAAAAABXNsb3RzCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAA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AAAAAAABCQAAAAAAAAIFAAAABHNtdDIAAAAAAAAAAAEHCQAAAAAAAAIFAAAABHNtdDMAAAAAAAAAAAEHCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAVzbG90MQIAAAABXwUAAAAFc2xvdDICAAAAAV8FAAAABXNsb3QzCQABLAAAAAIJAAEsAAAAAgUAAAAGcGxheWVyAgAAAAFfBQAAAAl0aW1lc3RhbXAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAADaW52AAAABmNhbGxlcgkAAGkAAAACCQAAaAAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAAAAAAAAAAAvgAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAVzbG90MQIAAAABXwUAAAAFc2xvdDICAAAAAV8FAAAABXNsb3QzCQABLAAAAAIJAAEsAAAAAgUAAAAGcGxheWVyAgAAAAFfBQAAAAl0aW1lc3RhbXAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAQAAAANpbnYBAAAABWxvdHRvAAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAAAVf+YHw==", "chainId": 84, "height": 604644, "spentComplexity": 0 } View: original | compacted Prev: 4K2HuvdHGHuryuTbbwHZRb8AWxbJCxfMdj6eqRiGiNvd Next: FD7G7Z3QBrb63cpHzHGgYW9DMybNvU2qQtzeAm4hrViq Diff:
OldNewDifferences
5252 let randhash = randomizer(inv)
5353 let timestamp = toString(lastBlock.timestamp)
5454 if (if (if ((smt1 == 1))
55- then true
56- else (smt2 == 1))
57- then true
58- else (smt3 == 1))
55+ then (smt2 == 1)
56+ else false)
57+ then (smt3 == 1)
58+ else false)
5959 then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]))
6060 else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil))
6161 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let slotCount = 100
55
66 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]
77
88 func randomizer (inv) = {
99 let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1010 sha256(rand)
1111 }
1212
1313
1414 func getSlot1 (inv) = {
1515 let hash = sha256(((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)))
1616 let index = toInt(hash)
1717 slots[(index % slotCount)]
1818 }
1919
2020
2121 func getSlot2 (inv) = {
2222 let hash = sha256(((((inv.transactionId + lastBlock.generationSignature) + inv.callerPublicKey) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)))
2323 let index = toInt(hash)
2424 slots[(index % slotCount)]
2525 }
2626
2727
2828 func getSlot3 (inv) = {
2929 let hash = sha256(((((inv.callerPublicKey + inv.transactionId) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)))
3030 let index = toInt(hash)
3131 slots[(index % slotCount)]
3232 }
3333
3434
3535 func startLotto (inv) = {
3636 let MaxBet = (wavesBalance(this) / 100)
3737 let payment = extract(inv.payment)
3838 let slot1 = toString(getSlot1(inv))
3939 let slot2 = toString(getSlot2(inv))
4040 let slot3 = toString(getSlot3(inv))
4141 let smt1 = getSlot1(inv)
4242 let smt2 = getSlot2(inv)
4343 let smt3 = getSlot3(inv)
4444 if (!(isDefined(inv.payment)))
4545 then throw("Should be with Payment in Waves")
4646 else if (isDefined(payment.assetId))
4747 then throw("Payment should be in Waves")
4848 else if ((payment.amount > MaxBet))
4949 then throw(("Payment should be less than " + toString(MaxBet)))
5050 else {
5151 let player = toBase58String(inv.caller.bytes)
5252 let randhash = randomizer(inv)
5353 let timestamp = toString(lastBlock.timestamp)
5454 if (if (if ((smt1 == 1))
55- then true
56- else (smt2 == 1))
57- then true
58- else (smt3 == 1))
55+ then (smt2 == 1)
56+ else false)
57+ then (smt3 == 1)
58+ else false)
5959 then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]))
6060 else ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), ((player + "_") + timestamp))]), TransferSet(nil))
6161 }
6262 }
6363
6464
6565 @Callable(inv)
6666 func lotto () = startLotto(inv)
6767
6868

github/deemru/w8io/026f985 
29.78 ms