tx · 6MyTkzm8fjJC1dAw43qfkmcDjMHjHuZ3SmdeukpWpvRf 3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC: -0.01200000 Waves 2024.04.29 03:59 [3083456] smart account 3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC > SELF 0.00000000 Waves
{ "type": 13, "id": "6MyTkzm8fjJC1dAw43qfkmcDjMHjHuZ3SmdeukpWpvRf", "fee": 1200000, "feeAssetId": null, "timestamp": 1714352363870, "version": 2, "chainId": 84, "sender": "3N7XWpdx1UJKZp5stTtFMXPEygyfZ7j4PyC", "senderPublicKey": "APsCCjsKHFx7rbr1mG8Pca43pccTbH2G4FZj4keEqKJ5", "proofs": [ "wxHjLPSAuPBhwoXXXx3B9LGU5Z2P3pRUUW7jvvVhpjjjgn1xgUHP6DJsMbQXqYu4zNnzuoZKfcZtxbrEiBT8736" ], "script": "base64:BgIoCAISBwoFAQEBERgSBwoFAQgBCAESBwoFARIREQgSAwoBARIAEgASABkACE1pbmVyRmVlAAUAEVBheW91dEVtcHR5U3RhdHVzAAAAFVBheW91dEluaXRpYXRlZFN0YXR1cwABABVQYXlvdXRDb21wbGV0ZWRTdGF0dXMAAgASQmxvY2tzQmF0Y2hNYXhTaXplAAoAFlJlY2lwaWVudHNCYXRjaE1heFNpemUAZAAGSGVpZ2h0BQZoZWlnaHQAB0NoYWluSWQAVAAFQXJyMTAJAMwIAgAACQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUJAMwIAgAGCQDMCAIABwkAzAgCAAgJAMwIAgAJBQNuaWwADUNhbGxlckFkZHJlc3MJAQdBZGRyZXNzAQEaAVTyivfVKpPlEk6umrrIyi00GQZQXD9/r7cAFldhdmVzRGFvRmFjdG9yeUFkZHJlc3MJAQdBZGRyZXNzAQEaAVQ8hf55dL/LZOPYRZ/ELezKrvBEP8q22ucAD1NldHRpbmdzQWRkcmVzcwkBB0FkZHJlc3MBARoBVIyem88MXqbW0vyDLXrGPL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ggFAWkGY2FsbGVyBRFNYWludGFpbmVyQWRkcmVzcwkAAgECDUFjY2VzcyBkZW5pZWQDCQECIT0CCQCQAwEIBQFpCHBheW1lbnRzAAAJAAIBAhdQYXltZW50cyBhcmUgcHJvaGliaXRlZAQXY3VycmVudE1hc3NUcmFuc2ZlckZlZXMJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUTTWFzc1RyYW5zZmVyRmVlc0tleQAAAwkAAAIFF2N1cnJlbnRNYXNzVHJhbnNmZXJGZWVzAAAJAAIBAhNOb3RoaW5nIHRvIHdpdGhkcmF3CQDMCAIJAQxJbnRlZ2VyRW50cnkCBRNNYXNzVHJhbnNmZXJGZWVzS2V5AAAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwURTWFpbnRhaW5lckFkZHJlc3MFF2N1cnJlbnRNYXNzVHJhbnNmZXJGZWVzBQR1bml0BQNuaWwBAnR4AQZ2ZXJpZnkABAckbWF0Y2gwBQJ0eAMJAAECBQckbWF0Y2gwAhdNYXNzVHJhbnNmZXJUcmFuc2FjdGlvbgQGbWFzc1R4BQckbWF0Y2gwCQDIEwMIBQZtYXNzVHgJYm9keUJ5dGVzCQCRAwIIBQZtYXNzVHgGcHJvb2ZzAAABICdyyI/DWUM9psFqeRmTYcK5k1+LqigLMCS33KkAh0oxCQDIEwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAAASAumQaoN6U+xrN5VpNDLBIHmCVy2F3Irlvu7+1i5+zzFKw4HUo=", "height": 3083456, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gei317femh5k1rpRaYcjujXrC4HFpBU7Z3o87joVkbUk Next: 7cW213AvGoKvVVNrKP8iGi9n8yrpNSsSXXDEo4zQAhwL Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | let SettingsAddress = Address(base58'3N2jcP6cAcDJoVpfsQ5tVDTQrNgJcVUjj4v') | |
27 | 27 | ||
28 | - | let PuzzleAggregatorAddress = Address(base58' | |
28 | + | let PuzzleAggregatorAddress = Address(base58'3MyJM8hLxAMYFrPzdh68QqeMdFSSWufQqw3') | |
29 | 29 | ||
30 | 30 | let MaintainerAddress = Address(base58'3N7ynzLr2PzVg9bCkrwLezNLVmoEyFmJtPL') | |
31 | 31 | ||
32 | - | let | |
32 | + | let PuzzleBuybackAddress = Address(base58'3MyUDpTMG43mkmScfDKgG9gep4reUboH9YF') | |
33 | 33 | ||
34 | 34 | let WavesId = "WAVES" | |
35 | 35 | ||
78 | 78 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
79 | 79 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
80 | 80 | else { | |
81 | - | let $ | |
82 | - | let lastStartHeight = $ | |
83 | - | let lastEndHeight = $ | |
81 | + | let $t024492513 = getPayoutData(lastPayout) | |
82 | + | let lastStartHeight = $t024492513._1 | |
83 | + | let lastEndHeight = $t024492513._2 | |
84 | 84 | if ((startHeight != (lastEndHeight + 1))) | |
85 | 85 | then throw(((("Wrong startHeight: " + toString(startHeight)) + ", should be: ") + toString((lastEndHeight + 1)))) | |
86 | 86 | else if ((startHeight > endHeight)) | |
111 | 111 | if ((getInteger(SettingsAddress, ("inputAssetIndex_" + assetStr)) == unit)) | |
112 | 112 | then throw(("Unknown input: " + assetStr)) | |
113 | 113 | else { | |
114 | - | let $ | |
114 | + | let $t039154094 = if ((assetStr == WavesId)) | |
115 | 115 | then $Tuple2(unit, (amounts[index] + currentAdditionalRewards)) | |
116 | 116 | else $Tuple2(fromBase58String(assetStr), amounts[index]) | |
117 | - | let asset = $ | |
118 | - | let amount = $ | |
117 | + | let asset = $t039154094._1 | |
118 | + | let amount = $t039154094._2 | |
119 | 119 | if ((0 > amount)) | |
120 | 120 | then throw((("Wrong asset amount: " + toString(amount)) + ", should be positive or zero")) | |
121 | 121 | else { | |
123 | 123 | let maintainerFee = (minerFee / 2) | |
124 | 124 | let puzzleTeamFee = (minerFee - maintainerFee) | |
125 | 125 | let lessorsAmount = ((amount - maintainerFee) - puzzleTeamFee) | |
126 | - | $Tuple2(((accum._1 :+ ScriptTransfer(MaintainerAddress, maintainerFee, asset)) :+ ScriptTransfer( | |
126 | + | $Tuple2(((accum._1 :+ ScriptTransfer(MaintainerAddress, maintainerFee, asset)) :+ ScriptTransfer(PuzzleBuybackAddress, puzzleTeamFee, asset)), (accum._2 :+ toString(lessorsAmount))) | |
127 | 127 | } | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | ||
131 | - | let $ | |
131 | + | let $t046694736 = { | |
132 | 132 | let $l = Arr10 | |
133 | 133 | let $s = size($l) | |
134 | 134 | let $acc0 = $Tuple2(nil, nil) | |
142 | 142 | ||
143 | 143 | $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) | |
144 | 144 | } | |
145 | - | let transfers = $ | |
146 | - | let amountKeys = $ | |
145 | + | let transfers = $t046694736._1 | |
146 | + | let amountKeys = $t046694736._2 | |
147 | 147 | let newPayoutData = makeString(([toString(startHeight), toString(endHeight)] ++ amountKeys), "_") | |
148 | 148 | (transfers ++ [IntegerEntry(LastPayoutKey, payoutId), StringEntry(makePayoutDataKey(payoutId), newPayoutData), IntegerEntry(makePayoutStatusKey(payoutId), PayoutInitiatedStatus)]) | |
149 | 149 | } | |
170 | 170 | if ((payoutStatus != PayoutInitiatedStatus)) | |
171 | 171 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
172 | 172 | else { | |
173 | - | let $ | |
173 | + | let $t056875936 = if ((swapFrom == WavesId)) | |
174 | 174 | then $Tuple2(wavesBalance(this).available, unit) | |
175 | 175 | else { | |
176 | 176 | let assetId = fromBase58String(swapFrom) | |
177 | 177 | $Tuple2(assetBalance(this, assetId), assetId) | |
178 | 178 | } | |
179 | - | let balanceInBeforeSwap = $ | |
180 | - | let swapFromId = $ | |
179 | + | let balanceInBeforeSwap = $t056875936._1 | |
180 | + | let swapFromId = $t056875936._2 | |
181 | 181 | let swapInvoke = invoke(PuzzleAggregatorAddress, "swapWithReferral", [route, minToReceive, "puzzlenode"], [AttachedPayment(swapFromId, amountIn)]) | |
182 | 182 | if ((swapInvoke == swapInvoke)) | |
183 | 183 | then { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MinerFee = 5 | |
5 | 5 | ||
6 | 6 | let PayoutEmptyStatus = 0 | |
7 | 7 | ||
8 | 8 | let PayoutInitiatedStatus = 1 | |
9 | 9 | ||
10 | 10 | let PayoutCompletedStatus = 2 | |
11 | 11 | ||
12 | 12 | let BlocksBatchMaxSize = 10 | |
13 | 13 | ||
14 | 14 | let RecipientsBatchMaxSize = 100 | |
15 | 15 | ||
16 | 16 | let Height = height | |
17 | 17 | ||
18 | 18 | let ChainId = 84 | |
19 | 19 | ||
20 | 20 | let Arr10 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
21 | 21 | ||
22 | 22 | let CallerAddress = Address(base58'3NC2Xn1tUKEc7YxJS9oxdtY4x5NaQHhpH2e') | |
23 | 23 | ||
24 | 24 | let WavesDaoFactoryAddress = Address(base58'3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx') | |
25 | 25 | ||
26 | 26 | let SettingsAddress = Address(base58'3N2jcP6cAcDJoVpfsQ5tVDTQrNgJcVUjj4v') | |
27 | 27 | ||
28 | - | let PuzzleAggregatorAddress = Address(base58' | |
28 | + | let PuzzleAggregatorAddress = Address(base58'3MyJM8hLxAMYFrPzdh68QqeMdFSSWufQqw3') | |
29 | 29 | ||
30 | 30 | let MaintainerAddress = Address(base58'3N7ynzLr2PzVg9bCkrwLezNLVmoEyFmJtPL') | |
31 | 31 | ||
32 | - | let | |
32 | + | let PuzzleBuybackAddress = Address(base58'3MyUDpTMG43mkmScfDKgG9gep4reUboH9YF') | |
33 | 33 | ||
34 | 34 | let WavesId = "WAVES" | |
35 | 35 | ||
36 | 36 | let LastPayoutKey = "lastPayout" | |
37 | 37 | ||
38 | 38 | let MassTransferFeesKey = "massTransferFees" | |
39 | 39 | ||
40 | 40 | func makePayoutDataKey (payoutId) = ("payoutData_" + toString(payoutId)) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func makePayoutStatusKey (payoutId) = ("payoutStatus_" + toString(payoutId)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func makePayoutAdditionalRewardsKey (payoutId) = ("payoutAdditionalRewards_" + toString(payoutId)) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getLastPayout () = getIntegerValue(this, LastPayoutKey) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getPayoutData (payoutId) = { | |
53 | 53 | let payoutString = getStringValue(makePayoutDataKey(payoutId)) | |
54 | 54 | let payoutDataList = split(payoutString, "_") | |
55 | 55 | let startHeight = parseIntValue(payoutDataList[0]) | |
56 | 56 | let endHeight = parseIntValue(payoutDataList[1]) | |
57 | 57 | $Tuple2(startHeight, endHeight) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getPayoutStatus (payoutId) = valueOrElse(getInteger(makePayoutStatusKey(payoutId)), PayoutEmptyStatus) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getPayoutAdditionalRewards (payoutId) = valueOrElse(getInteger(makePayoutAdditionalRewardsKey(payoutId)), 0) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | 68 | func initiatePayout (payoutId,startHeight,endHeight,amounts,assets) = if ((i.caller != CallerAddress)) | |
69 | 69 | then throw("Access denied") | |
70 | 70 | else if ((size(i.payments) != 0)) | |
71 | 71 | then throw("Payments are prohibited") | |
72 | 72 | else { | |
73 | 73 | let lastPayout = getLastPayout() | |
74 | 74 | if ((payoutId != (lastPayout + 1))) | |
75 | 75 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString((lastPayout + 1)))) | |
76 | 76 | else { | |
77 | 77 | let lastPayoutStatus = getPayoutStatus(lastPayout) | |
78 | 78 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
79 | 79 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
80 | 80 | else { | |
81 | - | let $ | |
82 | - | let lastStartHeight = $ | |
83 | - | let lastEndHeight = $ | |
81 | + | let $t024492513 = getPayoutData(lastPayout) | |
82 | + | let lastStartHeight = $t024492513._1 | |
83 | + | let lastEndHeight = $t024492513._2 | |
84 | 84 | if ((startHeight != (lastEndHeight + 1))) | |
85 | 85 | then throw(((("Wrong startHeight: " + toString(startHeight)) + ", should be: ") + toString((lastEndHeight + 1)))) | |
86 | 86 | else if ((startHeight > endHeight)) | |
87 | 87 | then throw(((("endHeight: " + toString(endHeight)) + " less than startHeight: ") + toString(startHeight))) | |
88 | 88 | else { | |
89 | 89 | let inputsQuantity = getIntegerValue(SettingsAddress, "inputsQuantity") | |
90 | 90 | let amountsSize = size(amounts) | |
91 | 91 | let assetsSize = size(assets) | |
92 | 92 | if (if ((amountsSize != assetsSize)) | |
93 | 93 | then true | |
94 | 94 | else (amountsSize != inputsQuantity)) | |
95 | 95 | then throw("Wrong size of amounts or assets") | |
96 | 96 | else { | |
97 | 97 | let availableWavesDaoLpToClaim = valueOrElse(getInteger(WavesDaoFactoryAddress, ("%s%s__available__" + toString(this))), 0) | |
98 | 98 | let wavesDaoNextBlockToProcess = getIntegerValue(WavesDaoFactoryAddress, "%s__nextBlockToProcess") | |
99 | 99 | let wavesDlpClaim = if (if ((availableWavesDaoLpToClaim > 0)) | |
100 | 100 | then ((wavesDaoNextBlockToProcess + BlocksBatchMaxSize) >= Height) | |
101 | 101 | else false) | |
102 | 102 | then invoke(WavesDaoFactoryAddress, "claimLP", nil, nil) | |
103 | 103 | else unit | |
104 | 104 | if ((wavesDlpClaim == wavesDlpClaim)) | |
105 | 105 | then { | |
106 | 106 | let currentAdditionalRewards = getPayoutAdditionalRewards(payoutId) | |
107 | 107 | func assetsFold (accum,index) = if ((index >= assetsSize)) | |
108 | 108 | then accum | |
109 | 109 | else { | |
110 | 110 | let assetStr = assets[index] | |
111 | 111 | if ((getInteger(SettingsAddress, ("inputAssetIndex_" + assetStr)) == unit)) | |
112 | 112 | then throw(("Unknown input: " + assetStr)) | |
113 | 113 | else { | |
114 | - | let $ | |
114 | + | let $t039154094 = if ((assetStr == WavesId)) | |
115 | 115 | then $Tuple2(unit, (amounts[index] + currentAdditionalRewards)) | |
116 | 116 | else $Tuple2(fromBase58String(assetStr), amounts[index]) | |
117 | - | let asset = $ | |
118 | - | let amount = $ | |
117 | + | let asset = $t039154094._1 | |
118 | + | let amount = $t039154094._2 | |
119 | 119 | if ((0 > amount)) | |
120 | 120 | then throw((("Wrong asset amount: " + toString(amount)) + ", should be positive or zero")) | |
121 | 121 | else { | |
122 | 122 | let minerFee = fraction(amount, MinerFee, 100) | |
123 | 123 | let maintainerFee = (minerFee / 2) | |
124 | 124 | let puzzleTeamFee = (minerFee - maintainerFee) | |
125 | 125 | let lessorsAmount = ((amount - maintainerFee) - puzzleTeamFee) | |
126 | - | $Tuple2(((accum._1 :+ ScriptTransfer(MaintainerAddress, maintainerFee, asset)) :+ ScriptTransfer( | |
126 | + | $Tuple2(((accum._1 :+ ScriptTransfer(MaintainerAddress, maintainerFee, asset)) :+ ScriptTransfer(PuzzleBuybackAddress, puzzleTeamFee, asset)), (accum._2 :+ toString(lessorsAmount))) | |
127 | 127 | } | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | ||
131 | - | let $ | |
131 | + | let $t046694736 = { | |
132 | 132 | let $l = Arr10 | |
133 | 133 | let $s = size($l) | |
134 | 134 | let $acc0 = $Tuple2(nil, nil) | |
135 | 135 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
136 | 136 | then $a | |
137 | 137 | else assetsFold($a, $l[$i]) | |
138 | 138 | ||
139 | 139 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
140 | 140 | then $a | |
141 | 141 | else throw("List size exceeds 10") | |
142 | 142 | ||
143 | 143 | $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) | |
144 | 144 | } | |
145 | - | let transfers = $ | |
146 | - | let amountKeys = $ | |
145 | + | let transfers = $t046694736._1 | |
146 | + | let amountKeys = $t046694736._2 | |
147 | 147 | let newPayoutData = makeString(([toString(startHeight), toString(endHeight)] ++ amountKeys), "_") | |
148 | 148 | (transfers ++ [IntegerEntry(LastPayoutKey, payoutId), StringEntry(makePayoutDataKey(payoutId), newPayoutData), IntegerEntry(makePayoutStatusKey(payoutId), PayoutInitiatedStatus)]) | |
149 | 149 | } | |
150 | 150 | else throw("Strict value is not equal to itself.") | |
151 | 151 | } | |
152 | 152 | } | |
153 | 153 | } | |
154 | 154 | } | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(i) | |
160 | 160 | func swap (payoutId,swapFrom,amountIn,route,minToReceive) = if ((i.caller != CallerAddress)) | |
161 | 161 | then throw("Access denied") | |
162 | 162 | else if ((size(i.payments) != 0)) | |
163 | 163 | then throw("Payments are prohibited") | |
164 | 164 | else { | |
165 | 165 | let lastPayout = getLastPayout() | |
166 | 166 | if ((lastPayout != payoutId)) | |
167 | 167 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
168 | 168 | else { | |
169 | 169 | let payoutStatus = getPayoutStatus(payoutId) | |
170 | 170 | if ((payoutStatus != PayoutInitiatedStatus)) | |
171 | 171 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
172 | 172 | else { | |
173 | - | let $ | |
173 | + | let $t056875936 = if ((swapFrom == WavesId)) | |
174 | 174 | then $Tuple2(wavesBalance(this).available, unit) | |
175 | 175 | else { | |
176 | 176 | let assetId = fromBase58String(swapFrom) | |
177 | 177 | $Tuple2(assetBalance(this, assetId), assetId) | |
178 | 178 | } | |
179 | - | let balanceInBeforeSwap = $ | |
180 | - | let swapFromId = $ | |
179 | + | let balanceInBeforeSwap = $t056875936._1 | |
180 | + | let swapFromId = $t056875936._2 | |
181 | 181 | let swapInvoke = invoke(PuzzleAggregatorAddress, "swapWithReferral", [route, minToReceive, "puzzlenode"], [AttachedPayment(swapFromId, amountIn)]) | |
182 | 182 | if ((swapInvoke == swapInvoke)) | |
183 | 183 | then { | |
184 | 184 | let balanceInAfterSwap = if ((swapFrom == WavesId)) | |
185 | 185 | then wavesBalance(this).available | |
186 | 186 | else assetBalance(this, value(swapFromId)) | |
187 | 187 | let refund = (balanceInAfterSwap - (balanceInBeforeSwap - amountIn)) | |
188 | 188 | if ((refund > 10)) | |
189 | 189 | then throw(("Rollback aggregator refund: " + toString(refund))) | |
190 | 190 | else nil | |
191 | 191 | } | |
192 | 192 | else throw("Strict value is not equal to itself.") | |
193 | 193 | } | |
194 | 194 | } | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | ||
199 | 199 | @Callable(i) | |
200 | 200 | func distributeTokens (payoutId,recipients,amounts,assets,attachment) = if ((i.caller != CallerAddress)) | |
201 | 201 | then throw("Access denied") | |
202 | 202 | else if ((size(i.payments) != 0)) | |
203 | 203 | then throw("Payments are prohibited") | |
204 | 204 | else { | |
205 | 205 | let lastPayout = getLastPayout() | |
206 | 206 | if ((lastPayout != payoutId)) | |
207 | 207 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
208 | 208 | else { | |
209 | 209 | let payoutStatus = getPayoutStatus(payoutId) | |
210 | 210 | if ((payoutStatus != PayoutInitiatedStatus)) | |
211 | 211 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be 1")) | |
212 | 212 | else { | |
213 | 213 | let recipientsSize = size(recipients) | |
214 | 214 | let amountsSize = size(amounts) | |
215 | 215 | let assetsSize = size(assets) | |
216 | 216 | if (if ((recipientsSize != amountsSize)) | |
217 | 217 | then true | |
218 | 218 | else (recipientsSize != assetsSize)) | |
219 | 219 | then throw(((((("Wrong recipients size: " + toString(recipientsSize)) + ", amounts size: ") + toString(amountsSize)) + ", assets size: ") + toString(assetsSize))) | |
220 | 220 | else if ((recipientsSize == 0)) | |
221 | 221 | then throw("Recipients list should not be empty") | |
222 | 222 | else if ((recipientsSize > RecipientsBatchMaxSize)) | |
223 | 223 | then throw(((("Should be not greater than " + toString(RecipientsBatchMaxSize)) + " recipients, current: ") + toString(recipientsSize))) | |
224 | 224 | else { | |
225 | 225 | let magicByte = drop(toBytes(1), 7) | |
226 | 226 | let chainIdByte = drop(toBytes(ChainId), 7) | |
227 | 227 | let addressPrefix = (magicByte + chainIdByte) | |
228 | 228 | func scriptTransfersFold (accum,index) = if ((index >= recipientsSize)) | |
229 | 229 | then accum | |
230 | 230 | else { | |
231 | 231 | let publicKeyHash = recipients[index] | |
232 | 232 | let addressData = (addressPrefix + publicKeyHash) | |
233 | 233 | let addressChecksum = take(keccak256(blake2b256(addressData)), 4) | |
234 | 234 | let recipient = Address((addressData + addressChecksum)) | |
235 | 235 | let amount = amounts[index] | |
236 | 236 | let assetIndex = assets[index] | |
237 | 237 | let assetId = getBinaryValue(SettingsAddress, ("assetId_" + toString(assetIndex))) | |
238 | 238 | let asset = if ((assetId == base58'')) | |
239 | 239 | then unit | |
240 | 240 | else assetId | |
241 | 241 | (accum :+ ScriptTransfer(recipient, amount, asset)) | |
242 | 242 | } | |
243 | 243 | ||
244 | 244 | 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] | |
245 | 245 | let $l = indexes | |
246 | 246 | let $s = size($l) | |
247 | 247 | let $acc0 = nil | |
248 | 248 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
249 | 249 | then $a | |
250 | 250 | else scriptTransfersFold($a, $l[$i]) | |
251 | 251 | ||
252 | 252 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
253 | 253 | then $a | |
254 | 254 | else throw("List size exceeds 100") | |
255 | 255 | ||
256 | 256 | $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) | |
257 | 257 | } | |
258 | 258 | } | |
259 | 259 | } | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | ||
264 | 264 | @Callable(i) | |
265 | 265 | func finalizePayout (payoutId) = if ((i.caller != CallerAddress)) | |
266 | 266 | then throw("Access denied") | |
267 | 267 | else { | |
268 | 268 | let lastPayout = getLastPayout() | |
269 | 269 | if ((lastPayout != payoutId)) | |
270 | 270 | then throw(((("Wrong payoutId: " + toString(payoutId)) + ", should be: ") + toString(lastPayout))) | |
271 | 271 | else { | |
272 | 272 | let payoutStatus = getPayoutStatus(lastPayout) | |
273 | 273 | if ((payoutStatus != PayoutInitiatedStatus)) | |
274 | 274 | then throw((("Wrong payout status: " + toString(payoutStatus)) + ", should be: 1")) | |
275 | 275 | else [IntegerEntry(makePayoutStatusKey(lastPayout), PayoutCompletedStatus)] | |
276 | 276 | } | |
277 | 277 | } | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | ||
281 | 281 | @Callable(i) | |
282 | 282 | func addAdditionalRewards () = if ((size(i.payments) != 1)) | |
283 | 283 | then throw("At least one payment should be attached") | |
284 | 284 | else if ((i.payments[0].assetId != unit)) | |
285 | 285 | then throw("Only waves can be attached") | |
286 | 286 | else { | |
287 | 287 | let lastPayout = getLastPayout() | |
288 | 288 | let lastPayoutStatus = getPayoutStatus(lastPayout) | |
289 | 289 | if ((lastPayoutStatus != PayoutCompletedStatus)) | |
290 | 290 | then throw((("Last payout: " + toString(lastPayout)) + " was not completed")) | |
291 | 291 | else { | |
292 | 292 | let nextPayoutId = (lastPayout + 1) | |
293 | 293 | let currentAdditionalRewards = getPayoutAdditionalRewards(nextPayoutId) | |
294 | 294 | let newAdditionalRewards = (currentAdditionalRewards + i.payments[0].amount) | |
295 | 295 | [IntegerEntry(makePayoutAdditionalRewardsKey(nextPayoutId), newAdditionalRewards)] | |
296 | 296 | } | |
297 | 297 | } | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | ||
301 | 301 | @Callable(i) | |
302 | 302 | func addMassTransferFees () = if ((size(i.payments) != 1)) | |
303 | 303 | then throw("At least one payment should be attached") | |
304 | 304 | else if ((i.payments[0].assetId != unit)) | |
305 | 305 | then throw("Only waves can be attached") | |
306 | 306 | else { | |
307 | 307 | let currentMassTransferFees = valueOrElse(getInteger(MassTransferFeesKey), 0) | |
308 | 308 | let newMassTransferFees = (currentMassTransferFees + i.payments[0].amount) | |
309 | 309 | [IntegerEntry(MassTransferFeesKey, newMassTransferFees)] | |
310 | 310 | } | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | ||
314 | 314 | @Callable(i) | |
315 | 315 | func withdrawMassTransferFees () = if ((i.caller != MaintainerAddress)) | |
316 | 316 | then throw("Access denied") | |
317 | 317 | else if ((size(i.payments) != 0)) | |
318 | 318 | then throw("Payments are prohibited") | |
319 | 319 | else { | |
320 | 320 | let currentMassTransferFees = valueOrElse(getInteger(MassTransferFeesKey), 0) | |
321 | 321 | if ((currentMassTransferFees == 0)) | |
322 | 322 | then throw("Nothing to withdraw") | |
323 | 323 | else [IntegerEntry(MassTransferFeesKey, 0), ScriptTransfer(MaintainerAddress, currentMassTransferFees, unit)] | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | @Verifier(tx) | |
328 | 328 | func verify () = match tx { | |
329 | 329 | case massTx: MassTransferTransaction => | |
330 | 330 | sigVerify_128Kb(massTx.bodyBytes, massTx.proofs[0], base58'3ezR5yaSmZAzqGt8iqRkYESRWpH1uaTKZ9ZffHD3C2Wc') | |
331 | 331 | case _ => | |
332 | 332 | sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], base58'48u6HN3ArS3YcgWAwiuq3aAnviVc2uPwuEj2QuFcV4bd') | |
333 | 333 | } | |
334 | 334 |
github/deemru/w8io/026f985 58.60 ms ◑