tx · AJitddCyvvx7w6fnSJrVnNy6sH4Gb78aCAYzGk828oZr 3NC9dyrMheMhHXcaeCXkuKqaTkLFa5Ahzd2: -0.01400000 Waves 2023.11.14 08:58 [2842617] smart account 3NC9dyrMheMhHXcaeCXkuKqaTkLFa5Ahzd2 > SELF 0.00000000 Waves
{ "type": 13, "id": "AJitddCyvvx7w6fnSJrVnNy6sH4Gb78aCAYzGk828oZr", "fee": 1400000, "feeAssetId": null, "timestamp": 1699941627897, "version": 2, "chainId": 84, "sender": "3NC9dyrMheMhHXcaeCXkuKqaTkLFa5Ahzd2", "senderPublicKey": "8fS13zFL61wF3maPyR7vTayhasoH9StToqd7wGuecHXN", "proofs": [ "3B5itCb15jkfi9xjb21vi9mikgmMSux654HBTtmyy1rpj7ABDAjKh6vXFfZMTXiSnSuK95KNbnfkkC4t6N1b5zcG" ], "script": "base64:BgJgCAISBAoCCAgSBAoCCAESBAoCCAQSBAoCCAISAwoBCBIFCgMCAQQSBAoCAgESBQoDAgECEgUKAwISERIECgICARIJCgcICAgIAQEYEggKBggICAECARIECgIIGBIDCgEIMwAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAAIBAhFwZXJtaXNzaW9uIGRlbmllZAEIbXVzdFRoaXMBAWkJAQttdXN0QWRkcmVzcwIFAWkFBHRoaXMAA1NFUAICX18ABVdBVkVTAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQISd3hkYW9fZmFjdG9yeS5yaWRlAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzAQ9zdHJpbmdUb0Fzc2V0SWQBAXMDCQAAAgUBcwUF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MJbp2aQRru Diff:
Old | New | Differences | |
---|---|---|---|
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | - | func keyCalculatorAddress () = "%s__ | |
164 | + | func keyCalculatorAddress () = "%s__calculatorAddress" | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func keyLpAssetId () = "%s__lpAssetId" | |
168 | 168 | ||
169 | 169 | ||
170 | - | func | |
170 | + | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
171 | 171 | ||
172 | 172 | ||
173 | - | func | |
173 | + | func keyStartHeightByPeriod (period) = makeString(["%s%d", "startHeight", toString(period)], SEP) | |
174 | 174 | ||
175 | 175 | ||
176 | - | func | |
176 | + | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
177 | 177 | ||
178 | 178 | ||
179 | - | func | |
179 | + | func keyTreasuryValueByPeriod (period) = makeString(["%s%d", "treasuryValue", toString(period)], SEP) | |
180 | 180 | ||
181 | 181 | ||
182 | - | func | |
182 | + | func keyTreasuryValue () = makeString(["%s", "treasuryValue"], SEP) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
193 | 193 | ||
194 | 194 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
195 | 195 | ||
196 | - | func | |
196 | + | func keyPowerConfigAddress () = "%s__powerConfigAddress" | |
197 | 197 | ||
198 | 198 | ||
199 | - | func keyPowerContractAddress () = "%s__powerContract" | |
199 | + | func keyPowerContractAddress () = "%s__powerContractAddress" | |
200 | + | ||
201 | + | ||
202 | + | func keyAssets () = "%s__assets" | |
200 | 203 | ||
201 | 204 | ||
202 | 205 | func keyVotingResultAddress () = "contract_voting_result" | |
205 | 208 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
206 | 209 | ||
207 | 210 | ||
208 | - | let configAddressOption = match getString(this, | |
211 | + | let configAddressOption = match getString(this, keyPowerConfigAddress()) { | |
209 | 212 | case s: String => | |
210 | 213 | addressFromString(s) | |
211 | 214 | case _: Unit => | |
290 | 293 | ||
291 | 294 | ||
292 | 295 | @Callable(i) | |
293 | - | func reissue (amount) = if (onlyCalculator(i)) | |
294 | - | then $Tuple2([Reissue( | |
296 | + | func reissue (assetId,amount,reissuable) = if (onlyCalculator(i)) | |
297 | + | then $Tuple2([Reissue(assetId, amount, reissuable)], amount) | |
295 | 298 | else $Tuple2(nil, unit) | |
296 | 299 | ||
297 | 300 | ||
298 | 301 | ||
299 | 302 | @Callable(i) | |
300 | - | func burn (amount) = if (onlyCalculator(i)) | |
301 | - | then $Tuple2([Burn( | |
303 | + | func burn (assetId,amount) = if (onlyCalculator(i)) | |
304 | + | then $Tuple2([Burn(assetId, amount)], amount) | |
302 | 305 | else $Tuple2(nil, unit) | |
303 | 306 | ||
304 | 307 | ||
314 | 317 | func transferAssets (recipientBytes,assetsList,amountsList) = if (onlyCalculator(i)) | |
315 | 318 | then { | |
316 | 319 | func addNewTransfer (acc,nextAssetId) = { | |
317 | - | let $ | |
318 | - | let transfers = $ | |
319 | - | let j = $ | |
320 | - | let newTransfer = ScriptTransfer(Address(recipientBytes), | |
320 | + | let $t064996523 = acc | |
321 | + | let transfers = $t064996523._1 | |
322 | + | let j = $t064996523._2 | |
323 | + | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
321 | 324 | let updatedTransfers = (transfers :+ newTransfer) | |
322 | 325 | $Tuple2(updatedTransfers, (j + 1)) | |
323 | 326 | } | |
324 | 327 | ||
325 | - | let $ | |
328 | + | let $t067496830 = { | |
326 | 329 | let $l = assetsList | |
327 | 330 | let $s = size($l) | |
328 | 331 | let $acc0 = $Tuple2(nil, 0) | |
336 | 339 | ||
337 | 340 | $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) | |
338 | 341 | } | |
339 | - | let assetsTransfers = $ | |
340 | - | let _lastIndex = $ | |
342 | + | let assetsTransfers = $t067496830._1 | |
343 | + | let _lastIndex = $t067496830._2 | |
341 | 344 | $Tuple2(assetsTransfers, unit) | |
342 | 345 | } | |
343 | 346 | else $Tuple2(nil, unit) | |
352 | 355 | ||
353 | 356 | ||
354 | 357 | @Callable(i) | |
355 | - | func commitAfterStartWithLockRoundFor (contract,child,address,additionalLockRounds,paymentAssetId,paymentAmount) = $Tuple2(nil, invoke(addressFromStringValue(contract), "commitAfterStartWithLockRoundFor", [child, address, additionalLockRounds], [AttachedPayment(paymentAssetId, paymentAmount)])) | |
358 | + | func init (lpAssetIdStr,calculatorAddressStr,powerConfigAddressStr,powerContractAddress,periodLength,treasuryValue,assets) = { | |
359 | + | let checkCaller = mustThis(i) | |
360 | + | if ((checkCaller == checkCaller)) | |
361 | + | then $Tuple2([StringEntry(keyLpAssetId(), lpAssetIdStr), StringEntry(keyCalculatorAddress(), calculatorAddressStr), StringEntry(keyPowerConfigAddress(), powerConfigAddressStr), StringEntry(keyPowerContractAddress(), powerContractAddress), IntegerEntry(keyPeriodLength(), periodLength), IntegerEntry(keyTreasuryValue(), treasuryValue), IntegerEntry(keyTreasuryValueByPeriod(0), treasuryValue), IntegerEntry(keyCurrentPeriod(), 0), IntegerEntry(keyStartHeightByPeriod(0), height), StringEntry(keyAssets(), makeString(assets, SEP))], unit) | |
362 | + | else throw("Strict value is not equal to itself.") | |
363 | + | } | |
356 | 364 | ||
357 | 365 | ||
358 | 366 | ||
359 | 367 | @Callable(i) | |
360 | - | func init (calculatorAddressStr,powerConfigAddressStr,powerContractAddressStr) = { | |
361 | - | let checkCaller = mustThis(i) | |
362 | - | if ((checkCaller == checkCaller)) | |
363 | - | then $Tuple2([StringEntry(keyCalculatorAddress(), calculatorAddressStr), StringEntry(keyConfigAddress(), powerConfigAddressStr), StringEntry(keyPowerContractAddress(), powerContractAddressStr)], unit) | |
364 | - | else throw("Strict value is not equal to itself.") | |
365 | - | } | |
368 | + | func commitAfterStartWithLockRoundFor (contract,child,address,additionalLockRounds,paymentAssetId,paymentAmount) = $Tuple2(nil, invoke(addressFromStringValue(contract), "commitAfterStartWithLockRoundFor", [child, address, additionalLockRounds], [AttachedPayment(paymentAssetId, paymentAmount)])) | |
366 | 369 | ||
367 | 370 | ||
368 | 371 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let chainId = take(drop(this.bytes, 1), 1) | |
7 | 7 | ||
8 | 8 | let chainIdT = base58'2T' | |
9 | 9 | ||
10 | 10 | let chainIdW = base58'2W' | |
11 | 11 | ||
12 | 12 | func mustAddress (i,address) = if ((i.caller == address)) | |
13 | 13 | then true | |
14 | 14 | else throw("permission denied") | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func mustThis (i) = mustAddress(i, this) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let WAVES = "WAVES" | |
23 | 23 | ||
24 | 24 | let contractFilename = "wxdao_factory.ride" | |
25 | 25 | ||
26 | 26 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func throwErr (s) = throw(wrapErr(s)) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func stringToAssetId (s) = if ((s == WAVES)) | |
33 | 33 | then unit | |
34 | 34 | else fromBase58String(s) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | let ADMIN_LIST_SIZE = 5 | |
38 | 38 | ||
39 | 39 | let QUORUM = 3 | |
40 | 40 | ||
41 | 41 | let TXID_BYTES_LENGTH = 32 | |
42 | 42 | ||
43 | 43 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getAdminVote (prefix,admin) = { | |
56 | 56 | let voteKey = keyFullAdminVote(prefix, admin) | |
57 | 57 | valueOrElse(getInteger(voteKey), 0) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
62 | 62 | case s: String => | |
63 | 63 | split(s, SEP) | |
64 | 64 | case _ => | |
65 | 65 | nil | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func genVotesKeysHelper (a,adminAddress) = { | |
73 | 73 | let $t014801504 = a | |
74 | 74 | let result = $t014801504._1 | |
75 | 75 | let prefix = $t014801504._2 | |
76 | 76 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func genVotesKeys (keyPrefix) = { | |
81 | 81 | let adminList = keyAdminAddressList() | |
82 | 82 | let $t016511735 = { | |
83 | 83 | let $l = getAdminsList() | |
84 | 84 | let $s = size($l) | |
85 | 85 | let $acc0 = $Tuple2(nil, keyPrefix) | |
86 | 86 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
87 | 87 | then $a | |
88 | 88 | else genVotesKeysHelper($a, $l[$i]) | |
89 | 89 | ||
90 | 90 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
91 | 91 | then $a | |
92 | 92 | else throw("List size exceeds 5") | |
93 | 93 | ||
94 | 94 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
95 | 95 | } | |
96 | 96 | let result = $t016511735._1 | |
97 | 97 | let prefix = $t016511735._2 | |
98 | 98 | result | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func countVotes (prefix) = { | |
106 | 106 | let votes = genVotesKeys(prefix) | |
107 | 107 | let $l = votes | |
108 | 108 | let $s = size($l) | |
109 | 109 | let $acc0 = 0 | |
110 | 110 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
111 | 111 | then $a | |
112 | 112 | else countVotesHelper($a, $l[$i]) | |
113 | 113 | ||
114 | 114 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
115 | 115 | then $a | |
116 | 116 | else throw("List size exceeds 5") | |
117 | 117 | ||
118 | 118 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getClearVoteEntries (prefix) = { | |
126 | 126 | let votes = genVotesKeys(prefix) | |
127 | 127 | let $l = votes | |
128 | 128 | let $s = size($l) | |
129 | 129 | let $acc0 = nil | |
130 | 130 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
131 | 131 | then $a | |
132 | 132 | else clearVotesHelper($a, $l[$i]) | |
133 | 133 | ||
134 | 134 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
135 | 135 | then $a | |
136 | 136 | else throw("List size exceeds 5") | |
137 | 137 | ||
138 | 138 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
143 | 143 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
144 | 144 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
145 | 145 | let err = if (!(isInAdminList(callerAddressString))) | |
146 | 146 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
147 | 147 | else if ((adminCurrentVote == 1)) | |
148 | 148 | then throwErr((voteKey + " you already voted")) | |
149 | 149 | else unit | |
150 | 150 | if ((err == err)) | |
151 | 151 | then { | |
152 | 152 | let votes = countVotes(keyPrefix) | |
153 | 153 | if (((votes + 1) >= minVotes)) | |
154 | 154 | then { | |
155 | 155 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
156 | 156 | (clearVoteEntries ++ voteResult) | |
157 | 157 | } | |
158 | 158 | else [IntegerEntry(voteKey, 1)] | |
159 | 159 | } | |
160 | 160 | else throw("Strict value is not equal to itself.") | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | - | func keyCalculatorAddress () = "%s__ | |
164 | + | func keyCalculatorAddress () = "%s__calculatorAddress" | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func keyLpAssetId () = "%s__lpAssetId" | |
168 | 168 | ||
169 | 169 | ||
170 | - | func | |
170 | + | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
171 | 171 | ||
172 | 172 | ||
173 | - | func | |
173 | + | func keyStartHeightByPeriod (period) = makeString(["%s%d", "startHeight", toString(period)], SEP) | |
174 | 174 | ||
175 | 175 | ||
176 | - | func | |
176 | + | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
177 | 177 | ||
178 | 178 | ||
179 | - | func | |
179 | + | func keyTreasuryValueByPeriod (period) = makeString(["%s%d", "treasuryValue", toString(period)], SEP) | |
180 | 180 | ||
181 | 181 | ||
182 | - | func | |
182 | + | func keyTreasuryValue () = makeString(["%s", "treasuryValue"], SEP) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
186 | 186 | case s: String => | |
187 | 187 | addressFromString(s) | |
188 | 188 | case _: Unit => | |
189 | 189 | unit | |
190 | 190 | case _ => | |
191 | 191 | throw("Match error") | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
195 | 195 | ||
196 | - | func | |
196 | + | func keyPowerConfigAddress () = "%s__powerConfigAddress" | |
197 | 197 | ||
198 | 198 | ||
199 | - | func keyPowerContractAddress () = "%s__powerContract" | |
199 | + | func keyPowerContractAddress () = "%s__powerContractAddress" | |
200 | + | ||
201 | + | ||
202 | + | func keyAssets () = "%s__assets" | |
200 | 203 | ||
201 | 204 | ||
202 | 205 | func keyVotingResultAddress () = "contract_voting_result" | |
203 | 206 | ||
204 | 207 | ||
205 | 208 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
206 | 209 | ||
207 | 210 | ||
208 | - | let configAddressOption = match getString(this, | |
211 | + | let configAddressOption = match getString(this, keyPowerConfigAddress()) { | |
209 | 212 | case s: String => | |
210 | 213 | addressFromString(s) | |
211 | 214 | case _: Unit => | |
212 | 215 | unit | |
213 | 216 | case _ => | |
214 | 217 | throw("Match error") | |
215 | 218 | } | |
216 | 219 | ||
217 | 220 | let votingResultAddressOption = match configAddressOption { | |
218 | 221 | case a: Address => | |
219 | 222 | match getString(a, keyVotingResultAddress()) { | |
220 | 223 | case s: String => | |
221 | 224 | addressFromString(s) | |
222 | 225 | case _: Unit => | |
223 | 226 | unit | |
224 | 227 | case _ => | |
225 | 228 | throw("Match error") | |
226 | 229 | } | |
227 | 230 | case _: Unit => | |
228 | 231 | unit | |
229 | 232 | case _ => | |
230 | 233 | throw("Match error") | |
231 | 234 | } | |
232 | 235 | ||
233 | 236 | let votingResultAddressOrFail = valueOrErrorMessage(votingResultAddressOption, wrapErr("invalid voting result address")) | |
234 | 237 | ||
235 | 238 | let lpAssetIdOption = match getString(this, keyLpAssetId()) { | |
236 | 239 | case s: String => | |
237 | 240 | fromBase58String(s) | |
238 | 241 | case _: Unit => | |
239 | 242 | unit | |
240 | 243 | case _ => | |
241 | 244 | throw("Match error") | |
242 | 245 | } | |
243 | 246 | ||
244 | 247 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
245 | 248 | ||
246 | 249 | func onlyAddress (i,address) = if ((i.caller == address)) | |
247 | 250 | then true | |
248 | 251 | else throwErr("permission denied") | |
249 | 252 | ||
250 | 253 | ||
251 | 254 | func onlyThis (i) = onlyAddress(i, this) | |
252 | 255 | ||
253 | 256 | ||
254 | 257 | func onlyCalculator (i) = onlyAddress(i, calculatorAddressOrFail) | |
255 | 258 | ||
256 | 259 | ||
257 | 260 | @Callable(i) | |
258 | 261 | func stringEntry (key,val) = if (onlyCalculator(i)) | |
259 | 262 | then $Tuple2([StringEntry(key, val)], key) | |
260 | 263 | else $Tuple2(nil, unit) | |
261 | 264 | ||
262 | 265 | ||
263 | 266 | ||
264 | 267 | @Callable(i) | |
265 | 268 | func integerEntry (key,val) = if (onlyCalculator(i)) | |
266 | 269 | then $Tuple2([IntegerEntry(key, val)], key) | |
267 | 270 | else $Tuple2(nil, unit) | |
268 | 271 | ||
269 | 272 | ||
270 | 273 | ||
271 | 274 | @Callable(i) | |
272 | 275 | func booleanEntry (key,val) = if (onlyCalculator(i)) | |
273 | 276 | then $Tuple2([BooleanEntry(key, val)], key) | |
274 | 277 | else $Tuple2(nil, unit) | |
275 | 278 | ||
276 | 279 | ||
277 | 280 | ||
278 | 281 | @Callable(i) | |
279 | 282 | func binaryEntry (key,val) = if (onlyCalculator(i)) | |
280 | 283 | then $Tuple2([BinaryEntry(key, val)], key) | |
281 | 284 | else $Tuple2(nil, unit) | |
282 | 285 | ||
283 | 286 | ||
284 | 287 | ||
285 | 288 | @Callable(i) | |
286 | 289 | func deleteEntry (key) = if (onlyCalculator(i)) | |
287 | 290 | then $Tuple2([DeleteEntry(key)], key) | |
288 | 291 | else $Tuple2(nil, unit) | |
289 | 292 | ||
290 | 293 | ||
291 | 294 | ||
292 | 295 | @Callable(i) | |
293 | - | func reissue (amount) = if (onlyCalculator(i)) | |
294 | - | then $Tuple2([Reissue( | |
296 | + | func reissue (assetId,amount,reissuable) = if (onlyCalculator(i)) | |
297 | + | then $Tuple2([Reissue(assetId, amount, reissuable)], amount) | |
295 | 298 | else $Tuple2(nil, unit) | |
296 | 299 | ||
297 | 300 | ||
298 | 301 | ||
299 | 302 | @Callable(i) | |
300 | - | func burn (amount) = if (onlyCalculator(i)) | |
301 | - | then $Tuple2([Burn( | |
303 | + | func burn (assetId,amount) = if (onlyCalculator(i)) | |
304 | + | then $Tuple2([Burn(assetId, amount)], amount) | |
302 | 305 | else $Tuple2(nil, unit) | |
303 | 306 | ||
304 | 307 | ||
305 | 308 | ||
306 | 309 | @Callable(i) | |
307 | 310 | func transferAsset (recipientBytes,amount,assetId) = if (onlyCalculator(i)) | |
308 | 311 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
309 | 312 | else $Tuple2(nil, unit) | |
310 | 313 | ||
311 | 314 | ||
312 | 315 | ||
313 | 316 | @Callable(i) | |
314 | 317 | func transferAssets (recipientBytes,assetsList,amountsList) = if (onlyCalculator(i)) | |
315 | 318 | then { | |
316 | 319 | func addNewTransfer (acc,nextAssetId) = { | |
317 | - | let $ | |
318 | - | let transfers = $ | |
319 | - | let j = $ | |
320 | - | let newTransfer = ScriptTransfer(Address(recipientBytes), | |
320 | + | let $t064996523 = acc | |
321 | + | let transfers = $t064996523._1 | |
322 | + | let j = $t064996523._2 | |
323 | + | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
321 | 324 | let updatedTransfers = (transfers :+ newTransfer) | |
322 | 325 | $Tuple2(updatedTransfers, (j + 1)) | |
323 | 326 | } | |
324 | 327 | ||
325 | - | let $ | |
328 | + | let $t067496830 = { | |
326 | 329 | let $l = assetsList | |
327 | 330 | let $s = size($l) | |
328 | 331 | let $acc0 = $Tuple2(nil, 0) | |
329 | 332 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
330 | 333 | then $a | |
331 | 334 | else addNewTransfer($a, $l[$i]) | |
332 | 335 | ||
333 | 336 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
334 | 337 | then $a | |
335 | 338 | else throw("List size exceeds 10") | |
336 | 339 | ||
337 | 340 | $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) | |
338 | 341 | } | |
339 | - | let assetsTransfers = $ | |
340 | - | let _lastIndex = $ | |
342 | + | let assetsTransfers = $t067496830._1 | |
343 | + | let _lastIndex = $t067496830._2 | |
341 | 344 | $Tuple2(assetsTransfers, unit) | |
342 | 345 | } | |
343 | 346 | else $Tuple2(nil, unit) | |
344 | 347 | ||
345 | 348 | ||
346 | 349 | ||
347 | 350 | @Callable(i) | |
348 | 351 | func transferWaves (recipientBytes,amount) = if (onlyCalculator(i)) | |
349 | 352 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
350 | 353 | else $Tuple2(nil, unit) | |
351 | 354 | ||
352 | 355 | ||
353 | 356 | ||
354 | 357 | @Callable(i) | |
355 | - | func commitAfterStartWithLockRoundFor (contract,child,address,additionalLockRounds,paymentAssetId,paymentAmount) = $Tuple2(nil, invoke(addressFromStringValue(contract), "commitAfterStartWithLockRoundFor", [child, address, additionalLockRounds], [AttachedPayment(paymentAssetId, paymentAmount)])) | |
358 | + | func init (lpAssetIdStr,calculatorAddressStr,powerConfigAddressStr,powerContractAddress,periodLength,treasuryValue,assets) = { | |
359 | + | let checkCaller = mustThis(i) | |
360 | + | if ((checkCaller == checkCaller)) | |
361 | + | then $Tuple2([StringEntry(keyLpAssetId(), lpAssetIdStr), StringEntry(keyCalculatorAddress(), calculatorAddressStr), StringEntry(keyPowerConfigAddress(), powerConfigAddressStr), StringEntry(keyPowerContractAddress(), powerContractAddress), IntegerEntry(keyPeriodLength(), periodLength), IntegerEntry(keyTreasuryValue(), treasuryValue), IntegerEntry(keyTreasuryValueByPeriod(0), treasuryValue), IntegerEntry(keyCurrentPeriod(), 0), IntegerEntry(keyStartHeightByPeriod(0), height), StringEntry(keyAssets(), makeString(assets, SEP))], unit) | |
362 | + | else throw("Strict value is not equal to itself.") | |
363 | + | } | |
356 | 364 | ||
357 | 365 | ||
358 | 366 | ||
359 | 367 | @Callable(i) | |
360 | - | func init (calculatorAddressStr,powerConfigAddressStr,powerContractAddressStr) = { | |
361 | - | let checkCaller = mustThis(i) | |
362 | - | if ((checkCaller == checkCaller)) | |
363 | - | then $Tuple2([StringEntry(keyCalculatorAddress(), calculatorAddressStr), StringEntry(keyConfigAddress(), powerConfigAddressStr), StringEntry(keyPowerContractAddress(), powerContractAddressStr)], unit) | |
364 | - | else throw("Strict value is not equal to itself.") | |
365 | - | } | |
368 | + | func commitAfterStartWithLockRoundFor (contract,child,address,additionalLockRounds,paymentAssetId,paymentAmount) = $Tuple2(nil, invoke(addressFromStringValue(contract), "commitAfterStartWithLockRoundFor", [child, address, additionalLockRounds], [AttachedPayment(paymentAssetId, paymentAmount)])) | |
366 | 369 | ||
367 | 370 | ||
368 | 371 | ||
369 | 372 | @Callable(i) | |
370 | 373 | func call (function,args) = { | |
371 | 374 | let result = reentrantInvoke(calculatorAddressOrFail, function, [i.callerPublicKey, args], i.payments) | |
372 | 375 | $Tuple2(nil, result) | |
373 | 376 | } | |
374 | 377 | ||
375 | 378 | ||
376 | 379 | ||
377 | 380 | @Callable(i) | |
378 | 381 | func voteForTxId (txId) = { | |
379 | 382 | let callerAddressString = toBase58String(i.caller.bytes) | |
380 | 383 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
381 | 384 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
382 | 385 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
383 | 386 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
384 | 387 | then true | |
385 | 388 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
386 | 389 | then true | |
387 | 390 | else (value(allowedTxIdOption) != txId)) | |
388 | 391 | then true | |
389 | 392 | else throwErr((txId + " is already allowed"))] | |
390 | 393 | if ((err == err)) | |
391 | 394 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
392 | 395 | else throw("Strict value is not equal to itself.") | |
393 | 396 | } | |
394 | 397 | ||
395 | 398 | ||
396 | 399 | @Verifier(tx) | |
397 | 400 | func verify () = { | |
398 | 401 | let byProposal = match votingResultAddressOption { | |
399 | 402 | case proposalAddress: Address => | |
400 | 403 | valueOrElse(getBoolean(proposalAddress, keyProposalAllowBroadcast(this, tx.id)), false) | |
401 | 404 | case _ => | |
402 | 405 | false | |
403 | 406 | } | |
404 | 407 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
405 | 408 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
406 | 409 | then false | |
407 | 410 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
408 | 411 | if (if (byProposal) | |
409 | 412 | then true | |
410 | 413 | else byAdmins) | |
411 | 414 | then true | |
412 | 415 | else byOwner | |
413 | 416 | } | |
414 | 417 |
github/deemru/w8io/026f985 49.83 ms ◑