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