tx · D2WnCg4iQDx65LJdMTsbkt6YzPFEbwQtp2wPMY95X4xw

3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9:  -0.01400000 Waves

2019.07.27 17:40 [604602] smart account 3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9 > SELF 0.00000000 Waves

{ "type": 13, "id": "D2WnCg4iQDx65LJdMTsbkt6YzPFEbwQtp2wPMY95X4xw", "fee": 1400000, "feeAssetId": null, "timestamp": 1564238422752, "version": 1, "sender": "3N8GJgmMBsrwhn6uQstYAmqZBLuupZEGXr9", "senderPublicKey": "BUuYfkh9hHixwVUQvqzkLkLbWrQYnWpJ8FXVjZUPxBcm", "proofs": [ "3Nw4S5KhgJPy6cgkdYpeT5Xc9F4NvEEaK2qAKLc1bxqX4LNx72enU1GsdqfG3cdSkZaSqnGqetoLCPWRovDEYCez" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAAAAAAlzbG90Q291bnQAAAAAAAAAAGQAAAAABXNsb3RzCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAAAAAAAAAAABCQAETAAAAA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AAAAAAAAEHCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAVzbG90MQIAAAABXwUAAAAFc2xvdDICAAAAAV8FAAAABXNsb3QzBQAAAAl0aW1lc3RhbXAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAADaW52AAAABmNhbGxlcgkAAGkAAAACCQAAaAAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAAAAAAAAAAAvgAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAETG9vcwUAAAAGcGxheWVyBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAA25pbAAAAAEAAAADaW52AQAAAAVsb3R0bwAAAAAJAQAAAApzdGFydExvdHRvAAAAAQUAAAADaW52AAAAAH+juCQ=", "chainId": 84, "height": 604602, "spentComplexity": 0 } View: original | compacted Prev: 8bgwzrxraHPSjekDzDtALWEomJ2rzyoPwEAfNxBt86Ks Next: 48vWEE79xWoAxwn1GRPWYNfW5zMkGgytNXJokv5EkKHw Diff:
OldNewDifferences
4848 let player = toBase58String(inv.caller.bytes)
4949 let randhash = randomizer(inv)
5050 let timestamp = toString(lastBlock.timestamp)
51- if ((500 > (toInt(randhash) % 1000)))
51+ if (if (if ((getSlot1(inv) == 1))
52+ then (getSlot2(inv) == 1)
53+ else false)
54+ then (getSlot3(inv) == 1)
55+ else false)
5256 then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), timestamp)]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]))
5357 else ScriptResult(WriteSet([DataEntry("Loos", player)]), TransferSet(nil))
5458 }
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 if (!(isDefined(inv.payment)))
4242 then throw("Should be with Payment in Waves")
4343 else if (isDefined(payment.assetId))
4444 then throw("Payment should be in Waves")
4545 else if ((payment.amount > MaxBet))
4646 then throw(("Payment should be less than " + toString(MaxBet)))
4747 else {
4848 let player = toBase58String(inv.caller.bytes)
4949 let randhash = randomizer(inv)
5050 let timestamp = toString(lastBlock.timestamp)
51- if ((500 > (toInt(randhash) % 1000)))
51+ if (if (if ((getSlot1(inv) == 1))
52+ then (getSlot2(inv) == 1)
53+ else false)
54+ then (getSlot3(inv) == 1)
55+ else false)
5256 then ScriptResult(WriteSet([DataEntry(((((slot1 + "_") + slot2) + "_") + slot3), timestamp)]), TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]))
5357 else ScriptResult(WriteSet([DataEntry("Loos", player)]), TransferSet(nil))
5458 }
5559 }
5660
5761
5862 @Callable(inv)
5963 func lotto () = startLotto(inv)
6064
6165

github/deemru/w8io/169f3d6 
27.71 ms