tx · 2iS98cMTs3iGrKhTJNoBw1Q6c3YHgvRFgCzpqKxNW9BE

3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy:  -0.01000000 Waves

2022.05.14 22:36 [2051765] smart account 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy > SELF 0.00000000 Waves

{ "type": 13, "id": "2iS98cMTs3iGrKhTJNoBw1Q6c3YHgvRFgCzpqKxNW9BE", "fee": 1000000, "feeAssetId": null, "timestamp": 1652556958169, "version": 2, "chainId": 84, "sender": "3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy", "senderPublicKey": "BfMBEE7fb4c1RcjEUzpvNjTpjoKMmDRef15igPkstvRm", "proofs": [ "oXSdfhrPW7q1Pb1ABLih1Spbm3MuEK9P9tf9BKKjwihcRbNCwMAsgLVpLoswUAAsRYJ7Up6Ry883GpiqwFBu9kf" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAACAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGV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ACBQAAAA13cml0ZUxhc3RQbGF5BQAAAAt3aW5UcmFuc2ZlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAADXdyaXRlTGFzdFBsYXkJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAA25pbAAAAAIAAAADaW52AQAAAAVsb3R0bwAAAAAJAQAAAApzdGFydExvdHRvAAAAAQUAAAADaW52AAAAA2ludgEAAAAHZGVmYXVsdAAAAAAJAQAAAApzdGFydExvdHRvAAAAAQUAAAADaW52AAAAAD7Ng8A=", "height": 2051765, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6c1QzGRZ39qbWiGzf3tRexnh1CiacbpWMQb7A3UHkX25 Next: GzYqWSdH5Y1cZYvBhr3KCNV3CdwF1yXYGPZs73zFSTmn Diff:
OldNewDifferences
2626 then throw(("Payment should be less than " + toString(playLimit)))
2727 else {
2828 let randhash = randomizer(inv)
29- let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)])
29+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 2), unit)])
3030 let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
3131 if ((500 > (toInt(randhash) % 1000)))
3232 then ScriptResult(writeLastPlay, winTransfer)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func randomizer (inv) = {
55 let lastPlay = match getBinary(this, "lastPlay") {
66 case s: ByteVector =>
77 s
88 case _: Unit =>
99 base58'2ee4oFDYriWJ9EMeR'
1010 case _ =>
1111 throw("Match error")
1212 }
1313 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1414 sha256(rand)
1515 }
1616
1717
1818 func startLotto (inv) = {
1919 let playLimit = (wavesBalance(this) / 100)
2020 let payment = extract(inv.payment)
2121 if (!(isDefined(inv.payment)))
2222 then throw("Should be with Payment in Waves")
2323 else if (isDefined(payment.assetId))
2424 then throw("Payment should be in Waves")
2525 else if ((payment.amount > playLimit))
2626 then throw(("Payment should be less than " + toString(playLimit)))
2727 else {
2828 let randhash = randomizer(inv)
29- let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)])
29+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 2), unit)])
3030 let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
3131 if ((500 > (toInt(randhash) % 1000)))
3232 then ScriptResult(writeLastPlay, winTransfer)
3333 else ScriptResult(writeLastPlay, TransferSet(nil))
3434 }
3535 }
3636
3737
3838 @Callable(inv)
3939 func lotto () = startLotto(inv)
4040
4141
4242
4343 @Callable(inv)
4444 func default () = startLotto(inv)
4545
4646

github/deemru/w8io/169f3d6 
39.56 ms