tx · DHWMjwPMfQHyW7eVe6TJReKP7bMv5HRkr3LR3yxUDLAz 3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d: -0.01000000 Waves 2023.10.12 12:26 [2795199] smart account 3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d > SELF 0.00000000 Waves
{ "type": 13, "id": "DHWMjwPMfQHyW7eVe6TJReKP7bMv5HRkr3LR3yxUDLAz", "fee": 1000000, "feeAssetId": null, "timestamp": 1697102755661, "version": 2, "chainId": 84, "sender": "3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d", "senderPublicKey": "7E4cNcg8gSYTmNbmLG2kvAiePh9KZoAT7W64shHxCc6n", "proofs": [ "4SVwhtVHfa2C85xuAWP5G2bkLQog93GZcipCFgGSqaKemL6pFMyYJEVg5tcUfhxQhuSn9mFJ8wzimSakn8ahCjqf" ], "script": "base64:BgIPCAISBgoEGBERCBIDCgEBBAARbHBfYWRkcmVzc19wdWJrZXkBIHy+XBhI/rhv/LQUflYon8e8q0PT8nBDeExH6jeAesBrACBtYXNzdHJhbnNmZXJfd2hpdGVsaXN0ZWRfYWRkcmVzcwkApwgBBRFscF9hZGRyZXNzX3B1YmtleQALbmV0d29ya19mZWUAwJaxAgERdmFsaWRhdGVBcmd1bWVudHMECnJlY2lwaWVudHMHYW1vdW50cwpwYXltZW50SWR4CHBheW1lbnRzBA5yZWNpcGllbnRzU2l6ZQkAkAMBBQpyZWNpcGllbnRzBAthbW91bnRzU2l6ZQkAkAMBBQdhbW91bnRzBA5wYXltZW50SWR4U2l6ZQkAkAMBBQpwYXltZW50SWR4BAxwYXltZW50c1NpemUJAJADAQUIcGF5bWVudHMECW1pbkFtb3VudAkAlwMBBQdhbW91bnRzBA1taW5QYXltZW50SWR4CQCXAwEFCnBheW1lbnRJZHgEDW1heFBheW1lbnRJZHgJAJYDAQUKcGF5bWVudElkeAoBEXBheW1lbnRzVmFsaWRhdG9yAgxwYXltZW50QWNjdW0LbmV4dFBheW1lbnQECSR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xNYXNzVHJhbnNmZXJDb3VudGVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAhhUb3RhbF9NYXNzX1RyYW5zZmVyX1NlbmQFFVRvdGFsTWFzc1RyYW5zZmVyU2VuZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCkAwEFGFRvdGFsTWFzc1RyYW5zZmVyQ291bnRlcgITX01hc3NfVHJhbnNmZXJfU2VuZAUWUGFpZE1hc3NUcmFuc2ZlckFtb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQCnCAEFEWxwX2FkZHJlc3NfcHVia2V5BRZQYWlkTWFzc1RyYW5zZmVyQW1vdW50BQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAKcIAQURbHBfYWRkcmVzc19wdWJrZXkFC25ldHdvcmtfZmVlBQR1bml0BQNuaWwAVnpKFQ==", "height": 2795199, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ypGAEhcaZeUnbdPi9qe93M8NZgczVYr4xAsPuAEycR3 Next: 13bW8pmxgJs6KT8zJAJhx13n9hmz4BqwzW4pZc4JemhQ Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ' | |
5 | 5 | ||
6 | 6 | let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey) | |
7 | + | ||
8 | + | let network_fee = 5000000 | |
7 | 9 | ||
8 | 10 | func validateArguments (recipients,amounts,paymentIdx,payments) = { | |
9 | 11 | let recipientsSize = size(recipients) | |
14 | 16 | let minPaymentIdx = min(paymentIdx) | |
15 | 17 | let maxPaymentIdx = max(paymentIdx) | |
16 | 18 | func paymentsValidator (paymentAccum,nextPayment) = { | |
17 | - | let $ | |
18 | - | let validPayments = $ | |
19 | - | let j = $ | |
19 | + | let $t0768805 = paymentAccum | |
20 | + | let validPayments = $t0768805._1 | |
21 | + | let j = $t0768805._2 | |
20 | 22 | if ((j >= paymentsSize)) | |
21 | 23 | then $Tuple2(validPayments, (j + 1)) | |
22 | 24 | else { | |
23 | 25 | func amountsAggregator (amountAccum,nextAmount) = { | |
24 | - | let $ | |
25 | - | let amount = $ | |
26 | - | let k = $ | |
26 | + | let $t0960989 = amountAccum | |
27 | + | let amount = $t0960989._1 | |
28 | + | let k = $t0960989._2 | |
27 | 29 | if (if ((k >= recipientsSize)) | |
28 | 30 | then true | |
29 | 31 | else (paymentIdx[k] != j)) | |
97 | 99 | else { | |
98 | 100 | let recipientsSize = size(recipients) | |
99 | 101 | func scriptTransfersGenerator (accum,next) = { | |
100 | - | let $ | |
101 | - | let scriptTransfers = $ | |
102 | - | let j = $ | |
102 | + | let $t023462378 = accum | |
103 | + | let scriptTransfers = $t023462378._1 | |
104 | + | let j = $t023462378._2 | |
103 | 105 | if ((j >= recipientsSize)) | |
104 | 106 | then $Tuple2(scriptTransfers, (j + 1)) | |
105 | 107 | else $Tuple2((scriptTransfers :+ ScriptTransfer(addressFromStringValue(recipients[j]), next, i.payments[paymentIdx[j]].assetId)), (j + 1)) | |
149 | 151 | then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it.")) | |
150 | 152 | else if ((PaidMassTransferAmount > read_total_pool_liquidity)) | |
151 | 153 | then throw("Placed Mass Transfer Amount Size is more than Total Pool Liquidity.") | |
152 | - | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), PaidMassTransferAmount, unit)] | |
154 | + | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), PaidMassTransferAmount, unit), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), network_fee, unit)] | |
153 | 155 | } | |
154 | 156 | ||
155 | 157 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ' | |
5 | 5 | ||
6 | 6 | let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey) | |
7 | + | ||
8 | + | let network_fee = 5000000 | |
7 | 9 | ||
8 | 10 | func validateArguments (recipients,amounts,paymentIdx,payments) = { | |
9 | 11 | let recipientsSize = size(recipients) | |
10 | 12 | let amountsSize = size(amounts) | |
11 | 13 | let paymentIdxSize = size(paymentIdx) | |
12 | 14 | let paymentsSize = size(payments) | |
13 | 15 | let minAmount = min(amounts) | |
14 | 16 | let minPaymentIdx = min(paymentIdx) | |
15 | 17 | let maxPaymentIdx = max(paymentIdx) | |
16 | 18 | func paymentsValidator (paymentAccum,nextPayment) = { | |
17 | - | let $ | |
18 | - | let validPayments = $ | |
19 | - | let j = $ | |
19 | + | let $t0768805 = paymentAccum | |
20 | + | let validPayments = $t0768805._1 | |
21 | + | let j = $t0768805._2 | |
20 | 22 | if ((j >= paymentsSize)) | |
21 | 23 | then $Tuple2(validPayments, (j + 1)) | |
22 | 24 | else { | |
23 | 25 | func amountsAggregator (amountAccum,nextAmount) = { | |
24 | - | let $ | |
25 | - | let amount = $ | |
26 | - | let k = $ | |
26 | + | let $t0960989 = amountAccum | |
27 | + | let amount = $t0960989._1 | |
28 | + | let k = $t0960989._2 | |
27 | 29 | if (if ((k >= recipientsSize)) | |
28 | 30 | then true | |
29 | 31 | else (paymentIdx[k] != j)) | |
30 | 32 | then $Tuple2(amount, (k + 1)) | |
31 | 33 | else $Tuple2((amount + nextAmount), (k + 1)) | |
32 | 34 | } | |
33 | 35 | ||
34 | 36 | let aggregatedAmount = { | |
35 | 37 | let $l = amounts | |
36 | 38 | let $s = size($l) | |
37 | 39 | let $acc0 = $Tuple2(0, 0) | |
38 | 40 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
39 | 41 | then $a | |
40 | 42 | else amountsAggregator($a, $l[$i]) | |
41 | 43 | ||
42 | 44 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
43 | 45 | then $a | |
44 | 46 | else throw("List size exceeds 100") | |
45 | 47 | ||
46 | 48 | $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) | |
47 | 49 | } | |
48 | 50 | if ((aggregatedAmount._1 == nextPayment.amount)) | |
49 | 51 | then $Tuple2((validPayments + 1), (j + 1)) | |
50 | 52 | else $Tuple2(validPayments, (j + 1)) | |
51 | 53 | } | |
52 | 54 | } | |
53 | 55 | ||
54 | 56 | let paymentsValidation = { | |
55 | 57 | let $l = payments | |
56 | 58 | let $s = size($l) | |
57 | 59 | let $acc0 = $Tuple2(0, 0) | |
58 | 60 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
59 | 61 | then $a | |
60 | 62 | else paymentsValidator($a, $l[$i]) | |
61 | 63 | ||
62 | 64 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
63 | 65 | then $a | |
64 | 66 | else throw("List size exceeds 10") | |
65 | 67 | ||
66 | 68 | $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) | |
67 | 69 | } | |
68 | 70 | if (if (if (if (if (if (if (if ((recipientsSize == amountsSize)) | |
69 | 71 | then (recipientsSize == paymentIdxSize) | |
70 | 72 | else false) | |
71 | 73 | then (recipientsSize > 0) | |
72 | 74 | else false) | |
73 | 75 | then (100 >= recipientsSize) | |
74 | 76 | else false) | |
75 | 77 | then (paymentsSize > 0) | |
76 | 78 | else false) | |
77 | 79 | then (minAmount > 0) | |
78 | 80 | else false) | |
79 | 81 | then (minPaymentIdx == 0) | |
80 | 82 | else false) | |
81 | 83 | then (maxPaymentIdx == (paymentsSize - 1)) | |
82 | 84 | else false) | |
83 | 85 | then (paymentsValidation._1 == paymentsSize) | |
84 | 86 | else false | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 | ||
88 | 90 | @Callable(i) | |
89 | 91 | func massTransfer (recipients,amounts,paymentIdx,attachment) = { | |
90 | 92 | let pmt = value(i.payments[0]) | |
91 | 93 | if ((i.caller != masstransfer_whitelisted_address)) | |
92 | 94 | then throw((("Not an Admin only " + toString(masstransfer_whitelisted_address)) + " can sign it.")) | |
93 | 95 | else if (isDefined(pmt.assetId)) | |
94 | 96 | then throw("Only Waves is allowed to Attach as payment.") | |
95 | 97 | else if (!(validateArguments(recipients, amounts, paymentIdx, i.payments))) | |
96 | 98 | then throw("Invalid arguments") | |
97 | 99 | else { | |
98 | 100 | let recipientsSize = size(recipients) | |
99 | 101 | func scriptTransfersGenerator (accum,next) = { | |
100 | - | let $ | |
101 | - | let scriptTransfers = $ | |
102 | - | let j = $ | |
102 | + | let $t023462378 = accum | |
103 | + | let scriptTransfers = $t023462378._1 | |
104 | + | let j = $t023462378._2 | |
103 | 105 | if ((j >= recipientsSize)) | |
104 | 106 | then $Tuple2(scriptTransfers, (j + 1)) | |
105 | 107 | else $Tuple2((scriptTransfers :+ ScriptTransfer(addressFromStringValue(recipients[j]), next, i.payments[paymentIdx[j]].assetId)), (j + 1)) | |
106 | 108 | } | |
107 | 109 | ||
108 | 110 | let result = { | |
109 | 111 | let $l = amounts | |
110 | 112 | let $s = size($l) | |
111 | 113 | let $acc0 = $Tuple2(nil, 0) | |
112 | 114 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
113 | 115 | then $a | |
114 | 116 | else scriptTransfersGenerator($a, $l[$i]) | |
115 | 117 | ||
116 | 118 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
117 | 119 | then $a | |
118 | 120 | else throw("List size exceeds 100") | |
119 | 121 | ||
120 | 122 | $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) | |
121 | 123 | } | |
122 | 124 | $Tuple2(result._1, unit) | |
123 | 125 | } | |
124 | 126 | } | |
125 | 127 | ||
126 | 128 | ||
127 | 129 | ||
128 | 130 | @Callable(i) | |
129 | 131 | func UpdateLPBalance (PaidMassTransferAmount) = { | |
130 | 132 | let read_account_balance = wavesBalance(this).regular | |
131 | 133 | let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.") | |
132 | 134 | let received_order_amount = (read_account_balance - read_total_pool_liquidity) | |
133 | 135 | let updated_pool_balance = ((read_total_pool_liquidity - PaidMassTransferAmount) + received_order_amount) | |
134 | 136 | let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") { | |
135 | 137 | case a: Int => | |
136 | 138 | a | |
137 | 139 | case _ => | |
138 | 140 | 0 | |
139 | 141 | } | |
140 | 142 | let TotalMassTransferCounter = (PreviousMassTransferCounter + 1) | |
141 | 143 | let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") { | |
142 | 144 | case a: Int => | |
143 | 145 | a | |
144 | 146 | case _ => | |
145 | 147 | 0 | |
146 | 148 | } | |
147 | 149 | let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount) | |
148 | 150 | if ((i.caller != masstransfer_whitelisted_address)) | |
149 | 151 | then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it.")) | |
150 | 152 | else if ((PaidMassTransferAmount > read_total_pool_liquidity)) | |
151 | 153 | then throw("Placed Mass Transfer Amount Size is more than Total Pool Liquidity.") | |
152 | - | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), PaidMassTransferAmount, unit)] | |
154 | + | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), PaidMassTransferAmount, unit), ScriptTransfer(addressFromPublicKey(lp_address_pubkey), network_fee, unit)] | |
153 | 155 | } | |
154 | 156 | ||
155 | 157 |
github/deemru/w8io/026f985 40.75 ms ◑