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