tx · AG4uBoCjs4TNUi2No4zSUyZQKerKBRh1oJqUrV7fqZ8z 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00700000 Waves 2023.11.08 12:19 [2834191] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "AG4uBoCjs4TNUi2No4zSUyZQKerKBRh1oJqUrV7fqZ8z", "fee": 700000, "feeAssetId": null, "timestamp": 1699435175894, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "3AHXNZZJUSvkuznAhjPwwVgJi15UeeMo9fe9n2NzqAxipamFPyH86bJJgnchqgb2Ubdue3ryFEGWAgvvWT9xicN5" ], "script": "base64:BgIbCAISBAoCCAESAwoBCBIAEgMKAQgSABIDCgEICQACbGkJAMwIAgIBMQkAzAgCAgEyCQDMCAICATMJAMwIAgIBNAkAzAgCAgE1CQDMCAICATYJAMwIAgIBNwkAzAgCAgE4CQDMCAICATkJAMwIAgICMTAJAMwIAgICMTEJAMwIAgICMTIJAMwIAgICMTMJAMwIAgICMTQJAMwIAgICMTUJAMwIAgICMTYJAMwIAgICMTcJAMwIAgICMTgJAMwIAgICMTkJAMwIAgICMjAJAMwIAgICMjEJAMwIAgICMjIJAMwIAgICMjMJAMwIAgICMjQJAMwIAgICMjUJAMwIAgICMjYJAMwIAgICMjcJAMwIAgICMjgJAMwIAgICMjkJAMwIAgICMzAJAMwIAgICMzEJAMwIAgICMzIJAMwIAgICMzMJAMwIAgICMzQJAMwIAgICMzUJAMwIAgICMzYJAMwIAgICMzcJAMwIAgICMzgJAMwIAgICMzkJAMwIAgICNDAJAMwIAgICNDEJAMwIAgICNDIJAMwIAgICNDMJAMwIAgICNDQJAMwIAgICNDUJAMwIAgICNDYJAMwIAgICNDcJAMwIAgICNDgJAMwIAgICN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QkArAICCQCsAgICBXBvb2xfBQZwb29sSWQCCl9ib29zdGluZ3MFA25pbADHVOIg", "height": 2834191, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GKFECfCpKP3NdGxAgoJuUGPeoLHA7w3JPshyyukBbV5R Next: 3EDoMavUgGSjtjUoh3YWjn6298Mjc6E92hgD6eR7RNL3 Diff:
Old | New | Differences | |
---|---|---|---|
49 | 49 | let o = d((("boosting_" + n) + "_lastHeight")) | |
50 | 50 | let p = d((("boosting_" + n) + "_finishHeight")) | |
51 | 51 | let q = h((("boosting_" + n) + "_poolId")) | |
52 | - | let r = dropRight(h((("pool_" + q) + "_boostings")), 1) | |
53 | - | let s = value(indexOf(r, n)) | |
52 | + | let r = h((("pool_" + q) + "_boostings")) | |
53 | + | let s = size(r) | |
54 | + | let t = value(indexOf(r, n)) | |
55 | + | let u = (take(r, (s - (s - t))) + takeRight(r, (s - (t + 1)))) | |
54 | 56 | if (if ((o != 0)) | |
55 | 57 | then (p > o) | |
56 | 58 | else false) | |
57 | 59 | then { | |
58 | - | let | |
59 | - | let | |
60 | - | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), | |
60 | + | let v = (d((("boosting_" + n) + "_totalAmount")) / ((d((("boosting_" + n) + "_days")) * b) * c)) | |
61 | + | let w = fraction((min([p, height]) - o), v, 1) | |
62 | + | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), w, k(h((("boosting_" + n) + "_assetId")))), StringEntry("getFinishedPoolId", q), StringEntry("getPoolBoostings", r), IntegerEntry("findIndex", t), IntegerEntry("sizeStr", s)] | |
61 | 63 | } | |
62 | 64 | else nil | |
63 | 65 | } | |
64 | 66 | ||
65 | 67 | ||
66 | - | func | |
68 | + | func x (n) = { | |
67 | 69 | let o = d((("boosting_" + n) + "_lastHeight")) | |
68 | 70 | let p = d((("boosting_" + n) + "_finishHeight")) | |
69 | 71 | if ((o >= p)) | |
70 | 72 | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((h((("list ended " + toString(height)) + " boostingIds")) + n) + ","))] | |
71 | - | else | |
73 | + | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((h((("list ongoing boosts " + toString(height)) + " boostingIds")) + n) + ","))] | |
72 | 74 | } | |
73 | 75 | ||
74 | 76 | ||
75 | - | @Callable( | |
76 | - | func addBoosting ( | |
77 | + | @Callable(y) | |
78 | + | func addBoosting (z,A) = if ((1 > A)) | |
77 | 79 | then throw("amount of days has to be between 1 and 365") | |
78 | - | else if (( | |
80 | + | else if ((A > 365)) | |
79 | 81 | then throw("amount of days has to be between 1 and 365") | |
80 | 82 | else if (false) | |
81 | 83 | then throw("under maintenance until further notice") | |
82 | 84 | else { | |
83 | - | let | |
84 | - | if ((1440 > ( | |
85 | - | then throw((("boosting amount too small, minimum is " + toString((1440 * | |
85 | + | let B = y.payments[0].amount | |
86 | + | if ((1440 > (B / A))) | |
87 | + | then throw((("boosting amount too small, minimum is " + toString((1440 * A))) + " of the smallest unit of payment asset")) | |
86 | 88 | else { | |
87 | - | let j = i( | |
89 | + | let j = i(y.payments[0].assetId) | |
88 | 90 | if ((height == d("height"))) | |
89 | 91 | then throw("wait 1 minute") | |
90 | 92 | else { | |
91 | - | let | |
93 | + | let C = if ((size(h((("pool_" + z) + "_boostings"))) > 11)) | |
92 | 94 | then throw("max 5 boosts per pool") | |
93 | 95 | else invoke(this, "entryEnded", nil, nil) | |
94 | - | if (( | |
96 | + | if ((C == C)) | |
95 | 97 | then { | |
96 | - | let n = if (( | |
98 | + | let n = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 3)) | |
97 | 99 | then throw("wait till other boosts are finished") | |
98 | 100 | else take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
99 | - | if ((addressFromString( | |
101 | + | if ((addressFromString(z) == unit)) | |
100 | 102 | then throw("incorrect pool address") | |
101 | - | else [IntegerEntry((("boosting_" + n) + "_days"), | |
103 | + | else [IntegerEntry((("boosting_" + n) + "_days"), A), IntegerEntry((("boosting_" + n) + "_totalAmount"), B), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (B / A)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((A * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((A * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(y.caller)), StringEntry((("boosting_" + n) + "_poolId"), z), StringEntry((("pool_" + z) + "_boostings"), ((h((("pool_" + z) + "_boostings")) + n) + ","))] | |
102 | 104 | } | |
103 | 105 | else throw("Strict value is not equal to itself.") | |
104 | 106 | } | |
107 | 109 | ||
108 | 110 | ||
109 | 111 | ||
110 | - | @Callable( | |
112 | + | @Callable(y) | |
111 | 113 | func payBoosting (n) = m(n) | |
112 | 114 | ||
113 | 115 | ||
114 | 116 | ||
115 | - | @Callable( | |
117 | + | @Callable(y) | |
116 | 118 | func payBoostings () = { | |
117 | - | func | |
118 | - | let | |
119 | - | if (( | |
120 | - | then | |
119 | + | func D (E,F) = { | |
120 | + | let G = invoke(this, "payBoosting", [F], nil) | |
121 | + | if ((G == G)) | |
122 | + | then G | |
121 | 123 | else throw("Strict value is not equal to itself.") | |
122 | 124 | } | |
123 | 125 | ||
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | func | |
129 | - | then | |
130 | - | else | |
126 | + | let H = { | |
127 | + | let I = a | |
128 | + | let J = size(I) | |
129 | + | let K = 0 | |
130 | + | func L (M,N) = if ((N >= J)) | |
131 | + | then M | |
132 | + | else D(M, I[N]) | |
131 | 133 | ||
132 | - | func | |
133 | - | then | |
134 | + | func O (M,N) = if ((N >= J)) | |
135 | + | then M | |
134 | 136 | else throw("List size exceeds 56") | |
135 | 137 | ||
136 | - | | |
138 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 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) | |
137 | 139 | } | |
138 | - | if (( | |
140 | + | if ((H == H)) | |
139 | 141 | then nil | |
140 | 142 | else throw("Strict value is not equal to itself.") | |
141 | 143 | } | |
142 | 144 | ||
143 | 145 | ||
144 | 146 | ||
145 | - | @Callable( | |
146 | - | func endedBoostings (n) = | |
147 | + | @Callable(y) | |
148 | + | func endedBoostings (n) = x(n) | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | - | @Callable( | |
152 | + | @Callable(y) | |
151 | 153 | func entryEnded () = { | |
152 | - | func | |
153 | - | let | |
154 | - | if (( | |
155 | - | then | |
154 | + | func D (E,F) = { | |
155 | + | let G = invoke(this, "endedBoostings", [F], nil) | |
156 | + | if ((G == G)) | |
157 | + | then G | |
156 | 158 | else throw("Strict value is not equal to itself.") | |
157 | 159 | } | |
158 | 160 | ||
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | func | |
164 | - | then | |
165 | - | else | |
161 | + | let P = { | |
162 | + | let I = a | |
163 | + | let J = size(I) | |
164 | + | let K = 0 | |
165 | + | func L (M,N) = if ((N >= J)) | |
166 | + | then M | |
167 | + | else D(M, I[N]) | |
166 | 168 | ||
167 | - | func | |
168 | - | then | |
169 | + | func O (M,N) = if ((N >= J)) | |
170 | + | then M | |
169 | 171 | else throw("List size exceeds 56") | |
170 | 172 | ||
171 | - | | |
173 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 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) | |
172 | 174 | } | |
173 | - | if (( | |
175 | + | if ((P == P)) | |
174 | 176 | then [IntegerEntry("height", height)] | |
175 | 177 | else throw("Strict value is not equal to itself.") | |
176 | 178 | } | |
177 | 179 | ||
178 | 180 | ||
179 | 181 | ||
180 | - | @Callable( | |
181 | - | func deleteEntr ( | |
182 | + | @Callable(y) | |
183 | + | func deleteEntr (z) = [DeleteEntry((("pool_" + z) + "_boostings"))] | |
182 | 184 | ||
183 | 185 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = ["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", "55", "56"] | |
5 | 5 | ||
6 | 6 | let b = 1 | |
7 | 7 | ||
8 | 8 | let c = 10 | |
9 | 9 | ||
10 | 10 | func d (e) = { | |
11 | 11 | let f = getInteger(this, e) | |
12 | 12 | if ($isInstanceOf(f, "Int")) | |
13 | 13 | then { | |
14 | 14 | let g = f | |
15 | 15 | g | |
16 | 16 | } | |
17 | 17 | else 0 | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func h (e) = { | |
22 | 22 | let f = getString(this, e) | |
23 | 23 | if ($isInstanceOf(f, "String")) | |
24 | 24 | then { | |
25 | 25 | let g = f | |
26 | 26 | g | |
27 | 27 | } | |
28 | 28 | else "" | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func i (j) = { | |
33 | 33 | let f = j | |
34 | 34 | if ($isInstanceOf(f, "ByteVector")) | |
35 | 35 | then { | |
36 | 36 | let g = f | |
37 | 37 | toBase58String(g) | |
38 | 38 | } | |
39 | 39 | else "WAVES" | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func k (l) = if ((l == "WAVES")) | |
44 | 44 | then unit | |
45 | 45 | else fromBase58String(l) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func m (n) = { | |
49 | 49 | let o = d((("boosting_" + n) + "_lastHeight")) | |
50 | 50 | let p = d((("boosting_" + n) + "_finishHeight")) | |
51 | 51 | let q = h((("boosting_" + n) + "_poolId")) | |
52 | - | let r = dropRight(h((("pool_" + q) + "_boostings")), 1) | |
53 | - | let s = value(indexOf(r, n)) | |
52 | + | let r = h((("pool_" + q) + "_boostings")) | |
53 | + | let s = size(r) | |
54 | + | let t = value(indexOf(r, n)) | |
55 | + | let u = (take(r, (s - (s - t))) + takeRight(r, (s - (t + 1)))) | |
54 | 56 | if (if ((o != 0)) | |
55 | 57 | then (p > o) | |
56 | 58 | else false) | |
57 | 59 | then { | |
58 | - | let | |
59 | - | let | |
60 | - | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), | |
60 | + | let v = (d((("boosting_" + n) + "_totalAmount")) / ((d((("boosting_" + n) + "_days")) * b) * c)) | |
61 | + | let w = fraction((min([p, height]) - o), v, 1) | |
62 | + | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), w, k(h((("boosting_" + n) + "_assetId")))), StringEntry("getFinishedPoolId", q), StringEntry("getPoolBoostings", r), IntegerEntry("findIndex", t), IntegerEntry("sizeStr", s)] | |
61 | 63 | } | |
62 | 64 | else nil | |
63 | 65 | } | |
64 | 66 | ||
65 | 67 | ||
66 | - | func | |
68 | + | func x (n) = { | |
67 | 69 | let o = d((("boosting_" + n) + "_lastHeight")) | |
68 | 70 | let p = d((("boosting_" + n) + "_finishHeight")) | |
69 | 71 | if ((o >= p)) | |
70 | 72 | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((h((("list ended " + toString(height)) + " boostingIds")) + n) + ","))] | |
71 | - | else | |
73 | + | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((h((("list ongoing boosts " + toString(height)) + " boostingIds")) + n) + ","))] | |
72 | 74 | } | |
73 | 75 | ||
74 | 76 | ||
75 | - | @Callable( | |
76 | - | func addBoosting ( | |
77 | + | @Callable(y) | |
78 | + | func addBoosting (z,A) = if ((1 > A)) | |
77 | 79 | then throw("amount of days has to be between 1 and 365") | |
78 | - | else if (( | |
80 | + | else if ((A > 365)) | |
79 | 81 | then throw("amount of days has to be between 1 and 365") | |
80 | 82 | else if (false) | |
81 | 83 | then throw("under maintenance until further notice") | |
82 | 84 | else { | |
83 | - | let | |
84 | - | if ((1440 > ( | |
85 | - | then throw((("boosting amount too small, minimum is " + toString((1440 * | |
85 | + | let B = y.payments[0].amount | |
86 | + | if ((1440 > (B / A))) | |
87 | + | then throw((("boosting amount too small, minimum is " + toString((1440 * A))) + " of the smallest unit of payment asset")) | |
86 | 88 | else { | |
87 | - | let j = i( | |
89 | + | let j = i(y.payments[0].assetId) | |
88 | 90 | if ((height == d("height"))) | |
89 | 91 | then throw("wait 1 minute") | |
90 | 92 | else { | |
91 | - | let | |
93 | + | let C = if ((size(h((("pool_" + z) + "_boostings"))) > 11)) | |
92 | 94 | then throw("max 5 boosts per pool") | |
93 | 95 | else invoke(this, "entryEnded", nil, nil) | |
94 | - | if (( | |
96 | + | if ((C == C)) | |
95 | 97 | then { | |
96 | - | let n = if (( | |
98 | + | let n = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 3)) | |
97 | 99 | then throw("wait till other boosts are finished") | |
98 | 100 | else take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
99 | - | if ((addressFromString( | |
101 | + | if ((addressFromString(z) == unit)) | |
100 | 102 | then throw("incorrect pool address") | |
101 | - | else [IntegerEntry((("boosting_" + n) + "_days"), | |
103 | + | else [IntegerEntry((("boosting_" + n) + "_days"), A), IntegerEntry((("boosting_" + n) + "_totalAmount"), B), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (B / A)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((A * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((A * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(y.caller)), StringEntry((("boosting_" + n) + "_poolId"), z), StringEntry((("pool_" + z) + "_boostings"), ((h((("pool_" + z) + "_boostings")) + n) + ","))] | |
102 | 104 | } | |
103 | 105 | else throw("Strict value is not equal to itself.") | |
104 | 106 | } | |
105 | 107 | } | |
106 | 108 | } | |
107 | 109 | ||
108 | 110 | ||
109 | 111 | ||
110 | - | @Callable( | |
112 | + | @Callable(y) | |
111 | 113 | func payBoosting (n) = m(n) | |
112 | 114 | ||
113 | 115 | ||
114 | 116 | ||
115 | - | @Callable( | |
117 | + | @Callable(y) | |
116 | 118 | func payBoostings () = { | |
117 | - | func | |
118 | - | let | |
119 | - | if (( | |
120 | - | then | |
119 | + | func D (E,F) = { | |
120 | + | let G = invoke(this, "payBoosting", [F], nil) | |
121 | + | if ((G == G)) | |
122 | + | then G | |
121 | 123 | else throw("Strict value is not equal to itself.") | |
122 | 124 | } | |
123 | 125 | ||
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | func | |
129 | - | then | |
130 | - | else | |
126 | + | let H = { | |
127 | + | let I = a | |
128 | + | let J = size(I) | |
129 | + | let K = 0 | |
130 | + | func L (M,N) = if ((N >= J)) | |
131 | + | then M | |
132 | + | else D(M, I[N]) | |
131 | 133 | ||
132 | - | func | |
133 | - | then | |
134 | + | func O (M,N) = if ((N >= J)) | |
135 | + | then M | |
134 | 136 | else throw("List size exceeds 56") | |
135 | 137 | ||
136 | - | | |
138 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 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) | |
137 | 139 | } | |
138 | - | if (( | |
140 | + | if ((H == H)) | |
139 | 141 | then nil | |
140 | 142 | else throw("Strict value is not equal to itself.") | |
141 | 143 | } | |
142 | 144 | ||
143 | 145 | ||
144 | 146 | ||
145 | - | @Callable( | |
146 | - | func endedBoostings (n) = | |
147 | + | @Callable(y) | |
148 | + | func endedBoostings (n) = x(n) | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | - | @Callable( | |
152 | + | @Callable(y) | |
151 | 153 | func entryEnded () = { | |
152 | - | func | |
153 | - | let | |
154 | - | if (( | |
155 | - | then | |
154 | + | func D (E,F) = { | |
155 | + | let G = invoke(this, "endedBoostings", [F], nil) | |
156 | + | if ((G == G)) | |
157 | + | then G | |
156 | 158 | else throw("Strict value is not equal to itself.") | |
157 | 159 | } | |
158 | 160 | ||
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | func | |
164 | - | then | |
165 | - | else | |
161 | + | let P = { | |
162 | + | let I = a | |
163 | + | let J = size(I) | |
164 | + | let K = 0 | |
165 | + | func L (M,N) = if ((N >= J)) | |
166 | + | then M | |
167 | + | else D(M, I[N]) | |
166 | 168 | ||
167 | - | func | |
168 | - | then | |
169 | + | func O (M,N) = if ((N >= J)) | |
170 | + | then M | |
169 | 171 | else throw("List size exceeds 56") | |
170 | 172 | ||
171 | - | | |
173 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 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) | |
172 | 174 | } | |
173 | - | if (( | |
175 | + | if ((P == P)) | |
174 | 176 | then [IntegerEntry("height", height)] | |
175 | 177 | else throw("Strict value is not equal to itself.") | |
176 | 178 | } | |
177 | 179 | ||
178 | 180 | ||
179 | 181 | ||
180 | - | @Callable( | |
181 | - | func deleteEntr ( | |
182 | + | @Callable(y) | |
183 | + | func deleteEntr (z) = [DeleteEntry((("pool_" + z) + "_boostings"))] | |
182 | 184 | ||
183 | 185 |
github/deemru/w8io/026f985 116.75 ms ◑