tx · HhKNyXaTEfB9NFUSwjYCwTkFkx1F9pTvVgiKFeQ6dYht 3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP: -0.01900000 Waves 2023.06.22 12:30 [2633664] smart account 3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP > SELF 0.00000000 Waves
{ "type": 13, "id": "HhKNyXaTEfB9NFUSwjYCwTkFkx1F9pTvVgiKFeQ6dYht", "fee": 1900000, "feeAssetId": null, "timestamp": 1687426281608, "version": 2, "chainId": 84, "sender": "3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP", "senderPublicKey": "AoKo4segKHU4DeJnxXQYJj2u7J6XJeux6r8KLW52cd2Q", "proofs": [ "4CT3v2zqAS6ViczAr78Y7XNaHtka7ZZ1DJuRMWrh8MbxBpgSZGRQWEv6Z95NxcZGEq5w66bgfBygsUbuEiChaz6P" ], "script": "base64:BwIrCAISAwoBAhIHCgUCAQEBARIDCgECEgMKAQISBAoCAgISBAoCAgISAwoBAikAA1NFUAICX18ADUNPTlRSQUNUX05BTUUCD2NhbGN1bGF0b3IucmlkZQAGU0NBTEU4AIDC1y8AB1BFTkRJTkcCB1BFTkRJTkcACEZJTklTSEVEAghGSU5JU0hFRAAFV0FWRVMCBVdBVkVTAA13YXZlc0RlY2ltYWxzAAgAC3h0bkRlY2ltYWxzAAYBB3dyYXBFcnIBAXMJAKwCAgkArAICBQ1DT05UUkFDVF9OQU1FAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD2Fzc2V0SWRUb1N0cmluZwEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDYBAEFAWIDCQABAgUHJG1hdGNoMAIEVW5pdAUFV0FWRVMJAAIBAgtNYXRjaCBlcnJvcgEDYWJzAQFuAwkAZgIAAAUBbgkBAS0BBQFuBQFuARFrZXlGYWN0b3J5QWRkcmV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WdlckVudHJ5CQDMCAIJARVrZXlOZXh0QmxvY2tUb1Byb2Nlc3MACQDMCAIJAGQCBRJuZXh0QmxvY2tUb1Byb2Nlc3MFGWJsb2Nrc1Byb2Nlc3NpbmdCYXRjaFNpemUFA25pbAUDbmlsBQNuaWwDCQAAAgUHYWN0aW9ucwUHYWN0aW9ucwkAlAoCBQNuaWwFBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5GV7SCg==", "height": 2633664, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BrRNVGS6tk4V9Ri3MbwPXjBDSpewSt9dohMQPrcWqqvq Next: 7ZnmG9nsCR5qWzhQqeoZZSTe3kBgc8DbjD3uaYPyc9fA Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | let FINISHED = "FINISHED" | |
13 | 13 | ||
14 | 14 | let WAVES = "WAVES" | |
15 | + | ||
16 | + | let wavesDecimals = 8 | |
17 | + | ||
18 | + | let xtnDecimals = 6 | |
15 | 19 | ||
16 | 20 | func wrapErr (s) = ((CONTRACT_NAME + ": ") + s) | |
17 | 21 | ||
184 | 188 | ||
185 | 189 | func rewardForOption (rewards,target) = { | |
186 | 190 | let s = size(rewards) | |
187 | - | let $ | |
188 | - | let a0 = $ | |
189 | - | let r0 = $ | |
190 | - | let $ | |
191 | - | let a1 = $ | |
192 | - | let r1 = $ | |
193 | - | let $ | |
194 | - | let a2 = $ | |
195 | - | let r2 = $ | |
191 | + | let $t041154140 = rewards[0] | |
192 | + | let a0 = $t041154140._1 | |
193 | + | let r0 = $t041154140._2 | |
194 | + | let $t041434168 = rewards[1] | |
195 | + | let a1 = $t041434168._1 | |
196 | + | let r1 = $t041434168._2 | |
197 | + | let $t041714196 = rewards[2] | |
198 | + | let a2 = $t041714196._1 | |
199 | + | let r2 = $t041714196._2 | |
196 | 200 | if (if ((s > 0)) | |
197 | 201 | then (a0 == target) | |
198 | 202 | else false) | |
259 | 263 | then { | |
260 | 264 | let investedXtnAmount = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(xtnAssetIdOrFail)), 0) | |
261 | 265 | let investedWavesAmount = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
262 | - | let investedXtnAmountInWaves = fraction(investedXtnAmount, xtnPrice, SCALE8) | |
266 | + | let investedXtnAmountInWaves = fraction(investedXtnAmount, (xtnPrice * wavesDecimals), (SCALE8 * xtnDecimals)) | |
263 | 267 | let currentTreasuryVolumeInWaves = (investedXtnAmountInWaves + investedWavesAmount) | |
264 | 268 | let profitRaw = (newTreasuryVolumeInWaves - currentTreasuryVolumeInWaves) | |
265 | 269 | let pwrManagersBonusAmount = if ((profitRaw > 0)) | |
281 | 285 | let donationProfitPart = ((donationProfitPartRaw - amountToInvestment) + amountToDonation) | |
282 | 286 | let investmentProfitPart = ((investmentProfitPartRaw - amountToDonation) + amountToInvestment) | |
283 | 287 | let investedWavesAmountNew = (investedWavesAmount + investmentProfitPart) | |
284 | - | let investedXtnAmountNew = fraction((investedXtnAmountInWaves + donationProfitPart), SCALE8, xtnPrice) | |
288 | + | let investedXtnAmountNew = fraction((investedXtnAmountInWaves + donationProfitPart), (SCALE8 * xtnDecimals), (xtnPrice * wavesDecimals)) | |
285 | 289 | let newPeriod = (currentPeriodOrFail + 1) | |
286 | 290 | let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity | |
287 | 291 | let newPrice = fraction(investedWavesAmountNew, SCALE8, lpAssetQuantity) | |
373 | 377 | let userAddress = Address(userAddressBytes) | |
374 | 378 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
375 | 379 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
376 | - | let $ | |
377 | - | let status = $ | |
378 | - | let lpAssetAmount = $ | |
379 | - | let targetPeriod = $ | |
380 | - | let claimTxId = $ | |
380 | + | let $t01307413187 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
381 | + | let status = $t01307413187._1 | |
382 | + | let lpAssetAmount = $t01307413187._2 | |
383 | + | let targetPeriod = $t01307413187._3 | |
384 | + | let claimTxId = $t01307413187._4 | |
381 | 385 | let checks = [if ((status == PENDING)) | |
382 | 386 | then true | |
383 | 387 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
408 | 412 | let userAddress = Address(userAddressBytes) | |
409 | 413 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
410 | 414 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
411 | - | let $ | |
412 | - | let status = $ | |
413 | - | let lpAssetAmount = $ | |
414 | - | let targetPeriod = $ | |
415 | - | let claimTxId = $ | |
415 | + | let $t01451914632 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
416 | + | let status = $t01451914632._1 | |
417 | + | let lpAssetAmount = $t01451914632._2 | |
418 | + | let targetPeriod = $t01451914632._3 | |
419 | + | let claimTxId = $t01451914632._4 | |
416 | 420 | if ((status == FINISHED)) | |
417 | 421 | then throwErr("invalid withdrawal request status") | |
418 | 422 | else if ((targetPeriod > currentPeriodOrFail)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let CONTRACT_NAME = "calculator.ride" | |
7 | 7 | ||
8 | 8 | let SCALE8 = 100000000 | |
9 | 9 | ||
10 | 10 | let PENDING = "PENDING" | |
11 | 11 | ||
12 | 12 | let FINISHED = "FINISHED" | |
13 | 13 | ||
14 | 14 | let WAVES = "WAVES" | |
15 | + | ||
16 | + | let wavesDecimals = 8 | |
17 | + | ||
18 | + | let xtnDecimals = 6 | |
15 | 19 | ||
16 | 20 | func wrapErr (s) = ((CONTRACT_NAME + ": ") + s) | |
17 | 21 | ||
18 | 22 | ||
19 | 23 | func throwErr (s) = throw(wrapErr(s)) | |
20 | 24 | ||
21 | 25 | ||
22 | 26 | func assetIdToString (assetId) = match assetId { | |
23 | 27 | case b: ByteVector => | |
24 | 28 | toBase58String(b) | |
25 | 29 | case _: Unit => | |
26 | 30 | WAVES | |
27 | 31 | case _ => | |
28 | 32 | throw("Match error") | |
29 | 33 | } | |
30 | 34 | ||
31 | 35 | ||
32 | 36 | func abs (n) = if ((0 > n)) | |
33 | 37 | then -(n) | |
34 | 38 | else n | |
35 | 39 | ||
36 | 40 | ||
37 | 41 | func keyFactoryAddress () = makeString(["%s", "factory"], SEP) | |
38 | 42 | ||
39 | 43 | ||
40 | 44 | func keyLpAssetId () = makeString(["%s", "lpAssetId"], SEP) | |
41 | 45 | ||
42 | 46 | ||
43 | 47 | func keyXtnAssetId () = makeString(["%s", "xtnAssetId"], SEP) | |
44 | 48 | ||
45 | 49 | ||
46 | 50 | func keyTreasuryAddress () = makeString(["%s", "treasury"], SEP) | |
47 | 51 | ||
48 | 52 | ||
49 | 53 | func keyInvested (assetId) = makeString(["%s%s", "invested", assetIdToString(assetId)], SEP) | |
50 | 54 | ||
51 | 55 | ||
52 | 56 | func keyAvailable (userAddress) = makeString(["%s%s", "available", toString(userAddress)], SEP) | |
53 | 57 | ||
54 | 58 | ||
55 | 59 | func keyClaimed (userAddress) = makeString(["%s%s", "claimed", toString(userAddress)], SEP) | |
56 | 60 | ||
57 | 61 | ||
58 | 62 | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
59 | 63 | ||
60 | 64 | ||
61 | 65 | func keyPriceForPeriod (period) = makeString(["%s%d", "price", toString(period)], SEP) | |
62 | 66 | ||
63 | 67 | ||
64 | 68 | func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP) | |
65 | 69 | ||
66 | 70 | ||
67 | 71 | func keyPeriodLength () = "%s__periodLength" | |
68 | 72 | ||
69 | 73 | ||
70 | 74 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
71 | 75 | ||
72 | 76 | ||
73 | 77 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
74 | 78 | ||
75 | 79 | ||
76 | 80 | func keyBlockProcessed (height) = makeString(["%s%d", "blockProcessed", toString(height)], SEP) | |
77 | 81 | ||
78 | 82 | ||
79 | 83 | func keyWithdrawal () = "%s__withdrawal" | |
80 | 84 | ||
81 | 85 | ||
82 | 86 | func keyWithdrawalRequest (userAddress,txId) = makeString(["%s%s%s", "withdrawal", toString(userAddress), toBase58String(txId)], SEP) | |
83 | 87 | ||
84 | 88 | ||
85 | 89 | func valueWithdrawalRequest (status,lpAssetAmount,targetPeriod,claimTxId) = { | |
86 | 90 | let claimTxIdStr = match claimTxId { | |
87 | 91 | case b: ByteVector => | |
88 | 92 | toBase58String(b) | |
89 | 93 | case _: Unit => | |
90 | 94 | "SOON" | |
91 | 95 | case _ => | |
92 | 96 | throw("Match error") | |
93 | 97 | } | |
94 | 98 | makeString(["%s%d%d%s", status, toString(lpAssetAmount), toString(targetPeriod), claimTxIdStr], SEP) | |
95 | 99 | } | |
96 | 100 | ||
97 | 101 | ||
98 | 102 | func parseWithdrawalRequestValueOrFail (s) = { | |
99 | 103 | let parts = split(s, SEP) | |
100 | 104 | if ((size(parts) == 5)) | |
101 | 105 | then { | |
102 | 106 | let status = parts[1] | |
103 | 107 | let lpAssetAmount = valueOrErrorMessage(parseInt(parts[2]), wrapErr("invalid lpAssetAmount")) | |
104 | 108 | let targetPeriod = valueOrErrorMessage(parseInt(parts[3]), wrapErr("invalid targetPeriod")) | |
105 | 109 | let claimTxId = parts[4] | |
106 | 110 | $Tuple4(status, lpAssetAmount, targetPeriod, claimTxId) | |
107 | 111 | } | |
108 | 112 | else throwErr("invalid withdrawal request value") | |
109 | 113 | } | |
110 | 114 | ||
111 | 115 | ||
112 | 116 | let factoryAddressOption = match getString(this, keyFactoryAddress()) { | |
113 | 117 | case s: String => | |
114 | 118 | addressFromString(s) | |
115 | 119 | case _: Unit => | |
116 | 120 | unit | |
117 | 121 | case _ => | |
118 | 122 | throw("Match error") | |
119 | 123 | } | |
120 | 124 | ||
121 | 125 | let factoryAddressOrFail = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
122 | 126 | ||
123 | 127 | let lpAssetIdOption = match factoryAddressOption { | |
124 | 128 | case a: Address => | |
125 | 129 | match getString(a, keyLpAssetId()) { | |
126 | 130 | case s: String => | |
127 | 131 | fromBase58String(s) | |
128 | 132 | case _: Unit => | |
129 | 133 | unit | |
130 | 134 | case _ => | |
131 | 135 | throw("Match error") | |
132 | 136 | } | |
133 | 137 | case _: Unit => | |
134 | 138 | unit | |
135 | 139 | case _ => | |
136 | 140 | throw("Match error") | |
137 | 141 | } | |
138 | 142 | ||
139 | 143 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
140 | 144 | ||
141 | 145 | let xtnAssetIdOption = match factoryAddressOption { | |
142 | 146 | case a: Address => | |
143 | 147 | match getString(a, keyXtnAssetId()) { | |
144 | 148 | case s: String => | |
145 | 149 | fromBase58String(s) | |
146 | 150 | case _: Unit => | |
147 | 151 | unit | |
148 | 152 | case _ => | |
149 | 153 | throw("Match error") | |
150 | 154 | } | |
151 | 155 | case _: Unit => | |
152 | 156 | unit | |
153 | 157 | case _ => | |
154 | 158 | throw("Match error") | |
155 | 159 | } | |
156 | 160 | ||
157 | 161 | let xtnAssetIdOrFail = valueOrErrorMessage(xtnAssetIdOption, wrapErr("invalid xtnAssetId")) | |
158 | 162 | ||
159 | 163 | let treasuryAddressOption = match factoryAddressOption { | |
160 | 164 | case a: Address => | |
161 | 165 | match getString(a, keyTreasuryAddress()) { | |
162 | 166 | case s: String => | |
163 | 167 | addressFromString(s) | |
164 | 168 | case _: Unit => | |
165 | 169 | unit | |
166 | 170 | case _ => | |
167 | 171 | throw("Match error") | |
168 | 172 | } | |
169 | 173 | case _: Unit => | |
170 | 174 | unit | |
171 | 175 | case _ => | |
172 | 176 | throw("Match error") | |
173 | 177 | } | |
174 | 178 | ||
175 | 179 | let treasuryAddressOrFail = valueOrErrorMessage(treasuryAddressOption, wrapErr("invalid treasury address")) | |
176 | 180 | ||
177 | 181 | func onlyAddress (i,address) = if ((i.caller == address)) | |
178 | 182 | then true | |
179 | 183 | else throwErr("permission denied") | |
180 | 184 | ||
181 | 185 | ||
182 | 186 | func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail) | |
183 | 187 | ||
184 | 188 | ||
185 | 189 | func rewardForOption (rewards,target) = { | |
186 | 190 | let s = size(rewards) | |
187 | - | let $ | |
188 | - | let a0 = $ | |
189 | - | let r0 = $ | |
190 | - | let $ | |
191 | - | let a1 = $ | |
192 | - | let r1 = $ | |
193 | - | let $ | |
194 | - | let a2 = $ | |
195 | - | let r2 = $ | |
191 | + | let $t041154140 = rewards[0] | |
192 | + | let a0 = $t041154140._1 | |
193 | + | let r0 = $t041154140._2 | |
194 | + | let $t041434168 = rewards[1] | |
195 | + | let a1 = $t041434168._1 | |
196 | + | let r1 = $t041434168._2 | |
197 | + | let $t041714196 = rewards[2] | |
198 | + | let a2 = $t041714196._1 | |
199 | + | let r2 = $t041714196._2 | |
196 | 200 | if (if ((s > 0)) | |
197 | 201 | then (a0 == target) | |
198 | 202 | else false) | |
199 | 203 | then r0 | |
200 | 204 | else if (if ((s > 1)) | |
201 | 205 | then (a1 == target) | |
202 | 206 | else false) | |
203 | 207 | then r1 | |
204 | 208 | else if (if ((s > 2)) | |
205 | 209 | then (a2 == target) | |
206 | 210 | else false) | |
207 | 211 | then r2 | |
208 | 212 | else unit | |
209 | 213 | } | |
210 | 214 | ||
211 | 215 | ||
212 | 216 | @Callable(i) | |
213 | 217 | func claimLP (userAddressBytes) = { | |
214 | 218 | let checkCaller = onlyFactory(i) | |
215 | 219 | if ((checkCaller == checkCaller)) | |
216 | 220 | then { | |
217 | 221 | let userAddress = Address(userAddressBytes) | |
218 | 222 | let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(userAddress)), 0) | |
219 | 223 | let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0) | |
220 | 224 | let factoryActions = if ((available > 0)) | |
221 | 225 | then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyClaimed(userAddress), (claimed + available)], nil)] | |
222 | 226 | else throwErr("nothing to claim") | |
223 | 227 | $Tuple2(nil, factoryActions) | |
224 | 228 | } | |
225 | 229 | else throw("Strict value is not equal to itself.") | |
226 | 230 | } | |
227 | 231 | ||
228 | 232 | ||
229 | 233 | ||
230 | 234 | @Callable(i) | |
231 | 235 | func finalize (userAddressBytes,newTreasuryVolumeInWaves,xtnPrice,pwrManagersBonus,treasuryVolumeDiffAllocationCoef) = { | |
232 | 236 | let checkCaller = onlyFactory(i) | |
233 | 237 | if ((checkCaller == checkCaller)) | |
234 | 238 | then { | |
235 | 239 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
236 | 240 | let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length")) | |
237 | 241 | let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height")) | |
238 | 242 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
239 | 243 | let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process")) | |
240 | 244 | let periodEndHeight = ((currentStartHeight + periodLength) - 1) | |
241 | 245 | let checks = [if ((i.originCaller == treasuryAddressOrFail)) | |
242 | 246 | then true | |
243 | 247 | else throwErr("permission denied"), if ((nextBlockToProcess > periodEndHeight)) | |
244 | 248 | then true | |
245 | 249 | else throwErr("unprocessed blocks"), if ((newTreasuryVolumeInWaves >= 0)) | |
246 | 250 | then true | |
247 | 251 | else throwErr("invalid new treasury volume"), if ((xtnPrice >= 0)) | |
248 | 252 | then true | |
249 | 253 | else throwErr("invalid XTN price"), if (if ((pwrManagersBonus >= 0)) | |
250 | 254 | then (SCALE8 >= pwrManagersBonus) | |
251 | 255 | else false) | |
252 | 256 | then true | |
253 | 257 | else throwErr("invalid PWR managers bonus"), if (if ((treasuryVolumeDiffAllocationCoef >= -(SCALE8))) | |
254 | 258 | then (SCALE8 >= treasuryVolumeDiffAllocationCoef) | |
255 | 259 | else false) | |
256 | 260 | then true | |
257 | 261 | else throwErr("invalid treasury volume diff allocation coefficient")] | |
258 | 262 | if ((checks == checks)) | |
259 | 263 | then { | |
260 | 264 | let investedXtnAmount = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(xtnAssetIdOrFail)), 0) | |
261 | 265 | let investedWavesAmount = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
262 | - | let investedXtnAmountInWaves = fraction(investedXtnAmount, xtnPrice, SCALE8) | |
266 | + | let investedXtnAmountInWaves = fraction(investedXtnAmount, (xtnPrice * wavesDecimals), (SCALE8 * xtnDecimals)) | |
263 | 267 | let currentTreasuryVolumeInWaves = (investedXtnAmountInWaves + investedWavesAmount) | |
264 | 268 | let profitRaw = (newTreasuryVolumeInWaves - currentTreasuryVolumeInWaves) | |
265 | 269 | let pwrManagersBonusAmount = if ((profitRaw > 0)) | |
266 | 270 | then fraction(profitRaw, pwrManagersBonus, SCALE8) | |
267 | 271 | else 0 | |
268 | 272 | let profit = (profitRaw - pwrManagersBonusAmount) | |
269 | 273 | let donationPart = if ((currentTreasuryVolumeInWaves > 0)) | |
270 | 274 | then fraction(investedXtnAmountInWaves, SCALE8, currentTreasuryVolumeInWaves) | |
271 | 275 | else 0 | |
272 | 276 | let donationProfitPartRaw = fraction(profit, donationPart, SCALE8) | |
273 | 277 | let investmentProfitPartRaw = (profit - donationProfitPartRaw) | |
274 | 278 | let treasuryVolumeDiffAllocationCoefAbs = abs(treasuryVolumeDiffAllocationCoef) | |
275 | 279 | let amountToDonation = fraction(investmentProfitPartRaw, if ((0 > treasuryVolumeDiffAllocationCoef)) | |
276 | 280 | then treasuryVolumeDiffAllocationCoefAbs | |
277 | 281 | else 0, SCALE8) | |
278 | 282 | let amountToInvestment = fraction(donationProfitPartRaw, if ((treasuryVolumeDiffAllocationCoef > 0)) | |
279 | 283 | then treasuryVolumeDiffAllocationCoefAbs | |
280 | 284 | else 0, SCALE8) | |
281 | 285 | let donationProfitPart = ((donationProfitPartRaw - amountToInvestment) + amountToDonation) | |
282 | 286 | let investmentProfitPart = ((investmentProfitPartRaw - amountToDonation) + amountToInvestment) | |
283 | 287 | let investedWavesAmountNew = (investedWavesAmount + investmentProfitPart) | |
284 | - | let investedXtnAmountNew = fraction((investedXtnAmountInWaves + donationProfitPart), SCALE8, xtnPrice) | |
288 | + | let investedXtnAmountNew = fraction((investedXtnAmountInWaves + donationProfitPart), (SCALE8 * xtnDecimals), (xtnPrice * wavesDecimals)) | |
285 | 289 | let newPeriod = (currentPeriodOrFail + 1) | |
286 | 290 | let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity | |
287 | 291 | let newPrice = fraction(investedWavesAmountNew, SCALE8, lpAssetQuantity) | |
288 | 292 | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
289 | 293 | let paymentAmountMin = fraction(lpAssetAmountToBurn, newPrice, SCALE8) | |
290 | 294 | let checkPaymentAmount = if (if ((paymentAmountMin == 0)) | |
291 | 295 | then true | |
292 | 296 | else if (if ((size(i.payments) == 1)) | |
293 | 297 | then (i.payments[0].assetId == unit) | |
294 | 298 | else false) | |
295 | 299 | then (i.payments[0].amount >= paymentAmountMin) | |
296 | 300 | else false) | |
297 | 301 | then true | |
298 | 302 | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
299 | 303 | if ((checkPaymentAmount == checkPaymentAmount)) | |
300 | 304 | then { | |
301 | 305 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "integerEntry", [keyStartHeight(newPeriod), (periodEndHeight + 1)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), 0], nil)] | |
302 | 306 | $Tuple2(nil, factoryActions) | |
303 | 307 | } | |
304 | 308 | else throw("Strict value is not equal to itself.") | |
305 | 309 | } | |
306 | 310 | else throw("Strict value is not equal to itself.") | |
307 | 311 | } | |
308 | 312 | else throw("Strict value is not equal to itself.") | |
309 | 313 | } | |
310 | 314 | ||
311 | 315 | ||
312 | 316 | ||
313 | 317 | @Callable(i) | |
314 | 318 | func invest (userAddressBytes) = { | |
315 | 319 | let checkCaller = onlyFactory(i) | |
316 | 320 | if ((checkCaller == checkCaller)) | |
317 | 321 | then { | |
318 | 322 | let userAddress = Address(userAddressBytes) | |
319 | 323 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
320 | 324 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
321 | 325 | let payment = if ((size(i.payments) == 1)) | |
322 | 326 | then i.payments[0] | |
323 | 327 | else throwErr("invalid payments") | |
324 | 328 | let paymentAmount = if (if ((payment.assetId == unit)) | |
325 | 329 | then (payment.amount > 0) | |
326 | 330 | else false) | |
327 | 331 | then payment.amount | |
328 | 332 | else throwErr("invalid payment amount") | |
329 | 333 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
330 | 334 | then fraction(paymentAmount, SCALE8, currentPriceOrFail) | |
331 | 335 | else 0 | |
332 | 336 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
333 | 337 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + paymentAmount)], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "transferWaves", [treasuryAddressOrFail.bytes, paymentAmount], [AttachedPayment(unit, paymentAmount)])] | |
334 | 338 | $Tuple2(nil, factoryActions) | |
335 | 339 | } | |
336 | 340 | else throw("Strict value is not equal to itself.") | |
337 | 341 | } | |
338 | 342 | ||
339 | 343 | ||
340 | 344 | ||
341 | 345 | @Callable(i) | |
342 | 346 | func withdraw (userAddressBytes) = { | |
343 | 347 | let checkCaller = onlyFactory(i) | |
344 | 348 | if ((checkCaller == checkCaller)) | |
345 | 349 | then { | |
346 | 350 | let userAddress = Address(userAddressBytes) | |
347 | 351 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
348 | 352 | let payment = if ((size(i.payments) == 1)) | |
349 | 353 | then i.payments[0] | |
350 | 354 | else throwErr(wrapErr("invalid payments")) | |
351 | 355 | let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail)) | |
352 | 356 | then lpAssetIdOrFail | |
353 | 357 | else throwErr("invalid payment asset") | |
354 | 358 | let paymentAmount = if ((payment.amount > 0)) | |
355 | 359 | then payment.amount | |
356 | 360 | else throwErr("invalid payment amount") | |
357 | 361 | let withdrawal = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
358 | 362 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), (withdrawal + paymentAmount)], nil), invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)] | |
359 | 363 | if ((factoryActions == factoryActions)) | |
360 | 364 | then $Tuple2([ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)], factoryActions) | |
361 | 365 | else throw("Strict value is not equal to itself.") | |
362 | 366 | } | |
363 | 367 | else throw("Strict value is not equal to itself.") | |
364 | 368 | } | |
365 | 369 | ||
366 | 370 | ||
367 | 371 | ||
368 | 372 | @Callable(i) | |
369 | 373 | func cancelWithdraw (userAddressBytes,txId) = { | |
370 | 374 | let checkCaller = onlyFactory(i) | |
371 | 375 | if ((checkCaller == checkCaller)) | |
372 | 376 | then { | |
373 | 377 | let userAddress = Address(userAddressBytes) | |
374 | 378 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
375 | 379 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
376 | - | let $ | |
377 | - | let status = $ | |
378 | - | let lpAssetAmount = $ | |
379 | - | let targetPeriod = $ | |
380 | - | let claimTxId = $ | |
380 | + | let $t01307413187 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
381 | + | let status = $t01307413187._1 | |
382 | + | let lpAssetAmount = $t01307413187._2 | |
383 | + | let targetPeriod = $t01307413187._3 | |
384 | + | let claimTxId = $t01307413187._4 | |
381 | 385 | let checks = [if ((status == PENDING)) | |
382 | 386 | then true | |
383 | 387 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
384 | 388 | then true | |
385 | 389 | else throwErr("invalid withdrawal request period")] | |
386 | 390 | if ((checks == checks)) | |
387 | 391 | then { | |
388 | 392 | let withdrawal = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyWithdrawal()), wrapErr("invalid total withdrawal amount")) | |
389 | 393 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), if ((withdrawal >= lpAssetAmount)) | |
390 | 394 | then (withdrawal - lpAssetAmount) | |
391 | 395 | else throwErr("invalid withdrawal amount")], nil), invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, txId)], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)] | |
392 | 396 | if ((factoryActions == factoryActions)) | |
393 | 397 | then $Tuple2(nil, factoryActions) | |
394 | 398 | else throw("Strict value is not equal to itself.") | |
395 | 399 | } | |
396 | 400 | else throw("Strict value is not equal to itself.") | |
397 | 401 | } | |
398 | 402 | else throw("Strict value is not equal to itself.") | |
399 | 403 | } | |
400 | 404 | ||
401 | 405 | ||
402 | 406 | ||
403 | 407 | @Callable(i) | |
404 | 408 | func claimWaves (userAddressBytes,txId) = { | |
405 | 409 | let checkCaller = onlyFactory(i) | |
406 | 410 | if ((checkCaller == checkCaller)) | |
407 | 411 | then { | |
408 | 412 | let userAddress = Address(userAddressBytes) | |
409 | 413 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
410 | 414 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
411 | - | let $ | |
412 | - | let status = $ | |
413 | - | let lpAssetAmount = $ | |
414 | - | let targetPeriod = $ | |
415 | - | let claimTxId = $ | |
415 | + | let $t01451914632 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
416 | + | let status = $t01451914632._1 | |
417 | + | let lpAssetAmount = $t01451914632._2 | |
418 | + | let targetPeriod = $t01451914632._3 | |
419 | + | let claimTxId = $t01451914632._4 | |
416 | 420 | if ((status == FINISHED)) | |
417 | 421 | then throwErr("invalid withdrawal request status") | |
418 | 422 | else if ((targetPeriod > currentPeriodOrFail)) | |
419 | 423 | then throwErr("invalid withdrawal request period") | |
420 | 424 | else { | |
421 | 425 | let priceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(targetPeriod)), wrapErr("invalid price")) | |
422 | 426 | let amount = if ((priceOrFail > 0)) | |
423 | 427 | then fraction(lpAssetAmount, priceOrFail, SCALE8) | |
424 | 428 | else 0 | |
425 | 429 | let factoryActions = [invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, txId), valueWithdrawalRequest(FINISHED, lpAssetAmount, targetPeriod, i.transactionId)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferWaves", [userAddressBytes, amount], nil)] | |
426 | 430 | $Tuple2(nil, factoryActions) | |
427 | 431 | } | |
428 | 432 | } | |
429 | 433 | else throw("Strict value is not equal to itself.") | |
430 | 434 | } | |
431 | 435 | ||
432 | 436 | ||
433 | 437 | ||
434 | 438 | @Callable(i) | |
435 | 439 | func processBlocks (userAddressBytes) = { | |
436 | 440 | let checkCaller = onlyFactory(i) | |
437 | 441 | if ((checkCaller == checkCaller)) | |
438 | 442 | then { | |
439 | 443 | let userAddress = Address(userAddressBytes) | |
440 | 444 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
441 | 445 | let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length")) | |
442 | 446 | let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height")) | |
443 | 447 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
444 | 448 | let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process")) | |
445 | 449 | let periodEndHeight = ((currentStartHeight + periodLength) - 1) | |
446 | 450 | let blocksProcessingBatchSizeMax = 40 | |
447 | 451 | let blocksProcessingBatchSize = if (if (if ((height >= nextBlockToProcess)) | |
448 | 452 | then if ((nextBlockToProcess >= currentStartHeight)) | |
449 | 453 | then true | |
450 | 454 | else (currentPeriodOrFail == 0) | |
451 | 455 | else false) | |
452 | 456 | then (periodEndHeight >= nextBlockToProcess) | |
453 | 457 | else false) | |
454 | 458 | then min([((periodEndHeight - nextBlockToProcess) + 1), blocksProcessingBatchSizeMax]) | |
455 | 459 | else throwErr(wrapErr("invalid target block")) | |
456 | 460 | let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward")) | |
457 | 461 | let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSize) | |
458 | 462 | let blockProcessingRewardByGeneratorRemainder = (blockProcessingReward - (blockProcessingRewardByGenerator * blocksProcessingBatchSize)) | |
459 | 463 | func map (acc,inc) = if ((inc >= blocksProcessingBatchSize)) | |
460 | 464 | then acc | |
461 | 465 | else { | |
462 | 466 | let targetBlockHeight = (nextBlockToProcess + inc) | |
463 | 467 | let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info")) | |
464 | 468 | let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, treasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight)))) | |
465 | 469 | let generator = targetBlockInfo.generator | |
466 | 470 | let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0) | |
467 | 471 | let callerReward = if ((inc == (blocksProcessingBatchSize - 1))) | |
468 | 472 | then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder) | |
469 | 473 | else blockProcessingRewardByGenerator | |
470 | 474 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
471 | 475 | then fraction((treasuryRewardOrFail - callerReward), SCALE8, currentPriceOrFail) | |
472 | 476 | else 0 | |
473 | 477 | let factoryActionsSingle = [invoke(factoryAddressOrFail, "stringEntry", [keyBlockProcessed(targetBlockHeight), makeString([toBase58String(i.transactionId), toBase58String(userAddressBytes), toString(treasuryRewardOrFail), toString(callerReward), toString(lpAssetAmount)], SEP)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(generator), (available + lpAssetAmount)], nil)] | |
474 | 478 | if ((factoryActionsSingle == factoryActionsSingle)) | |
475 | 479 | then (acc + lpAssetAmount) | |
476 | 480 | else throw("Strict value is not equal to itself.") | |
477 | 481 | } | |
478 | 482 | ||
479 | 483 | let list = [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] | |
480 | 484 | let lpAssetAmountTotal = { | |
481 | 485 | let $l = list | |
482 | 486 | let $s = size($l) | |
483 | 487 | let $acc0 = 0 | |
484 | 488 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
485 | 489 | then $a | |
486 | 490 | else map($a, $l[$i]) | |
487 | 491 | ||
488 | 492 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
489 | 493 | then $a | |
490 | 494 | else throw("List size exceeds 40") | |
491 | 495 | ||
492 | 496 | $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($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) | |
493 | 497 | } | |
494 | 498 | if ((lpAssetAmountTotal == lpAssetAmountTotal)) | |
495 | 499 | then { | |
496 | 500 | let actions = [invoke(factoryAddressOrFail, "transferWaves", [userAddressBytes, blockProcessingReward], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmountTotal], nil), invoke(factoryAddressOrFail, "integerEntry", [keyNextBlockToProcess(), (nextBlockToProcess + blocksProcessingBatchSize)], nil)] | |
497 | 501 | if ((actions == actions)) | |
498 | 502 | then $Tuple2(nil, unit) | |
499 | 503 | else throw("Strict value is not equal to itself.") | |
500 | 504 | } | |
501 | 505 | else throw("Strict value is not equal to itself.") | |
502 | 506 | } | |
503 | 507 | else throw("Strict value is not equal to itself.") | |
504 | 508 | } | |
505 | 509 | ||
506 | 510 | ||
507 | 511 | @Verifier(tx) | |
508 | 512 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
509 | 513 |
github/deemru/w8io/169f3d6 74.88 ms ◑