tx · 7Pr4zFa9z1dXyWFQ8VMRN6jiRJPjP6TKZPB4hGCQZoBH

3MqnKFCPYSFqTyMrLUvGmn9wNh1cvqsBvV4:  -0.04000000 Waves

2020.10.03 00:59 [1203504] smart account 3MqnKFCPYSFqTyMrLUvGmn9wNh1cvqsBvV4 > SELF 0.00000000 Waves

{ "type": 13, "id": "7Pr4zFa9z1dXyWFQ8VMRN6jiRJPjP6TKZPB4hGCQZoBH", "fee": 4000000, "feeAssetId": null, "timestamp": 1601675996646, "version": 2, "chainId": 84, "sender": "3MqnKFCPYSFqTyMrLUvGmn9wNh1cvqsBvV4", "senderPublicKey": "7QzpPMPE9EBjsL8KjTqA6co5svTSPeCJKxMjtXd6vURP", "proofs": [ "2mjq9HSA4aFVUztDmSBASR4s3a8X72fxpax2vttiJ1Pc3AkAGHFezkVhCLFDxFFySqBQ286toDb8yux6n1mE3ppf" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAgEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAEAAAAMV2F2ZXNMb3R0b1YyCQAAAgAAAAECAAAAC01hdGNoIGVycm9yBAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAIbGFzdFBsYXkIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkAAZoAAAABCAUAAAAJbGFzd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AAAA+gJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAA13cml0ZUxhc3RQbGF5BQAAAAt3aW5UcmFuc2ZlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAADXdyaXRlTGFzdFBsYXkJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAA25pbAAAAAEAAAADaW52AQAAAAdMb3R0ZXJ5AAAAAAkBAAAACnN0YXJ0TG90dG8AAAABBQAAAANpbnYAAAAAjavxMA==", "height": 1203504, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2uEKpyPAUZeAqC4Vzku2agEsuYbRT1kLfjynwGSKsZ6z Next: none Diff:
OldNewDifferences
3636
3737
3838 @Callable(inv)
39-func Start () = startLotto(inv)
39+func Lottery () = startLotto(inv)
4040
4141
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)
2929 let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), 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)
39-func Start () = startLotto(inv)
39+func Lottery () = startLotto(inv)
4040
4141

github/deemru/w8io/169f3d6 
25.11 ms