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