tx · 6HkGmmPw3FwSkeHnydmjHJJJK8nDxjMrReZEuRyctjMG 3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC: -0.14000000 Waves 2022.10.18 17:27 [2277956] smart account 3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC > SELF 0.00000000 Waves
{ "type": 13, "id": "6HkGmmPw3FwSkeHnydmjHJJJK8nDxjMrReZEuRyctjMG", "fee": 14000000, "feeAssetId": null, "timestamp": 1666103211181, "version": 2, "chainId": 84, "sender": "3MtsXxXqERvHEmkPiiuBESuixd9Y8qAU1PC", "senderPublicKey": "EBCSQaTtuxQBJyc62F142LxJ3hpQtCwuZ2z9kkoe6Vvt", "proofs": [ "3dzxBAHoo8u2RBE6nZJJfwr2zvxTZ26B6wSzqeuVmcW59WYHKvdjQHXyk1SfPATokc1fpLCxZUQTTgk6VPixXHA1", "SKiK949pccRHH8SxggyitEFtkKP3bUNi1YsJvJRgjmkhkoFCGDc6sfYJi8JLaQdfeqAZwnAX2kRGHeyM891KTDT" ], "script": "base64:BgIbCAISABIECgIICBIFCgMBBAESBAoCAQgSABIAPwAGb3JhY2xlCQEHQWRkcmVzcwEBGgFUSBOXDMDTM8wlMoC2KfenZGiAq+PMe0uZAAd2ZXJzaW9uAgUxLjAuMAAIa1ZlcnNpb24CB3ZlcnNpb24AB2tBY3RpdmUCBmFjdGl2ZQALa0FjdGl2ZUdsb2ICFGFjdGl2ZV9hbGxfY29udHJhY3RzAA9rTnVtYmVyT2ZWb3RpbmcCFHZvdGluZ19hY3RpdmVfbnVtYmVyAA1rSGVpZ2h0T2ZQb29sAg5fZmluaXNoX2hlaWdodAADa05vAg9fdG90YWxfdm90ZXNfbm8ABGtZZXMCEF90b3RhbF92b3Rlc195ZXMAB2tOb1VzZXICCF92b3RlX25vAAhrWWVzVXNlcgIJX3ZvdGVfeWVzAA9rU3RhdHVzT2ZWb3RpbmcCB19zdGF0dXMAD2tBbW91bnRPZlZvdGluZwIOdm90aW5nX2lkX2xh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AEFAWkDBQZhY3RpdmUJAAIBAhZEQXBwIGlzIGFscmVhZHkgYWN0aXZlCQDMCAIJAQxCb29sZWFuRW50cnkCBQdrQWN0aXZlBgkAzAgCCQELRGVsZXRlRW50cnkBBQZrQ2F1c2UFA25pbAECdHgBBnZlcmlmeQAEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAub913Q=", "height": 2277956, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6NN1XcK3HGPbPXT9ZtW6qdWXB47267RkWpgVDcJvyNmd Next: 6sZEEaSg9e389m4azP6dugxRbKbPV1vYgw5e5vTySxUU Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
5 | 5 | ||
6 | - | let b = " | |
6 | + | let b = "1.0.0" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "version" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "active" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "active_all_contracts" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "voting_active_number" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_finish_height" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_total_votes_no" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_total_votes_yes" | |
21 | 21 | ||
22 | - | let j = "_ | |
22 | + | let j = "_vote_no" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "_vote_yes" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "_status" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "voting_id_last" | |
29 | 29 | ||
30 | - | let n = " | |
30 | + | let n = "max_amount_voting" | |
31 | 31 | ||
32 | - | let o = " | |
32 | + | let o = "max_day_voting" | |
33 | 33 | ||
34 | 34 | let p = "shutdown_cause" | |
35 | 35 | ||
36 | 36 | let q = "_cancel_cause" | |
37 | 37 | ||
38 | - | let r = "_ | |
38 | + | let r = "_GSwop_amount" | |
39 | 39 | ||
40 | 40 | let s = "_asset_name" | |
41 | 41 | ||
42 | 42 | let t = "_voting" | |
43 | 43 | ||
44 | - | let u = " | |
44 | + | let u = "voting_active_cell_1" | |
45 | 45 | ||
46 | - | let v = "voting_active_cell_ | |
46 | + | let v = "voting_active_cell_2" | |
47 | 47 | ||
48 | - | let w = "voting_active_cell_ | |
48 | + | let w = "voting_active_cell_3" | |
49 | 49 | ||
50 | - | let x = " | |
50 | + | let x = "admin_pub_1" | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = "admin_pub_2" | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = "admin_pub_3" | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = "money_box_address" | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = "governance_address" | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = "farming_address" | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = "usdn_asset_id" | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = "SWOP_id" | |
65 | 65 | ||
66 | - | let F = | |
66 | + | let F = getIntegerValue(this, f) | |
67 | 67 | ||
68 | - | let G = | |
68 | + | let G = getIntegerValue(this, m) | |
69 | 69 | ||
70 | - | let H = | |
70 | + | let H = valueOrElse(getString(this, u), "") | |
71 | 71 | ||
72 | - | let I = | |
72 | + | let I = valueOrElse(getString(this, v), "") | |
73 | 73 | ||
74 | - | let J = | |
74 | + | let J = valueOrElse(getString(this, w), "") | |
75 | 75 | ||
76 | - | let K = | |
76 | + | let K = getBooleanValue(this, d) | |
77 | 77 | ||
78 | - | let L = valueOrElse( | |
78 | + | let L = valueOrElse(getBoolean(a, e), true) | |
79 | 79 | ||
80 | - | let M = | |
80 | + | let M = 1000000000 | |
81 | 81 | ||
82 | - | let N = | |
82 | + | let N = 3 | |
83 | 83 | ||
84 | - | let O = | |
84 | + | let O = 7 | |
85 | 85 | ||
86 | - | let P = | |
86 | + | let P = (1443 * O) | |
87 | 87 | ||
88 | - | let Q = 1000 | |
88 | + | func Q (R) = { | |
89 | + | let S = getString(a, R) | |
90 | + | if ($isInstanceOf(S, "String")) | |
91 | + | then { | |
92 | + | let T = S | |
93 | + | fromBase58String(T) | |
94 | + | } | |
95 | + | else { | |
96 | + | let U = S | |
97 | + | throw((R + "is empty")) | |
98 | + | } | |
99 | + | } | |
89 | 100 | ||
90 | - | let R = 8 | |
91 | 101 | ||
92 | - | let | |
102 | + | let V = Q(x) | |
93 | 103 | ||
94 | - | let | |
104 | + | let W = Q(y) | |
95 | 105 | ||
96 | - | let | |
106 | + | let X = Q(z) | |
97 | 107 | ||
98 | - | func V (W) = { | |
99 | - | let X = W | |
100 | - | if ($isInstanceOf(X, "ByteVector")) | |
108 | + | let Y = Address(Q(B)) | |
109 | + | ||
110 | + | let Z = Address(Q(C)) | |
111 | + | ||
112 | + | let aa = Address(Q(A)) | |
113 | + | ||
114 | + | let ab = Q(D) | |
115 | + | ||
116 | + | let ac = fromBase58String(getStringValue(Z, E)) | |
117 | + | ||
118 | + | func ad () = if (if (K) | |
119 | + | then L | |
120 | + | else false) | |
121 | + | then unit | |
122 | + | else throw("DApp is inactive at this moment") | |
123 | + | ||
124 | + | ||
125 | + | func ae (af) = if (containsElement([V, W, X], af.callerPublicKey)) | |
126 | + | then unit | |
127 | + | else throw("Only admin can call this function") | |
128 | + | ||
129 | + | ||
130 | + | func ag (ah) = { | |
131 | + | let S = ah | |
132 | + | if ($isInstanceOf(S, "ByteVector")) | |
101 | 133 | then { | |
102 | - | let | |
103 | - | if (isDefined(assetInfo( | |
134 | + | let ai = S | |
135 | + | if (isDefined(assetInfo(ai))) | |
104 | 136 | then { | |
105 | - | let | |
106 | - | let | |
107 | - | $Tuple3( | |
137 | + | let aj = toBase58String(ai) | |
138 | + | let ak = valueOrErrorMessage(assetInfo(ai), (("Asset " + aj) + " doesn't exist")) | |
139 | + | $Tuple3(aj, ak.name, ak.decimals) | |
108 | 140 | } | |
109 | 141 | else throw("Asset is not defined") | |
110 | 142 | } | |
111 | - | else if ($isInstanceOf( | |
143 | + | else if ($isInstanceOf(S, "Unit")) | |
112 | 144 | then { | |
113 | - | let | |
145 | + | let al = S | |
114 | 146 | $Tuple3("WAVES", "WAVES", 8) | |
115 | 147 | } | |
116 | 148 | else throw("Match error") | |
117 | 149 | } | |
118 | 150 | ||
119 | 151 | ||
120 | - | func | |
121 | - | let | |
122 | - | let | |
123 | - | if (if ( | |
124 | - | then ( | |
152 | + | func am (an,ao,ap) = { | |
153 | + | let aq = split(an, "_") | |
154 | + | let ar = isDefined(getInteger(this, an)) | |
155 | + | if (if (ar) | |
156 | + | then (an != "") | |
125 | 157 | else false) | |
126 | 158 | then { | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | let | |
131 | - | let | |
132 | - | if ( | |
133 | - | then if (( | |
134 | - | then if ( | |
159 | + | let as = aq[2] | |
160 | + | let at = (((((ao + "_") + ap) + "_") + as) + t) | |
161 | + | let au = isDefined(getInteger(this, at)) | |
162 | + | let av = valueOrElse(getInteger(this, (as + g)), 0) | |
163 | + | let aw = valueOrElse(getBoolean(this, (as + l)), true) | |
164 | + | if (au) | |
165 | + | then if ((av > height)) | |
166 | + | then if (aw) | |
135 | 167 | then true | |
136 | 168 | else false | |
137 | 169 | else false | |
141 | 173 | } | |
142 | 174 | ||
143 | 175 | ||
144 | - | func | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | if (if ( | |
149 | - | then ( | |
176 | + | func ax (ay) = { | |
177 | + | let an = valueOrElse(getString(this, ay), "") | |
178 | + | let aq = split(an, "_") | |
179 | + | let ar = isDefined(getInteger(this, an)) | |
180 | + | if (if (ar) | |
181 | + | then (an != "") | |
150 | 182 | else false) | |
151 | 183 | then { | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | if (( | |
156 | - | then if ( | |
184 | + | let as = aq[2] | |
185 | + | let av = valueOrElse(getInteger(this, (as + g)), 0) | |
186 | + | let aw = valueOrElse(getBoolean(this, (as + l)), true) | |
187 | + | if ((av > height)) | |
188 | + | then if (aw) | |
157 | 189 | then "" | |
158 | - | else | |
159 | - | else | |
190 | + | else ay | |
191 | + | else ay | |
160 | 192 | } | |
161 | - | else | |
193 | + | else ay | |
162 | 194 | } | |
163 | 195 | ||
164 | 196 | ||
165 | - | func | |
197 | + | func az (ao,ap) = if (if (am(H, ao, ap)) | |
166 | 198 | then true | |
167 | - | else | |
199 | + | else am(I, ao, ap)) | |
168 | 200 | then true | |
169 | - | else | |
201 | + | else am(J, ao, ap) | |
170 | 202 | ||
171 | 203 | ||
172 | - | func | |
173 | - | let | |
174 | - | let | |
175 | - | let | |
176 | - | if ((0 > | |
204 | + | func aA (as) = { | |
205 | + | let av = valueOrElse(getInteger(this, (toString(as) + g)), 0) | |
206 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
207 | + | let aB = height | |
208 | + | if ((0 > as)) | |
177 | 209 | then 0 | |
178 | - | else if (!( | |
210 | + | else if (!(aw)) | |
179 | 211 | then 0 | |
180 | - | else if (( | |
212 | + | else if ((av > aB)) | |
181 | 213 | then 1 | |
182 | 214 | else 0 | |
183 | 215 | } | |
184 | 216 | ||
185 | 217 | ||
186 | - | func | |
218 | + | func aC () = ((aA(valueOrElse(getInteger(this, H), -1)) + aA(valueOrElse(getInteger(this, I), -1))) + aA(valueOrElse(getInteger(this, J), -1))) | |
187 | 219 | ||
188 | 220 | ||
189 | - | func | |
190 | - | then | |
191 | - | else if (( | |
192 | - | then | |
193 | - | else if (( | |
194 | - | then | |
221 | + | func aD () = if ((ax(u) != "")) | |
222 | + | then u | |
223 | + | else if ((ax(v) != "")) | |
224 | + | then v | |
225 | + | else if ((ax(w) != "")) | |
226 | + | then w | |
195 | 227 | else "" | |
196 | 228 | ||
197 | 229 | ||
198 | - | func | |
230 | + | func aE (aF) = if ((aF == "WAVES")) | |
199 | 231 | then unit | |
200 | - | else fromBase58String( | |
232 | + | else fromBase58String(aF) | |
201 | 233 | ||
202 | 234 | ||
203 | - | func | |
235 | + | func aG (aH) = if ((valueOrElse(getInteger(Y, (toString(aH) + r)), 0) > 0)) | |
204 | 236 | then true | |
205 | 237 | else false | |
206 | 238 | ||
207 | 239 | ||
208 | - | func | |
240 | + | func aI (aJ) = [BooleanEntry(d, false), StringEntry(p, aJ)] | |
209 | 241 | ||
210 | 242 | ||
211 | - | func aA (aB,aC) = throw(((((("Insufficient DApp balance to pay " + toString(aB)) + " ") + aC) + " due to staking.") + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
212 | - | ||
213 | - | ||
214 | - | @Callable(aD) | |
215 | - | func init () = if ((aD.caller != this)) | |
243 | + | @Callable(af) | |
244 | + | func init () = if ((af.caller != this)) | |
216 | 245 | then throw("Only the DApp itself can call this function") | |
217 | - | else if (isDefined(getBoolean(this, | |
246 | + | else if (isDefined(getBoolean(this, d))) | |
218 | 247 | then throw("DApp is already active") | |
219 | 248 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | [StringEntry( | |
249 | + | let aK = 0 | |
250 | + | let aL = 0 | |
251 | + | let aM = true | |
252 | + | let aN = "" | |
253 | + | [StringEntry(c, b), BooleanEntry(d, aM), IntegerEntry(f, aK), IntegerEntry(m, aL), IntegerEntry(n, N), IntegerEntry(o, O), StringEntry(u, aN), StringEntry(v, aN), StringEntry(w, aN)] | |
225 | 254 | } | |
226 | 255 | ||
227 | 256 | ||
228 | 257 | ||
229 | - | @Callable(aD) | |
230 | - | func initVotingForNewPool (ae,af) = { | |
231 | - | let aI = $Tuple2(aD.payments[0].amount, aD.payments[0].assetId) | |
232 | - | let aJ = aI._1 | |
233 | - | let aK = aI._2 | |
234 | - | let aL = $Tuple2(au(ae), au(af)) | |
235 | - | let aM = aL._1 | |
236 | - | let aN = aL._2 | |
237 | - | let aO = at() | |
238 | - | let aP = as() | |
239 | - | let aQ = ap(ae, af) | |
240 | - | let aR = V(aM) | |
258 | + | @Callable(af) | |
259 | + | func initVotingForNewPool (ao,ap) = valueOrElse(ad(), { | |
260 | + | let aO = $Tuple2(af.payments[0].amount, af.payments[0].assetId) | |
261 | + | let aP = aO._1 | |
262 | + | let aQ = aO._2 | |
263 | + | let aR = $Tuple2(aE(ao), aE(ap)) | |
241 | 264 | let aS = aR._1 | |
242 | 265 | let aT = aR._2 | |
243 | - | let aU = aR._3 | |
244 | - | let aV = V(aN) | |
245 | - | let aW = aV._1 | |
246 | - | let aX = aV._2 | |
247 | - | let aY = aV._3 | |
248 | - | if (!(H)) | |
249 | - | then throw("DApp is inactive at this moment") | |
250 | - | else if ((aM == aN)) | |
251 | - | then throw("Assets must be different") | |
252 | - | else if (aQ) | |
253 | - | then throw("This pool already exists") | |
254 | - | else if (if (((aP + 1) > S)) | |
255 | - | then true | |
256 | - | else (aO == "")) | |
257 | - | then throw(("Too many votings. Maximum quantity: " + toString(S))) | |
258 | - | else if ((size(aD.payments) != 1)) | |
259 | - | then throw("One attached asset expected") | |
260 | - | else if ((aK != F)) | |
261 | - | then throw("You must use a SWOP token") | |
262 | - | else if (if ((ae == "")) | |
266 | + | let aU = aD() | |
267 | + | let aV = aC() | |
268 | + | let aW = az(ao, ap) | |
269 | + | let aX = ag(aS) | |
270 | + | let aY = aX._1 | |
271 | + | let aZ = aX._2 | |
272 | + | let ba = aX._3 | |
273 | + | let bb = ag(aT) | |
274 | + | let bc = bb._1 | |
275 | + | let bd = bb._2 | |
276 | + | let be = bb._3 | |
277 | + | if ((aS == aT)) | |
278 | + | then throw("Assets must be different") | |
279 | + | else if (aW) | |
280 | + | then throw("This pool already exists") | |
281 | + | else if ((size(af.payments) != 1)) | |
282 | + | then throw("One attached asset expected") | |
283 | + | else if ((aQ != ac)) | |
284 | + | then throw("You must use a SWOP token") | |
285 | + | else if (if ((ao == "")) | |
286 | + | then true | |
287 | + | else (ap == "")) | |
288 | + | then throw("Assets can't be empty") | |
289 | + | else if ((aP != M)) | |
290 | + | then throw("You need to attach 10 SWOP tokens") | |
291 | + | else if (!(if (if ((aT == ab)) | |
263 | 292 | then true | |
264 | - | else (af == "")) | |
265 | - | then throw("Assets can't be empty") | |
266 | - | else if ((aJ != N)) | |
267 | - | then throw("You need to attach 10 SWOP tokens") | |
268 | - | else if (!(if (if (if ((aN == E)) | |
269 | - | then true | |
270 | - | else (aN == unit)) | |
271 | - | then true | |
272 | - | else (aN == F)) | |
273 | - | then true | |
274 | - | else (aN == G))) | |
275 | - | then throw("assetB must be USDN, WAVES or SWOP") | |
276 | - | else [IntegerEntry((((((ae + "_") + af) + "_") + toString(J)) + t), J), IntegerEntry((toString(J) + e), (height + U)), BooleanEntry((toString(J) + j), true), IntegerEntry(k, (J + 1)), IntegerEntry(d, (aP + 1)), StringEntry((ae + s), aT), StringEntry((af + s), aX), StringEntry(aO, (((((ae + "_") + af) + "_") + toString(J)) + t)), ScriptTransfer(C, aJ, aK)] | |
277 | - | } | |
293 | + | else (aT == unit)) | |
294 | + | then true | |
295 | + | else (aT == ac))) | |
296 | + | then throw("assetB must be USDN, WAVES or SWOP") | |
297 | + | else if (if (((aV + 1) > N)) | |
298 | + | then true | |
299 | + | else (aU == "")) | |
300 | + | then throw(("Too many votings. Maximum quantity: " + toString(N))) | |
301 | + | else [IntegerEntry((((((ao + "_") + ap) + "_") + toString(G)) + t), G), IntegerEntry((toString(G) + g), (height + P)), BooleanEntry((toString(G) + l), true), IntegerEntry(m, (G + 1)), IntegerEntry(f, (aV + 1)), StringEntry((ao + s), aZ), StringEntry((ap + s), bd), StringEntry(aU, (((((ao + "_") + ap) + "_") + toString(G)) + t)), ScriptTransfer(aa, aP, aQ)] | |
302 | + | }) | |
278 | 303 | ||
279 | 304 | ||
280 | 305 | ||
281 | - | @Callable( | |
282 | - | func voteForPool ( | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | then (valueOrElse(getInteger(this, (((toString( | |
289 | - | else (valueOrElse(getInteger(this, (((toString( | |
290 | - | if (!( | |
306 | + | @Callable(af) | |
307 | + | func voteForPool (as,bf,bg) = valueOrElse(ad(), { | |
308 | + | let aB = height | |
309 | + | let bh = valueOrErrorMessage(getIntegerValue(this, (toString(as) + g)), "Empty pool height") | |
310 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
311 | + | let bi = valueOrElse(getInteger(Y, (toString(af.caller) + r)), 0) | |
312 | + | let bj = if (bf) | |
313 | + | then (valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + j)), 0) + bg) | |
314 | + | else (valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + k)), 0) + bg) | |
315 | + | if (!(aG(af.caller))) | |
291 | 316 | then throw("This address has 0 SWOP in Governance dApp") | |
292 | - | else if (!( | |
317 | + | else if (!(aw)) | |
293 | 318 | then throw("This voting was canceled") | |
294 | - | else if (( | |
319 | + | else if ((aB > bh)) | |
295 | 320 | then throw("This voting was expired") | |
296 | - | else if ((0 > | |
321 | + | else if ((0 > bg)) | |
297 | 322 | then throw("The number of votes must be positive") | |
298 | - | else if (( | |
299 | - | then throw((((toString(this) + " has ") + toString( | |
300 | - | else if ( | |
323 | + | else if ((bj > bi)) | |
324 | + | then throw((((toString(this) + " has ") + toString(bi)) + " SWOP in governance.")) | |
325 | + | else if (bf) | |
301 | 326 | then { | |
302 | - | let | |
303 | - | let | |
304 | - | [IntegerEntry((toString( | |
327 | + | let bk = valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + k)), 0) | |
328 | + | let bl = ((valueOrElse(getInteger(this, (toString(as) + i)), 0) - bk) + bg) | |
329 | + | [IntegerEntry((toString(as) + i), bl), IntegerEntry((((toString(af.caller) + "_") + toString(as)) + k), bg)] | |
305 | 330 | } | |
306 | 331 | else { | |
307 | - | let | |
308 | - | let | |
309 | - | [IntegerEntry((toString( | |
332 | + | let bk = valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + j)), 0) | |
333 | + | let bl = ((valueOrElse(getInteger(this, (toString(as) + h)), 0) - bk) + bg) | |
334 | + | [IntegerEntry((toString(as) + h), bl), IntegerEntry((((toString(af.caller) + "_") + toString(as)) + j), bg)] | |
310 | 335 | } | |
311 | - | } | |
336 | + | }) | |
312 | 337 | ||
313 | 338 | ||
314 | 339 | ||
315 | - | @Callable(aD) | |
316 | - | func cancelVoting (ai,az) = { | |
317 | - | let am = valueOrElse(getBoolean(this, (toString(ai) + j)), true) | |
318 | - | if (!(H)) | |
319 | - | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, p), "the cause wasn't specified"))) | |
320 | - | else if (!(containsElement([y, z, A], aD.callerPublicKey))) | |
321 | - | then throw("Only admin can call this function") | |
322 | - | else if (!(am)) | |
323 | - | then throw((("Voting " + toString(ai)) + " has already been stopped")) | |
324 | - | else [IntegerEntry(d, (I - 1)), BooleanEntry((toString(ai) + j), false), StringEntry((toString(ai) + q), az)] | |
325 | - | } | |
340 | + | @Callable(af) | |
341 | + | func cancelVoting (as,aJ) = valueOrElse(ae(af), { | |
342 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
343 | + | if (!(aw)) | |
344 | + | then throw((("Voting " + toString(as)) + " has already been stopped")) | |
345 | + | else [IntegerEntry(f, (F - 1)), BooleanEntry((toString(as) + l), false), StringEntry((toString(as) + q), aJ)] | |
346 | + | }) | |
326 | 347 | ||
327 | 348 | ||
328 | 349 | ||
329 | - | @Callable( | |
330 | - | func shutdown () = if (!( | |
350 | + | @Callable(af) | |
351 | + | func shutdown () = valueOrElse(ae(af), if (!(K)) | |
331 | 352 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, p), "the cause wasn't specified"))) | |
332 | - | else if (!(containsElement([y, z, A, B], aD.callerPublicKey))) | |
333 | - | then throw("Only admin can call this function") | |
334 | - | else ay("Paused by admin") | |
353 | + | else aI("Paused by admin")) | |
335 | 354 | ||
336 | 355 | ||
337 | 356 | ||
338 | - | @Callable( | |
339 | - | func activate () = if ( | |
357 | + | @Callable(af) | |
358 | + | func activate () = valueOrElse(ae(af), if (K) | |
340 | 359 | then throw("DApp is already active") | |
341 | - | else if (!(containsElement([y, z, A, B], aD.callerPublicKey))) | |
342 | - | then throw("Only admin can call this function") | |
343 | - | else [BooleanEntry(c, true), DeleteEntry(p)] | |
360 | + | else [BooleanEntry(d, true), DeleteEntry(p)]) | |
344 | 361 | ||
345 | 362 | ||
346 | - | @Verifier( | |
347 | - | func | |
348 | - | let | |
363 | + | @Verifier(bm) | |
364 | + | func bn () = { | |
365 | + | let bo = if (sigVerify(bm.bodyBytes, bm.proofs[0], V)) | |
349 | 366 | then 1 | |
350 | 367 | else 0 | |
351 | - | let | |
368 | + | let bp = if (sigVerify(bm.bodyBytes, bm.proofs[1], W)) | |
352 | 369 | then 1 | |
353 | 370 | else 0 | |
354 | - | let | |
371 | + | let bq = if (sigVerify(bm.bodyBytes, bm.proofs[2], X)) | |
355 | 372 | then 1 | |
356 | 373 | else 0 | |
357 | - | ((( | |
374 | + | (((bo + bp) + bq) >= 2) | |
358 | 375 | } | |
359 | 376 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
5 | 5 | ||
6 | - | let b = " | |
6 | + | let b = "1.0.0" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "version" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "active" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "active_all_contracts" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "voting_active_number" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_finish_height" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_total_votes_no" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_total_votes_yes" | |
21 | 21 | ||
22 | - | let j = "_ | |
22 | + | let j = "_vote_no" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "_vote_yes" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "_status" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "voting_id_last" | |
29 | 29 | ||
30 | - | let n = " | |
30 | + | let n = "max_amount_voting" | |
31 | 31 | ||
32 | - | let o = " | |
32 | + | let o = "max_day_voting" | |
33 | 33 | ||
34 | 34 | let p = "shutdown_cause" | |
35 | 35 | ||
36 | 36 | let q = "_cancel_cause" | |
37 | 37 | ||
38 | - | let r = "_ | |
38 | + | let r = "_GSwop_amount" | |
39 | 39 | ||
40 | 40 | let s = "_asset_name" | |
41 | 41 | ||
42 | 42 | let t = "_voting" | |
43 | 43 | ||
44 | - | let u = " | |
44 | + | let u = "voting_active_cell_1" | |
45 | 45 | ||
46 | - | let v = "voting_active_cell_ | |
46 | + | let v = "voting_active_cell_2" | |
47 | 47 | ||
48 | - | let w = "voting_active_cell_ | |
48 | + | let w = "voting_active_cell_3" | |
49 | 49 | ||
50 | - | let x = " | |
50 | + | let x = "admin_pub_1" | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = "admin_pub_2" | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = "admin_pub_3" | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = "money_box_address" | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = "governance_address" | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = "farming_address" | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = "usdn_asset_id" | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = "SWOP_id" | |
65 | 65 | ||
66 | - | let F = | |
66 | + | let F = getIntegerValue(this, f) | |
67 | 67 | ||
68 | - | let G = | |
68 | + | let G = getIntegerValue(this, m) | |
69 | 69 | ||
70 | - | let H = | |
70 | + | let H = valueOrElse(getString(this, u), "") | |
71 | 71 | ||
72 | - | let I = | |
72 | + | let I = valueOrElse(getString(this, v), "") | |
73 | 73 | ||
74 | - | let J = | |
74 | + | let J = valueOrElse(getString(this, w), "") | |
75 | 75 | ||
76 | - | let K = | |
76 | + | let K = getBooleanValue(this, d) | |
77 | 77 | ||
78 | - | let L = valueOrElse( | |
78 | + | let L = valueOrElse(getBoolean(a, e), true) | |
79 | 79 | ||
80 | - | let M = | |
80 | + | let M = 1000000000 | |
81 | 81 | ||
82 | - | let N = | |
82 | + | let N = 3 | |
83 | 83 | ||
84 | - | let O = | |
84 | + | let O = 7 | |
85 | 85 | ||
86 | - | let P = | |
86 | + | let P = (1443 * O) | |
87 | 87 | ||
88 | - | let Q = 1000 | |
88 | + | func Q (R) = { | |
89 | + | let S = getString(a, R) | |
90 | + | if ($isInstanceOf(S, "String")) | |
91 | + | then { | |
92 | + | let T = S | |
93 | + | fromBase58String(T) | |
94 | + | } | |
95 | + | else { | |
96 | + | let U = S | |
97 | + | throw((R + "is empty")) | |
98 | + | } | |
99 | + | } | |
89 | 100 | ||
90 | - | let R = 8 | |
91 | 101 | ||
92 | - | let | |
102 | + | let V = Q(x) | |
93 | 103 | ||
94 | - | let | |
104 | + | let W = Q(y) | |
95 | 105 | ||
96 | - | let | |
106 | + | let X = Q(z) | |
97 | 107 | ||
98 | - | func V (W) = { | |
99 | - | let X = W | |
100 | - | if ($isInstanceOf(X, "ByteVector")) | |
108 | + | let Y = Address(Q(B)) | |
109 | + | ||
110 | + | let Z = Address(Q(C)) | |
111 | + | ||
112 | + | let aa = Address(Q(A)) | |
113 | + | ||
114 | + | let ab = Q(D) | |
115 | + | ||
116 | + | let ac = fromBase58String(getStringValue(Z, E)) | |
117 | + | ||
118 | + | func ad () = if (if (K) | |
119 | + | then L | |
120 | + | else false) | |
121 | + | then unit | |
122 | + | else throw("DApp is inactive at this moment") | |
123 | + | ||
124 | + | ||
125 | + | func ae (af) = if (containsElement([V, W, X], af.callerPublicKey)) | |
126 | + | then unit | |
127 | + | else throw("Only admin can call this function") | |
128 | + | ||
129 | + | ||
130 | + | func ag (ah) = { | |
131 | + | let S = ah | |
132 | + | if ($isInstanceOf(S, "ByteVector")) | |
101 | 133 | then { | |
102 | - | let | |
103 | - | if (isDefined(assetInfo( | |
134 | + | let ai = S | |
135 | + | if (isDefined(assetInfo(ai))) | |
104 | 136 | then { | |
105 | - | let | |
106 | - | let | |
107 | - | $Tuple3( | |
137 | + | let aj = toBase58String(ai) | |
138 | + | let ak = valueOrErrorMessage(assetInfo(ai), (("Asset " + aj) + " doesn't exist")) | |
139 | + | $Tuple3(aj, ak.name, ak.decimals) | |
108 | 140 | } | |
109 | 141 | else throw("Asset is not defined") | |
110 | 142 | } | |
111 | - | else if ($isInstanceOf( | |
143 | + | else if ($isInstanceOf(S, "Unit")) | |
112 | 144 | then { | |
113 | - | let | |
145 | + | let al = S | |
114 | 146 | $Tuple3("WAVES", "WAVES", 8) | |
115 | 147 | } | |
116 | 148 | else throw("Match error") | |
117 | 149 | } | |
118 | 150 | ||
119 | 151 | ||
120 | - | func | |
121 | - | let | |
122 | - | let | |
123 | - | if (if ( | |
124 | - | then ( | |
152 | + | func am (an,ao,ap) = { | |
153 | + | let aq = split(an, "_") | |
154 | + | let ar = isDefined(getInteger(this, an)) | |
155 | + | if (if (ar) | |
156 | + | then (an != "") | |
125 | 157 | else false) | |
126 | 158 | then { | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | let | |
131 | - | let | |
132 | - | if ( | |
133 | - | then if (( | |
134 | - | then if ( | |
159 | + | let as = aq[2] | |
160 | + | let at = (((((ao + "_") + ap) + "_") + as) + t) | |
161 | + | let au = isDefined(getInteger(this, at)) | |
162 | + | let av = valueOrElse(getInteger(this, (as + g)), 0) | |
163 | + | let aw = valueOrElse(getBoolean(this, (as + l)), true) | |
164 | + | if (au) | |
165 | + | then if ((av > height)) | |
166 | + | then if (aw) | |
135 | 167 | then true | |
136 | 168 | else false | |
137 | 169 | else false | |
138 | 170 | else false | |
139 | 171 | } | |
140 | 172 | else false | |
141 | 173 | } | |
142 | 174 | ||
143 | 175 | ||
144 | - | func | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | if (if ( | |
149 | - | then ( | |
176 | + | func ax (ay) = { | |
177 | + | let an = valueOrElse(getString(this, ay), "") | |
178 | + | let aq = split(an, "_") | |
179 | + | let ar = isDefined(getInteger(this, an)) | |
180 | + | if (if (ar) | |
181 | + | then (an != "") | |
150 | 182 | else false) | |
151 | 183 | then { | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | if (( | |
156 | - | then if ( | |
184 | + | let as = aq[2] | |
185 | + | let av = valueOrElse(getInteger(this, (as + g)), 0) | |
186 | + | let aw = valueOrElse(getBoolean(this, (as + l)), true) | |
187 | + | if ((av > height)) | |
188 | + | then if (aw) | |
157 | 189 | then "" | |
158 | - | else | |
159 | - | else | |
190 | + | else ay | |
191 | + | else ay | |
160 | 192 | } | |
161 | - | else | |
193 | + | else ay | |
162 | 194 | } | |
163 | 195 | ||
164 | 196 | ||
165 | - | func | |
197 | + | func az (ao,ap) = if (if (am(H, ao, ap)) | |
166 | 198 | then true | |
167 | - | else | |
199 | + | else am(I, ao, ap)) | |
168 | 200 | then true | |
169 | - | else | |
201 | + | else am(J, ao, ap) | |
170 | 202 | ||
171 | 203 | ||
172 | - | func | |
173 | - | let | |
174 | - | let | |
175 | - | let | |
176 | - | if ((0 > | |
204 | + | func aA (as) = { | |
205 | + | let av = valueOrElse(getInteger(this, (toString(as) + g)), 0) | |
206 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
207 | + | let aB = height | |
208 | + | if ((0 > as)) | |
177 | 209 | then 0 | |
178 | - | else if (!( | |
210 | + | else if (!(aw)) | |
179 | 211 | then 0 | |
180 | - | else if (( | |
212 | + | else if ((av > aB)) | |
181 | 213 | then 1 | |
182 | 214 | else 0 | |
183 | 215 | } | |
184 | 216 | ||
185 | 217 | ||
186 | - | func | |
218 | + | func aC () = ((aA(valueOrElse(getInteger(this, H), -1)) + aA(valueOrElse(getInteger(this, I), -1))) + aA(valueOrElse(getInteger(this, J), -1))) | |
187 | 219 | ||
188 | 220 | ||
189 | - | func | |
190 | - | then | |
191 | - | else if (( | |
192 | - | then | |
193 | - | else if (( | |
194 | - | then | |
221 | + | func aD () = if ((ax(u) != "")) | |
222 | + | then u | |
223 | + | else if ((ax(v) != "")) | |
224 | + | then v | |
225 | + | else if ((ax(w) != "")) | |
226 | + | then w | |
195 | 227 | else "" | |
196 | 228 | ||
197 | 229 | ||
198 | - | func | |
230 | + | func aE (aF) = if ((aF == "WAVES")) | |
199 | 231 | then unit | |
200 | - | else fromBase58String( | |
232 | + | else fromBase58String(aF) | |
201 | 233 | ||
202 | 234 | ||
203 | - | func | |
235 | + | func aG (aH) = if ((valueOrElse(getInteger(Y, (toString(aH) + r)), 0) > 0)) | |
204 | 236 | then true | |
205 | 237 | else false | |
206 | 238 | ||
207 | 239 | ||
208 | - | func | |
240 | + | func aI (aJ) = [BooleanEntry(d, false), StringEntry(p, aJ)] | |
209 | 241 | ||
210 | 242 | ||
211 | - | func aA (aB,aC) = throw(((((("Insufficient DApp balance to pay " + toString(aB)) + " ") + aC) + " due to staking.") + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
212 | - | ||
213 | - | ||
214 | - | @Callable(aD) | |
215 | - | func init () = if ((aD.caller != this)) | |
243 | + | @Callable(af) | |
244 | + | func init () = if ((af.caller != this)) | |
216 | 245 | then throw("Only the DApp itself can call this function") | |
217 | - | else if (isDefined(getBoolean(this, | |
246 | + | else if (isDefined(getBoolean(this, d))) | |
218 | 247 | then throw("DApp is already active") | |
219 | 248 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | [StringEntry( | |
249 | + | let aK = 0 | |
250 | + | let aL = 0 | |
251 | + | let aM = true | |
252 | + | let aN = "" | |
253 | + | [StringEntry(c, b), BooleanEntry(d, aM), IntegerEntry(f, aK), IntegerEntry(m, aL), IntegerEntry(n, N), IntegerEntry(o, O), StringEntry(u, aN), StringEntry(v, aN), StringEntry(w, aN)] | |
225 | 254 | } | |
226 | 255 | ||
227 | 256 | ||
228 | 257 | ||
229 | - | @Callable(aD) | |
230 | - | func initVotingForNewPool (ae,af) = { | |
231 | - | let aI = $Tuple2(aD.payments[0].amount, aD.payments[0].assetId) | |
232 | - | let aJ = aI._1 | |
233 | - | let aK = aI._2 | |
234 | - | let aL = $Tuple2(au(ae), au(af)) | |
235 | - | let aM = aL._1 | |
236 | - | let aN = aL._2 | |
237 | - | let aO = at() | |
238 | - | let aP = as() | |
239 | - | let aQ = ap(ae, af) | |
240 | - | let aR = V(aM) | |
258 | + | @Callable(af) | |
259 | + | func initVotingForNewPool (ao,ap) = valueOrElse(ad(), { | |
260 | + | let aO = $Tuple2(af.payments[0].amount, af.payments[0].assetId) | |
261 | + | let aP = aO._1 | |
262 | + | let aQ = aO._2 | |
263 | + | let aR = $Tuple2(aE(ao), aE(ap)) | |
241 | 264 | let aS = aR._1 | |
242 | 265 | let aT = aR._2 | |
243 | - | let aU = aR._3 | |
244 | - | let aV = V(aN) | |
245 | - | let aW = aV._1 | |
246 | - | let aX = aV._2 | |
247 | - | let aY = aV._3 | |
248 | - | if (!(H)) | |
249 | - | then throw("DApp is inactive at this moment") | |
250 | - | else if ((aM == aN)) | |
251 | - | then throw("Assets must be different") | |
252 | - | else if (aQ) | |
253 | - | then throw("This pool already exists") | |
254 | - | else if (if (((aP + 1) > S)) | |
255 | - | then true | |
256 | - | else (aO == "")) | |
257 | - | then throw(("Too many votings. Maximum quantity: " + toString(S))) | |
258 | - | else if ((size(aD.payments) != 1)) | |
259 | - | then throw("One attached asset expected") | |
260 | - | else if ((aK != F)) | |
261 | - | then throw("You must use a SWOP token") | |
262 | - | else if (if ((ae == "")) | |
266 | + | let aU = aD() | |
267 | + | let aV = aC() | |
268 | + | let aW = az(ao, ap) | |
269 | + | let aX = ag(aS) | |
270 | + | let aY = aX._1 | |
271 | + | let aZ = aX._2 | |
272 | + | let ba = aX._3 | |
273 | + | let bb = ag(aT) | |
274 | + | let bc = bb._1 | |
275 | + | let bd = bb._2 | |
276 | + | let be = bb._3 | |
277 | + | if ((aS == aT)) | |
278 | + | then throw("Assets must be different") | |
279 | + | else if (aW) | |
280 | + | then throw("This pool already exists") | |
281 | + | else if ((size(af.payments) != 1)) | |
282 | + | then throw("One attached asset expected") | |
283 | + | else if ((aQ != ac)) | |
284 | + | then throw("You must use a SWOP token") | |
285 | + | else if (if ((ao == "")) | |
286 | + | then true | |
287 | + | else (ap == "")) | |
288 | + | then throw("Assets can't be empty") | |
289 | + | else if ((aP != M)) | |
290 | + | then throw("You need to attach 10 SWOP tokens") | |
291 | + | else if (!(if (if ((aT == ab)) | |
263 | 292 | then true | |
264 | - | else (af == "")) | |
265 | - | then throw("Assets can't be empty") | |
266 | - | else if ((aJ != N)) | |
267 | - | then throw("You need to attach 10 SWOP tokens") | |
268 | - | else if (!(if (if (if ((aN == E)) | |
269 | - | then true | |
270 | - | else (aN == unit)) | |
271 | - | then true | |
272 | - | else (aN == F)) | |
273 | - | then true | |
274 | - | else (aN == G))) | |
275 | - | then throw("assetB must be USDN, WAVES or SWOP") | |
276 | - | else [IntegerEntry((((((ae + "_") + af) + "_") + toString(J)) + t), J), IntegerEntry((toString(J) + e), (height + U)), BooleanEntry((toString(J) + j), true), IntegerEntry(k, (J + 1)), IntegerEntry(d, (aP + 1)), StringEntry((ae + s), aT), StringEntry((af + s), aX), StringEntry(aO, (((((ae + "_") + af) + "_") + toString(J)) + t)), ScriptTransfer(C, aJ, aK)] | |
277 | - | } | |
293 | + | else (aT == unit)) | |
294 | + | then true | |
295 | + | else (aT == ac))) | |
296 | + | then throw("assetB must be USDN, WAVES or SWOP") | |
297 | + | else if (if (((aV + 1) > N)) | |
298 | + | then true | |
299 | + | else (aU == "")) | |
300 | + | then throw(("Too many votings. Maximum quantity: " + toString(N))) | |
301 | + | else [IntegerEntry((((((ao + "_") + ap) + "_") + toString(G)) + t), G), IntegerEntry((toString(G) + g), (height + P)), BooleanEntry((toString(G) + l), true), IntegerEntry(m, (G + 1)), IntegerEntry(f, (aV + 1)), StringEntry((ao + s), aZ), StringEntry((ap + s), bd), StringEntry(aU, (((((ao + "_") + ap) + "_") + toString(G)) + t)), ScriptTransfer(aa, aP, aQ)] | |
302 | + | }) | |
278 | 303 | ||
279 | 304 | ||
280 | 305 | ||
281 | - | @Callable( | |
282 | - | func voteForPool ( | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | then (valueOrElse(getInteger(this, (((toString( | |
289 | - | else (valueOrElse(getInteger(this, (((toString( | |
290 | - | if (!( | |
306 | + | @Callable(af) | |
307 | + | func voteForPool (as,bf,bg) = valueOrElse(ad(), { | |
308 | + | let aB = height | |
309 | + | let bh = valueOrErrorMessage(getIntegerValue(this, (toString(as) + g)), "Empty pool height") | |
310 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
311 | + | let bi = valueOrElse(getInteger(Y, (toString(af.caller) + r)), 0) | |
312 | + | let bj = if (bf) | |
313 | + | then (valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + j)), 0) + bg) | |
314 | + | else (valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + k)), 0) + bg) | |
315 | + | if (!(aG(af.caller))) | |
291 | 316 | then throw("This address has 0 SWOP in Governance dApp") | |
292 | - | else if (!( | |
317 | + | else if (!(aw)) | |
293 | 318 | then throw("This voting was canceled") | |
294 | - | else if (( | |
319 | + | else if ((aB > bh)) | |
295 | 320 | then throw("This voting was expired") | |
296 | - | else if ((0 > | |
321 | + | else if ((0 > bg)) | |
297 | 322 | then throw("The number of votes must be positive") | |
298 | - | else if (( | |
299 | - | then throw((((toString(this) + " has ") + toString( | |
300 | - | else if ( | |
323 | + | else if ((bj > bi)) | |
324 | + | then throw((((toString(this) + " has ") + toString(bi)) + " SWOP in governance.")) | |
325 | + | else if (bf) | |
301 | 326 | then { | |
302 | - | let | |
303 | - | let | |
304 | - | [IntegerEntry((toString( | |
327 | + | let bk = valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + k)), 0) | |
328 | + | let bl = ((valueOrElse(getInteger(this, (toString(as) + i)), 0) - bk) + bg) | |
329 | + | [IntegerEntry((toString(as) + i), bl), IntegerEntry((((toString(af.caller) + "_") + toString(as)) + k), bg)] | |
305 | 330 | } | |
306 | 331 | else { | |
307 | - | let | |
308 | - | let | |
309 | - | [IntegerEntry((toString( | |
332 | + | let bk = valueOrElse(getInteger(this, (((toString(af.caller) + "_") + toString(as)) + j)), 0) | |
333 | + | let bl = ((valueOrElse(getInteger(this, (toString(as) + h)), 0) - bk) + bg) | |
334 | + | [IntegerEntry((toString(as) + h), bl), IntegerEntry((((toString(af.caller) + "_") + toString(as)) + j), bg)] | |
310 | 335 | } | |
311 | - | } | |
336 | + | }) | |
312 | 337 | ||
313 | 338 | ||
314 | 339 | ||
315 | - | @Callable(aD) | |
316 | - | func cancelVoting (ai,az) = { | |
317 | - | let am = valueOrElse(getBoolean(this, (toString(ai) + j)), true) | |
318 | - | if (!(H)) | |
319 | - | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, p), "the cause wasn't specified"))) | |
320 | - | else if (!(containsElement([y, z, A], aD.callerPublicKey))) | |
321 | - | then throw("Only admin can call this function") | |
322 | - | else if (!(am)) | |
323 | - | then throw((("Voting " + toString(ai)) + " has already been stopped")) | |
324 | - | else [IntegerEntry(d, (I - 1)), BooleanEntry((toString(ai) + j), false), StringEntry((toString(ai) + q), az)] | |
325 | - | } | |
340 | + | @Callable(af) | |
341 | + | func cancelVoting (as,aJ) = valueOrElse(ae(af), { | |
342 | + | let aw = valueOrElse(getBoolean(this, (toString(as) + l)), true) | |
343 | + | if (!(aw)) | |
344 | + | then throw((("Voting " + toString(as)) + " has already been stopped")) | |
345 | + | else [IntegerEntry(f, (F - 1)), BooleanEntry((toString(as) + l), false), StringEntry((toString(as) + q), aJ)] | |
346 | + | }) | |
326 | 347 | ||
327 | 348 | ||
328 | 349 | ||
329 | - | @Callable( | |
330 | - | func shutdown () = if (!( | |
350 | + | @Callable(af) | |
351 | + | func shutdown () = valueOrElse(ae(af), if (!(K)) | |
331 | 352 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, p), "the cause wasn't specified"))) | |
332 | - | else if (!(containsElement([y, z, A, B], aD.callerPublicKey))) | |
333 | - | then throw("Only admin can call this function") | |
334 | - | else ay("Paused by admin") | |
353 | + | else aI("Paused by admin")) | |
335 | 354 | ||
336 | 355 | ||
337 | 356 | ||
338 | - | @Callable( | |
339 | - | func activate () = if ( | |
357 | + | @Callable(af) | |
358 | + | func activate () = valueOrElse(ae(af), if (K) | |
340 | 359 | then throw("DApp is already active") | |
341 | - | else if (!(containsElement([y, z, A, B], aD.callerPublicKey))) | |
342 | - | then throw("Only admin can call this function") | |
343 | - | else [BooleanEntry(c, true), DeleteEntry(p)] | |
360 | + | else [BooleanEntry(d, true), DeleteEntry(p)]) | |
344 | 361 | ||
345 | 362 | ||
346 | - | @Verifier( | |
347 | - | func | |
348 | - | let | |
363 | + | @Verifier(bm) | |
364 | + | func bn () = { | |
365 | + | let bo = if (sigVerify(bm.bodyBytes, bm.proofs[0], V)) | |
349 | 366 | then 1 | |
350 | 367 | else 0 | |
351 | - | let | |
368 | + | let bp = if (sigVerify(bm.bodyBytes, bm.proofs[1], W)) | |
352 | 369 | then 1 | |
353 | 370 | else 0 | |
354 | - | let | |
371 | + | let bq = if (sigVerify(bm.bodyBytes, bm.proofs[2], X)) | |
355 | 372 | then 1 | |
356 | 373 | else 0 | |
357 | - | ((( | |
374 | + | (((bo + bp) + bq) >= 2) | |
358 | 375 | } | |
359 | 376 |
github/deemru/w8io/026f985 109.82 ms ◑