tx · 5LHCoHZy3LwanTubA5khGB5cQcsit3mJkevfYXFXsFAg 3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC: -0.04000000 Waves 2019.12.29 12:21 [830163] smart account 3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC > SELF 0.00000000 Waves
{ "type": 13, "id": "5LHCoHZy3LwanTubA5khGB5cQcsit3mJkevfYXFXsFAg", "fee": 4000000, "feeAssetId": null, "timestamp": 1577611373036, "version": 1, "sender": "3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC", "senderPublicKey": "AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP", "proofs": [ "3gJkTwUAGwGAKA4kbAvGBeufeo6rgdkSdEjPGF69Hwq8gdFtow2BUPifNhc4hnM7PN3dAR2H6V2k1hy2EpcM2sgW" ], "script": "base64:AAIDAAAAAAAAAA0IARIECgIBCBIDCgEBAAAABwAAAAALb3duZXJQdWJLZXkBAAAAIJLVH1aKS7GiLdMgBtKumrDgMoaT5BFPrNSzSjm7iLMkAAAAAAhsdmwxUmF0ZQAAAAAAAAAADAAAAAAIbHZsMlJhdGUAAAAAAAAAAA4AAAAACGx2bDNSYXRlAAAAAAAAAAAQAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAABHJhbmQJAABqAAAAAgkABLEAAAABCQAB9wAAAAEJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAggFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AAAAAAAAAAAEAwkAAGYAAAACAAAAAAAAAAAABQAAAARyYW5kCQAAZAAAAAIJAABoAAAAAgD//////////wUAAAAEcmFuZAAA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AAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgeFXMOG", "chainId": 84, "height": 830163, "spentComplexity": 0 } View: original | compacted Prev: ADNkzFtqETK4HxEUCFSA6oNyMhtTNzzADAHd7ELHFvSW Next: none Diff:
Old | New | Differences | |
---|---|---|---|
41 | 41 | func start (bet,lvl) = { | |
42 | 42 | let playerAddress = addressFromPublicKey(inv.callerPublicKey) | |
43 | 43 | let gameKey = toBase58String(inv.transactionId) | |
44 | - | let gameData = ((((toBase58String(inv.callerPublicKey) + "_") + toString(bet)) + "_") + | |
44 | + | let gameData = ((((toBase58String(inv.callerPublicKey) + "_") + toString(bet)) + "_") + lvl) | |
45 | 45 | WriteSet([DataEntry(gameKey, gameData)]) | |
46 | 46 | } | |
47 | 47 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerPubKey = base58'AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP' | |
5 | 5 | ||
6 | 6 | let lvl1Rate = 12 | |
7 | 7 | ||
8 | 8 | let lvl2Rate = 14 | |
9 | 9 | ||
10 | 10 | let lvl3Rate = 16 | |
11 | 11 | ||
12 | 12 | func randomizer (inv) = { | |
13 | 13 | let rand = (toInt(sha256(((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)))) % 4) | |
14 | 14 | if ((0 > rand)) | |
15 | 15 | then ((-1 * rand) + 1) | |
16 | 16 | else (rand + 1) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func loadGameData (gameId) = { | |
21 | 21 | let gameData = match getString(this, gameId) { | |
22 | 22 | case str: String => | |
23 | 23 | str | |
24 | 24 | case _ => | |
25 | 25 | throw(("Couldn't find game by " + gameId)) | |
26 | 26 | } | |
27 | 27 | split(gameData, "_") | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func result (i,c) = { | |
32 | 32 | let rand = randomizer(i) | |
33 | 33 | let gameDataArr = loadGameData("F63eyYX6NmXE3fgdYLyiFo8KLBzdxDesFRK2zYSP4CMP") | |
34 | 34 | if ((rand == c)) | |
35 | 35 | then (((((((gameDataArr[0] + "_") + gameDataArr[1]) + "_") + gameDataArr[2]) + ":") + toString(c)) + ":") | |
36 | 36 | else ((((gameDataArr[0] + "_") + gameDataArr[1]) + "") + gameDataArr[2]) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(inv) | |
41 | 41 | func start (bet,lvl) = { | |
42 | 42 | let playerAddress = addressFromPublicKey(inv.callerPublicKey) | |
43 | 43 | let gameKey = toBase58String(inv.transactionId) | |
44 | - | let gameData = ((((toBase58String(inv.callerPublicKey) + "_") + toString(bet)) + "_") + | |
44 | + | let gameData = ((((toBase58String(inv.callerPublicKey) + "_") + toString(bet)) + "_") + lvl) | |
45 | 45 | WriteSet([DataEntry(gameKey, gameData)]) | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(inv) | |
51 | 51 | func choice (userChoice) = { | |
52 | 52 | let qwerty = loadGameData("F63eyYX6NmXE3fgdYLyiFo8KLBzdxDesFRK2zYSP4CMP") | |
53 | 53 | WriteSet([DataEntry(toString(inv.caller), toString(userChoice))]) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Verifier(tx) | |
58 | 58 | func verify () = match tx { | |
59 | 59 | case t: SetScriptTransaction => | |
60 | 60 | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
61 | 61 | case c: InvokeScriptTransaction => | |
62 | 62 | true | |
63 | 63 | case d: DataTransaction => | |
64 | 64 | true | |
65 | 65 | case _ => | |
66 | 66 | false | |
67 | 67 | } | |
68 | 68 |
github/deemru/w8io/169f3d6 43.31 ms ◑