tx · GrV1u2t9T5EnwvykP8swXtZzm6AwgwGgEDZPChq31adD 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.07.01 19:11 [566545] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "GrV1u2t9T5EnwvykP8swXtZzm6AwgwGgEDZPChq31adD", "fee": 1400000, "feeAssetId": null, "timestamp": 1561997499656, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "2gM3vubgKzJMqboWYhgDLQMn2KXAtT7nshvPttTSFnsVp6Hx99pQXnwqkUarhsZJXy6KXQouhPQXvfs1sVLwkGLk" ], "script": "base64:AAIDAAAAAAAAAAAAAAAmAAAAAA9TZXJ2ZXJQdWJsaWNLZXkBAAAAIL79hxhmqWX34iA/RS9p36FY3qCJjLclClmAz4vj6GlBAAAAAA1TZXJ2ZXJBZGRyZXNzCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNNdThvS1NjV0N3UjMzWW9tVDV1a1U3M1A3akxyeVpUazRzAAAAABBSb3VsZXR0ZVNlY3Rpb25zAAAAAAAAAAAVAAAAABFEYXRhR2FtZU51bWJlcktleQIAAAALQVBQX0dBTUVfSUQAAAAADURhdGFBbW91bnRLZXkCAAAABkFNT1VOVAAAAAAORGF0YVNlY3Rpb25LZXkCAAAAB1NFQ1RJT04AAAAADURhdGFTdGF0dXNLZXkCAAAABlNUQVRVUwAAAAANRGF0YVJlc3VsdEtleQIAAAAGUkVTVUxUAAAAABBEYXRhV2luQW1vdW50S2V5AgAAAApXSU5fQU1PVU5UAAAAAA1EYXRhU3RhdHVzTmV3AgAAAANORVcAAAAADURhdGFTdGF0dXNXaW4CAAAAA1dJTgAAAAAPRGF0YVN0YXR1c0xvb3NlA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AAEFAAAABWlzV2luCQAETAAAAAIJAQAAAAxTdG9yZURhdGFJbnQAAAADBQAAABFnYW1lVHJhbnNhY3Rpb25JZAUAAAANRGF0YVJlc3VsdEtleQUAAAAEcmFuZAUAAAADbmlsAwUAAAAFaXNXaW4EAAAABndhbGxldAkBAAAAB0dldERhdGEAAAABBQAAABFnYW1lVHJhbnNhY3Rpb25JZAQAAAAJd2luQW1vdW50CQEAAAAKR2V0RGF0YUludAAAAAIFAAAAEWdhbWVUcmFuc2FjdGlvbklkBQAAABBEYXRhV2luQW1vdW50S2V5CQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAAId3JpdGVTZXQJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAZ3YWxsZXQFAAAACXdpbkFtb3VudAUAAAAEdW5pdAUAAAADbmlsBQAAAAh3cml0ZVNldAkAAAIAAAABCQABLAAAAAIFAAAADUVycm9yR2FtZU92ZXIFAAAABnN0YXR1cwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAGBwdRByRp", "chainId": 84, "height": 566545, "spentComplexity": 0 } View: original | compacted Prev: DdidCosjvqoP3AM1mWJ4rp2JXEBF2xaasnvRk2Z8TjjJ Next: ED1Uts4s3TsVKmjLQ1UoRTSAsupSeT2qGeQemCLShAM4 Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | ||
40 | 40 | let s = (14 * m) | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = "Only waves accepted" | |
43 | 43 | ||
44 | - | let u = " | |
44 | + | let u = "Parameter size must be greater than 0" | |
45 | 45 | ||
46 | - | let v = "Parameter size must be | |
46 | + | let v = "Parameter size must be less than 100" | |
47 | 47 | ||
48 | - | let w = " | |
48 | + | let w = "Bet amount must be in Waves" | |
49 | 49 | ||
50 | - | let x = " | |
50 | + | let x = "Transaction's fee must be in Waves" | |
51 | 51 | ||
52 | - | let y = " | |
52 | + | let y = "Passed txId had been used before. Game aborted." | |
53 | 53 | ||
54 | - | let z = " | |
54 | + | let z = "Key not found: " | |
55 | 55 | ||
56 | - | let A = " | |
56 | + | let A = "Game already is over" | |
57 | 57 | ||
58 | - | let B = " | |
58 | + | let B = "Incorrect section result" | |
59 | 59 | ||
60 | - | let C = " | |
60 | + | let C = "Bet amount is not in range" | |
61 | 61 | ||
62 | - | let D = "Bet amount is not in range" | |
63 | - | ||
64 | - | func E (F,G,H) = DataEntry(((F + "_") + G), H) | |
62 | + | func D (E,F,G) = DataEntry(((E + "_") + F), G) | |
65 | 63 | ||
66 | 64 | ||
67 | - | func | |
65 | + | func H (E,F,G) = DataEntry(((E + "_") + F), G) | |
68 | 66 | ||
69 | 67 | ||
70 | - | func | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
68 | + | func I (F) = { | |
69 | + | let J = getString(this, F) | |
70 | + | if ($isInstanceOf(J, "String")) | |
73 | 71 | then { | |
74 | - | let | |
75 | - | | |
72 | + | let K = J | |
73 | + | K | |
76 | 74 | } | |
77 | - | else throw(( | |
75 | + | else throw((z + F)) | |
78 | 76 | } | |
79 | 77 | ||
80 | 78 | ||
81 | - | func | |
82 | - | let | |
83 | - | let | |
84 | - | if ($isInstanceOf( | |
79 | + | func L (E,F) = { | |
80 | + | let M = ((E + "_") + F) | |
81 | + | let J = getString(this, M) | |
82 | + | if ($isInstanceOf(J, "String")) | |
85 | 83 | then { | |
86 | - | let | |
87 | - | | |
84 | + | let K = J | |
85 | + | K | |
88 | 86 | } | |
89 | - | else throw(( | |
87 | + | else throw((z + M)) | |
90 | 88 | } | |
91 | 89 | ||
92 | 90 | ||
93 | - | func | |
94 | - | let | |
95 | - | let | |
96 | - | if ($isInstanceOf( | |
91 | + | func N (E,F) = { | |
92 | + | let M = ((E + "_") + F) | |
93 | + | let J = getInteger(this, M) | |
94 | + | if ($isInstanceOf(J, "Int")) | |
97 | 95 | then { | |
98 | - | let | |
99 | - | | |
96 | + | let K = J | |
97 | + | K | |
100 | 98 | } | |
101 | - | else throw(( | |
99 | + | else throw((z + M)) | |
102 | 100 | } | |
103 | 101 | ||
104 | 102 | ||
105 | - | func | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
103 | + | func O () = { | |
104 | + | let P = { | |
105 | + | let J = getInteger(this, d) | |
106 | + | if ($isInstanceOf(J, "Int")) | |
109 | 107 | then { | |
110 | - | let | |
111 | - | | |
108 | + | let Q = J | |
109 | + | Q | |
112 | 110 | } | |
113 | 111 | else 0 | |
114 | 112 | } | |
115 | - | ( | |
113 | + | (P + 1) | |
116 | 114 | } | |
117 | 115 | ||
118 | 116 | ||
119 | - | func | |
120 | - | let | |
121 | - | if ( | |
117 | + | func R (S,T) = { | |
118 | + | let U = sigVerify(fromBase58String(S), fromBase58String(T), a) | |
119 | + | if (U) | |
122 | 120 | then { | |
123 | - | let | |
124 | - | if ((0 > | |
125 | - | then (-1 * | |
126 | - | else | |
121 | + | let V = (toInt(sha256(toBytes(T))) % c) | |
122 | + | if ((0 > V)) | |
123 | + | then (-1 * V) | |
124 | + | else V | |
127 | 125 | } | |
128 | 126 | else throw("Invalid RSA signature") | |
129 | 127 | } | |
130 | 128 | ||
131 | 129 | ||
132 | - | func | |
130 | + | func W (X) = if (X) | |
133 | 131 | then k | |
134 | 132 | else l | |
135 | 133 | ||
136 | 134 | ||
137 | - | func | |
138 | - | let | |
135 | + | func Y (Z,aa) = { | |
136 | + | let ab = if (if (if (if ((aa == 2)) | |
139 | 137 | then true | |
140 | - | else (ab > 20) | |
141 | - | let ad = if (if (if (if ((aa == (o + n))) | |
138 | + | else (aa == 5)) | |
142 | 139 | then true | |
143 | - | else (aa == | |
140 | + | else (aa == 6)) | |
144 | 141 | then true | |
145 | - | else (aa == | |
142 | + | else (aa == 10)) | |
146 | 143 | then true | |
147 | - | else (aa == (r + n))) | |
144 | + | else (aa == 20) | |
145 | + | let ac = if (if (if (if ((Z == (o + n))) | |
148 | 146 | then true | |
149 | - | else (aa == (s + n)) | |
150 | - | if (ac) | |
151 | - | then throw(C) | |
152 | - | else if (ad) | |
153 | - | then ((aa - n) * t[ab]) | |
154 | - | else throw(D) | |
147 | + | else (Z == (p + n))) | |
148 | + | then true | |
149 | + | else (Z == (q + n))) | |
150 | + | then true | |
151 | + | else (Z == (r + n))) | |
152 | + | then true | |
153 | + | else (Z == (s + n)) | |
154 | + | if (!(ab)) | |
155 | + | then throw(B) | |
156 | + | else if (ac) | |
157 | + | then ((Z - n) * aa) | |
158 | + | else throw(C) | |
155 | 159 | } | |
156 | 160 | ||
157 | 161 | ||
158 | - | @Callable( | |
159 | - | func bet ( | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | if ( | |
170 | - | then throw( | |
171 | - | else if ( | |
172 | - | then throw( | |
173 | - | else if ( | |
174 | - | then throw( | |
175 | - | else ScriptResult(WriteSet([DataEntry( | |
162 | + | @Callable(ad) | |
163 | + | func bet (ae) = { | |
164 | + | let af = O() | |
165 | + | let ag = toBase58String(ad.transactionId) | |
166 | + | let ah = toBase58String(ad.caller.bytes) | |
167 | + | let ai = extract(ad.payment) | |
168 | + | let aj = isDefined(getString(this, ag)) | |
169 | + | let ak = isDefined(ai.assetId) | |
170 | + | let al = isDefined(ai.assetId) | |
171 | + | let am = ai.amount | |
172 | + | let an = Y(ai.amount, ae) | |
173 | + | if (ak) | |
174 | + | then throw(w) | |
175 | + | else if (al) | |
176 | + | then throw(x) | |
177 | + | else if (aj) | |
178 | + | then throw(y) | |
179 | + | else ScriptResult(WriteSet([DataEntry(ag, ah), DataEntry(d, af), H(ag, e, am), H(ag, f, ae), D(ag, g, j), H(ag, i, an)]), TransferSet([ScriptTransfer(b, n, unit)])) | |
176 | 180 | } | |
177 | 181 | ||
178 | 182 | ||
179 | 183 | ||
180 | - | @Callable( | |
181 | - | func result ( | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | if (( | |
184 | + | @Callable(ad) | |
185 | + | func result (ag,ao) = { | |
186 | + | let V = R(ag, ao) | |
187 | + | let ap = N(ag, f) | |
188 | + | let aq = L(ag, g) | |
189 | + | if ((aq == j)) | |
186 | 190 | then { | |
187 | - | let | |
188 | - | let | |
189 | - | if ( | |
191 | + | let ar = (V == ap) | |
192 | + | let as = WriteSet([D(ag, g, W(ar)), H(ag, h, V)]) | |
193 | + | if (ar) | |
190 | 194 | then { | |
191 | - | let | |
192 | - | let | |
193 | - | ScriptResult( | |
195 | + | let at = I(ag) | |
196 | + | let au = N(ag, i) | |
197 | + | ScriptResult(as, TransferSet([ScriptTransfer(addressFromStringValue(at), au, unit)])) | |
194 | 198 | } | |
195 | - | else | |
199 | + | else as | |
196 | 200 | } | |
197 | - | else throw(( | |
201 | + | else throw((A + aq)) | |
198 | 202 | } | |
199 | 203 | ||
200 | 204 | ||
201 | - | @Verifier( | |
202 | - | func | |
205 | + | @Verifier(av) | |
206 | + | func aw () = if (sigVerify(av.bodyBytes, av.proofs[0], av.senderPublicKey)) | |
203 | 207 | then { | |
204 | - | let | |
205 | - | if ($isInstanceOf( | |
208 | + | let J = av | |
209 | + | if ($isInstanceOf(J, "SetScriptTransaction")) | |
206 | 210 | then { | |
207 | - | let | |
211 | + | let ax = J | |
208 | 212 | true | |
209 | 213 | } | |
210 | 214 | else false |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'DrYgfD7j6AKD1iXtn9uhMka95ATZB42B1kGKCUATP2UG' | |
5 | 5 | ||
6 | 6 | let b = addressFromStringValue("3Mu8oKScWCwR33YomT5ukU73P7jLryZTk4s") | |
7 | 7 | ||
8 | 8 | let c = 21 | |
9 | 9 | ||
10 | 10 | let d = "APP_GAME_ID" | |
11 | 11 | ||
12 | 12 | let e = "AMOUNT" | |
13 | 13 | ||
14 | 14 | let f = "SECTION" | |
15 | 15 | ||
16 | 16 | let g = "STATUS" | |
17 | 17 | ||
18 | 18 | let h = "RESULT" | |
19 | 19 | ||
20 | 20 | let i = "WIN_AMOUNT" | |
21 | 21 | ||
22 | 22 | let j = "NEW" | |
23 | 23 | ||
24 | 24 | let k = "WIN" | |
25 | 25 | ||
26 | 26 | let l = "LOOSE" | |
27 | 27 | ||
28 | 28 | let m = ((100 * 1000) * 1000) | |
29 | 29 | ||
30 | 30 | let n = ((5 * m) / 1000) | |
31 | 31 | ||
32 | 32 | let o = (1 * m) | |
33 | 33 | ||
34 | 34 | let p = (2 * m) | |
35 | 35 | ||
36 | 36 | let q = (4 * m) | |
37 | 37 | ||
38 | 38 | let r = (8 * m) | |
39 | 39 | ||
40 | 40 | let s = (14 * m) | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = "Only waves accepted" | |
43 | 43 | ||
44 | - | let u = " | |
44 | + | let u = "Parameter size must be greater than 0" | |
45 | 45 | ||
46 | - | let v = "Parameter size must be | |
46 | + | let v = "Parameter size must be less than 100" | |
47 | 47 | ||
48 | - | let w = " | |
48 | + | let w = "Bet amount must be in Waves" | |
49 | 49 | ||
50 | - | let x = " | |
50 | + | let x = "Transaction's fee must be in Waves" | |
51 | 51 | ||
52 | - | let y = " | |
52 | + | let y = "Passed txId had been used before. Game aborted." | |
53 | 53 | ||
54 | - | let z = " | |
54 | + | let z = "Key not found: " | |
55 | 55 | ||
56 | - | let A = " | |
56 | + | let A = "Game already is over" | |
57 | 57 | ||
58 | - | let B = " | |
58 | + | let B = "Incorrect section result" | |
59 | 59 | ||
60 | - | let C = " | |
60 | + | let C = "Bet amount is not in range" | |
61 | 61 | ||
62 | - | let D = "Bet amount is not in range" | |
63 | - | ||
64 | - | func E (F,G,H) = DataEntry(((F + "_") + G), H) | |
62 | + | func D (E,F,G) = DataEntry(((E + "_") + F), G) | |
65 | 63 | ||
66 | 64 | ||
67 | - | func | |
65 | + | func H (E,F,G) = DataEntry(((E + "_") + F), G) | |
68 | 66 | ||
69 | 67 | ||
70 | - | func | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
68 | + | func I (F) = { | |
69 | + | let J = getString(this, F) | |
70 | + | if ($isInstanceOf(J, "String")) | |
73 | 71 | then { | |
74 | - | let | |
75 | - | | |
72 | + | let K = J | |
73 | + | K | |
76 | 74 | } | |
77 | - | else throw(( | |
75 | + | else throw((z + F)) | |
78 | 76 | } | |
79 | 77 | ||
80 | 78 | ||
81 | - | func | |
82 | - | let | |
83 | - | let | |
84 | - | if ($isInstanceOf( | |
79 | + | func L (E,F) = { | |
80 | + | let M = ((E + "_") + F) | |
81 | + | let J = getString(this, M) | |
82 | + | if ($isInstanceOf(J, "String")) | |
85 | 83 | then { | |
86 | - | let | |
87 | - | | |
84 | + | let K = J | |
85 | + | K | |
88 | 86 | } | |
89 | - | else throw(( | |
87 | + | else throw((z + M)) | |
90 | 88 | } | |
91 | 89 | ||
92 | 90 | ||
93 | - | func | |
94 | - | let | |
95 | - | let | |
96 | - | if ($isInstanceOf( | |
91 | + | func N (E,F) = { | |
92 | + | let M = ((E + "_") + F) | |
93 | + | let J = getInteger(this, M) | |
94 | + | if ($isInstanceOf(J, "Int")) | |
97 | 95 | then { | |
98 | - | let | |
99 | - | | |
96 | + | let K = J | |
97 | + | K | |
100 | 98 | } | |
101 | - | else throw(( | |
99 | + | else throw((z + M)) | |
102 | 100 | } | |
103 | 101 | ||
104 | 102 | ||
105 | - | func | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
103 | + | func O () = { | |
104 | + | let P = { | |
105 | + | let J = getInteger(this, d) | |
106 | + | if ($isInstanceOf(J, "Int")) | |
109 | 107 | then { | |
110 | - | let | |
111 | - | | |
108 | + | let Q = J | |
109 | + | Q | |
112 | 110 | } | |
113 | 111 | else 0 | |
114 | 112 | } | |
115 | - | ( | |
113 | + | (P + 1) | |
116 | 114 | } | |
117 | 115 | ||
118 | 116 | ||
119 | - | func | |
120 | - | let | |
121 | - | if ( | |
117 | + | func R (S,T) = { | |
118 | + | let U = sigVerify(fromBase58String(S), fromBase58String(T), a) | |
119 | + | if (U) | |
122 | 120 | then { | |
123 | - | let | |
124 | - | if ((0 > | |
125 | - | then (-1 * | |
126 | - | else | |
121 | + | let V = (toInt(sha256(toBytes(T))) % c) | |
122 | + | if ((0 > V)) | |
123 | + | then (-1 * V) | |
124 | + | else V | |
127 | 125 | } | |
128 | 126 | else throw("Invalid RSA signature") | |
129 | 127 | } | |
130 | 128 | ||
131 | 129 | ||
132 | - | func | |
130 | + | func W (X) = if (X) | |
133 | 131 | then k | |
134 | 132 | else l | |
135 | 133 | ||
136 | 134 | ||
137 | - | func | |
138 | - | let | |
135 | + | func Y (Z,aa) = { | |
136 | + | let ab = if (if (if (if ((aa == 2)) | |
139 | 137 | then true | |
140 | - | else (ab > 20) | |
141 | - | let ad = if (if (if (if ((aa == (o + n))) | |
138 | + | else (aa == 5)) | |
142 | 139 | then true | |
143 | - | else (aa == | |
140 | + | else (aa == 6)) | |
144 | 141 | then true | |
145 | - | else (aa == | |
142 | + | else (aa == 10)) | |
146 | 143 | then true | |
147 | - | else (aa == (r + n))) | |
144 | + | else (aa == 20) | |
145 | + | let ac = if (if (if (if ((Z == (o + n))) | |
148 | 146 | then true | |
149 | - | else (aa == (s + n)) | |
150 | - | if (ac) | |
151 | - | then throw(C) | |
152 | - | else if (ad) | |
153 | - | then ((aa - n) * t[ab]) | |
154 | - | else throw(D) | |
147 | + | else (Z == (p + n))) | |
148 | + | then true | |
149 | + | else (Z == (q + n))) | |
150 | + | then true | |
151 | + | else (Z == (r + n))) | |
152 | + | then true | |
153 | + | else (Z == (s + n)) | |
154 | + | if (!(ab)) | |
155 | + | then throw(B) | |
156 | + | else if (ac) | |
157 | + | then ((Z - n) * aa) | |
158 | + | else throw(C) | |
155 | 159 | } | |
156 | 160 | ||
157 | 161 | ||
158 | - | @Callable( | |
159 | - | func bet ( | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | if ( | |
170 | - | then throw( | |
171 | - | else if ( | |
172 | - | then throw( | |
173 | - | else if ( | |
174 | - | then throw( | |
175 | - | else ScriptResult(WriteSet([DataEntry( | |
162 | + | @Callable(ad) | |
163 | + | func bet (ae) = { | |
164 | + | let af = O() | |
165 | + | let ag = toBase58String(ad.transactionId) | |
166 | + | let ah = toBase58String(ad.caller.bytes) | |
167 | + | let ai = extract(ad.payment) | |
168 | + | let aj = isDefined(getString(this, ag)) | |
169 | + | let ak = isDefined(ai.assetId) | |
170 | + | let al = isDefined(ai.assetId) | |
171 | + | let am = ai.amount | |
172 | + | let an = Y(ai.amount, ae) | |
173 | + | if (ak) | |
174 | + | then throw(w) | |
175 | + | else if (al) | |
176 | + | then throw(x) | |
177 | + | else if (aj) | |
178 | + | then throw(y) | |
179 | + | else ScriptResult(WriteSet([DataEntry(ag, ah), DataEntry(d, af), H(ag, e, am), H(ag, f, ae), D(ag, g, j), H(ag, i, an)]), TransferSet([ScriptTransfer(b, n, unit)])) | |
176 | 180 | } | |
177 | 181 | ||
178 | 182 | ||
179 | 183 | ||
180 | - | @Callable( | |
181 | - | func result ( | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | if (( | |
184 | + | @Callable(ad) | |
185 | + | func result (ag,ao) = { | |
186 | + | let V = R(ag, ao) | |
187 | + | let ap = N(ag, f) | |
188 | + | let aq = L(ag, g) | |
189 | + | if ((aq == j)) | |
186 | 190 | then { | |
187 | - | let | |
188 | - | let | |
189 | - | if ( | |
191 | + | let ar = (V == ap) | |
192 | + | let as = WriteSet([D(ag, g, W(ar)), H(ag, h, V)]) | |
193 | + | if (ar) | |
190 | 194 | then { | |
191 | - | let | |
192 | - | let | |
193 | - | ScriptResult( | |
195 | + | let at = I(ag) | |
196 | + | let au = N(ag, i) | |
197 | + | ScriptResult(as, TransferSet([ScriptTransfer(addressFromStringValue(at), au, unit)])) | |
194 | 198 | } | |
195 | - | else | |
199 | + | else as | |
196 | 200 | } | |
197 | - | else throw(( | |
201 | + | else throw((A + aq)) | |
198 | 202 | } | |
199 | 203 | ||
200 | 204 | ||
201 | - | @Verifier( | |
202 | - | func | |
205 | + | @Verifier(av) | |
206 | + | func aw () = if (sigVerify(av.bodyBytes, av.proofs[0], av.senderPublicKey)) | |
203 | 207 | then { | |
204 | - | let | |
205 | - | if ($isInstanceOf( | |
208 | + | let J = av | |
209 | + | if ($isInstanceOf(J, "SetScriptTransaction")) | |
206 | 210 | then { | |
207 | - | let | |
211 | + | let ax = J | |
208 | 212 | true | |
209 | 213 | } | |
210 | 214 | else false | |
211 | 215 | } | |
212 | 216 | else false | |
213 | 217 |
github/deemru/w8io/026f985 84.28 ms ◑