tx · AjEBmJjy3NLcc7oQghBdYLDjQncoWTEnkdpUzSMcRzex 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx: -0.01600000 Waves 2023.08.18 10:33 [2715748] smart account 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx > SELF 0.00000000 Waves
{ "type": 13, "id": "AjEBmJjy3NLcc7oQghBdYLDjQncoWTEnkdpUzSMcRzex", "fee": 1600000, "feeAssetId": null, "timestamp": 1692344050842, "version": 1, "sender": "3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx", "senderPublicKey": "62CHk4MqTdq3LqeUycy7TPnpvwrjgerSa2FqAY2EafXn", "proofs": [ "2XuhsX8jwY6Xx8ohSeEAjbuETTEJF5AgNvN9FwsqzUW5xzfUKm5kxXBqfeBqN5FztXa7dhxZeWUAAr4Sqdx2s84e" ], "script": "base64:BwKHAQgCEgQKAggIEgQKAggBEgQKAggEEgQKAggCEgMKAQgSAwoBARIDCgEBEgUKAwIBAhIFCgMCGBgSBAoCAgESBAoCAgESBgoEAQEBARIGCgQBAQEBEgASAwoBCBIDCgEYEgASABIDCgEIEgASBAoCCAgSBAoCCBgSAwoBCBIFCgMCAgESAwoBCDcAA1NFUAICX18ABVdBVkVTAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIMZmFjdG9yeS5yaWRlAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzAQ9zdHJpbmdUb0Fzc2V0SWQBAXMDCQAAAgUBcwUFV0FWRVMFBHVuaXQJANkEAQUBcwAPQURNSU5fTElTVF9TSVpFAAUABlFVT1JVTQADABFUWElEX0JZVEVTX0xFTkdUSAAgARhrZXlBbGxvd2VkVHhJZFZvdGVQcmVmaXgBBHR4SWQJALkJAgkAzAgCAgYlcyVzJXMJAMwIAgIJYWxsb3dUeElkCQDMCAIFBHR4SWQFA25pb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dCAIFBHRoaXMJAQ5rZXlBbGxvd2VkVHhJZAACAAQHYnlPd25lcgMJAGcCCQCQAwEJAQ1nZXRBZG1pbnNMaXN0AAUGUVVPUlVNBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMDBQpieVByb3Bvc2FsBgUIYnlBZG1pbnMGBQdieU93bmVy9cfDOw==", "chainId": 84, "height": 2715748, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DygbdmnjtaS9cYUyP4yqdooK3Fs8n1uQmZwsXh2EyByL Next: 2qdzZdBTHW56ucvmocdoAWq86Teq67bxek3X69BkFzw2 Diff:
Old | New | Differences | |
---|---|---|---|
486 | 486 | ||
487 | 487 | ||
488 | 488 | @Callable(i) | |
489 | - | func powerStake (recipientBytes) = if (onlyCalculator(i)) | |
490 | - | then $Tuple2(nil, invoke(powerContractAddressOrFail, "commitForMiner", [toString(Address(recipientBytes))], | |
489 | + | func powerStake (recipientBytes,assetIdBytes,amount) = if (onlyCalculator(i)) | |
490 | + | then $Tuple2(nil, invoke(powerContractAddressOrFail, "commitForMiner", [toString(Address(recipientBytes))], [AttachedPayment(assetIdBytes, amount)])) | |
491 | 491 | else $Tuple2(nil, unit) | |
492 | 492 | ||
493 | 493 |
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 keyPowerContractAddress () = "%s__powerContract" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keySwapContractAddress () = "%s__swapContract" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func keyChildAddress () = "%s__child" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func keyLpAssetId () = "%s__lpAssetId" | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
173 | 173 | case s: String => | |
174 | 174 | addressFromString(s) | |
175 | 175 | case _: Unit => | |
176 | 176 | unit | |
177 | 177 | case _ => | |
178 | 178 | throw("Match error") | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
182 | 182 | ||
183 | 183 | let proxyTreasuryAddressOption = match getString(this, keyProxyTreasuryAddress()) { | |
184 | 184 | case s: String => | |
185 | 185 | addressFromString(s) | |
186 | 186 | case _: Unit => | |
187 | 187 | unit | |
188 | 188 | case _ => | |
189 | 189 | throw("Match error") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
193 | 193 | ||
194 | 194 | let powerContractAddressOption = match getString(this, keyPowerContractAddress()) { | |
195 | 195 | case s: String => | |
196 | 196 | addressFromString(s) | |
197 | 197 | case _: Unit => | |
198 | 198 | unit | |
199 | 199 | case _ => | |
200 | 200 | throw("Match error") | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | let powerContractAddressOrFail = valueOrErrorMessage(powerContractAddressOption, wrapErr("invalid power contract address")) | |
204 | 204 | ||
205 | 205 | let swapContractAddressOption = match getString(this, keySwapContractAddress()) { | |
206 | 206 | case s: String => | |
207 | 207 | addressFromString(s) | |
208 | 208 | case _: Unit => | |
209 | 209 | unit | |
210 | 210 | case _ => | |
211 | 211 | throw("Match error") | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 | let swapContractAddressOrFail = valueOrErrorMessage(swapContractAddressOption, wrapErr("invalid swap contract address")) | |
215 | 215 | ||
216 | 216 | func keyConfigAddress () = "%s__config" | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func keyChildrenAddress () = "contract_children" | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func keyVotingResultAddress () = "contract_voting_result" | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func keyInvestedByUser (childAddress,userAddress) = makeString(["investor", toString(childAddress), toString(userAddress)], "_") | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | let configAddressOption = match getString(this, keyConfigAddress()) { | |
232 | 232 | case s: String => | |
233 | 233 | addressFromString(s) | |
234 | 234 | case _: Unit => | |
235 | 235 | unit | |
236 | 236 | case _ => | |
237 | 237 | throw("Match error") | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | let configAddressOrFail = valueOrErrorMessage(configAddressOption, wrapErr("invalid config address")) | |
241 | 241 | ||
242 | 242 | let votingResultAddressOption = match configAddressOption { | |
243 | 243 | case a: Address => | |
244 | 244 | match getString(a, keyVotingResultAddress()) { | |
245 | 245 | case s: String => | |
246 | 246 | addressFromString(s) | |
247 | 247 | case _: Unit => | |
248 | 248 | unit | |
249 | 249 | case _ => | |
250 | 250 | throw("Match error") | |
251 | 251 | } | |
252 | 252 | case _: Unit => | |
253 | 253 | unit | |
254 | 254 | case _ => | |
255 | 255 | throw("Match error") | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | let votingResultAddressOrFail = valueOrErrorMessage(votingResultAddressOption, wrapErr("invalid voting result address")) | |
259 | 259 | ||
260 | 260 | let childrenAddressOption = match configAddressOption { | |
261 | 261 | case a: Address => | |
262 | 262 | match getString(a, keyChildrenAddress()) { | |
263 | 263 | case s: String => | |
264 | 264 | addressFromString(s) | |
265 | 265 | case _: Unit => | |
266 | 266 | unit | |
267 | 267 | case _ => | |
268 | 268 | throw("Match error") | |
269 | 269 | } | |
270 | 270 | case _: Unit => | |
271 | 271 | unit | |
272 | 272 | case _ => | |
273 | 273 | throw("Match error") | |
274 | 274 | } | |
275 | 275 | ||
276 | 276 | let childrenAddressOrFail = valueOrErrorMessage(childrenAddressOption, wrapErr("invalid children address")) | |
277 | 277 | ||
278 | 278 | let lpAssetIdOption = match getString(this, keyLpAssetId()) { | |
279 | 279 | case s: String => | |
280 | 280 | fromBase58String(s) | |
281 | 281 | case _: Unit => | |
282 | 282 | unit | |
283 | 283 | case _ => | |
284 | 284 | throw("Match error") | |
285 | 285 | } | |
286 | 286 | ||
287 | 287 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
288 | 288 | ||
289 | 289 | func onlyAddress (i,address) = if ((i.caller == address)) | |
290 | 290 | then true | |
291 | 291 | else throwErr("permission denied") | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | func onlyThis (i) = onlyAddress(i, this) | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | func onlyCalculator (i) = onlyAddress(i, calculatorAddressOrFail) | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | @Callable(i) | |
301 | 301 | func stringEntry (key,val) = if (onlyCalculator(i)) | |
302 | 302 | then $Tuple2([StringEntry(key, val)], key) | |
303 | 303 | else $Tuple2(nil, unit) | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | ||
307 | 307 | @Callable(i) | |
308 | 308 | func integerEntry (key,val) = if (onlyCalculator(i)) | |
309 | 309 | then $Tuple2([IntegerEntry(key, val)], key) | |
310 | 310 | else $Tuple2(nil, unit) | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | ||
314 | 314 | @Callable(i) | |
315 | 315 | func booleanEntry (key,val) = if (onlyCalculator(i)) | |
316 | 316 | then $Tuple2([BooleanEntry(key, val)], key) | |
317 | 317 | else $Tuple2(nil, unit) | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | ||
321 | 321 | @Callable(i) | |
322 | 322 | func binaryEntry (key,val) = if (onlyCalculator(i)) | |
323 | 323 | then $Tuple2([BinaryEntry(key, val)], key) | |
324 | 324 | else $Tuple2(nil, unit) | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | ||
328 | 328 | @Callable(i) | |
329 | 329 | func deleteEntry (key) = if (onlyCalculator(i)) | |
330 | 330 | then $Tuple2([DeleteEntry(key)], key) | |
331 | 331 | else $Tuple2(nil, unit) | |
332 | 332 | ||
333 | 333 | ||
334 | 334 | ||
335 | 335 | @Callable(i) | |
336 | 336 | func reissue (amount) = if (onlyCalculator(i)) | |
337 | 337 | then $Tuple2([Reissue(lpAssetIdOrFail, amount, true)], amount) | |
338 | 338 | else $Tuple2(nil, unit) | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | ||
342 | 342 | @Callable(i) | |
343 | 343 | func burn (amount) = if (onlyCalculator(i)) | |
344 | 344 | then $Tuple2([Burn(lpAssetIdOrFail, amount)], amount) | |
345 | 345 | else $Tuple2(nil, unit) | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | ||
349 | 349 | @Callable(i) | |
350 | 350 | func transferAsset (recipientBytes,amount,assetId) = if (onlyCalculator(i)) | |
351 | 351 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
352 | 352 | else $Tuple2(nil, unit) | |
353 | 353 | ||
354 | 354 | ||
355 | 355 | ||
356 | 356 | @Callable(i) | |
357 | 357 | func transferAssets (recipientBytes,assetsList,amountsList) = if (onlyCalculator(i)) | |
358 | 358 | then { | |
359 | 359 | func addNewTransfer (acc,nextAssetId) = { | |
360 | 360 | let $t081188142 = acc | |
361 | 361 | let transfers = $t081188142._1 | |
362 | 362 | let j = $t081188142._2 | |
363 | 363 | let newTransfer = ScriptTransfer(Address(recipientBytes), parseIntValue(amountsList[j]), stringToAssetId(assetsList[j])) | |
364 | 364 | let updatedTransfers = (transfers :+ newTransfer) | |
365 | 365 | $Tuple2(updatedTransfers, (j + 1)) | |
366 | 366 | } | |
367 | 367 | ||
368 | 368 | let $t084028483 = { | |
369 | 369 | let $l = assetsList | |
370 | 370 | let $s = size($l) | |
371 | 371 | let $acc0 = $Tuple2(nil, 0) | |
372 | 372 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
373 | 373 | then $a | |
374 | 374 | else addNewTransfer($a, $l[$i]) | |
375 | 375 | ||
376 | 376 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
377 | 377 | then $a | |
378 | 378 | else throw("List size exceeds 10") | |
379 | 379 | ||
380 | 380 | $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) | |
381 | 381 | } | |
382 | 382 | let assetsTransfers = $t084028483._1 | |
383 | 383 | let _lastIndex = $t084028483._2 | |
384 | 384 | $Tuple2(assetsTransfers, unit) | |
385 | 385 | } | |
386 | 386 | else $Tuple2(nil, unit) | |
387 | 387 | ||
388 | 388 | ||
389 | 389 | ||
390 | 390 | @Callable(i) | |
391 | 391 | func transferWaves (recipientBytes,amount) = if (onlyCalculator(i)) | |
392 | 392 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
393 | 393 | else $Tuple2(nil, unit) | |
394 | 394 | ||
395 | 395 | ||
396 | 396 | ||
397 | 397 | @Callable(i) | |
398 | 398 | func transferFromProxyTreasury (recipientBytes,rewardsAmount) = if (onlyCalculator(i)) | |
399 | 399 | then $Tuple2(nil, invoke(proxyTreasuryAddressOrFail, "transferWaves", [recipientBytes, rewardsAmount], nil)) | |
400 | 400 | else $Tuple2(nil, unit) | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(i) | |
405 | 405 | func finalize (donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalize", [i.caller.bytes, donationPartInWaves, lpPartInWaves, claimPartInWaves, powerStakePartInWaves], i.payments)) | |
406 | 406 | ||
407 | 407 | ||
408 | 408 | ||
409 | 409 | @Callable(i) | |
410 | 410 | func finalizeREADONLY (donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalizeREADONLY", [donationPartInWaves, lpPartInWaves, claimPartInWaves, powerStakePartInWaves], nil)) | |
411 | 411 | ||
412 | 412 | ||
413 | 413 | ||
414 | 414 | @Callable(i) | |
415 | 415 | func claimLP () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimLP", [i.caller.bytes], i.payments)) | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | 419 | @Callable(i) | |
420 | 420 | func claimCollateral (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateral", [i.caller.bytes, txIdStr], i.payments)) | |
421 | 421 | ||
422 | 422 | ||
423 | 423 | ||
424 | 424 | @Callable(i) | |
425 | 425 | func claimCollateralBulk (txIds) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateralBulk", [i.caller.bytes, txIds], i.payments)) | |
426 | 426 | ||
427 | 427 | ||
428 | 428 | ||
429 | 429 | @Callable(i) | |
430 | 430 | func invest () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "invest", [i.caller.bytes], i.payments)) | |
431 | 431 | ||
432 | 432 | ||
433 | 433 | ||
434 | 434 | @Callable(i) | |
435 | 435 | func withdraw () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "withdraw", [i.caller.bytes], i.payments)) | |
436 | 436 | ||
437 | 437 | ||
438 | 438 | ||
439 | 439 | @Callable(i) | |
440 | 440 | func cancelWithdraw (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "cancelWithdraw", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | ||
444 | 444 | @Callable(i) | |
445 | 445 | func processBlocks () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "processBlocks", [i.caller.bytes], i.payments)) | |
446 | 446 | ||
447 | 447 | ||
448 | 448 | ||
449 | 449 | @Callable(i) | |
450 | 450 | func claimCollateralREADONLY (userAddress,txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateralREADONLY", [fromBase58String(userAddress), txIdStr], nil)) | |
451 | 451 | ||
452 | 452 | ||
453 | 453 | ||
454 | 454 | @Callable(i) | |
455 | 455 | func claimCollateralBulkREADONLY (userAddress,txIds) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimCollateralBulkREADONLY", [fromBase58String(userAddress), txIds], nil)) | |
456 | 456 | ||
457 | 457 | ||
458 | 458 | ||
459 | 459 | @Callable(i) | |
460 | 460 | func swap (assetId) = { | |
461 | 461 | let check = [onlyCalculator(i)] | |
462 | 462 | if ((check == check)) | |
463 | 463 | then { | |
464 | 464 | let initAssetBalance = if ((assetId == "WAVES")) | |
465 | 465 | then wavesBalance(this).available | |
466 | 466 | else assetBalance(this, fromBase58String(assetId)) | |
467 | 467 | if ((initAssetBalance == initAssetBalance)) | |
468 | 468 | then { | |
469 | 469 | let swapInvoke = invoke(swapContractAddressOrFail, "swap", [0, assetId, toString(this)], i.payments) | |
470 | 470 | if ((swapInvoke == swapInvoke)) | |
471 | 471 | then { | |
472 | 472 | let newAssetBalance = if ((assetId == "WAVES")) | |
473 | 473 | then wavesBalance(this).available | |
474 | 474 | else assetBalance(this, fromBase58String(assetId)) | |
475 | 475 | if ((newAssetBalance == newAssetBalance)) | |
476 | 476 | then $Tuple2(nil, (newAssetBalance - initAssetBalance)) | |
477 | 477 | else throw("Strict value is not equal to itself.") | |
478 | 478 | } | |
479 | 479 | else throw("Strict value is not equal to itself.") | |
480 | 480 | } | |
481 | 481 | else throw("Strict value is not equal to itself.") | |
482 | 482 | } | |
483 | 483 | else throw("Strict value is not equal to itself.") | |
484 | 484 | } | |
485 | 485 | ||
486 | 486 | ||
487 | 487 | ||
488 | 488 | @Callable(i) | |
489 | - | func powerStake (recipientBytes) = if (onlyCalculator(i)) | |
490 | - | then $Tuple2(nil, invoke(powerContractAddressOrFail, "commitForMiner", [toString(Address(recipientBytes))], | |
489 | + | func powerStake (recipientBytes,assetIdBytes,amount) = if (onlyCalculator(i)) | |
490 | + | then $Tuple2(nil, invoke(powerContractAddressOrFail, "commitForMiner", [toString(Address(recipientBytes))], [AttachedPayment(assetIdBytes, amount)])) | |
491 | 491 | else $Tuple2(nil, unit) | |
492 | 492 | ||
493 | 493 | ||
494 | 494 | ||
495 | 495 | @Callable(i) | |
496 | 496 | func voteForTxId (txId) = { | |
497 | 497 | let callerAddressString = toBase58String(i.caller.bytes) | |
498 | 498 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
499 | 499 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
500 | 500 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
501 | 501 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
502 | 502 | then true | |
503 | 503 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
504 | 504 | then true | |
505 | 505 | else (value(allowedTxIdOption) != txId)) | |
506 | 506 | then true | |
507 | 507 | else throwErr((txId + " is already allowed"))] | |
508 | 508 | if ((err == err)) | |
509 | 509 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
510 | 510 | else throw("Strict value is not equal to itself.") | |
511 | 511 | } | |
512 | 512 | ||
513 | 513 | ||
514 | 514 | @Verifier(tx) | |
515 | 515 | func verify () = { | |
516 | 516 | let byProposal = match votingResultAddressOption { | |
517 | 517 | case proposalAddress: Address => | |
518 | 518 | valueOrElse(getBoolean(proposalAddress, keyProposalAllowBroadcast(this, tx.id)), false) | |
519 | 519 | case _ => | |
520 | 520 | false | |
521 | 521 | } | |
522 | 522 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
523 | 523 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
524 | 524 | then false | |
525 | 525 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
526 | 526 | if (if (byProposal) | |
527 | 527 | then true | |
528 | 528 | else byAdmins) | |
529 | 529 | then true | |
530 | 530 | else byOwner | |
531 | 531 | } | |
532 | 532 |
github/deemru/w8io/169f3d6 104.22 ms ◑