tx · Bw3dyDDD8Uefsw52sC2yRSTsi3KPZdjV7YjWfvZWETL6 3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC: -0.01400000 Waves 2024.05.22 22:13 [3117605] smart account 3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC > SELF 0.00000000 Waves
{ "type": 13, "id": "Bw3dyDDD8Uefsw52sC2yRSTsi3KPZdjV7YjWfvZWETL6", "fee": 1400000, "feeAssetId": null, "timestamp": 1716405191121, "version": 2, "chainId": 84, "sender": "3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC", "senderPublicKey": "APsCCjsKHFx7rbr1mG8Pca43pccTbH2G4FZj4keEqKJ5", "proofs": [ "2QyywaydkNwR8BYj8ea9FsGJ9QZqmHs2C7QuAbDw8UaMLFykJTjiUgi9fAxk4dcvscaSvvYHbaWnPNGHsEwYFfef" ], "script": "base64:BgItCAISAwoBCBIHCgUBAQERGBIHCgUBCAEIARIHCgUBEhERCBIDCgEBEgASABIAJQAHV2F2ZXNJZAIFV0FWRVMACE1pbmVyRmVlAAUAEVBheW91dEVtcHR5U3RhdHVzAAAAFVBheW91dEluaXRpYXRlZFN0YXR1cwABABVQYXlvdXRDb21wbGV0ZWRTdGF0dXMAAgASQmxvY2tzQmF0Y2hNYXhTaXplAAoAFlJlY2lwaWVudHNCYXRjaE1heFNpemUAZAAGSGVpZ2h0BQZoZWlnaHQABUFycjEwCQDMCAIAAAkAzAgCAAEJAMwIAgACCQDMCAIAAwkAzAgCAAQJAMwIAgAFCQDMCAIABgkAzAgCAAcJAMwIAgAICQDMCAIACQUDbmlsABBDb25maWdBZGRyZXNzS2V5Ag1jb25maWdBZGRyZXNzAA1MYXN0UGF5b3V0S2V5AgpsYXN0UGF5b3V0ABNNYXNzVHJhbnNmZXJGZWVzS2V5AhBtYXNzVHJhbnNmZXJGZWVzAA9XYXZlc0NoYWluSWRLZXkJAKwCAgIIY2hhaW5JZF8FB1dhdmVzSWQAEERhZW1vbkFkZHJ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UHVibGljS2V5CQDEEwMIBQhpbnZva2VUeAlib2R5Qnl0ZXMJAJEDAggFCGludm9rZVR4BnByb29mcwAABQlwdWJsaWNLZXkEEGNvbmZpZ0FkZHJlc3NTdHIJAJ0IAgUEdGhpcwUQQ29uZmlnQWRkcmVzc0tleQQNY29uZmlnQWRkcmVzcwkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUQY29uZmlnQWRkcmVzc1N0cgQJcHVibGljS2V5AwkBCWlzRGVmaW5lZAEFEGNvbmZpZ0FkZHJlc3NTdHIJAQt2YWx1ZU9yRWxzZQIJAJwIAgUNY29uZmlnQWRkcmVzcwUSU2lnbmVyUHVibGljS2V5S2V5CAUCdHgPc2VuZGVyUHVibGljS2V5CAUCdHgPc2VuZGVyUHVibGljS2V5CQDIEwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQlwdWJsaWNLZXkH1jcw", "height": 3117605, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Fuqph3uTgyS6qgsxgT2YLKEQtKjoTsUqzhASvKXqFzjD Next: DMXhdGpcvh65pn25ZCbsyZXjeb4Dm2Ge89xytG2jJd1v Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | let MassTransferFeesKey = "massTransferFees" | |
27 | 27 | ||
28 | - | let | |
28 | + | let WavesChainIdKey = ("chainId_" + WavesId) | |
29 | 29 | ||
30 | 30 | let DaemonAddressKey = "daemonAddress" | |
31 | 31 | ||
45 | 45 | ||
46 | 46 | let ConfigAddress = addressFromStringValue(getStringValue(this, ConfigAddressKey)) | |
47 | 47 | ||
48 | - | let | |
48 | + | let WavesChainId = getIntegerValue(ConfigAddress, WavesChainIdKey) | |
49 | 49 | ||
50 | 50 | let DaemonAddress = addressFromStringValue(getStringValue(ConfigAddress, DaemonAddressKey)) | |
51 | 51 | ||
56 | 56 | let PuzzleAggregatorAddress = addressFromStringValue(getStringValue(ConfigAddress, PuzzleAggregatorAddressKey)) | |
57 | 57 | ||
58 | 58 | let PuzzleBuybackAddress = addressFromStringValue(getStringValue(ConfigAddress, PuzzleBuybackAddressKey)) | |
59 | - | ||
60 | - | let SettingsAddress = addressFromStringValue(getStringValue(ConfigAddress, SettingsAddressKey)) | |
61 | 59 | ||
62 | 60 | let SignerPublicKey = getBinary(ConfigAddress, SignerPublicKeyKey) | |
63 | 61 | ||
115 | 113 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
116 | 114 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
117 | 115 | else { | |
118 | - | let $ | |
119 | - | let lastStartHeight = $ | |
120 | - | let lastEndHeight = $ | |
116 | + | let $t035963660 = getPayoutData(lastPayout) | |
117 | + | let lastStartHeight = $t035963660._1 | |
118 | + | let lastEndHeight = $t035963660._2 | |
121 | 119 | if ((startHeight != (lastEndHeight + 1))) | |
122 | 120 | then throw(((("Wrong startHeight: " + toString(startHeight)) + ", should be: ") + toString((lastEndHeight + 1)))) | |
123 | 121 | else if ((startHeight > endHeight)) | |
124 | 122 | then throw(((("endHeight: " + toString(endHeight)) + " less than startHeight: ") + toString(startHeight))) | |
125 | 123 | else { | |
126 | - | let inputsQuantity = getIntegerValue(SettingsAddress, "inputsQuantity") | |
127 | 124 | let amountsSize = size(amounts) | |
128 | 125 | let assetsSize = size(assets) | |
129 | - | if (if ((amountsSize != assetsSize)) | |
130 | - | then true | |
131 | - | else (amountsSize != inputsQuantity)) | |
126 | + | if ((amountsSize != assetsSize)) | |
132 | 127 | then throw("Wrong size of amounts or assets") | |
133 | 128 | else { | |
134 | 129 | let availableWavesDaoLpToClaim = valueOrElse(getInteger(WavesDaoFactoryAddress, ("%s%s__available__" + toString(this))), 0) | |
145 | 140 | then accum | |
146 | 141 | else { | |
147 | 142 | let assetStr = assets[index] | |
148 | - | if ((getInteger( | |
149 | - | then throw(("Unknown | |
143 | + | if ((getInteger(ConfigAddress, ("assetIndex_" + assetStr)) == unit)) | |
144 | + | then throw(("Unknown asset: " + assetStr)) | |
150 | 145 | else { | |
151 | - | let $ | |
146 | + | let $t049465125 = if ((assetStr == WavesId)) | |
152 | 147 | then $Tuple2(unit, (amounts[index] + currentAdditionalRewards)) | |
153 | 148 | else $Tuple2(fromBase58String(assetStr), amounts[index]) | |
154 | - | let asset = $ | |
155 | - | let amount = $ | |
149 | + | let asset = $t049465125._1 | |
150 | + | let amount = $t049465125._2 | |
156 | 151 | if ((0 > amount)) | |
157 | 152 | then throw((("Wrong asset amount: " + toString(amount)) + ", should be positive or zero")) | |
158 | 153 | else { | |
165 | 160 | } | |
166 | 161 | } | |
167 | 162 | ||
168 | - | let $ | |
163 | + | let $t057095776 = { | |
169 | 164 | let $l = Arr10 | |
170 | 165 | let $s = size($l) | |
171 | 166 | let $acc0 = $Tuple2(nil, nil) | |
179 | 174 | ||
180 | 175 | $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) | |
181 | 176 | } | |
182 | - | let transfers = $ | |
183 | - | let amountKeys = $ | |
177 | + | let transfers = $t057095776._1 | |
178 | + | let amountKeys = $t057095776._2 | |
184 | 179 | let newPayoutData = makeString(([toString(startHeight), toString(endHeight)] ++ amountKeys), "_") | |
185 | 180 | (transfers ++ [IntegerEntry(LastPayoutKey, payoutId), StringEntry(makePayoutDataKey(payoutId), newPayoutData), IntegerEntry(makePayoutStatusKey(payoutId), PayoutInitiatedStatus)]) | |
186 | 181 | } | |
207 | 202 | if ((payoutStatus != PayoutInitiatedStatus)) | |
208 | 203 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
209 | 204 | else { | |
210 | - | let $ | |
205 | + | let $t067276976 = if ((swapFrom == WavesId)) | |
211 | 206 | then $Tuple2(wavesBalance(this).available, unit) | |
212 | 207 | else { | |
213 | 208 | let assetId = fromBase58String(swapFrom) | |
214 | 209 | $Tuple2(assetBalance(this, assetId), assetId) | |
215 | 210 | } | |
216 | - | let balanceInBeforeSwap = $ | |
217 | - | let swapFromId = $ | |
211 | + | let balanceInBeforeSwap = $t067276976._1 | |
212 | + | let swapFromId = $t067276976._2 | |
218 | 213 | let swapInvoke = invoke(PuzzleAggregatorAddress, "swapWithReferral", [route, minToReceive, "puzzlenode"], [AttachedPayment(swapFromId, amountIn)]) | |
219 | 214 | if ((swapInvoke == swapInvoke)) | |
220 | 215 | then { | |
260 | 255 | then throw(((("Should be not greater than " + toString(RecipientsBatchMaxSize)) + " recipients, current: ") + toString(recipientsSize))) | |
261 | 256 | else { | |
262 | 257 | let magicByte = drop(toBytes(1), 7) | |
263 | - | let chainIdByte = drop(toBytes( | |
258 | + | let chainIdByte = drop(toBytes(WavesChainId), 7) | |
264 | 259 | let addressPrefix = (magicByte + chainIdByte) | |
265 | 260 | func scriptTransfersFold (accum,index) = if ((index >= recipientsSize)) | |
266 | 261 | then accum | |
271 | 266 | let recipient = Address((addressData + addressChecksum)) | |
272 | 267 | let amount = amounts[index] | |
273 | 268 | let assetIndex = assets[index] | |
274 | - | let assetId = getBinaryValue( | |
269 | + | let assetId = getBinaryValue(ConfigAddress, ("assetId_" + toString(assetIndex))) | |
275 | 270 | let asset = if ((assetId == base58'')) | |
276 | 271 | then unit | |
277 | 272 | else assetId | |
380 | 375 | else (invokeTx.function == "extendAltChain") | |
381 | 376 | let configAddressStr = getString(this, ConfigAddressKey) | |
382 | 377 | let configAddress = addressFromStringValue(value(configAddressStr)) | |
383 | - | let | |
378 | + | let unitsChain = getString(configAddress, ("unitsChainName_" + toString({ | |
384 | 379 | let @ = invokeTx.dApp | |
385 | 380 | if ($isInstanceOf(@, "Address")) | |
386 | 381 | then @ | |
388 | 383 | }))) | |
389 | 384 | let signerPublicKey = valueOrElse(getBinary(configAddress, SignerPublicKeyKey), tx.senderPublicKey) | |
390 | 385 | let publicKey = if (isDefined(configAddressStr)) | |
391 | - | then if (if (isDefined( | |
386 | + | then if (if (isDefined(unitsChain)) | |
392 | 387 | then validFunctionName | |
393 | 388 | else false) | |
394 | 389 | then tx.senderPublicKey |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WavesId = "WAVES" | |
5 | 5 | ||
6 | 6 | let MinerFee = 5 | |
7 | 7 | ||
8 | 8 | let PayoutEmptyStatus = 0 | |
9 | 9 | ||
10 | 10 | let PayoutInitiatedStatus = 1 | |
11 | 11 | ||
12 | 12 | let PayoutCompletedStatus = 2 | |
13 | 13 | ||
14 | 14 | let BlocksBatchMaxSize = 10 | |
15 | 15 | ||
16 | 16 | let RecipientsBatchMaxSize = 100 | |
17 | 17 | ||
18 | 18 | let Height = height | |
19 | 19 | ||
20 | 20 | let Arr10 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
21 | 21 | ||
22 | 22 | let ConfigAddressKey = "configAddress" | |
23 | 23 | ||
24 | 24 | let LastPayoutKey = "lastPayout" | |
25 | 25 | ||
26 | 26 | let MassTransferFeesKey = "massTransferFees" | |
27 | 27 | ||
28 | - | let | |
28 | + | let WavesChainIdKey = ("chainId_" + WavesId) | |
29 | 29 | ||
30 | 30 | let DaemonAddressKey = "daemonAddress" | |
31 | 31 | ||
32 | 32 | let DaemonPublicKeyKey = "daemonPublicKey" | |
33 | 33 | ||
34 | 34 | let MaintainerAddressKey = "maintainerAddress" | |
35 | 35 | ||
36 | 36 | let PuzzleAggregatorAddressKey = "puzzleAggregatorAddress" | |
37 | 37 | ||
38 | 38 | let PuzzleBuybackAddressKey = "puzzleBuybackAddress" | |
39 | 39 | ||
40 | 40 | let SettingsAddressKey = "settingsAddress" | |
41 | 41 | ||
42 | 42 | let SignerPublicKeyKey = "signerPublicKey" | |
43 | 43 | ||
44 | 44 | let WavesDaoFactoryAddressKey = "wavesDaoFactoryAddress" | |
45 | 45 | ||
46 | 46 | let ConfigAddress = addressFromStringValue(getStringValue(this, ConfigAddressKey)) | |
47 | 47 | ||
48 | - | let | |
48 | + | let WavesChainId = getIntegerValue(ConfigAddress, WavesChainIdKey) | |
49 | 49 | ||
50 | 50 | let DaemonAddress = addressFromStringValue(getStringValue(ConfigAddress, DaemonAddressKey)) | |
51 | 51 | ||
52 | 52 | let DaemonPublicKey = getBinaryValue(ConfigAddress, DaemonPublicKeyKey) | |
53 | 53 | ||
54 | 54 | let MaintainerAddress = addressFromStringValue(getStringValue(ConfigAddress, MaintainerAddressKey)) | |
55 | 55 | ||
56 | 56 | let PuzzleAggregatorAddress = addressFromStringValue(getStringValue(ConfigAddress, PuzzleAggregatorAddressKey)) | |
57 | 57 | ||
58 | 58 | let PuzzleBuybackAddress = addressFromStringValue(getStringValue(ConfigAddress, PuzzleBuybackAddressKey)) | |
59 | - | ||
60 | - | let SettingsAddress = addressFromStringValue(getStringValue(ConfigAddress, SettingsAddressKey)) | |
61 | 59 | ||
62 | 60 | let SignerPublicKey = getBinary(ConfigAddress, SignerPublicKeyKey) | |
63 | 61 | ||
64 | 62 | let WavesDaoFactoryAddress = addressFromStringValue(getStringValue(ConfigAddress, WavesDaoFactoryAddressKey)) | |
65 | 63 | ||
66 | 64 | func makePayoutDataKey (payoutId) = ("payoutData_" + toString(payoutId)) | |
67 | 65 | ||
68 | 66 | ||
69 | 67 | func makePayoutStatusKey (payoutId) = ("payoutStatus_" + toString(payoutId)) | |
70 | 68 | ||
71 | 69 | ||
72 | 70 | func makePayoutAdditionalRewardsKey (payoutId) = ("payoutAdditionalRewards_" + toString(payoutId)) | |
73 | 71 | ||
74 | 72 | ||
75 | 73 | func getLastPayout () = getIntegerValue(this, LastPayoutKey) | |
76 | 74 | ||
77 | 75 | ||
78 | 76 | func getPayoutData (payoutId) = { | |
79 | 77 | let payoutString = getStringValue(makePayoutDataKey(payoutId)) | |
80 | 78 | let payoutDataList = split(payoutString, "_") | |
81 | 79 | let startHeight = parseIntValue(payoutDataList[0]) | |
82 | 80 | let endHeight = parseIntValue(payoutDataList[1]) | |
83 | 81 | $Tuple2(startHeight, endHeight) | |
84 | 82 | } | |
85 | 83 | ||
86 | 84 | ||
87 | 85 | func getPayoutStatus (payoutId) = valueOrElse(getInteger(makePayoutStatusKey(payoutId)), PayoutEmptyStatus) | |
88 | 86 | ||
89 | 87 | ||
90 | 88 | func getPayoutAdditionalRewards (payoutId) = valueOrElse(getInteger(makePayoutAdditionalRewardsKey(payoutId)), 0) | |
91 | 89 | ||
92 | 90 | ||
93 | 91 | @Callable(i) | |
94 | 92 | func setup (configAddress) = if ((i.caller != this)) | |
95 | 93 | then throw("Access denied") | |
96 | 94 | else if ((size(i.payments) != 0)) | |
97 | 95 | then throw("Payments are prohibited") | |
98 | 96 | else if ((addressFromString(configAddress) == unit)) | |
99 | 97 | then throw(("Invalid configAddress: " + configAddress)) | |
100 | 98 | else [StringEntry(ConfigAddressKey, configAddress)] | |
101 | 99 | ||
102 | 100 | ||
103 | 101 | ||
104 | 102 | @Callable(i) | |
105 | 103 | func initiatePayout (payoutId,startHeight,endHeight,amounts,assets) = if ((i.caller != DaemonAddress)) | |
106 | 104 | then throw("Access denied") | |
107 | 105 | else if ((size(i.payments) != 0)) | |
108 | 106 | then throw("Payments are prohibited") | |
109 | 107 | else { | |
110 | 108 | let lastPayout = getLastPayout() | |
111 | 109 | if ((payoutId != (lastPayout + 1))) | |
112 | 110 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString((lastPayout + 1)))) | |
113 | 111 | else { | |
114 | 112 | let lastPayoutStatus = getPayoutStatus(lastPayout) | |
115 | 113 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
116 | 114 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
117 | 115 | else { | |
118 | - | let $ | |
119 | - | let lastStartHeight = $ | |
120 | - | let lastEndHeight = $ | |
116 | + | let $t035963660 = getPayoutData(lastPayout) | |
117 | + | let lastStartHeight = $t035963660._1 | |
118 | + | let lastEndHeight = $t035963660._2 | |
121 | 119 | if ((startHeight != (lastEndHeight + 1))) | |
122 | 120 | then throw(((("Wrong startHeight: " + toString(startHeight)) + ", should be: ") + toString((lastEndHeight + 1)))) | |
123 | 121 | else if ((startHeight > endHeight)) | |
124 | 122 | then throw(((("endHeight: " + toString(endHeight)) + " less than startHeight: ") + toString(startHeight))) | |
125 | 123 | else { | |
126 | - | let inputsQuantity = getIntegerValue(SettingsAddress, "inputsQuantity") | |
127 | 124 | let amountsSize = size(amounts) | |
128 | 125 | let assetsSize = size(assets) | |
129 | - | if (if ((amountsSize != assetsSize)) | |
130 | - | then true | |
131 | - | else (amountsSize != inputsQuantity)) | |
126 | + | if ((amountsSize != assetsSize)) | |
132 | 127 | then throw("Wrong size of amounts or assets") | |
133 | 128 | else { | |
134 | 129 | let availableWavesDaoLpToClaim = valueOrElse(getInteger(WavesDaoFactoryAddress, ("%s%s__available__" + toString(this))), 0) | |
135 | 130 | let wavesDaoNextBlockToProcess = getIntegerValue(WavesDaoFactoryAddress, "%s__nextBlockToProcess") | |
136 | 131 | let wavesDlpClaim = if (if ((availableWavesDaoLpToClaim > 0)) | |
137 | 132 | then ((wavesDaoNextBlockToProcess + BlocksBatchMaxSize) >= Height) | |
138 | 133 | else false) | |
139 | 134 | then invoke(WavesDaoFactoryAddress, "claimLP", nil, nil) | |
140 | 135 | else unit | |
141 | 136 | if ((wavesDlpClaim == wavesDlpClaim)) | |
142 | 137 | then { | |
143 | 138 | let currentAdditionalRewards = getPayoutAdditionalRewards(payoutId) | |
144 | 139 | func assetsFold (accum,index) = if ((index >= assetsSize)) | |
145 | 140 | then accum | |
146 | 141 | else { | |
147 | 142 | let assetStr = assets[index] | |
148 | - | if ((getInteger( | |
149 | - | then throw(("Unknown | |
143 | + | if ((getInteger(ConfigAddress, ("assetIndex_" + assetStr)) == unit)) | |
144 | + | then throw(("Unknown asset: " + assetStr)) | |
150 | 145 | else { | |
151 | - | let $ | |
146 | + | let $t049465125 = if ((assetStr == WavesId)) | |
152 | 147 | then $Tuple2(unit, (amounts[index] + currentAdditionalRewards)) | |
153 | 148 | else $Tuple2(fromBase58String(assetStr), amounts[index]) | |
154 | - | let asset = $ | |
155 | - | let amount = $ | |
149 | + | let asset = $t049465125._1 | |
150 | + | let amount = $t049465125._2 | |
156 | 151 | if ((0 > amount)) | |
157 | 152 | then throw((("Wrong asset amount: " + toString(amount)) + ", should be positive or zero")) | |
158 | 153 | else { | |
159 | 154 | let minerFee = fraction(amount, MinerFee, 100) | |
160 | 155 | let maintainerFee = (minerFee / 2) | |
161 | 156 | let puzzleBuybackFee = (minerFee - maintainerFee) | |
162 | 157 | let lessorsAmount = ((amount - maintainerFee) - puzzleBuybackFee) | |
163 | 158 | $Tuple2(((accum._1 :+ ScriptTransfer(MaintainerAddress, maintainerFee, asset)) :+ ScriptTransfer(PuzzleBuybackAddress, puzzleBuybackFee, asset)), (accum._2 :+ toString(lessorsAmount))) | |
164 | 159 | } | |
165 | 160 | } | |
166 | 161 | } | |
167 | 162 | ||
168 | - | let $ | |
163 | + | let $t057095776 = { | |
169 | 164 | let $l = Arr10 | |
170 | 165 | let $s = size($l) | |
171 | 166 | let $acc0 = $Tuple2(nil, nil) | |
172 | 167 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
173 | 168 | then $a | |
174 | 169 | else assetsFold($a, $l[$i]) | |
175 | 170 | ||
176 | 171 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
177 | 172 | then $a | |
178 | 173 | else throw("List size exceeds 10") | |
179 | 174 | ||
180 | 175 | $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) | |
181 | 176 | } | |
182 | - | let transfers = $ | |
183 | - | let amountKeys = $ | |
177 | + | let transfers = $t057095776._1 | |
178 | + | let amountKeys = $t057095776._2 | |
184 | 179 | let newPayoutData = makeString(([toString(startHeight), toString(endHeight)] ++ amountKeys), "_") | |
185 | 180 | (transfers ++ [IntegerEntry(LastPayoutKey, payoutId), StringEntry(makePayoutDataKey(payoutId), newPayoutData), IntegerEntry(makePayoutStatusKey(payoutId), PayoutInitiatedStatus)]) | |
186 | 181 | } | |
187 | 182 | else throw("Strict value is not equal to itself.") | |
188 | 183 | } | |
189 | 184 | } | |
190 | 185 | } | |
191 | 186 | } | |
192 | 187 | } | |
193 | 188 | ||
194 | 189 | ||
195 | 190 | ||
196 | 191 | @Callable(i) | |
197 | 192 | func swap (payoutId,swapFrom,amountIn,route,minToReceive) = if ((i.caller != DaemonAddress)) | |
198 | 193 | then throw("Access denied") | |
199 | 194 | else if ((size(i.payments) != 0)) | |
200 | 195 | then throw("Payments are prohibited") | |
201 | 196 | else { | |
202 | 197 | let lastPayout = getLastPayout() | |
203 | 198 | if ((lastPayout != payoutId)) | |
204 | 199 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
205 | 200 | else { | |
206 | 201 | let payoutStatus = getPayoutStatus(payoutId) | |
207 | 202 | if ((payoutStatus != PayoutInitiatedStatus)) | |
208 | 203 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
209 | 204 | else { | |
210 | - | let $ | |
205 | + | let $t067276976 = if ((swapFrom == WavesId)) | |
211 | 206 | then $Tuple2(wavesBalance(this).available, unit) | |
212 | 207 | else { | |
213 | 208 | let assetId = fromBase58String(swapFrom) | |
214 | 209 | $Tuple2(assetBalance(this, assetId), assetId) | |
215 | 210 | } | |
216 | - | let balanceInBeforeSwap = $ | |
217 | - | let swapFromId = $ | |
211 | + | let balanceInBeforeSwap = $t067276976._1 | |
212 | + | let swapFromId = $t067276976._2 | |
218 | 213 | let swapInvoke = invoke(PuzzleAggregatorAddress, "swapWithReferral", [route, minToReceive, "puzzlenode"], [AttachedPayment(swapFromId, amountIn)]) | |
219 | 214 | if ((swapInvoke == swapInvoke)) | |
220 | 215 | then { | |
221 | 216 | let balanceInAfterSwap = if ((swapFrom == WavesId)) | |
222 | 217 | then wavesBalance(this).available | |
223 | 218 | else assetBalance(this, value(swapFromId)) | |
224 | 219 | let refund = (balanceInAfterSwap - (balanceInBeforeSwap - amountIn)) | |
225 | 220 | if ((refund > 10)) | |
226 | 221 | then throw(("Rollback aggregator refund: " + toString(refund))) | |
227 | 222 | else nil | |
228 | 223 | } | |
229 | 224 | else throw("Strict value is not equal to itself.") | |
230 | 225 | } | |
231 | 226 | } | |
232 | 227 | } | |
233 | 228 | ||
234 | 229 | ||
235 | 230 | ||
236 | 231 | @Callable(i) | |
237 | 232 | func distributeTokens (payoutId,recipients,amounts,assets,attachment) = if ((i.caller != DaemonAddress)) | |
238 | 233 | then throw("Access denied") | |
239 | 234 | else if ((size(i.payments) != 0)) | |
240 | 235 | then throw("Payments are prohibited") | |
241 | 236 | else { | |
242 | 237 | let lastPayout = getLastPayout() | |
243 | 238 | if ((lastPayout != payoutId)) | |
244 | 239 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
245 | 240 | else { | |
246 | 241 | let payoutStatus = getPayoutStatus(payoutId) | |
247 | 242 | if ((payoutStatus != PayoutInitiatedStatus)) | |
248 | 243 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
249 | 244 | else { | |
250 | 245 | let recipientsSize = size(recipients) | |
251 | 246 | let amountsSize = size(amounts) | |
252 | 247 | let assetsSize = size(assets) | |
253 | 248 | if (if ((recipientsSize != amountsSize)) | |
254 | 249 | then true | |
255 | 250 | else (recipientsSize != assetsSize)) | |
256 | 251 | then throw(((((("Wrong recipients size: " + toString(recipientsSize)) + ", amounts size: ") + toString(amountsSize)) + ", assets size: ") + toString(assetsSize))) | |
257 | 252 | else if ((recipientsSize == 0)) | |
258 | 253 | then throw("Recipients list should not be empty") | |
259 | 254 | else if ((recipientsSize > RecipientsBatchMaxSize)) | |
260 | 255 | then throw(((("Should be not greater than " + toString(RecipientsBatchMaxSize)) + " recipients, current: ") + toString(recipientsSize))) | |
261 | 256 | else { | |
262 | 257 | let magicByte = drop(toBytes(1), 7) | |
263 | - | let chainIdByte = drop(toBytes( | |
258 | + | let chainIdByte = drop(toBytes(WavesChainId), 7) | |
264 | 259 | let addressPrefix = (magicByte + chainIdByte) | |
265 | 260 | func scriptTransfersFold (accum,index) = if ((index >= recipientsSize)) | |
266 | 261 | then accum | |
267 | 262 | else { | |
268 | 263 | let publicKeyHash = recipients[index] | |
269 | 264 | let addressData = (addressPrefix + publicKeyHash) | |
270 | 265 | let addressChecksum = take(keccak256(blake2b256(addressData)), 4) | |
271 | 266 | let recipient = Address((addressData + addressChecksum)) | |
272 | 267 | let amount = amounts[index] | |
273 | 268 | let assetIndex = assets[index] | |
274 | - | let assetId = getBinaryValue( | |
269 | + | let assetId = getBinaryValue(ConfigAddress, ("assetId_" + toString(assetIndex))) | |
275 | 270 | let asset = if ((assetId == base58'')) | |
276 | 271 | then unit | |
277 | 272 | else assetId | |
278 | 273 | (accum :+ ScriptTransfer(recipient, amount, asset)) | |
279 | 274 | } | |
280 | 275 | ||
281 | 276 | let indexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] | |
282 | 277 | let $l = indexes | |
283 | 278 | let $s = size($l) | |
284 | 279 | let $acc0 = nil | |
285 | 280 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
286 | 281 | then $a | |
287 | 282 | else scriptTransfersFold($a, $l[$i]) | |
288 | 283 | ||
289 | 284 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
290 | 285 | then $a | |
291 | 286 | else throw("List size exceeds 100") | |
292 | 287 | ||
293 | 288 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
294 | 289 | } | |
295 | 290 | } | |
296 | 291 | } | |
297 | 292 | } | |
298 | 293 | ||
299 | 294 | ||
300 | 295 | ||
301 | 296 | @Callable(i) | |
302 | 297 | func finalizePayout (payoutId) = if ((i.caller != DaemonAddress)) | |
303 | 298 | then throw("Access denied") | |
304 | 299 | else { | |
305 | 300 | let lastPayout = getLastPayout() | |
306 | 301 | if ((lastPayout != payoutId)) | |
307 | 302 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
308 | 303 | else { | |
309 | 304 | let payoutStatus = getPayoutStatus(lastPayout) | |
310 | 305 | if ((payoutStatus != PayoutInitiatedStatus)) | |
311 | 306 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be: 1")) | |
312 | 307 | else [IntegerEntry(makePayoutStatusKey(lastPayout), PayoutCompletedStatus)] | |
313 | 308 | } | |
314 | 309 | } | |
315 | 310 | ||
316 | 311 | ||
317 | 312 | ||
318 | 313 | @Callable(i) | |
319 | 314 | func addAdditionalRewards () = if ((size(i.payments) != 1)) | |
320 | 315 | then throw("At least one payment should be attached") | |
321 | 316 | else if ((i.payments[0].assetId != unit)) | |
322 | 317 | then throw("Only waves can be attached") | |
323 | 318 | else { | |
324 | 319 | let lastPayout = getLastPayout() | |
325 | 320 | let lastPayoutStatus = getPayoutStatus(lastPayout) | |
326 | 321 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
327 | 322 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
328 | 323 | else { | |
329 | 324 | let nextPayoutId = (lastPayout + 1) | |
330 | 325 | let currentAdditionalRewards = getPayoutAdditionalRewards(nextPayoutId) | |
331 | 326 | let newAdditionalRewards = (currentAdditionalRewards + i.payments[0].amount) | |
332 | 327 | [IntegerEntry(makePayoutAdditionalRewardsKey(nextPayoutId), newAdditionalRewards)] | |
333 | 328 | } | |
334 | 329 | } | |
335 | 330 | ||
336 | 331 | ||
337 | 332 | ||
338 | 333 | @Callable(i) | |
339 | 334 | func addMassTransferFees () = if ((size(i.payments) != 1)) | |
340 | 335 | then throw("At least one payment should be attached") | |
341 | 336 | else if ((i.payments[0].assetId != unit)) | |
342 | 337 | then throw("Only waves can be attached") | |
343 | 338 | else { | |
344 | 339 | let currentMassTransferFees = valueOrElse(getInteger(MassTransferFeesKey), 0) | |
345 | 340 | let newMassTransferFees = (currentMassTransferFees + i.payments[0].amount) | |
346 | 341 | [IntegerEntry(MassTransferFeesKey, newMassTransferFees)] | |
347 | 342 | } | |
348 | 343 | ||
349 | 344 | ||
350 | 345 | ||
351 | 346 | @Callable(i) | |
352 | 347 | func withdrawMassTransferFees () = if ((i.caller != MaintainerAddress)) | |
353 | 348 | then throw("Access denied") | |
354 | 349 | else if ((size(i.payments) != 0)) | |
355 | 350 | then throw("Payments are prohibited") | |
356 | 351 | else { | |
357 | 352 | let currentMassTransferFees = valueOrElse(getInteger(MassTransferFeesKey), 0) | |
358 | 353 | if ((currentMassTransferFees == 0)) | |
359 | 354 | then throw("Nothing to withdraw") | |
360 | 355 | else [IntegerEntry(MassTransferFeesKey, 0), ScriptTransfer(MaintainerAddress, currentMassTransferFees, unit)] | |
361 | 356 | } | |
362 | 357 | ||
363 | 358 | ||
364 | 359 | @Verifier(tx) | |
365 | 360 | func verify () = match tx { | |
366 | 361 | case massTx: MassTransferTransaction => | |
367 | 362 | let configAddressStr = getString(this, ConfigAddressKey) | |
368 | 363 | let configAddress = addressFromStringValue(value(configAddressStr)) | |
369 | 364 | let publicKey = if (isDefined(configAddressStr)) | |
370 | 365 | then valueOrElse(getBinary(configAddress, DaemonPublicKeyKey), tx.senderPublicKey) | |
371 | 366 | else tx.senderPublicKey | |
372 | 367 | sigVerify_8Kb(massTx.bodyBytes, massTx.proofs[0], publicKey) | |
373 | 368 | case invokeTx: InvokeScriptTransaction => | |
374 | 369 | let validFunctionName = if (if (if ((invokeTx.function == "extendMainChain")) | |
375 | 370 | then true | |
376 | 371 | else (invokeTx.function == "appendBlock")) | |
377 | 372 | then true | |
378 | 373 | else (invokeTx.function == "startAltChain")) | |
379 | 374 | then true | |
380 | 375 | else (invokeTx.function == "extendAltChain") | |
381 | 376 | let configAddressStr = getString(this, ConfigAddressKey) | |
382 | 377 | let configAddress = addressFromStringValue(value(configAddressStr)) | |
383 | - | let | |
378 | + | let unitsChain = getString(configAddress, ("unitsChainName_" + toString({ | |
384 | 379 | let @ = invokeTx.dApp | |
385 | 380 | if ($isInstanceOf(@, "Address")) | |
386 | 381 | then @ | |
387 | 382 | else throw(($getType(@) + " couldn't be cast to Address")) | |
388 | 383 | }))) | |
389 | 384 | let signerPublicKey = valueOrElse(getBinary(configAddress, SignerPublicKeyKey), tx.senderPublicKey) | |
390 | 385 | let publicKey = if (isDefined(configAddressStr)) | |
391 | - | then if (if (isDefined( | |
386 | + | then if (if (isDefined(unitsChain)) | |
392 | 387 | then validFunctionName | |
393 | 388 | else false) | |
394 | 389 | then tx.senderPublicKey | |
395 | 390 | else signerPublicKey | |
396 | 391 | else tx.senderPublicKey | |
397 | 392 | sigVerify_8Kb(invokeTx.bodyBytes, invokeTx.proofs[0], publicKey) | |
398 | 393 | case _ => | |
399 | 394 | let configAddressStr = getString(this, ConfigAddressKey) | |
400 | 395 | let configAddress = addressFromStringValue(value(configAddressStr)) | |
401 | 396 | let publicKey = if (isDefined(configAddressStr)) | |
402 | 397 | then valueOrElse(getBinary(configAddress, SignerPublicKeyKey), tx.senderPublicKey) | |
403 | 398 | else tx.senderPublicKey | |
404 | 399 | sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], publicKey) | |
405 | 400 | } | |
406 | 401 |
github/deemru/w8io/026f985 61.14 ms ◑