tx · HvUisbNom7CphFmyCUeqzACd9PCMFU7nsJ9q3WY3uSEP 3MuvBJpADBsCka7S6WMRgtLRFTEdxagh1vp: -0.01400000 Waves 2019.06.30 12:04 [564661] smart account 3MuvBJpADBsCka7S6WMRgtLRFTEdxagh1vp > SELF 0.00000000 Waves
{ "type": 13, "id": "HvUisbNom7CphFmyCUeqzACd9PCMFU7nsJ9q3WY3uSEP", "fee": 1400000, "feeAssetId": null, "timestamp": 1561885489365, "version": 1, "sender": "3MuvBJpADBsCka7S6WMRgtLRFTEdxagh1vp", "senderPublicKey": "HSP9V7edVKjfLJUfRkEF6vfV9Tyz4Us4yqH9rkwqnHY", "proofs": [ "g2vGBEecqippTYSPfaDwUTmmfUbULcwS94cWosu4ytNBDqDvY4VEeVhSEmuETLH5hNwHCP9DkzAD4ADYpZ7kNtm" ], "script": "base64:AAIDAAAAAAAAAAAAAAAXAAAAAA9TZXJ2ZXJQdWJsaWNLZXkBAAAAIAQ1/gW4L6VUuKyMox3deX07Tu0dL8x1obg+vYqfUuwTAAAAABBSb3VsZXR0ZVNlY3Rpb25zAAAAAAAAAAAVAAAAABFEYXRhR2FtZU51bWJlcktleQIAAAALQVBQX0dBTUVfSUQAAAAADURhdGFBbW91bnRLZXkCAAAABkFNT1VOVAAAAAAORGF0YVNlY3Rpb25LZXkCAAAAB1NFQ1RJT04AAAAADURhdGFTdGF0dXNLZXkCAAAABlNUQVRVUwAAAAANRGF0YVN0YXR1c05ldwIAAAADTkVXAAAAAA1EYXRhU3RhdHVzV2luAgAAAANXSU4AAAAAD0RhdGFTdGF0dXNMb29zZQIAAAAFTE9PU0UAAAAAFkVycm9yT25seVdhdmVzQWNjZXB0ZWQCAAAAE09ubHkgd2F2ZXMgYWNjZXB0ZWQAAAAAFUVycm9yTXVzdEdyZWF0ZXJUaGFuMAIAAAAlUGFyYW1ldGVyIHNpemUgbXVzdCBiZSBncmVhdGVyIHRoYW4gMAAAAAAURXJyb3JNdXN0TGVzc1RoYW4xMDACAA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AAAEAAAACdHgBAAAABnZlcmlmeQAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAGBwfH4z1z", "chainId": 84, "height": 564661, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = base58'HSP9V7edVKjfLJUfRkEF6vfV9Tyz4Us4yqH9rkwqnHY' | |
5 | + | ||
6 | + | let b = 21 | |
7 | + | ||
8 | + | let c = "APP_GAME_ID" | |
9 | + | ||
10 | + | let d = "AMOUNT" | |
11 | + | ||
12 | + | let e = "SECTION" | |
13 | + | ||
14 | + | let f = "STATUS" | |
15 | + | ||
16 | + | let g = "NEW" | |
17 | + | ||
18 | + | let h = "WIN" | |
19 | + | ||
20 | + | let i = "LOOSE" | |
21 | + | ||
22 | + | let j = "Only waves accepted" | |
23 | + | ||
24 | + | let k = "Parameter size must be greater than 0" | |
25 | + | ||
26 | + | let l = "Parameter size must be less than 100" | |
27 | + | ||
28 | + | let m = "Bet amount must be in Waves" | |
29 | + | ||
30 | + | let n = "Transaction's fee must be in Waves" | |
31 | + | ||
32 | + | let o = "Passed txId had been used before. Game aborted." | |
33 | + | ||
34 | + | let p = "Key not found: " | |
35 | + | ||
36 | + | let q = "Game already is over" | |
37 | + | ||
38 | + | func r (s,t,u) = DataEntry(((s + "_") + t), u) | |
39 | + | ||
40 | + | ||
41 | + | func v (s,t,u) = DataEntry(((s + "_") + t), u) | |
42 | + | ||
43 | + | ||
44 | + | func w (s,t) = { | |
45 | + | let x = ((s + "_") + t) | |
46 | + | let y = getString(this, x) | |
47 | + | if ($isInstanceOf(y, "String")) | |
48 | + | then { | |
49 | + | let z = y | |
50 | + | z | |
51 | + | } | |
52 | + | else throw((p + x)) | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | func A (s,t) = { | |
57 | + | let x = ((s + "_") + t) | |
58 | + | let y = getInteger(this, x) | |
59 | + | if ($isInstanceOf(y, "Int")) | |
60 | + | then { | |
61 | + | let z = y | |
62 | + | z | |
63 | + | } | |
64 | + | else throw((p + x)) | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | func B () = { | |
69 | + | let C = { | |
70 | + | let y = getInteger(this, c) | |
71 | + | if ($isInstanceOf(y, "Int")) | |
72 | + | then { | |
73 | + | let D = y | |
74 | + | D | |
75 | + | } | |
76 | + | else 0 | |
77 | + | } | |
78 | + | (C + 1) | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func E (F,G) = { | |
83 | + | let H = sigVerify(fromBase58String(F), fromBase58String(G), a) | |
84 | + | if (H) | |
85 | + | then { | |
86 | + | let I = (toInt(sha256(toBytes(G))) % b) | |
87 | + | if ((0 > I)) | |
88 | + | then (-1 * I) | |
89 | + | else I | |
90 | + | } | |
91 | + | else throw("Invalid RSA signature") | |
92 | + | } | |
93 | + | ||
94 | + | ||
95 | + | @Callable(J) | |
96 | + | func bet (K) = { | |
97 | + | let L = B() | |
98 | + | let M = toBase58String(J.transactionId) | |
99 | + | let N = toBase58String(J.caller.bytes) | |
100 | + | let O = extract(J.payment) | |
101 | + | let P = isDefined(getString(this, M)) | |
102 | + | let Q = isDefined(O.assetId) | |
103 | + | let R = isDefined(O.assetId) | |
104 | + | let S = O.amount | |
105 | + | if (Q) | |
106 | + | then throw(m) | |
107 | + | else if (R) | |
108 | + | then throw(n) | |
109 | + | else if (P) | |
110 | + | then throw(o) | |
111 | + | else WriteSet([DataEntry(M, N), DataEntry(c, L), v(M, d, S), v(M, e, K), r(M, f, g)]) | |
112 | + | } | |
113 | + | ||
114 | + | ||
115 | + | ||
116 | + | @Callable(J) | |
117 | + | func result (M,T) = { | |
118 | + | let I = E(M, T) | |
119 | + | let U = A(M, e) | |
120 | + | let V = w(M, f) | |
121 | + | if ((V == g)) | |
122 | + | then { | |
123 | + | let W = (I == U) | |
124 | + | if (W) | |
125 | + | then WriteSet([r(M, f, h)]) | |
126 | + | else WriteSet([r(M, f, i)]) | |
127 | + | } | |
128 | + | else throw((q + V)) | |
129 | + | } | |
130 | + | ||
131 | + | ||
132 | + | @Verifier(X) | |
133 | + | func Y () = if (sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey)) | |
134 | + | then { | |
135 | + | let y = X | |
136 | + | if ($isInstanceOf(y, "SetScriptTransaction")) | |
137 | + | then { | |
138 | + | let Z = y | |
139 | + | true | |
140 | + | } | |
141 | + | else false | |
142 | + | } | |
143 | + | else false | |
144 | + |
github/deemru/w8io/026f985 15.63 ms ◑