tx · F5wxi4XnZwhcThWNNhDoXYHcEkWroURbSZU8AYavqVtF

3N5iryEj86a3pY3nwLsqXfPbQ2jAn78pXjn:  -0.01000000 Waves

2019.10.18 19:20 [725673] smart account 3N5iryEj86a3pY3nwLsqXfPbQ2jAn78pXjn > SELF 0.00000000 Waves

{ "type": 13, "id": "F5wxi4XnZwhcThWNNhDoXYHcEkWroURbSZU8AYavqVtF", "fee": 1000000, "feeAssetId": null, "timestamp": 1571415661937, "version": 1, "sender": "3N5iryEj86a3pY3nwLsqXfPbQ2jAn78pXjn", "senderPublicKey": "CZSf2oXBBDdW225HUCvmBXCt2zxEcFAciefw1CE4UyNt", "proofs": [ "4ZceKknja5VVH1KLRspzkWwXLYuwoefgCV9abtfa4AC8c9b7zCKbpZv2dy36BSwJBaG4D6Umpsnzx385Gyj6mubT" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAEAAAAAAZpc3N1ZXIJAQAAAAdBZGRyZXNzAAAAAQEAAAAKMHNA6BgrVo5j4gAAAAAHYXNzZXRJZAEAAAAgVa8F3KfcsjaG5bdAZm3jcIPTyVszBC54bWpEjtXcznYBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAKdWx0aW1vSm9nbwQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAp1bHRpbW9Kb2dvAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAApBcG9zdGFzV0JUCQEAAAAFdGhyb3cAAAAABAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAKdWx0aW1vSm9nbwgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWx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AAAAgIAAAAKdWx0aW1vSm9nbwUAAAAIcmFuZGhhc2gFAAAAA25pbAMJAABmAAAAAgAAAAAAAAAB9AkAAGoAAAACCQAEsQAAAAEFAAAACHJhbmRoYXNoAAAAAAAAAAPoCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAARZ3JhdmFVbHRpbWFKb2dhZGEFAAAACXRyYW5zZmVyZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAAEWdyYXZhVWx0aW1hSm9nYWRhCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAACAAAAA2ludgEAAAAFbG90dG8AAAAACQEAAAAJYXBvc3RhV0JUAAAAAQUAAAADaW52AAAAA2ludgEAAAAHZGVmYXVsdAAAAAAJAQAAAAlhcG9zdGFXQlQAAAABBQAAAANpbnYAAAAA8xEeqg==", "chainId": 84, "height": 725673, "spentComplexity": 0 } View: original | compacted Prev: none Next: 9gQ5g32XP6kVTR7s4J4WErBzmX3zLy7FfkbmXycUwrvH Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let issuer = Address(base58'3issuerAddress')
5+
6+let assetId = base58'6mUSqVGteY6pQitcbXFzJd2C7r85dn31pdHS9LzEuxQu'
7+
8+func randomizer (inv) = {
9+ let ultimoJogo = match getBinary(this, "ultimoJogo") {
10+ case s: ByteVector =>
11+ s
12+ case a: Unit =>
13+ base58'4gEivd7cGhPHTZ'
14+ case _ =>
15+ throw()
16+ }
17+ let rand = (((((ultimoJogo + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
18+ sha256(rand)
19+ }
20+
21+
22+func apostaWBT (inv) = {
23+ let playLimit = assetBalance(this, assetId)
24+ let payment = extract(inv.payment)
25+ if (isDefined(inv.payment))
26+ then throw("Você não pode apostar com Waves.")
27+ else if ((payment.assetId != assetId))
28+ then throw("Você deve fazer o pagamento em SendToken")
29+ else if ((payment.amount > playLimit))
30+ then throw(("O pagamento deve ser menor que " + toString(playLimit)))
31+ else {
32+ let randhash = randomizer(inv)
33+ let transfere = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), assetId)])
34+ let gravaUltimaJogada = WriteSet([DataEntry("ultimoJogo", randhash)])
35+ if ((500 > (toInt(randhash) % 1000)))
36+ then ScriptResult(gravaUltimaJogada, transfere)
37+ else ScriptResult(gravaUltimaJogada, TransferSet(nil))
38+ }
39+ }
40+
41+
42+@Callable(inv)
43+func lotto () = apostaWBT(inv)
44+
45+
46+
47+@Callable(inv)
48+func default () = apostaWBT(inv)
49+
50+

github/deemru/w8io/169f3d6 
14.95 ms