tx · AExETa4jnWybPsvStybpqU23E64Dx3eYyaN1ugeeeepU
3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe: -0.05000000 Waves
2021.04.15 12:47 [1483397] smart account 3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe > SELF 0.00000000 Waves
{
"type": 13,
"id": "AExETa4jnWybPsvStybpqU23E64Dx3eYyaN1ugeeeepU",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1618480036293,
"version": 2,
"chainId": 84,
"sender": "3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe",
"senderPublicKey": "4MMreyp5fK9PfGwiJTaZTXuPjY9Tj3qHt6pHiGJ8uyXJ",
"proofs": [
"5BTnb6Bs8VWRPEwarFXoQB5BSrSgARJApQB3DHafbdyBiDf7S1iLBvHpXReJXi2tH9Psyy1PAKUi1U5Y6YDLUGUX"
],
"script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAggIAAAABwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXhYSXVxbWZ4RE5rVjVKbzlheG51RnBBaktIMmN5R3FRY2tqd0JwRnoydFlKWE4vTXNEdVJraC90WkJ0bm5RVEczRUsrWGJ3V0ZjWUhzNEJvSHpoYUtGb2c0eEtyVDRudFViY1RFMkFxUHNoWGlPc0llSnZlR2RJVDdoL0gySmRBVUZNdXIzdGxQVlhBMWZScGxWMVc2NTFPSWFFOEYrQ252QjlZV2NBVEJxcVVLM1lZaHc3VmErRG96dHZKd3ZOcXVjb1ltZG5uaTZ6NXYwckNsSm1pZk9IQlhGczBVUW83UnFqV2gzTDkrZkdqT2pxUUxzQ2VtYklRYmwvU0lxUm1YMUhZZW1CMUdRQlNsM3U1TGlNOU43aEdTT3V2N01GSWYyZXpReWFnU2JxK3YvM3dBRHZQL1d3K3FTbHhpa0pOYmp4WHBMYUxMSlh6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91bnQFAAAAA25pbAMJAABmAAAAAgAAAAAAAAAAMAUAAAAEcmFuZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAB3VzZXJpZDoFAAAABnVzZXJpZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABXJhbmQ6CQABpAAAAAEFAAAABHJhbmQCAAAABXJpc2s6CQABpAAAAAEFAAAABHJpc2sCAAAABHdvbjoJAAGkAAAAAQkAAGgAAAACBQAAAAZhbW91bnQAAAAAAAAAAAMFAAAAA25pbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAB3VzZXJpZDoFAAAABnVzZXJpZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABXJhbmQ6CQABpAAAAAEFAAAABHJhbmQCAAAABXJpc2s6CQABpAAAAAEFAAAABHJpc2sCAAAABWxvc3Q6CQABpAAAAAEFAAAABmFtb3VudAUAAAADbmlsAAAAAAYMESY=",
"height": 1483397,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: B7ZfeRuxQMAsVrLUXtU6AKC4wYq4dRsyZpSn51LaKTL5
Next: DuwSWrK3KC1UjUbc7H4L6rhKkyg5LaPHMaGDEr6bdUek
Diff:
Old | New | | Differences |
---|
48 | 48 | | |
---|
49 | 49 | | |
---|
50 | 50 | | @Callable(o) |
---|
51 | | - | func game (q,k,r) = { |
---|
52 | | - | let l = fromBase64String(r) |
---|
| 51 | + | func game (k,q) = { |
---|
| 52 | + | let l = fromBase64String(q) |
---|
53 | 53 | | let p = toBase58String(o.caller.bytes) |
---|
54 | 54 | | let n = j(k, l) |
---|
55 | | - | let s = 10000 |
---|
56 | | - | let t = "12345" |
---|
57 | | - | if ((q == 2)) |
---|
| 55 | + | let r = 10000 |
---|
| 56 | + | let s = "12345" |
---|
| 57 | + | let t = 3 |
---|
| 58 | + | if ((t == 2)) |
---|
58 | 59 | | then if ((73 > n)) |
---|
59 | | - | then WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "won:") + toString((s * 2))))]) |
---|
60 | | - | else WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "lost:") + toString(s)))]) |
---|
| 60 | + | then WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "won:") + toString((r * 2))))]) |
---|
| 61 | + | else WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "lost:") + toString(r)))]) |
---|
61 | 62 | | else if ((48 > n)) |
---|
62 | | - | then WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "won:") + toString((s * 3))))]) |
---|
63 | | - | else WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "lost:") + toString(s)))]) |
---|
| 63 | + | then WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "won:") + toString((r * 3))))]) |
---|
| 64 | + | else WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "lost:") + toString(r)))]) |
---|
64 | 65 | | } |
---|
65 | 66 | | |
---|
66 | 67 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxXIuqmfxDNkV5Jo9axnuFpAjKH2cyGqQckjwBpFz2tYJXN/MsDuRkh/tZBtnnQTG3EK+XbwWFcYHs4BoHzhaKFog4xKrT4ntUbcTE2AqPshXiOsIeJveGdIT7h/H2JdAUFMur3tlPVXA1fRplV1W651OIaE8F+CnvB9YWcATBqqUK3YYhw7Va+DoztvJwvNqucoYmdnni6z5v0rClJmifOHBXFs0UQo7RqjWh3L9+fGjOjqQLsCembIQbl/SIqRmX1HYemB1GQBSl3u5LiM9N7hGSOuv7MFIf2ezQyagSbq+v/3wADvP/Ww+qSlxikJNbjxXpLaLLJXzTyeJD+kt4wIDAQAB") |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "$GAME_NUM" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "SUBMITTED" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "WON" |
---|
11 | 11 | | |
---|
12 | 12 | | let e = "LOST" |
---|
13 | 13 | | |
---|
14 | 14 | | func f () = { |
---|
15 | 15 | | let g = { |
---|
16 | 16 | | let h = getInteger(this, b) |
---|
17 | 17 | | if ($isInstanceOf(h, "Int")) |
---|
18 | 18 | | then { |
---|
19 | 19 | | let i = h |
---|
20 | 20 | | i |
---|
21 | 21 | | } |
---|
22 | 22 | | else 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | (g + 1) |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|
28 | 28 | | func j (k,l) = { |
---|
29 | 29 | | let m = rsaVerify(SHA256, toBytes(k), l, a) |
---|
30 | 30 | | if (m) |
---|
31 | 31 | | then { |
---|
32 | 32 | | let n = (toInt(sha256(l)) % 150) |
---|
33 | 33 | | if ((0 > n)) |
---|
34 | 34 | | then ((-1 * n) + 1) |
---|
35 | 35 | | else (n + 1) |
---|
36 | 36 | | } |
---|
37 | 37 | | else throw("Invalid RSA signature") |
---|
38 | 38 | | } |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | 41 | | @Callable(o) |
---|
42 | 42 | | func init () = { |
---|
43 | 43 | | let p = toBase58String(o.caller.bytes) |
---|
44 | 44 | | let k = toBase58String(o.transactionId) |
---|
45 | 45 | | WriteSet([DataEntry((p + "_g"), k)]) |
---|
46 | 46 | | } |
---|
47 | 47 | | |
---|
48 | 48 | | |
---|
49 | 49 | | |
---|
50 | 50 | | @Callable(o) |
---|
51 | | - | func game (q,k,r) = { |
---|
52 | | - | let l = fromBase64String(r) |
---|
| 51 | + | func game (k,q) = { |
---|
| 52 | + | let l = fromBase64String(q) |
---|
53 | 53 | | let p = toBase58String(o.caller.bytes) |
---|
54 | 54 | | let n = j(k, l) |
---|
55 | | - | let s = 10000 |
---|
56 | | - | let t = "12345" |
---|
57 | | - | if ((q == 2)) |
---|
| 55 | + | let r = 10000 |
---|
| 56 | + | let s = "12345" |
---|
| 57 | + | let t = 3 |
---|
| 58 | + | if ((t == 2)) |
---|
58 | 59 | | then if ((73 > n)) |
---|
59 | | - | then WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "won:") + toString((s * 2))))]) |
---|
60 | | - | else WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "lost:") + toString(s)))]) |
---|
| 60 | + | then WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "won:") + toString((r * 2))))]) |
---|
| 61 | + | else WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "lost:") + toString(r)))]) |
---|
61 | 62 | | else if ((48 > n)) |
---|
62 | | - | then WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "won:") + toString((s * 3))))]) |
---|
63 | | - | else WriteSet([DataEntry(((p + "userid:") + t), ((((("rand:" + toString(n)) + "risk:") + toString(q)) + "lost:") + toString(s)))]) |
---|
| 63 | + | then WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "won:") + toString((r * 3))))]) |
---|
| 64 | + | else WriteSet([DataEntry(((p + "userid:") + s), ((((("rand:" + toString(n)) + "risk:") + toString(t)) + "lost:") + toString(r)))]) |
---|
64 | 65 | | } |
---|
65 | 66 | | |
---|
66 | 67 | | |
---|