tx · 2tnMxHbUKtcAaDsNtSNRSRKPmAZj21wuu57XHg4zqUC6 3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH: -0.00900000 Waves 2023.11.08 15:00 [2834350] smart account 3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH > SELF 0.00000000 Waves
{ "type": 13, "id": "2tnMxHbUKtcAaDsNtSNRSRKPmAZj21wuu57XHg4zqUC6", "fee": 900000, "feeAssetId": null, "timestamp": 1699444895561, "version": 2, "chainId": 84, "sender": "3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH", "senderPublicKey": "9ggtmbyecVRfUY2zeZhNaoLBp2iymhnQhffXQhemTJaG", "proofs": [ "2XA6MbeDXBSF3KDt2h5k383p87xSHZMDWnhQVsB4J2ErWGe3wHp3Y3YBA9ZEdEfVZihxTJi923tRN775xRa6oHMa" ], "script": "base64:BgIgCAISBAoCCAESAwoBCBIAEgMKAQgSABIDCgEIEgMKAQgJAAJsaQkAzAgCAgExCQDMCAICATIJAMwIAgIBMwkAzAgCAgE0CQDMCAICATUJAMwIAgIBNgkAzAgCAgE3CQDMCAICATgJAMwIAgIBOQkAzAgCAgIxMAkAzAgCAgIxMQkAzAgCAgIxMgkAzAgCAgIxMwkAzAgCAgIxNAkAzAgCAgIxNQkAzAgCAgIxNgkAzAgCAgIxNwkAzAgCAgIxOAkAzAgCAgIxOQkAzAgCAgIyMAkAzAgCAgIyMQkAzAgCAgIyMgkAzAgCAgIyMwkAzAgCAgIyNAkAzAgCAgIyNQkAzAgCAgIyNgkAzAgCAgIyNwkAzAgCAgIyOAkAzAgCAgIyOQkAzAgCAgIzMAkAzAgCAgIzMQkAzAgCAgIzMgkAzAgCAgIzMwkAzAgCAgIzNAkAzAgCAgIzNQkAzAgCAgIzNgkAzAgCAgIzNwkAzAgCAgIzOAkAzAgCAgIzOQkAzAgCAgI0MAkAzAgCAgI0MQkAzAgCAgI0MgkAzAgCAgI0MwkAzAgCAgI0NAkAzAgCAgI0N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AAAAAAABBBVyZW1vdmVFbmRlZEJvb3N0aW5nSUQJAKwCAgkArwICBRBnZXRQb29sQm9vc3RpbmdzCQBlAgUHc2l6ZVN0cgkAZAIJAGUCBQdzaXplU3RyBQlmaW5kSW5kZXgFDG1vZGlmaWVyTGVmdAkAsgICBRBnZXRQb29sQm9vc3RpbmdzCQBlAgUHc2l6ZVN0cgkAZAIFCWZpbmRJbmRleAUNbW9kaWZpZXJSaWdodAkAzAgCCQELU3RyaW5nRW50cnkCAhFnZXRGaW5pc2hlZFBvb2xJZAUSZ2V0RmluaXNoZWRQb29sSWQxCQDMCAIJAQtTdHJpbmdFbnRyeQICEGdldFBvb2xCb29zdGluZ3MFEGdldFBvb2xCb29zdGluZ3MJAMwIAgkBDEludGVnZXJFbnRyeQICCWZpbmRJbmRleAUJZmluZEluZGV4CQDMCAIJAQxJbnRlZ2VyRW50cnkCAgdzaXplU3RyBQdzaXplU3RyCQDMCAIJAQtTdHJpbmdFbnRyeQICC2xlZnQgc3RyaW5nCQCvAgIFEGdldFBvb2xCb29zdGluZ3MJAGUCBQdzaXplU3RyCQBlAgUHc2l6ZVN0cgUJZmluZEluZGV4CQDMCAIJAQtTdHJpbmdFbnRyeQICDHJpZ2h0IHN0cmluZwkAsgICBRBnZXRQb29sQm9vc3RpbmdzCQBlAgUHc2l6ZVN0cgkAZAIFCWZpbmRJbmRleAUNbW9kaWZpZXJSaWdodAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgIFcG9vbF8FEmdldEZpbmlzaGVkUG9vbElkMQIKX2Jvb3N0aW5ncwUVcmVtb3ZlRW5kZWRCb29zdGluZ0lEBQNuaWwAYlgWAg==", "height": 2834350, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G4rzCXizoYcp8StjzodhFN4K4XZQuLwSA845rLhbwZ8y Next: Gm1pYpHu5Wsovqg8f6Rofb5zvFQQwhBZhc6CF5eqDwJ4 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let li = ["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"] | |
43 | 43 | then (finishHeight > lastHeight) | |
44 | 44 | else false) | |
45 | 45 | then { | |
46 | - | let blockReward = tryGetInteger((("boosting_" + boostingId) + "_blockAmount")) | |
47 | - | let toPay = ((min([finishHeight, height]) - lastHeight) * blockReward) | |
48 | - | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId"))))] | |
46 | + | let blockReward = (tryGetInteger((("boosting_" + boostingId) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
47 | + | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 1) | |
48 | + | let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
49 | + | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId) + "_boostings")) | |
50 | + | let sizeStr = size(getPoolBoostings) | |
51 | + | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
52 | + | let modifierLeft = if ((findIndex == 0)) | |
53 | + | then 0 | |
54 | + | else 1 | |
55 | + | let modifierRight = if ((findIndex == 0)) | |
56 | + | then 2 | |
57 | + | else 1 | |
58 | + | let leftStr = take(getPoolBoostings, (sizeStr - ((sizeStr - findIndex) + modifierLeft))) | |
59 | + | let rightStr = takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight))) | |
60 | + | let openBoostingsIds = (leftStr + rightStr) | |
61 | + | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId")))), StringEntry("getFinishedPoolId", getFinishedPoolId), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", leftStr), StringEntry("right string", rightStr), StringEntry("openBoostingsIds", openBoostingsIds)] | |
49 | 62 | } | |
50 | 63 | else nil | |
51 | 64 | } | |
52 | 65 | ||
53 | 66 | ||
54 | - | func | |
67 | + | func endedBoostingIds (boostingId) = { | |
55 | 68 | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
56 | 69 | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
57 | - | if (if ((lastHeight != 0)) | |
58 | - | then (lastHeight >= finishHeight) | |
59 | - | else false) | |
60 | - | then [StringEntry("list ended boostings", ((tryGetString("list ended boostings") + boostingId) + ","))] | |
61 | - | else nil | |
70 | + | if ((lastHeight >= finishHeight)) | |
71 | + | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
72 | + | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((tryGetString((("list ongoing boosts " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
62 | 73 | } | |
63 | 74 | ||
64 | 75 | ||
65 | 76 | @Callable(i) | |
66 | - | func addBoosting (poolId,days) = { | |
67 | - | let fullAmount = i.payments[0].amount | |
68 | - | let assetId = getAssetString(i.payments[0].assetId) | |
69 | - | let inv = invoke(this, "findEndedBoosting", nil, nil) | |
70 | - | if ((inv == inv)) | |
71 | - | then { | |
72 | - | let newBoostingsAmount = (tryGetInteger("global_boostingsAmount") + 1) | |
73 | - | let boostingId = toString(newBoostingsAmount) | |
74 | - | if ((addressFromString(poolId) == unit)) | |
75 | - | then throw("incorrect pool address") | |
76 | - | else [IntegerEntry("global_boostingsAmount", newBoostingsAmount), IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), IntegerEntry((("boosting_" + boostingId) + "_blockAmount"), (fullAmount / ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_startHeight"), height), IntegerEntry((("boosting_" + boostingId) + "_finishHeight"), (height + ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_finishTimestamp"), (lastBlock.timestamp + ((((days * hours) * minutes) * 60) * 1000))), IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), StringEntry((("boosting_" + boostingId) + "_assetId"), assetId), StringEntry((("boosting_" + boostingId) + "_owner"), toString(i.caller)), StringEntry((("boosting_" + boostingId) + "_poolId"), poolId), StringEntry((("pool_" + poolId) + "_boostings"), ((tryGetString((("pool_" + poolId) + "_boostings")) + boostingId) + ","))] | |
77 | - | } | |
78 | - | else throw("Strict value is not equal to itself.") | |
79 | - | } | |
77 | + | func addBoosting (poolId,days) = if ((1 > days)) | |
78 | + | then throw("amount of days has to be between 1 and 365") | |
79 | + | else if ((days > 365)) | |
80 | + | then throw("amount of days has to be between 1 and 365") | |
81 | + | else if (false) | |
82 | + | then throw("under maintenance until further notice") | |
83 | + | else { | |
84 | + | let fullAmount = i.payments[0].amount | |
85 | + | if ((1440 > (fullAmount / days))) | |
86 | + | then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset")) | |
87 | + | else { | |
88 | + | let assetId = getAssetString(i.payments[0].assetId) | |
89 | + | if ((height == tryGetInteger("height"))) | |
90 | + | then throw("wait 1 minute") | |
91 | + | else { | |
92 | + | let entry = if ((size(tryGetString((("pool_" + poolId) + "_boostings"))) > 11)) | |
93 | + | then throw("max 5 boosts per pool") | |
94 | + | else invoke(this, "entryEnded", nil, nil) | |
95 | + | if ((entry == entry)) | |
96 | + | then { | |
97 | + | let boostingId = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 112)) | |
98 | + | then throw("wait till other boosts are finished") | |
99 | + | else take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1) | |
100 | + | if ((addressFromString(poolId) == unit)) | |
101 | + | then throw("incorrect pool address") | |
102 | + | else [IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), IntegerEntry((("boosting_" + boostingId) + "_startHeight"), height), IntegerEntry((("boosting_" + boostingId) + "_finishHeight"), (height + ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_finishTimestamp"), (lastBlock.timestamp + ((((days * hours) * minutes) * 60) * 1000))), IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), StringEntry((("boosting_" + boostingId) + "_assetId"), assetId), StringEntry((("boosting_" + boostingId) + "_owner"), toString(i.caller)), StringEntry((("boosting_" + boostingId) + "_poolId"), poolId), StringEntry((("pool_" + poolId) + "_boostings"), ((tryGetString((("pool_" + poolId) + "_boostings")) + boostingId) + ","))] | |
103 | + | } | |
104 | + | else throw("Strict value is not equal to itself.") | |
105 | + | } | |
106 | + | } | |
107 | + | } | |
80 | 108 | ||
81 | 109 | ||
82 | 110 | ||
104 | 132 | ||
105 | 133 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 134 | then $a | |
107 | - | else throw("List size exceeds | |
135 | + | else throw("List size exceeds 56") | |
108 | 136 | ||
109 | - | $f0_2 | |
137 | + | $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($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) | |
110 | 138 | } | |
111 | 139 | if ((payments == payments)) | |
112 | 140 | then nil | |
116 | 144 | ||
117 | 145 | ||
118 | 146 | @Callable(i) | |
119 | - | func | |
147 | + | func endedBoostings (boostingId) = endedBoostingIds(boostingId) | |
120 | 148 | ||
121 | 149 | ||
122 | 150 | ||
123 | 151 | @Callable(i) | |
124 | - | func | |
125 | - | func | |
126 | - | let in = invoke(this, " | |
152 | + | func entryEnded () = { | |
153 | + | func f (accum,next) = { | |
154 | + | let in = invoke(this, "endedBoostings", [next], nil) | |
127 | 155 | if ((in == in)) | |
128 | 156 | then in | |
129 | 157 | else throw("Strict value is not equal to itself.") | |
130 | 158 | } | |
131 | 159 | ||
132 | - | let | |
160 | + | let end = { | |
133 | 161 | let $l = li | |
134 | 162 | let $s = size($l) | |
135 | 163 | let $acc0 = 0 | |
136 | 164 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
137 | 165 | then $a | |
138 | - | else | |
166 | + | else f($a, $l[$i]) | |
139 | 167 | ||
140 | 168 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
141 | 169 | then $a | |
142 | - | else throw("List size exceeds | |
170 | + | else throw("List size exceeds 56") | |
143 | 171 | ||
144 | - | $f0_2 | |
172 | + | $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($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) | |
145 | 173 | } | |
146 | - | if ((ended == ended)) | |
174 | + | if ((end == end)) | |
175 | + | then [IntegerEntry("height", height)] | |
176 | + | else throw("Strict value is not equal to itself.") | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | @Callable(i) | |
182 | + | func deleteEntr (poolId) = [DeleteEntry((("pool_" + poolId) + "_boostings"))] | |
183 | + | ||
184 | + | ||
185 | + | ||
186 | + | @Callable(i) | |
187 | + | func checkStr (boostingId) = { | |
188 | + | let getFinishedPoolId1 = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
189 | + | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId1) + "_boostings")) | |
190 | + | let sizeStr = size(getPoolBoostings) | |
191 | + | if ((indexOf(getPoolBoostings, boostingId) == unit)) | |
147 | 192 | then nil | |
148 | - | else throw("Strict value is not equal to itself.") | |
193 | + | else { | |
194 | + | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
195 | + | let modifierRight = if ((findIndex == 0)) | |
196 | + | then 2 | |
197 | + | else 1 | |
198 | + | let modifierLeft = if ((findIndex == 0)) | |
199 | + | then 0 | |
200 | + | else 1 | |
201 | + | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - ((sizeStr - findIndex) + modifierLeft))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight)))) | |
202 | + | [StringEntry("getFinishedPoolId", getFinishedPoolId1), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight)))), StringEntry((("pool_" + getFinishedPoolId1) + "_boostings"), removeEndedBoostingID)] | |
203 | + | } | |
149 | 204 | } | |
150 | 205 | ||
151 | 206 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let li = ["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 hours = 1 | |
7 | 7 | ||
8 | 8 | let minutes = 10 | |
9 | 9 | ||
10 | 10 | func tryGetInteger (key) = match getInteger(this, key) { | |
11 | 11 | case b: Int => | |
12 | 12 | b | |
13 | 13 | case _ => | |
14 | 14 | 0 | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func tryGetString (key) = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getAssetString (assetId) = match assetId { | |
27 | 27 | case b: ByteVector => | |
28 | 28 | toBase58String(b) | |
29 | 29 | case _ => | |
30 | 30 | "WAVES" | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
35 | 35 | then unit | |
36 | 36 | else fromBase58String(assetIdStr) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func payBoostingResult (boostingId) = { | |
40 | 40 | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
41 | 41 | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
42 | 42 | if (if ((lastHeight != 0)) | |
43 | 43 | then (finishHeight > lastHeight) | |
44 | 44 | else false) | |
45 | 45 | then { | |
46 | - | let blockReward = tryGetInteger((("boosting_" + boostingId) + "_blockAmount")) | |
47 | - | let toPay = ((min([finishHeight, height]) - lastHeight) * blockReward) | |
48 | - | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId"))))] | |
46 | + | let blockReward = (tryGetInteger((("boosting_" + boostingId) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
47 | + | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 1) | |
48 | + | let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
49 | + | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId) + "_boostings")) | |
50 | + | let sizeStr = size(getPoolBoostings) | |
51 | + | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
52 | + | let modifierLeft = if ((findIndex == 0)) | |
53 | + | then 0 | |
54 | + | else 1 | |
55 | + | let modifierRight = if ((findIndex == 0)) | |
56 | + | then 2 | |
57 | + | else 1 | |
58 | + | let leftStr = take(getPoolBoostings, (sizeStr - ((sizeStr - findIndex) + modifierLeft))) | |
59 | + | let rightStr = takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight))) | |
60 | + | let openBoostingsIds = (leftStr + rightStr) | |
61 | + | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId")))), StringEntry("getFinishedPoolId", getFinishedPoolId), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", leftStr), StringEntry("right string", rightStr), StringEntry("openBoostingsIds", openBoostingsIds)] | |
49 | 62 | } | |
50 | 63 | else nil | |
51 | 64 | } | |
52 | 65 | ||
53 | 66 | ||
54 | - | func | |
67 | + | func endedBoostingIds (boostingId) = { | |
55 | 68 | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
56 | 69 | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
57 | - | if (if ((lastHeight != 0)) | |
58 | - | then (lastHeight >= finishHeight) | |
59 | - | else false) | |
60 | - | then [StringEntry("list ended boostings", ((tryGetString("list ended boostings") + boostingId) + ","))] | |
61 | - | else nil | |
70 | + | if ((lastHeight >= finishHeight)) | |
71 | + | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
72 | + | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((tryGetString((("list ongoing boosts " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
62 | 73 | } | |
63 | 74 | ||
64 | 75 | ||
65 | 76 | @Callable(i) | |
66 | - | func addBoosting (poolId,days) = { | |
67 | - | let fullAmount = i.payments[0].amount | |
68 | - | let assetId = getAssetString(i.payments[0].assetId) | |
69 | - | let inv = invoke(this, "findEndedBoosting", nil, nil) | |
70 | - | if ((inv == inv)) | |
71 | - | then { | |
72 | - | let newBoostingsAmount = (tryGetInteger("global_boostingsAmount") + 1) | |
73 | - | let boostingId = toString(newBoostingsAmount) | |
74 | - | if ((addressFromString(poolId) == unit)) | |
75 | - | then throw("incorrect pool address") | |
76 | - | else [IntegerEntry("global_boostingsAmount", newBoostingsAmount), IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), IntegerEntry((("boosting_" + boostingId) + "_blockAmount"), (fullAmount / ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_startHeight"), height), IntegerEntry((("boosting_" + boostingId) + "_finishHeight"), (height + ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_finishTimestamp"), (lastBlock.timestamp + ((((days * hours) * minutes) * 60) * 1000))), IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), StringEntry((("boosting_" + boostingId) + "_assetId"), assetId), StringEntry((("boosting_" + boostingId) + "_owner"), toString(i.caller)), StringEntry((("boosting_" + boostingId) + "_poolId"), poolId), StringEntry((("pool_" + poolId) + "_boostings"), ((tryGetString((("pool_" + poolId) + "_boostings")) + boostingId) + ","))] | |
77 | - | } | |
78 | - | else throw("Strict value is not equal to itself.") | |
79 | - | } | |
77 | + | func addBoosting (poolId,days) = if ((1 > days)) | |
78 | + | then throw("amount of days has to be between 1 and 365") | |
79 | + | else if ((days > 365)) | |
80 | + | then throw("amount of days has to be between 1 and 365") | |
81 | + | else if (false) | |
82 | + | then throw("under maintenance until further notice") | |
83 | + | else { | |
84 | + | let fullAmount = i.payments[0].amount | |
85 | + | if ((1440 > (fullAmount / days))) | |
86 | + | then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset")) | |
87 | + | else { | |
88 | + | let assetId = getAssetString(i.payments[0].assetId) | |
89 | + | if ((height == tryGetInteger("height"))) | |
90 | + | then throw("wait 1 minute") | |
91 | + | else { | |
92 | + | let entry = if ((size(tryGetString((("pool_" + poolId) + "_boostings"))) > 11)) | |
93 | + | then throw("max 5 boosts per pool") | |
94 | + | else invoke(this, "entryEnded", nil, nil) | |
95 | + | if ((entry == entry)) | |
96 | + | then { | |
97 | + | let boostingId = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 112)) | |
98 | + | then throw("wait till other boosts are finished") | |
99 | + | else take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1) | |
100 | + | if ((addressFromString(poolId) == unit)) | |
101 | + | then throw("incorrect pool address") | |
102 | + | else [IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), IntegerEntry((("boosting_" + boostingId) + "_startHeight"), height), IntegerEntry((("boosting_" + boostingId) + "_finishHeight"), (height + ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_finishTimestamp"), (lastBlock.timestamp + ((((days * hours) * minutes) * 60) * 1000))), IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), StringEntry((("boosting_" + boostingId) + "_assetId"), assetId), StringEntry((("boosting_" + boostingId) + "_owner"), toString(i.caller)), StringEntry((("boosting_" + boostingId) + "_poolId"), poolId), StringEntry((("pool_" + poolId) + "_boostings"), ((tryGetString((("pool_" + poolId) + "_boostings")) + boostingId) + ","))] | |
103 | + | } | |
104 | + | else throw("Strict value is not equal to itself.") | |
105 | + | } | |
106 | + | } | |
107 | + | } | |
80 | 108 | ||
81 | 109 | ||
82 | 110 | ||
83 | 111 | @Callable(i) | |
84 | 112 | func payBoosting (boostingId) = payBoostingResult(boostingId) | |
85 | 113 | ||
86 | 114 | ||
87 | 115 | ||
88 | 116 | @Callable(i) | |
89 | 117 | func payBoostings () = { | |
90 | 118 | func f (accum,next) = { | |
91 | 119 | let in = invoke(this, "payBoosting", [next], nil) | |
92 | 120 | if ((in == in)) | |
93 | 121 | then in | |
94 | 122 | else throw("Strict value is not equal to itself.") | |
95 | 123 | } | |
96 | 124 | ||
97 | 125 | let payments = { | |
98 | 126 | let $l = li | |
99 | 127 | let $s = size($l) | |
100 | 128 | let $acc0 = 0 | |
101 | 129 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 130 | then $a | |
103 | 131 | else f($a, $l[$i]) | |
104 | 132 | ||
105 | 133 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 134 | then $a | |
107 | - | else throw("List size exceeds | |
135 | + | else throw("List size exceeds 56") | |
108 | 136 | ||
109 | - | $f0_2 | |
137 | + | $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($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) | |
110 | 138 | } | |
111 | 139 | if ((payments == payments)) | |
112 | 140 | then nil | |
113 | 141 | else throw("Strict value is not equal to itself.") | |
114 | 142 | } | |
115 | 143 | ||
116 | 144 | ||
117 | 145 | ||
118 | 146 | @Callable(i) | |
119 | - | func | |
147 | + | func endedBoostings (boostingId) = endedBoostingIds(boostingId) | |
120 | 148 | ||
121 | 149 | ||
122 | 150 | ||
123 | 151 | @Callable(i) | |
124 | - | func | |
125 | - | func | |
126 | - | let in = invoke(this, " | |
152 | + | func entryEnded () = { | |
153 | + | func f (accum,next) = { | |
154 | + | let in = invoke(this, "endedBoostings", [next], nil) | |
127 | 155 | if ((in == in)) | |
128 | 156 | then in | |
129 | 157 | else throw("Strict value is not equal to itself.") | |
130 | 158 | } | |
131 | 159 | ||
132 | - | let | |
160 | + | let end = { | |
133 | 161 | let $l = li | |
134 | 162 | let $s = size($l) | |
135 | 163 | let $acc0 = 0 | |
136 | 164 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
137 | 165 | then $a | |
138 | - | else | |
166 | + | else f($a, $l[$i]) | |
139 | 167 | ||
140 | 168 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
141 | 169 | then $a | |
142 | - | else throw("List size exceeds | |
170 | + | else throw("List size exceeds 56") | |
143 | 171 | ||
144 | - | $f0_2 | |
172 | + | $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($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) | |
145 | 173 | } | |
146 | - | if ((ended == ended)) | |
174 | + | if ((end == end)) | |
175 | + | then [IntegerEntry("height", height)] | |
176 | + | else throw("Strict value is not equal to itself.") | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | @Callable(i) | |
182 | + | func deleteEntr (poolId) = [DeleteEntry((("pool_" + poolId) + "_boostings"))] | |
183 | + | ||
184 | + | ||
185 | + | ||
186 | + | @Callable(i) | |
187 | + | func checkStr (boostingId) = { | |
188 | + | let getFinishedPoolId1 = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
189 | + | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId1) + "_boostings")) | |
190 | + | let sizeStr = size(getPoolBoostings) | |
191 | + | if ((indexOf(getPoolBoostings, boostingId) == unit)) | |
147 | 192 | then nil | |
148 | - | else throw("Strict value is not equal to itself.") | |
193 | + | else { | |
194 | + | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
195 | + | let modifierRight = if ((findIndex == 0)) | |
196 | + | then 2 | |
197 | + | else 1 | |
198 | + | let modifierLeft = if ((findIndex == 0)) | |
199 | + | then 0 | |
200 | + | else 1 | |
201 | + | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - ((sizeStr - findIndex) + modifierLeft))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight)))) | |
202 | + | [StringEntry("getFinishedPoolId", getFinishedPoolId1), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + modifierRight)))), StringEntry((("pool_" + getFinishedPoolId1) + "_boostings"), removeEndedBoostingID)] | |
203 | + | } | |
149 | 204 | } | |
150 | 205 | ||
151 | 206 |
github/deemru/w8io/026f985 85.73 ms ◑