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