tx · 4ypGAEhcaZeUnbdPi9qe93M8NZgczVYr4xAsPuAEycR3

3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d:  -0.01000000 Waves

2023.10.12 11:38 [2795154] smart account 3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d > SELF 0.00000000 Waves

{ "type": 13, "id": "4ypGAEhcaZeUnbdPi9qe93M8NZgczVYr4xAsPuAEycR3", "fee": 1000000, "feeAssetId": null, "timestamp": 1697099972808, "version": 2, "chainId": 84, "sender": "3Ms2ssGBpsFccHLtdb5zApeJ51jU3377r1d", "senderPublicKey": "7E4cNcg8gSYTmNbmLG2kvAiePh9KZoAT7W64shHxCc6n", "proofs": [ "4Yk7MfgoyhKQFmRB5LLq6bBLdedm3uvkziFAE5VQvqt7iq1qyN9nG6UaRwBB2aYtbJMRtLnWgLAAcrXDWiJAWaDw" ], "script": "base64:BgIPCAISBgoEGBERCBIDCgEBAwARbHBfYWRkcmVzc19wdWJrZXkBIHy+XBhI/rhv/LQUflYon8e8q0PT8nBDeExH6jeAesBrACBtYXNzdHJhbnNmZXJfd2hpdGVsaXN0ZWRfYWRkcmVzcwkApwgBBRFscF9hZGRyZXNzX3B1YmtleQERdmFsaWRhdGVBcmd1bWVudHMECnJlY2lwaWVudHMHYW1vdW50cwpwYXltZW50SWR4CHBheW1lbnRzBA5yZWNpcGllbnRzU2l6ZQkAkAMBBQpyZWNpcGllbnRzBAthbW91bnRzU2l6ZQkAkAMBBQdhbW91bnRzBA5wYXltZW50SWR4U2l6ZQkAkAMBBQpwYXltZW50SWR4BAxwYXltZW50c1NpemUJAJADAQUIcGF5bWVudHMECW1pbkFtb3VudAkAlwMBBQdhbW91bnRzBA1taW5QYXltZW50SWR4CQCXAwEFCnBheW1lbnRJZHgEDW1heFBheW1lbnRJZHgJAJYDAQUKcGF5bWVudElkeAoBEXBheW1lbnRzVmFsaWRhdG9yAgxwYXltZW50QWNjdW0LbmV4dFBheW1lbnQECSR0MDc0MDc3NwUMcGF5b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udGVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAhhUb3RhbF9NYXNzX1RyYW5zZmVyX1NlbmQFFVRvdGFsTWFzc1RyYW5zZmVyU2VuZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCkAwEFGFRvdGFsTWFzc1RyYW5zZmVyQ291bnRlcgITX01hc3NfVHJhbnNmZXJfU2VuZAUWUGFpZE1hc3NUcmFuc2ZlckFtb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQCnCAEFEWxwX2FkZHJlc3NfcHVia2V5BRZQYWlkTWFzc1RyYW5zZmVyQW1vdW50BQR1bml0BQNuaWwAI6Xcog==", "height": 2795154, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2tE6nPEivm9YfBgF12c2mRHKRtR54QqjLSimYRgNHKg2 Next: DHWMjwPMfQHyW7eVe6TJReKP7bMv5HRkr3LR3yxUDLAz Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ'
5+
6+let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey)
7+
48 func validateArguments (recipients,amounts,paymentIdx,payments) = {
59 let recipientsSize = size(recipients)
610 let amountsSize = size(amounts)
1014 let minPaymentIdx = min(paymentIdx)
1115 let maxPaymentIdx = max(paymentIdx)
1216 func paymentsValidator (paymentAccum,nextPayment) = {
13- let $t0583620 = paymentAccum
14- let validPayments = $t0583620._1
15- let j = $t0583620._2
17+ let $t0740777 = paymentAccum
18+ let validPayments = $t0740777._1
19+ let j = $t0740777._2
1620 if ((j >= paymentsSize))
1721 then $Tuple2(validPayments, (j + 1))
1822 else {
1923 func amountsAggregator (amountAccum,nextAmount) = {
20- let $t0775804 = amountAccum
21- let amount = $t0775804._1
22- let k = $t0775804._2
24+ let $t0932961 = amountAccum
25+ let amount = $t0932961._1
26+ let k = $t0932961._2
2327 if (if ((k >= recipientsSize))
2428 then true
2529 else (paymentIdx[k] != j))
8488 @Callable(i)
8589 func massTransfer (recipients,amounts,paymentIdx,attachment) = {
8690 let pmt = value(i.payments[0])
87- let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ'
88- let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey)
8991 if ((i.caller != masstransfer_whitelisted_address))
90- then throw((("Not an Admin only" + toString(masstransfer_whitelisted_address)) + " can sign it."))
92+ then throw((("Not an Admin only " + toString(masstransfer_whitelisted_address)) + " can sign it."))
9193 else if (isDefined(pmt.assetId))
9294 then throw("Only Waves is allowed to Attach as payment.")
9395 else if (!(validateArguments(recipients, amounts, paymentIdx, i.payments)))
9597 else {
9698 let recipientsSize = size(recipients)
9799 func scriptTransfersGenerator (accum,next) = {
98- let $t023242356 = accum
99- let scriptTransfers = $t023242356._1
100- let j = $t023242356._2
100+ let $t023182350 = accum
101+ let scriptTransfers = $t023182350._1
102+ let j = $t023182350._2
101103 if ((j >= recipientsSize))
102104 then $Tuple2(scriptTransfers, (j + 1))
103105 else $Tuple2((scriptTransfers :+ ScriptTransfer(addressFromStringValue(recipients[j]), next, i.payments[paymentIdx[j]].assetId)), (j + 1))
122124 }
123125
124126
127+
128+@Callable(i)
129+func UpdateLPBalance (PaidMassTransferAmount) = {
130+ let read_account_balance = wavesBalance(this).regular
131+ let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.")
132+ let received_order_amount = (read_account_balance - read_total_pool_liquidity)
133+ let updated_pool_balance = ((read_total_pool_liquidity - PaidMassTransferAmount) + received_order_amount)
134+ let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") {
135+ case a: Int =>
136+ a
137+ case _ =>
138+ 0
139+ }
140+ let TotalMassTransferCounter = (PreviousMassTransferCounter + 1)
141+ let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") {
142+ case a: Int =>
143+ a
144+ case _ =>
145+ 0
146+ }
147+ let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount)
148+ if ((i.caller != masstransfer_whitelisted_address))
149+ then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
150+ else if ((PaidMassTransferAmount > read_total_pool_liquidity))
151+ 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)]
153+ }
154+
155+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ'
5+
6+let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey)
7+
48 func validateArguments (recipients,amounts,paymentIdx,payments) = {
59 let recipientsSize = size(recipients)
610 let amountsSize = size(amounts)
711 let paymentIdxSize = size(paymentIdx)
812 let paymentsSize = size(payments)
913 let minAmount = min(amounts)
1014 let minPaymentIdx = min(paymentIdx)
1115 let maxPaymentIdx = max(paymentIdx)
1216 func paymentsValidator (paymentAccum,nextPayment) = {
13- let $t0583620 = paymentAccum
14- let validPayments = $t0583620._1
15- let j = $t0583620._2
17+ let $t0740777 = paymentAccum
18+ let validPayments = $t0740777._1
19+ let j = $t0740777._2
1620 if ((j >= paymentsSize))
1721 then $Tuple2(validPayments, (j + 1))
1822 else {
1923 func amountsAggregator (amountAccum,nextAmount) = {
20- let $t0775804 = amountAccum
21- let amount = $t0775804._1
22- let k = $t0775804._2
24+ let $t0932961 = amountAccum
25+ let amount = $t0932961._1
26+ let k = $t0932961._2
2327 if (if ((k >= recipientsSize))
2428 then true
2529 else (paymentIdx[k] != j))
2630 then $Tuple2(amount, (k + 1))
2731 else $Tuple2((amount + nextAmount), (k + 1))
2832 }
2933
3034 let aggregatedAmount = {
3135 let $l = amounts
3236 let $s = size($l)
3337 let $acc0 = $Tuple2(0, 0)
3438 func $f0_1 ($a,$i) = if (($i >= $s))
3539 then $a
3640 else amountsAggregator($a, $l[$i])
3741
3842 func $f0_2 ($a,$i) = if (($i >= $s))
3943 then $a
4044 else throw("List size exceeds 100")
4145
4246 $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)
4347 }
4448 if ((aggregatedAmount._1 == nextPayment.amount))
4549 then $Tuple2((validPayments + 1), (j + 1))
4650 else $Tuple2(validPayments, (j + 1))
4751 }
4852 }
4953
5054 let paymentsValidation = {
5155 let $l = payments
5256 let $s = size($l)
5357 let $acc0 = $Tuple2(0, 0)
5458 func $f0_1 ($a,$i) = if (($i >= $s))
5559 then $a
5660 else paymentsValidator($a, $l[$i])
5761
5862 func $f0_2 ($a,$i) = if (($i >= $s))
5963 then $a
6064 else throw("List size exceeds 10")
6165
6266 $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)
6367 }
6468 if (if (if (if (if (if (if (if ((recipientsSize == amountsSize))
6569 then (recipientsSize == paymentIdxSize)
6670 else false)
6771 then (recipientsSize > 0)
6872 else false)
6973 then (100 >= recipientsSize)
7074 else false)
7175 then (paymentsSize > 0)
7276 else false)
7377 then (minAmount > 0)
7478 else false)
7579 then (minPaymentIdx == 0)
7680 else false)
7781 then (maxPaymentIdx == (paymentsSize - 1))
7882 else false)
7983 then (paymentsValidation._1 == paymentsSize)
8084 else false
8185 }
8286
8387
8488 @Callable(i)
8589 func massTransfer (recipients,amounts,paymentIdx,attachment) = {
8690 let pmt = value(i.payments[0])
87- let lp_address_pubkey = base58'9Pwum3va2xrkVwsGRNiTeGxBBBNFEDaS9sfkZiSpSvdQ'
88- let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey)
8991 if ((i.caller != masstransfer_whitelisted_address))
90- then throw((("Not an Admin only" + toString(masstransfer_whitelisted_address)) + " can sign it."))
92+ then throw((("Not an Admin only " + toString(masstransfer_whitelisted_address)) + " can sign it."))
9193 else if (isDefined(pmt.assetId))
9294 then throw("Only Waves is allowed to Attach as payment.")
9395 else if (!(validateArguments(recipients, amounts, paymentIdx, i.payments)))
9496 then throw("Invalid arguments")
9597 else {
9698 let recipientsSize = size(recipients)
9799 func scriptTransfersGenerator (accum,next) = {
98- let $t023242356 = accum
99- let scriptTransfers = $t023242356._1
100- let j = $t023242356._2
100+ let $t023182350 = accum
101+ let scriptTransfers = $t023182350._1
102+ let j = $t023182350._2
101103 if ((j >= recipientsSize))
102104 then $Tuple2(scriptTransfers, (j + 1))
103105 else $Tuple2((scriptTransfers :+ ScriptTransfer(addressFromStringValue(recipients[j]), next, i.payments[paymentIdx[j]].assetId)), (j + 1))
104106 }
105107
106108 let result = {
107109 let $l = amounts
108110 let $s = size($l)
109111 let $acc0 = $Tuple2(nil, 0)
110112 func $f0_1 ($a,$i) = if (($i >= $s))
111113 then $a
112114 else scriptTransfersGenerator($a, $l[$i])
113115
114116 func $f0_2 ($a,$i) = if (($i >= $s))
115117 then $a
116118 else throw("List size exceeds 100")
117119
118120 $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)
119121 }
120122 $Tuple2(result._1, unit)
121123 }
122124 }
123125
124126
127+
128+@Callable(i)
129+func UpdateLPBalance (PaidMassTransferAmount) = {
130+ let read_account_balance = wavesBalance(this).regular
131+ let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.")
132+ let received_order_amount = (read_account_balance - read_total_pool_liquidity)
133+ let updated_pool_balance = ((read_total_pool_liquidity - PaidMassTransferAmount) + received_order_amount)
134+ let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") {
135+ case a: Int =>
136+ a
137+ case _ =>
138+ 0
139+ }
140+ let TotalMassTransferCounter = (PreviousMassTransferCounter + 1)
141+ let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") {
142+ case a: Int =>
143+ a
144+ case _ =>
145+ 0
146+ }
147+ let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount)
148+ if ((i.caller != masstransfer_whitelisted_address))
149+ then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
150+ else if ((PaidMassTransferAmount > read_total_pool_liquidity))
151+ 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)]
153+ }
154+
155+

github/deemru/w8io/026f985 
40.26 ms