tx · D5Td2rbPe6mDS8JpFxjA4iKjmL2Eh7q69gtXFsJkT3FZ 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx: -0.01400000 Waves 2023.08.07 15:47 [2700185] smart account 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx > SELF 0.00000000 Waves
{ "type": 13, "id": "D5Td2rbPe6mDS8JpFxjA4iKjmL2Eh7q69gtXFsJkT3FZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1691412554344, "version": 2, "chainId": 84, "sender": "3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx", "senderPublicKey": "62CHk4MqTdq3LqeUycy7TPnpvwrjgerSa2FqAY2EafXn", "proofs": [ "bQSuYtZ5qCcjGcZabzcrsPGVRzzV6XxnbiEnZfVgp2heCLhWKvs7r7eQqrmC88Z6iRFGqsaF1jhjxwxvXPbLANp" ], "script": "base64:BwJuCAISBAoCCAgSBAoCCAESBAoCCAQSBAoCCAISAwoBCBIDCgEBEgMKAQESBQoDAgECEgUKAwIYGBIECgICARIECgICARIFCgMBAQESBQoDAQEBEgASAwoBCBIAEgASAwoBCBIAEgQKAggIEgMKAQgxAANTRVACAl9fAAVXQVZFUwIFV0FWRVMAEGNvbnRyYWN0RmlsZW5hbWUCDGZhY3RvcnkucmlkZQEHd3JhcEVycgEBcwkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzAQh0aHJvd0VycgEBcwkAAgEJAQd3cmFwRXJyAQUBcwEPc3RyaW5nVG9Bc3NldElkAQFzAwkAAAIFAXMFBVdBVkVTBQR1bml0CQDZBAEFAXMAD0FETUlOX0xJU1RfU0laRQAFAAZRVU9SVU0AAwARVFhJRF9CWVRFU19MRU5HVEgAIAEYa2V5QWxsb3dlZFR4SWRWb3RlUHJlZml4AQR0eElkCQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICCWFsbG93VHhJZAkAzAgCBQR0eElkBQNuaWwFA1NFUAEQa2V5RnVsbEFkb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, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FnjdA9Rj9FxjWAKpa45AtPk5xfNBPzmKCN2dqmAzu8xx Next: EP1UgKEVvxPxEhFsGZUbi8MrsVjuyR7Xbp1w4fdE1Pd3 Diff:
Old | New | Differences | |
---|---|---|---|
414 | 414 | ||
415 | 415 | ||
416 | 416 | @Callable(i) | |
417 | + | func claimCollateralREADONLY (userAddress,txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateralREADONLY", [fromBase58String(userAddress), fromBase58String(txIdStr)], nil)) | |
418 | + | ||
419 | + | ||
420 | + | ||
421 | + | @Callable(i) | |
417 | 422 | func voteForTxId (txId) = { | |
418 | 423 | let callerAddressString = toBase58String(i.caller.bytes) | |
419 | 424 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let WAVES = "WAVES" | |
7 | 7 | ||
8 | 8 | let contractFilename = "factory.ride" | |
9 | 9 | ||
10 | 10 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func throwErr (s) = throw(wrapErr(s)) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func stringToAssetId (s) = if ((s == WAVES)) | |
17 | 17 | then unit | |
18 | 18 | else fromBase58String(s) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let ADMIN_LIST_SIZE = 5 | |
22 | 22 | ||
23 | 23 | let QUORUM = 3 | |
24 | 24 | ||
25 | 25 | let TXID_BYTES_LENGTH = 32 | |
26 | 26 | ||
27 | 27 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getAdminVote (prefix,admin) = { | |
40 | 40 | let voteKey = keyFullAdminVote(prefix, admin) | |
41 | 41 | valueOrElse(getInteger(voteKey), 0) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
46 | 46 | case s: String => | |
47 | 47 | split(s, SEP) | |
48 | 48 | case _ => | |
49 | 49 | nil | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func genVotesKeysHelper (a,adminAddress) = { | |
57 | 57 | let $t013751399 = a | |
58 | 58 | let result = $t013751399._1 | |
59 | 59 | let prefix = $t013751399._2 | |
60 | 60 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func genVotesKeys (keyPrefix) = { | |
65 | 65 | let adminList = keyAdminAddressList() | |
66 | 66 | let $t015461630 = { | |
67 | 67 | let $l = getAdminsList() | |
68 | 68 | let $s = size($l) | |
69 | 69 | let $acc0 = $Tuple2(nil, keyPrefix) | |
70 | 70 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
71 | 71 | then $a | |
72 | 72 | else genVotesKeysHelper($a, $l[$i]) | |
73 | 73 | ||
74 | 74 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
75 | 75 | then $a | |
76 | 76 | else throw("List size exceeds 5") | |
77 | 77 | ||
78 | 78 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
79 | 79 | } | |
80 | 80 | let result = $t015461630._1 | |
81 | 81 | let prefix = $t015461630._2 | |
82 | 82 | result | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func countVotes (prefix) = { | |
90 | 90 | let votes = genVotesKeys(prefix) | |
91 | 91 | let $l = votes | |
92 | 92 | let $s = size($l) | |
93 | 93 | let $acc0 = 0 | |
94 | 94 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
95 | 95 | then $a | |
96 | 96 | else countVotesHelper($a, $l[$i]) | |
97 | 97 | ||
98 | 98 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
99 | 99 | then $a | |
100 | 100 | else throw("List size exceeds 5") | |
101 | 101 | ||
102 | 102 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getClearVoteEntries (prefix) = { | |
110 | 110 | let votes = genVotesKeys(prefix) | |
111 | 111 | let $l = votes | |
112 | 112 | let $s = size($l) | |
113 | 113 | let $acc0 = nil | |
114 | 114 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
115 | 115 | then $a | |
116 | 116 | else clearVotesHelper($a, $l[$i]) | |
117 | 117 | ||
118 | 118 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
119 | 119 | then $a | |
120 | 120 | else throw("List size exceeds 5") | |
121 | 121 | ||
122 | 122 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
127 | 127 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
128 | 128 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
129 | 129 | let err = if (!(isInAdminList(callerAddressString))) | |
130 | 130 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
131 | 131 | else if ((adminCurrentVote == 1)) | |
132 | 132 | then throwErr((voteKey + " you already voted")) | |
133 | 133 | else unit | |
134 | 134 | if ((err == err)) | |
135 | 135 | then { | |
136 | 136 | let votes = countVotes(keyPrefix) | |
137 | 137 | if (((votes + 1) >= minVotes)) | |
138 | 138 | then { | |
139 | 139 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
140 | 140 | (clearVoteEntries ++ voteResult) | |
141 | 141 | } | |
142 | 142 | else [IntegerEntry(voteKey, 1)] | |
143 | 143 | } | |
144 | 144 | else throw("Strict value is not equal to itself.") | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func keyCalculatorAddress () = "%s__calculator" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func keyProxyTreasuryAddress () = "%s__proxyTreasury" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyChildAddress () = "%s__child" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func keyLpAssetId () = "%s__lpAssetId" | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
167 | 167 | case s: String => | |
168 | 168 | addressFromString(s) | |
169 | 169 | case _: Unit => | |
170 | 170 | unit | |
171 | 171 | case _ => | |
172 | 172 | throw("Match error") | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
176 | 176 | ||
177 | 177 | let proxyTreasuryAddressOption = match getString(this, keyProxyTreasuryAddress()) { | |
178 | 178 | case s: String => | |
179 | 179 | addressFromString(s) | |
180 | 180 | case _: Unit => | |
181 | 181 | unit | |
182 | 182 | case _ => | |
183 | 183 | throw("Match error") | |
184 | 184 | } | |
185 | 185 | ||
186 | 186 | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
187 | 187 | ||
188 | 188 | func keyConfigAddress () = "%s__config" | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func keyChildrenAddress () = "contract_children" | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func keyVotingResultAddress () = "contract_voting_result" | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func keyInvestedByUser (childAddress,userAddress) = makeString(["investor", toString(childAddress), toString(userAddress)], "_") | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | let configAddressOption = match getString(this, keyConfigAddress()) { | |
204 | 204 | case s: String => | |
205 | 205 | addressFromString(s) | |
206 | 206 | case _: Unit => | |
207 | 207 | unit | |
208 | 208 | case _ => | |
209 | 209 | throw("Match error") | |
210 | 210 | } | |
211 | 211 | ||
212 | 212 | let configAddressOrFail = valueOrErrorMessage(configAddressOption, wrapErr("invalid config address")) | |
213 | 213 | ||
214 | 214 | let votingResultAddressOption = match configAddressOption { | |
215 | 215 | case a: Address => | |
216 | 216 | match getString(a, keyVotingResultAddress()) { | |
217 | 217 | case s: String => | |
218 | 218 | addressFromString(s) | |
219 | 219 | case _: Unit => | |
220 | 220 | unit | |
221 | 221 | case _ => | |
222 | 222 | throw("Match error") | |
223 | 223 | } | |
224 | 224 | case _: Unit => | |
225 | 225 | unit | |
226 | 226 | case _ => | |
227 | 227 | throw("Match error") | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | let votingResultAddressOrFail = valueOrErrorMessage(votingResultAddressOption, wrapErr("invalid voting result address")) | |
231 | 231 | ||
232 | 232 | let childrenAddressOption = match configAddressOption { | |
233 | 233 | case a: Address => | |
234 | 234 | match getString(a, keyChildrenAddress()) { | |
235 | 235 | case s: String => | |
236 | 236 | addressFromString(s) | |
237 | 237 | case _: Unit => | |
238 | 238 | unit | |
239 | 239 | case _ => | |
240 | 240 | throw("Match error") | |
241 | 241 | } | |
242 | 242 | case _: Unit => | |
243 | 243 | unit | |
244 | 244 | case _ => | |
245 | 245 | throw("Match error") | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 | let childrenAddressOrFail = valueOrErrorMessage(childrenAddressOption, wrapErr("invalid children address")) | |
249 | 249 | ||
250 | 250 | let lpAssetIdOption = match getString(this, keyLpAssetId()) { | |
251 | 251 | case s: String => | |
252 | 252 | fromBase58String(s) | |
253 | 253 | case _: Unit => | |
254 | 254 | unit | |
255 | 255 | case _ => | |
256 | 256 | throw("Match error") | |
257 | 257 | } | |
258 | 258 | ||
259 | 259 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
260 | 260 | ||
261 | 261 | func onlyAddress (i,address) = if ((i.caller == address)) | |
262 | 262 | then true | |
263 | 263 | else throwErr("permission denied") | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func onlyThis (i) = onlyAddress(i, this) | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func onlyCalculator (i) = onlyAddress(i, calculatorAddressOrFail) | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | @Callable(i) | |
273 | 273 | func stringEntry (key,val) = if (onlyCalculator(i)) | |
274 | 274 | then $Tuple2([StringEntry(key, val)], key) | |
275 | 275 | else $Tuple2(nil, unit) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | ||
279 | 279 | @Callable(i) | |
280 | 280 | func integerEntry (key,val) = if (onlyCalculator(i)) | |
281 | 281 | then $Tuple2([IntegerEntry(key, val)], key) | |
282 | 282 | else $Tuple2(nil, unit) | |
283 | 283 | ||
284 | 284 | ||
285 | 285 | ||
286 | 286 | @Callable(i) | |
287 | 287 | func booleanEntry (key,val) = if (onlyCalculator(i)) | |
288 | 288 | then $Tuple2([BooleanEntry(key, val)], key) | |
289 | 289 | else $Tuple2(nil, unit) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(i) | |
294 | 294 | func binaryEntry (key,val) = if (onlyCalculator(i)) | |
295 | 295 | then $Tuple2([BinaryEntry(key, val)], key) | |
296 | 296 | else $Tuple2(nil, unit) | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | ||
300 | 300 | @Callable(i) | |
301 | 301 | func deleteEntry (key) = if (onlyCalculator(i)) | |
302 | 302 | then $Tuple2([DeleteEntry(key)], key) | |
303 | 303 | else $Tuple2(nil, unit) | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | ||
307 | 307 | @Callable(i) | |
308 | 308 | func reissue (amount) = if (onlyCalculator(i)) | |
309 | 309 | then $Tuple2([Reissue(lpAssetIdOrFail, amount, true)], amount) | |
310 | 310 | else $Tuple2(nil, unit) | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | ||
314 | 314 | @Callable(i) | |
315 | 315 | func burn (amount) = if (onlyCalculator(i)) | |
316 | 316 | then $Tuple2([Burn(lpAssetIdOrFail, amount)], amount) | |
317 | 317 | else $Tuple2(nil, unit) | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | ||
321 | 321 | @Callable(i) | |
322 | 322 | func transferAsset (recepientBytes,amount,assetId) = if (onlyCalculator(i)) | |
323 | 323 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, assetId)], amount) | |
324 | 324 | else $Tuple2(nil, unit) | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | ||
328 | 328 | @Callable(i) | |
329 | 329 | func transferAssets (recepientBytes,assetsList,amountsList) = if (onlyCalculator(i)) | |
330 | 330 | then { | |
331 | 331 | func addNewTransfer (accum,nextAssetId) = { | |
332 | 332 | let $t074577483 = accum | |
333 | 333 | let transfers = $t074577483._1 | |
334 | 334 | let j = $t074577483._2 | |
335 | 335 | let newTransfer = ScriptTransfer(Address(recepientBytes), parseIntValue(amountsList[j]), stringToAssetId(assetsList[j])) | |
336 | 336 | let updatedTransfers = (transfers :+ newTransfer) | |
337 | 337 | $Tuple2(updatedTransfers, (j + 1)) | |
338 | 338 | } | |
339 | 339 | ||
340 | 340 | let $t077437824 = { | |
341 | 341 | let $l = assetsList | |
342 | 342 | let $s = size($l) | |
343 | 343 | let $acc0 = $Tuple2(nil, 0) | |
344 | 344 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
345 | 345 | then $a | |
346 | 346 | else addNewTransfer($a, $l[$i]) | |
347 | 347 | ||
348 | 348 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
349 | 349 | then $a | |
350 | 350 | else throw("List size exceeds 10") | |
351 | 351 | ||
352 | 352 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
353 | 353 | } | |
354 | 354 | let assetsTransfers = $t077437824._1 | |
355 | 355 | let _lastIndex = $t077437824._2 | |
356 | 356 | $Tuple2(assetsTransfers, unit) | |
357 | 357 | } | |
358 | 358 | else $Tuple2(nil, unit) | |
359 | 359 | ||
360 | 360 | ||
361 | 361 | ||
362 | 362 | @Callable(i) | |
363 | 363 | func transferWaves (recepientBytes,amount) = if (onlyCalculator(i)) | |
364 | 364 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, unit)], amount) | |
365 | 365 | else $Tuple2(nil, unit) | |
366 | 366 | ||
367 | 367 | ||
368 | 368 | ||
369 | 369 | @Callable(i) | |
370 | 370 | func transferFromProxyTreasury (recipientBytes,rewardsAmount) = if (onlyCalculator(i)) | |
371 | 371 | then $Tuple2(nil, invoke(proxyTreasuryAddressOrFail, "transferWaves", [recipientBytes, rewardsAmount], nil)) | |
372 | 372 | else $Tuple2(nil, unit) | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | ||
376 | 376 | @Callable(i) | |
377 | 377 | func finalize (newTreasuryVolumeInWaves,pwrManagersBonusInWaves,treasuryVolumeDiffAllocationCoef) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalize", [i.caller.bytes, newTreasuryVolumeInWaves, pwrManagersBonusInWaves, treasuryVolumeDiffAllocationCoef], i.payments)) | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
381 | 381 | @Callable(i) | |
382 | 382 | func finalizeREADONLY (newTreasuryVolumeInWaves,pwrManagersBonusInWaves,treasuryVolumeDiffAllocationCoef) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalizeREADONLY", [newTreasuryVolumeInWaves, pwrManagersBonusInWaves, treasuryVolumeDiffAllocationCoef], nil)) | |
383 | 383 | ||
384 | 384 | ||
385 | 385 | ||
386 | 386 | @Callable(i) | |
387 | 387 | func claimLP () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimLP", [i.caller.bytes], i.payments)) | |
388 | 388 | ||
389 | 389 | ||
390 | 390 | ||
391 | 391 | @Callable(i) | |
392 | 392 | func claimCollateral (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateral", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | ||
396 | 396 | @Callable(i) | |
397 | 397 | func invest () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "invest", [i.caller.bytes], i.payments)) | |
398 | 398 | ||
399 | 399 | ||
400 | 400 | ||
401 | 401 | @Callable(i) | |
402 | 402 | func withdraw () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "withdraw", [i.caller.bytes], i.payments)) | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | ||
406 | 406 | @Callable(i) | |
407 | 407 | func cancelWithdraw (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "cancelWithdraw", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
408 | 408 | ||
409 | 409 | ||
410 | 410 | ||
411 | 411 | @Callable(i) | |
412 | 412 | func processBlocks () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "processBlocks", [i.caller.bytes], i.payments)) | |
413 | 413 | ||
414 | 414 | ||
415 | 415 | ||
416 | 416 | @Callable(i) | |
417 | + | func claimCollateralREADONLY (userAddress,txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateralREADONLY", [fromBase58String(userAddress), fromBase58String(txIdStr)], nil)) | |
418 | + | ||
419 | + | ||
420 | + | ||
421 | + | @Callable(i) | |
417 | 422 | func voteForTxId (txId) = { | |
418 | 423 | let callerAddressString = toBase58String(i.caller.bytes) | |
419 | 424 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
420 | 425 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
421 | 426 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
422 | 427 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
423 | 428 | then true | |
424 | 429 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
425 | 430 | then true | |
426 | 431 | else (value(allowedTxIdOption) != txId)) | |
427 | 432 | then true | |
428 | 433 | else throwErr((txId + " is already allowed"))] | |
429 | 434 | if ((err == err)) | |
430 | 435 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
431 | 436 | else throw("Strict value is not equal to itself.") | |
432 | 437 | } | |
433 | 438 | ||
434 | 439 | ||
435 | 440 | @Verifier(tx) | |
436 | 441 | func verify () = { | |
437 | 442 | let byProposal = match votingResultAddressOption { | |
438 | 443 | case proposalAddress: Address => | |
439 | 444 | valueOrElse(getBoolean(proposalAddress, keyProposalAllowBroadcast(this, tx.id)), false) | |
440 | 445 | case _ => | |
441 | 446 | false | |
442 | 447 | } | |
443 | 448 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
444 | 449 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
445 | 450 | then false | |
446 | 451 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
447 | 452 | if (if (byProposal) | |
448 | 453 | then true | |
449 | 454 | else byAdmins) | |
450 | 455 | then true | |
451 | 456 | else byOwner | |
452 | 457 | } | |
453 | 458 |
github/deemru/w8io/026f985 101.52 ms ◑