tx · GzYqWSdH5Y1cZYvBhr3KCNV3CdwF1yXYGPZs73zFSTmn

3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy:  -0.01000000 Waves

2022.05.14 23:10 [2051803] smart account 3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy > SELF 0.00000000 Waves

{ "type": 13, "id": "GzYqWSdH5Y1cZYvBhr3KCNV3CdwF1yXYGPZs73zFSTmn", "fee": 1000000, "feeAssetId": null, "timestamp": 1652559013606, "version": 2, "chainId": 84, "sender": "3MySJyGK77d6FhzLNaVVQPXdd9a83bM3qDy", "senderPublicKey": "BfMBEE7fb4c1RcjEUzpvNjTpjoKMmDRef15igPkstvRm", "proofs": [ "2o8gWi37x9aF3mjzF1SC9znLkvGAgJUkE1QmifSQ7DZEiZ9Vaoti5yZp16own3pUK2f6YKDYDNnEfr3e4X5MZrVH" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAACAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0CQAB9wAAAAEFAAAABHJhbmQBAAAACnN0YXJ0TG90dG8AAAABAAAAA2ludgQAAAAJcGxheUxpbWl0CQAAaQAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzAAAAAAAAAAABBAAAAAdwYXltZW50CQEAAAAHZXh0cmFjdAAAAAEIBQAAAANpbnYAAAAHcGF5bWVudAQAAAAIcmFuZGhhc2gJAQAAAApyYW5kb21pemVyAAAAAQUAAAADaW52BAAAAAt3aW5UcmFuc2ZlcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAADaW52AAAABmNhbGxlcgkAAGgAAAACCAUAAAAHcGF5bWVudAAAAAZhbW91bnQAAAAAAAAAAAEFAAAABHVuaXQFAAAAA25pbAQAAAANd3JpdGVMYXN0UGxheQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAIbGFzdFBsYXkFAAAACHJhbmRoYXNoBQAAAANuaWwDCQAAZgAAAAIAAAAAAAAAAfQJAABqAAAAAgkABLEAAAABBQAAAAhyYW5kaGFzaAAAAAAAAAAD6AkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAADXdyaXRlTGFzdFBsYXkFAAAAC3dpblRyYW5zZmVyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAANd3JpdGVMYXN0UGxheQkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAgAAAANpbnYBAAAABWxvdHRvAAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAADaW52AQAAAAdkZWZhdWx0AAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAAANExvEg==", "height": 2051803, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2iS98cMTs3iGrKhTJNoBw1Q6c3YHgvRFgCzpqKxNW9BE Next: 7GQseVv3FaupJkR1v86k4vZPQ9kMCdS9mxytJqntbzAJ Diff:
OldNewDifferences
1616
1717
1818 func startLotto (inv) = {
19- let playLimit = (wavesBalance(this) / 100)
19+ let playLimit = (wavesBalance(this) / 1)
2020 let payment = extract(inv.payment)
21- if (!(isDefined(inv.payment)))
22- then throw("Should be with Payment in Waves")
23- else if (isDefined(payment.assetId))
24- then throw("Payment should be in Waves")
25- else if ((payment.amount > playLimit))
26- then throw(("Payment should be less than " + toString(playLimit)))
27- else {
28- let randhash = randomizer(inv)
29- let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 2), unit)])
30- let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
31- if ((500 > (toInt(randhash) % 1000)))
32- then ScriptResult(writeLastPlay, winTransfer)
33- else ScriptResult(writeLastPlay, TransferSet(nil))
34- }
21+ let randhash = randomizer(inv)
22+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 1), unit)])
23+ let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
24+ if ((500 > (toInt(randhash) % 1000)))
25+ then ScriptResult(writeLastPlay, winTransfer)
26+ else ScriptResult(writeLastPlay, TransferSet(nil))
3527 }
3628
3729
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) = {
19- let playLimit = (wavesBalance(this) / 100)
19+ let playLimit = (wavesBalance(this) / 1)
2020 let payment = extract(inv.payment)
21- if (!(isDefined(inv.payment)))
22- then throw("Should be with Payment in Waves")
23- else if (isDefined(payment.assetId))
24- then throw("Payment should be in Waves")
25- else if ((payment.amount > playLimit))
26- then throw(("Payment should be less than " + toString(playLimit)))
27- else {
28- let randhash = randomizer(inv)
29- let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 2), unit)])
30- let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
31- if ((500 > (toInt(randhash) % 1000)))
32- then ScriptResult(writeLastPlay, winTransfer)
33- else ScriptResult(writeLastPlay, TransferSet(nil))
34- }
21+ let randhash = randomizer(inv)
22+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, (payment.amount * 1), unit)])
23+ let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)])
24+ if ((500 > (toInt(randhash) % 1000)))
25+ then ScriptResult(writeLastPlay, winTransfer)
26+ else ScriptResult(writeLastPlay, TransferSet(nil))
3527 }
3628
3729
3830 @Callable(inv)
3931 func lotto () = startLotto(inv)
4032
4133
4234
4335 @Callable(inv)
4436 func default () = startLotto(inv)
4537
4638

github/deemru/w8io/169f3d6 
36.67 ms