tx · ABZJApoav1djP3Q64dvmHhpTDBBHf38dSLwmbhoBPpAx 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00700000 Waves 2023.11.08 11:43 [2834156] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "ABZJApoav1djP3Q64dvmHhpTDBBHf38dSLwmbhoBPpAx", "fee": 700000, "feeAssetId": null, "timestamp": 1699433030531, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "wwNfaf5GR5GTYJqH7aF8aVE3o7iMFJgypRV3gMTtarz5CoR2m2qxNAuGT2vbpdpCrnAytbLU9LhV612AyPP6uu6" ], "script": "base64:BgIWCAISBAoCCAESAwoBCBIAEgMKAQgSAAkAAmxpCQDMCAICATEJAMwIAgIBMgkAzAgCAgEzCQDMCAICATQJAMwIAgIBNQkAzAgCAgE2CQDMCAICATcJAMwIAgIBOAkAzAgCAgE5CQDMCAICAjEwCQDMCAICAjExCQDMCAICAjEyCQDMCAICAjEzCQDMCAICAjE0CQDMCAICAjE1CQDMCAICAjE2CQDMCAICAjE3CQDMCAICAjE4CQDMCAICAjE5CQDMCAICAjIwCQDMCAICAjIxCQDMCAICAjIyCQDMCAICAjIzCQDMCAICAjI0CQDMCAICAjI1CQDMCAICAjI2CQDMCAICAjI3CQDMCAICAjI4CQDMCAICAjI5CQDMCAICAjMwCQDMCAICAjMxCQDMCAICAjMyCQDMCAICAjMzCQDMCAICAjM0CQDMCAICAjM1CQDMCAICAjM2CQDMCAICAjM3CQDMCAICAjM4CQDMCAICAjM5CQDMCAICAjQwCQDMCAICAjQxCQDMCAICAjQyCQDMCAICAjQzCQDMCAICAjQ0CQDMCAICAjQ1CQDMCAICAjQ2CQDMCAICAjQ3CQDMCAICAjQ4CQDMCAICAjQ5CQ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fMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4AwkAAAIFA2VuZAUDZW5kCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgZoZWlnaHQFBmhlaWdodAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuALqOLDc=", "height": 2834156, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7wux38rZdW27DZqpVSCdLyUnKf1Vz96ST24zmTKrf1Cr Next: GKFECfCpKP3NdGxAgoJuUGPeoLHA7w3JPshyyukBbV5R Diff:
Old | New | Differences | |
---|---|---|---|
88 | 88 | if ((height == d("height"))) | |
89 | 89 | then throw("wait 1 minute") | |
90 | 90 | else { | |
91 | - | let A = invoke(this, "entryEnded", nil, nil) | |
91 | + | let A = if ((size(h((("pool_" + x) + "_boostings"))) > 11)) | |
92 | + | then throw("max 5 boosts per pool") | |
93 | + | else invoke(this, "entryEnded", nil, nil) | |
92 | 94 | if ((A == A)) | |
93 | 95 | then { | |
94 | - | let B = invoke(this, "firstEndedBoostingId", nil, nil) | |
95 | - | if ((B == B)) | |
96 | - | then { | |
97 | - | let n = h("first") | |
98 | - | if ((addressFromString(x) == unit)) | |
99 | - | then throw("incorrect pool address") | |
100 | - | else [IntegerEntry((("boosting_" + n) + "_days"), y), IntegerEntry((("boosting_" + n) + "_totalAmount"), z), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (z / y)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((y * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((y * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(w.caller)), StringEntry((("boosting_" + n) + "_poolId"), x), StringEntry((("pool_" + x) + "_boostings"), ((h((("pool_" + x) + "_boostings")) + n) + ","))] | |
101 | - | } | |
102 | - | else throw("Strict value is not equal to itself.") | |
96 | + | let n = if ((take(h((("list ended " + toString(height)) + " boostingIds")), 1) == "0")) | |
97 | + | then throw("wait till other boosts are finished") | |
98 | + | else take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
99 | + | if ((addressFromString(x) == unit)) | |
100 | + | then throw("incorrect pool address") | |
101 | + | else [IntegerEntry((("boosting_" + n) + "_days"), y), IntegerEntry((("boosting_" + n) + "_totalAmount"), z), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (z / y)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((y * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((y * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(w.caller)), StringEntry((("boosting_" + n) + "_poolId"), x), StringEntry((("pool_" + x) + "_boostings"), ((h((("pool_" + x) + "_boostings")) + n) + ","))] | |
103 | 102 | } | |
104 | 103 | else throw("Strict value is not equal to itself.") | |
105 | 104 | } | |
115 | 114 | ||
116 | 115 | @Callable(w) | |
117 | 116 | func payBoostings () = { | |
118 | - | func | |
119 | - | let | |
120 | - | if (( | |
121 | - | then | |
117 | + | func B (C,D) = { | |
118 | + | let E = invoke(this, "payBoosting", [D], nil) | |
119 | + | if ((E == E)) | |
120 | + | then E | |
122 | 121 | else throw("Strict value is not equal to itself.") | |
123 | 122 | } | |
124 | 123 | ||
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | func | |
130 | - | then | |
131 | - | else | |
124 | + | let F = { | |
125 | + | let G = a | |
126 | + | let H = size(G) | |
127 | + | let I = 0 | |
128 | + | func J (K,L) = if ((L >= H)) | |
129 | + | then K | |
130 | + | else B(K, G[L]) | |
132 | 131 | ||
133 | - | func | |
134 | - | then | |
132 | + | func M (K,L) = if ((L >= H)) | |
133 | + | then K | |
135 | 134 | else throw("List size exceeds 56") | |
136 | 135 | ||
137 | - | | |
136 | + | M(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(I, 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) | |
138 | 137 | } | |
139 | - | if (( | |
138 | + | if ((F == F)) | |
140 | 139 | then nil | |
141 | 140 | else throw("Strict value is not equal to itself.") | |
142 | 141 | } | |
150 | 149 | ||
151 | 150 | @Callable(w) | |
152 | 151 | func entryEnded () = { | |
153 | - | func | |
154 | - | let | |
155 | - | if (( | |
156 | - | then | |
152 | + | func B (C,D) = { | |
153 | + | let E = invoke(this, "endedBoostings", [D], nil) | |
154 | + | if ((E == E)) | |
155 | + | then E | |
157 | 156 | else throw("Strict value is not equal to itself.") | |
158 | 157 | } | |
159 | 158 | ||
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | func | |
165 | - | then | |
166 | - | else | |
159 | + | let N = { | |
160 | + | let G = a | |
161 | + | let H = size(G) | |
162 | + | let I = 0 | |
163 | + | func J (K,L) = if ((L >= H)) | |
164 | + | then K | |
165 | + | else B(K, G[L]) | |
167 | 166 | ||
168 | - | func | |
169 | - | then | |
167 | + | func M (K,L) = if ((L >= H)) | |
168 | + | then K | |
170 | 169 | else throw("List size exceeds 56") | |
171 | 170 | ||
172 | - | | |
171 | + | M(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(I, 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) | |
173 | 172 | } | |
174 | - | if (( | |
173 | + | if ((N == N)) | |
175 | 174 | then [IntegerEntry("height", height)] | |
176 | 175 | else throw("Strict value is not equal to itself.") | |
177 | - | } | |
178 | - | ||
179 | - | ||
180 | - | ||
181 | - | @Callable(w) | |
182 | - | func firstEndedBoostingId () = { | |
183 | - | let P = take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
184 | - | [StringEntry("first", P)] | |
185 | 176 | } | |
186 | 177 | ||
187 | 178 |
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 | 52 | let r = dropRight(h((("pool_" + q) + "_boostings")), 1) | |
53 | 53 | let s = value(indexOf(r, n)) | |
54 | 54 | if (if ((o != 0)) | |
55 | 55 | then (p > o) | |
56 | 56 | else false) | |
57 | 57 | then { | |
58 | 58 | let t = (d((("boosting_" + n) + "_totalAmount")) / ((d((("boosting_" + n) + "_days")) * b) * c)) | |
59 | 59 | let u = fraction((min([p, height]) - o), t, 1) | |
60 | 60 | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), u, k(h((("boosting_" + n) + "_assetId")))), StringEntry("getFinishedPoolId", q), StringEntry("getPoolBoostings", r), IntegerEntry("findIndex", s)] | |
61 | 61 | } | |
62 | 62 | else nil | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func v (n) = { | |
67 | 67 | let o = d((("boosting_" + n) + "_lastHeight")) | |
68 | 68 | let p = d((("boosting_" + n) + "_finishHeight")) | |
69 | 69 | if ((o >= p)) | |
70 | 70 | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((h((("list ended " + toString(height)) + " boostingIds")) + n) + ","))] | |
71 | 71 | else nil | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(w) | |
76 | 76 | func addBoosting (x,y) = if ((1 > y)) | |
77 | 77 | then throw("amount of days has to be between 1 and 365") | |
78 | 78 | else if ((y > 365)) | |
79 | 79 | then throw("amount of days has to be between 1 and 365") | |
80 | 80 | else if (false) | |
81 | 81 | then throw("under maintenance until further notice") | |
82 | 82 | else { | |
83 | 83 | let z = w.payments[0].amount | |
84 | 84 | if ((1440 > (z / y))) | |
85 | 85 | then throw((("boosting amount too small, minimum is " + toString((1440 * y))) + " of the smallest unit of payment asset")) | |
86 | 86 | else { | |
87 | 87 | let j = i(w.payments[0].assetId) | |
88 | 88 | if ((height == d("height"))) | |
89 | 89 | then throw("wait 1 minute") | |
90 | 90 | else { | |
91 | - | let A = invoke(this, "entryEnded", nil, nil) | |
91 | + | let A = if ((size(h((("pool_" + x) + "_boostings"))) > 11)) | |
92 | + | then throw("max 5 boosts per pool") | |
93 | + | else invoke(this, "entryEnded", nil, nil) | |
92 | 94 | if ((A == A)) | |
93 | 95 | then { | |
94 | - | let B = invoke(this, "firstEndedBoostingId", nil, nil) | |
95 | - | if ((B == B)) | |
96 | - | then { | |
97 | - | let n = h("first") | |
98 | - | if ((addressFromString(x) == unit)) | |
99 | - | then throw("incorrect pool address") | |
100 | - | else [IntegerEntry((("boosting_" + n) + "_days"), y), IntegerEntry((("boosting_" + n) + "_totalAmount"), z), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (z / y)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((y * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((y * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(w.caller)), StringEntry((("boosting_" + n) + "_poolId"), x), StringEntry((("pool_" + x) + "_boostings"), ((h((("pool_" + x) + "_boostings")) + n) + ","))] | |
101 | - | } | |
102 | - | else throw("Strict value is not equal to itself.") | |
96 | + | let n = if ((take(h((("list ended " + toString(height)) + " boostingIds")), 1) == "0")) | |
97 | + | then throw("wait till other boosts are finished") | |
98 | + | else take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
99 | + | if ((addressFromString(x) == unit)) | |
100 | + | then throw("incorrect pool address") | |
101 | + | else [IntegerEntry((("boosting_" + n) + "_days"), y), IntegerEntry((("boosting_" + n) + "_totalAmount"), z), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (z / y)), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((y * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((y * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(w.caller)), StringEntry((("boosting_" + n) + "_poolId"), x), StringEntry((("pool_" + x) + "_boostings"), ((h((("pool_" + x) + "_boostings")) + n) + ","))] | |
103 | 102 | } | |
104 | 103 | else throw("Strict value is not equal to itself.") | |
105 | 104 | } | |
106 | 105 | } | |
107 | 106 | } | |
108 | 107 | ||
109 | 108 | ||
110 | 109 | ||
111 | 110 | @Callable(w) | |
112 | 111 | func payBoosting (n) = m(n) | |
113 | 112 | ||
114 | 113 | ||
115 | 114 | ||
116 | 115 | @Callable(w) | |
117 | 116 | func payBoostings () = { | |
118 | - | func | |
119 | - | let | |
120 | - | if (( | |
121 | - | then | |
117 | + | func B (C,D) = { | |
118 | + | let E = invoke(this, "payBoosting", [D], nil) | |
119 | + | if ((E == E)) | |
120 | + | then E | |
122 | 121 | else throw("Strict value is not equal to itself.") | |
123 | 122 | } | |
124 | 123 | ||
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | func | |
130 | - | then | |
131 | - | else | |
124 | + | let F = { | |
125 | + | let G = a | |
126 | + | let H = size(G) | |
127 | + | let I = 0 | |
128 | + | func J (K,L) = if ((L >= H)) | |
129 | + | then K | |
130 | + | else B(K, G[L]) | |
132 | 131 | ||
133 | - | func | |
134 | - | then | |
132 | + | func M (K,L) = if ((L >= H)) | |
133 | + | then K | |
135 | 134 | else throw("List size exceeds 56") | |
136 | 135 | ||
137 | - | | |
136 | + | M(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(I, 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) | |
138 | 137 | } | |
139 | - | if (( | |
138 | + | if ((F == F)) | |
140 | 139 | then nil | |
141 | 140 | else throw("Strict value is not equal to itself.") | |
142 | 141 | } | |
143 | 142 | ||
144 | 143 | ||
145 | 144 | ||
146 | 145 | @Callable(w) | |
147 | 146 | func endedBoostings (n) = v(n) | |
148 | 147 | ||
149 | 148 | ||
150 | 149 | ||
151 | 150 | @Callable(w) | |
152 | 151 | func entryEnded () = { | |
153 | - | func | |
154 | - | let | |
155 | - | if (( | |
156 | - | then | |
152 | + | func B (C,D) = { | |
153 | + | let E = invoke(this, "endedBoostings", [D], nil) | |
154 | + | if ((E == E)) | |
155 | + | then E | |
157 | 156 | else throw("Strict value is not equal to itself.") | |
158 | 157 | } | |
159 | 158 | ||
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | func | |
165 | - | then | |
166 | - | else | |
159 | + | let N = { | |
160 | + | let G = a | |
161 | + | let H = size(G) | |
162 | + | let I = 0 | |
163 | + | func J (K,L) = if ((L >= H)) | |
164 | + | then K | |
165 | + | else B(K, G[L]) | |
167 | 166 | ||
168 | - | func | |
169 | - | then | |
167 | + | func M (K,L) = if ((L >= H)) | |
168 | + | then K | |
170 | 169 | else throw("List size exceeds 56") | |
171 | 170 | ||
172 | - | | |
171 | + | M(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(J(I, 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) | |
173 | 172 | } | |
174 | - | if (( | |
173 | + | if ((N == N)) | |
175 | 174 | then [IntegerEntry("height", height)] | |
176 | 175 | else throw("Strict value is not equal to itself.") | |
177 | - | } | |
178 | - | ||
179 | - | ||
180 | - | ||
181 | - | @Callable(w) | |
182 | - | func firstEndedBoostingId () = { | |
183 | - | let P = take(h((("list ended " + toString(height)) + " boostingIds")), 1) | |
184 | - | [StringEntry("first", P)] | |
185 | 176 | } | |
186 | 177 | ||
187 | 178 |
github/deemru/w8io/169f3d6 56.12 ms ◑