tx · w433iYaXYXGn8DR8kQArforf8QT2hCRwrv4Ejndkoyz 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b: -0.01400000 Waves 2021.02.09 10:02 [1390323] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves
{ "type": 13, "id": "w433iYaXYXGn8DR8kQArforf8QT2hCRwrv4Ejndkoyz", "fee": 1400000, "feeAssetId": null, "timestamp": 1612854154383, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "3fYrKiGFy7ESkWpmLXV97aWXqpb1iEMrrHPGSyeXPevZzKtL3EY6HkAwdFLwDv4p6bse2ZA6yLeLpAA8CwbxVKkn" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OUZ0enNubzd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AAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24GCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tled+OqrI=", "height": 1390323, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9NzdWXa5i7Q7PU7xYavSLRyLb91G1QUBJbWxdRXY8Ykb Next: F9c3dFdejPYaaLdfJ9NEULhkhBJ9ApPEF3gGuTC2iEAa Diff:
Old | New | Differences | |
---|---|---|---|
104 | 104 | let lotteryAssetTN = if ((assetId == "")) | |
105 | 105 | then true | |
106 | 106 | else false | |
107 | + | let totalRequiredAmount = (amount * poolprice) | |
107 | 108 | if ((paymentIsDefined == true)) | |
108 | - | then throw(toString(lotteryAssetTN)) | |
109 | + | then { | |
110 | + | let payment = extract(i.payment) | |
111 | + | let paymentAssetId = match payment.assetId { | |
112 | + | case a: ByteVector => | |
113 | + | toBase64String(a) | |
114 | + | case _: Unit => | |
115 | + | "" | |
116 | + | case _ => | |
117 | + | throw("Match error") | |
118 | + | } | |
119 | + | let paymentAmount = payment.amount | |
120 | + | if ((paymentAssetId != assetId)) | |
121 | + | then throw("Asset Id not matching with Payment Asset Id") | |
122 | + | else if ((totalRequiredAmount > paymentAmount)) | |
123 | + | then throw("Not enough Asset Amount") | |
124 | + | else { | |
125 | + | let tempValue = match getString(this, lotteryPrices) { | |
126 | + | case a: String => | |
127 | + | a | |
128 | + | case _: Unit => | |
129 | + | "" | |
130 | + | case _ => | |
131 | + | throw("Match error") | |
132 | + | } | |
133 | + | let containKey = indexOf(tempValue, token) | |
134 | + | let storedTokensValues = match containKey { | |
135 | + | case _: Unit => | |
136 | + | ((tempValue + token) + ",") | |
137 | + | case x: Int => | |
138 | + | throw("Token is duplicated") | |
139 | + | case _ => | |
140 | + | throw("Match error") | |
141 | + | } | |
142 | + | let countTokens = match getInteger(this, countOfPrices) { | |
143 | + | case a: Int => | |
144 | + | a | |
145 | + | case _: Unit => | |
146 | + | 0 | |
147 | + | case _ => | |
148 | + | throw("Match error") | |
149 | + | } | |
150 | + | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
151 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
152 | + | } | |
153 | + | } | |
109 | 154 | else { | |
110 | 155 | let tnBalance = if (lotteryAssetTN) | |
111 | 156 | then wavesBalance(this) | |
112 | 157 | else assetBalance(this, fromBase64String(assetId)) | |
113 | - | let totalRequiredAmount = (amount * poolprice) | |
114 | 158 | if ((totalRequiredAmount > tnBalance)) | |
115 | 159 | then throw("Not enough Asset Amount") | |
116 | 160 | else { | |
155 | 199 | let priceList = getPriceArray() | |
156 | 200 | let randNumber = toInt(randhash) | |
157 | 201 | let winningToken = { | |
158 | - | let $ | |
159 | - | let $ | |
160 | - | let $ | |
161 | - | if (($ | |
162 | - | then $ | |
202 | + | let $list83548391 = priceList | |
203 | + | let $size83548391 = size($list83548391) | |
204 | + | let $acc083548391 = nil | |
205 | + | if (($size83548391 == 0)) | |
206 | + | then $acc083548391 | |
163 | 207 | else { | |
164 | - | let $ | |
165 | - | if (($ | |
166 | - | then $ | |
208 | + | let $acc183548391 = procedLottery($acc083548391, $list83548391[0]) | |
209 | + | if (($size83548391 == 1)) | |
210 | + | then $acc183548391 | |
167 | 211 | else { | |
168 | - | let $ | |
169 | - | if (($ | |
170 | - | then $ | |
212 | + | let $acc283548391 = procedLottery($acc183548391, $list83548391[1]) | |
213 | + | if (($size83548391 == 2)) | |
214 | + | then $acc283548391 | |
171 | 215 | else { | |
172 | - | let $ | |
173 | - | if (($ | |
174 | - | then $ | |
216 | + | let $acc383548391 = procedLottery($acc283548391, $list83548391[2]) | |
217 | + | if (($size83548391 == 3)) | |
218 | + | then $acc383548391 | |
175 | 219 | else { | |
176 | - | let $ | |
177 | - | if (($ | |
178 | - | then $ | |
220 | + | let $acc483548391 = procedLottery($acc383548391, $list83548391[3]) | |
221 | + | if (($size83548391 == 4)) | |
222 | + | then $acc483548391 | |
179 | 223 | else { | |
180 | - | let $ | |
181 | - | if (($ | |
182 | - | then $ | |
224 | + | let $acc583548391 = procedLottery($acc483548391, $list83548391[4]) | |
225 | + | if (($size83548391 == 5)) | |
226 | + | then $acc583548391 | |
183 | 227 | else { | |
184 | - | let $ | |
228 | + | let $acc683548391 = procedLottery($acc583548391, $list83548391[5]) | |
185 | 229 | throw("List size exceed 5") | |
186 | 230 | } | |
187 | 231 | } | |
208 | 252 | if ((actualAmount == 0)) | |
209 | 253 | then { | |
210 | 254 | let actualListPrices = { | |
211 | - | let $ | |
212 | - | let $ | |
213 | - | let $ | |
214 | - | if (($ | |
215 | - | then $ | |
255 | + | let $list92099259 = priceList | |
256 | + | let $size92099259 = size($list92099259) | |
257 | + | let $acc092099259 = token | |
258 | + | if (($size92099259 == 0)) | |
259 | + | then $acc092099259 | |
216 | 260 | else { | |
217 | - | let $ | |
218 | - | if (($ | |
219 | - | then $ | |
261 | + | let $acc192099259 = generateNewListOfPrices($acc092099259, $list92099259[0]) | |
262 | + | if (($size92099259 == 1)) | |
263 | + | then $acc192099259 | |
220 | 264 | else { | |
221 | - | let $ | |
222 | - | if (($ | |
223 | - | then $ | |
265 | + | let $acc292099259 = generateNewListOfPrices($acc192099259, $list92099259[1]) | |
266 | + | if (($size92099259 == 2)) | |
267 | + | then $acc292099259 | |
224 | 268 | else { | |
225 | - | let $ | |
226 | - | if (($ | |
227 | - | then $ | |
269 | + | let $acc392099259 = generateNewListOfPrices($acc292099259, $list92099259[2]) | |
270 | + | if (($size92099259 == 3)) | |
271 | + | then $acc392099259 | |
228 | 272 | else { | |
229 | - | let $ | |
230 | - | if (($ | |
231 | - | then $ | |
273 | + | let $acc492099259 = generateNewListOfPrices($acc392099259, $list92099259[3]) | |
274 | + | if (($size92099259 == 4)) | |
275 | + | then $acc492099259 | |
232 | 276 | else { | |
233 | - | let $ | |
234 | - | if (($ | |
235 | - | then $ | |
277 | + | let $acc592099259 = generateNewListOfPrices($acc492099259, $list92099259[4]) | |
278 | + | if (($size92099259 == 5)) | |
279 | + | then $acc592099259 | |
236 | 280 | else { | |
237 | - | let $ | |
281 | + | let $acc692099259 = generateNewListOfPrices($acc592099259, $list92099259[5]) | |
238 | 282 | throw("List size exceed 5") | |
239 | 283 | } | |
240 | 284 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lotteryamount = "_amount" | |
5 | 5 | ||
6 | 6 | let lotteryprobability = "_probability" | |
7 | 7 | ||
8 | 8 | let lotteryprobabilitydecimal = "_probability_decimal" | |
9 | 9 | ||
10 | 10 | let lotteryPrice = "_price" | |
11 | 11 | ||
12 | 12 | let lotteryPrices = "_lottery_prices" | |
13 | 13 | ||
14 | 14 | let lotteryAssetId = "_lottery_asset_id" | |
15 | 15 | ||
16 | 16 | let countOfPrices = "_count_prices" | |
17 | 17 | ||
18 | 18 | let lastHashRandomNumber = "last_spin_random_hash" | |
19 | 19 | ||
20 | 20 | let lastTokenRandomHash = "last_token_random_hash" | |
21 | 21 | ||
22 | 22 | let dAppAddres = "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV" | |
23 | 23 | ||
24 | 24 | func randomizer (inv) = { | |
25 | 25 | let lastPlay = match getBinary(this, lastHashRandomNumber) { | |
26 | 26 | case s: ByteVector => | |
27 | 27 | s | |
28 | 28 | case _: Unit => | |
29 | 29 | base58'2ee4oFDYriWJ9EMeR' | |
30 | 30 | case _ => | |
31 | 31 | throw("Match error") | |
32 | 32 | } | |
33 | 33 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
34 | 34 | sha256(rand) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func generatorRandomHash (inv) = { | |
39 | 39 | let lastHashForToken = match getBinary(this, lastTokenRandomHash) { | |
40 | 40 | case s: ByteVector => | |
41 | 41 | s | |
42 | 42 | case _: Unit => | |
43 | 43 | base58'4dD7osCQzvuXJdTiGfKvTwnKT' | |
44 | 44 | case _ => | |
45 | 45 | throw("Match error") | |
46 | 46 | } | |
47 | 47 | let rand = (((((lastHashForToken + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
48 | 48 | sha256(rand) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getSizePriceArray () = match getInteger(this, countOfPrices) { | |
53 | 53 | case a: Int => | |
54 | 54 | a | |
55 | 55 | case _: Unit => | |
56 | 56 | 0 | |
57 | 57 | case _ => | |
58 | 58 | throw("Match error") | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getPriceArray () = { | |
63 | 63 | let tempPrices = getStringValue(this, lotteryPrices) | |
64 | 64 | let trimPrices = take(tempPrices, (size(tempPrices) - 1)) | |
65 | 65 | let newArray = split(trimPrices, ",") | |
66 | 66 | newArray | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func generateNewListOfPrices (token,val) = { | |
71 | 71 | let indexOfComma = indexOf(token, ",") | |
72 | 72 | if ((indexOfComma == unit)) | |
73 | 73 | then (val + ",") | |
74 | 74 | else ((token + val) + ",") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func procedLottery (win,token) = { | |
79 | 79 | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
80 | 80 | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
81 | 81 | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
82 | 82 | let hash = (tokenProbabilityDecimal % probabilityValue) | |
83 | 83 | let sizeOfWin = size(win) | |
84 | 84 | if ((sizeOfWin == 1)) | |
85 | 85 | then { | |
86 | 86 | let randomNumber = win[0] | |
87 | 87 | if ((probabilityValue > hash)) | |
88 | 88 | then { | |
89 | 89 | let newList = token :: win | |
90 | 90 | newList | |
91 | 91 | } | |
92 | 92 | else win | |
93 | 93 | } | |
94 | 94 | else win | |
95 | 95 | } | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | @Callable(i) | |
99 | 99 | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
100 | 100 | let token = toBase64String(generatorRandomHash(i)) | |
101 | 101 | let paymentIsDefined = if (!(isDefined(i.payment))) | |
102 | 102 | then false | |
103 | 103 | else true | |
104 | 104 | let lotteryAssetTN = if ((assetId == "")) | |
105 | 105 | then true | |
106 | 106 | else false | |
107 | + | let totalRequiredAmount = (amount * poolprice) | |
107 | 108 | if ((paymentIsDefined == true)) | |
108 | - | then throw(toString(lotteryAssetTN)) | |
109 | + | then { | |
110 | + | let payment = extract(i.payment) | |
111 | + | let paymentAssetId = match payment.assetId { | |
112 | + | case a: ByteVector => | |
113 | + | toBase64String(a) | |
114 | + | case _: Unit => | |
115 | + | "" | |
116 | + | case _ => | |
117 | + | throw("Match error") | |
118 | + | } | |
119 | + | let paymentAmount = payment.amount | |
120 | + | if ((paymentAssetId != assetId)) | |
121 | + | then throw("Asset Id not matching with Payment Asset Id") | |
122 | + | else if ((totalRequiredAmount > paymentAmount)) | |
123 | + | then throw("Not enough Asset Amount") | |
124 | + | else { | |
125 | + | let tempValue = match getString(this, lotteryPrices) { | |
126 | + | case a: String => | |
127 | + | a | |
128 | + | case _: Unit => | |
129 | + | "" | |
130 | + | case _ => | |
131 | + | throw("Match error") | |
132 | + | } | |
133 | + | let containKey = indexOf(tempValue, token) | |
134 | + | let storedTokensValues = match containKey { | |
135 | + | case _: Unit => | |
136 | + | ((tempValue + token) + ",") | |
137 | + | case x: Int => | |
138 | + | throw("Token is duplicated") | |
139 | + | case _ => | |
140 | + | throw("Match error") | |
141 | + | } | |
142 | + | let countTokens = match getInteger(this, countOfPrices) { | |
143 | + | case a: Int => | |
144 | + | a | |
145 | + | case _: Unit => | |
146 | + | 0 | |
147 | + | case _ => | |
148 | + | throw("Match error") | |
149 | + | } | |
150 | + | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
151 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
152 | + | } | |
153 | + | } | |
109 | 154 | else { | |
110 | 155 | let tnBalance = if (lotteryAssetTN) | |
111 | 156 | then wavesBalance(this) | |
112 | 157 | else assetBalance(this, fromBase64String(assetId)) | |
113 | - | let totalRequiredAmount = (amount * poolprice) | |
114 | 158 | if ((totalRequiredAmount > tnBalance)) | |
115 | 159 | then throw("Not enough Asset Amount") | |
116 | 160 | else { | |
117 | 161 | let tempValue = match getString(this, lotteryPrices) { | |
118 | 162 | case a: String => | |
119 | 163 | a | |
120 | 164 | case _: Unit => | |
121 | 165 | "" | |
122 | 166 | case _ => | |
123 | 167 | throw("Match error") | |
124 | 168 | } | |
125 | 169 | let containKey = indexOf(tempValue, token) | |
126 | 170 | let storedTokensValues = match containKey { | |
127 | 171 | case _: Unit => | |
128 | 172 | ((tempValue + token) + ",") | |
129 | 173 | case x: Int => | |
130 | 174 | throw("Token is duplicated") | |
131 | 175 | case _ => | |
132 | 176 | throw("Match error") | |
133 | 177 | } | |
134 | 178 | let countTokens = match getInteger(this, countOfPrices) { | |
135 | 179 | case a: Int => | |
136 | 180 | a | |
137 | 181 | case _: Unit => | |
138 | 182 | 0 | |
139 | 183 | case _ => | |
140 | 184 | throw("Match error") | |
141 | 185 | } | |
142 | 186 | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
143 | 187 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
144 | 188 | } | |
145 | 189 | } | |
146 | 190 | } | |
147 | 191 | ||
148 | 192 | ||
149 | 193 | ||
150 | 194 | @Callable(i) | |
151 | 195 | func startlotto () = { | |
152 | 196 | let currentKey = toBase58String(i.caller.bytes) | |
153 | 197 | let randhash = randomizer(i) | |
154 | 198 | let sizeTempPrice = getSizePriceArray() | |
155 | 199 | let priceList = getPriceArray() | |
156 | 200 | let randNumber = toInt(randhash) | |
157 | 201 | let winningToken = { | |
158 | - | let $ | |
159 | - | let $ | |
160 | - | let $ | |
161 | - | if (($ | |
162 | - | then $ | |
202 | + | let $list83548391 = priceList | |
203 | + | let $size83548391 = size($list83548391) | |
204 | + | let $acc083548391 = nil | |
205 | + | if (($size83548391 == 0)) | |
206 | + | then $acc083548391 | |
163 | 207 | else { | |
164 | - | let $ | |
165 | - | if (($ | |
166 | - | then $ | |
208 | + | let $acc183548391 = procedLottery($acc083548391, $list83548391[0]) | |
209 | + | if (($size83548391 == 1)) | |
210 | + | then $acc183548391 | |
167 | 211 | else { | |
168 | - | let $ | |
169 | - | if (($ | |
170 | - | then $ | |
212 | + | let $acc283548391 = procedLottery($acc183548391, $list83548391[1]) | |
213 | + | if (($size83548391 == 2)) | |
214 | + | then $acc283548391 | |
171 | 215 | else { | |
172 | - | let $ | |
173 | - | if (($ | |
174 | - | then $ | |
216 | + | let $acc383548391 = procedLottery($acc283548391, $list83548391[2]) | |
217 | + | if (($size83548391 == 3)) | |
218 | + | then $acc383548391 | |
175 | 219 | else { | |
176 | - | let $ | |
177 | - | if (($ | |
178 | - | then $ | |
220 | + | let $acc483548391 = procedLottery($acc383548391, $list83548391[3]) | |
221 | + | if (($size83548391 == 4)) | |
222 | + | then $acc483548391 | |
179 | 223 | else { | |
180 | - | let $ | |
181 | - | if (($ | |
182 | - | then $ | |
224 | + | let $acc583548391 = procedLottery($acc483548391, $list83548391[4]) | |
225 | + | if (($size83548391 == 5)) | |
226 | + | then $acc583548391 | |
183 | 227 | else { | |
184 | - | let $ | |
228 | + | let $acc683548391 = procedLottery($acc583548391, $list83548391[5]) | |
185 | 229 | throw("List size exceed 5") | |
186 | 230 | } | |
187 | 231 | } | |
188 | 232 | } | |
189 | 233 | } | |
190 | 234 | } | |
191 | 235 | } | |
192 | 236 | } | |
193 | 237 | let sizeOfWinPrices = size(winningToken) | |
194 | 238 | if ((sizeOfWinPrices == 1)) | |
195 | 239 | then { | |
196 | 240 | let writeSets = WriteSet(nil) | |
197 | 241 | ScriptResult(writeSets, TransferSet(nil)) | |
198 | 242 | } | |
199 | 243 | else { | |
200 | 244 | let token = winningToken[1] | |
201 | 245 | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
202 | 246 | if ((currentAmount == 0)) | |
203 | 247 | then throw("Amount exceeded") | |
204 | 248 | else { | |
205 | 249 | let actualAmount = (currentAmount - 1) | |
206 | 250 | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
207 | 251 | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
208 | 252 | if ((actualAmount == 0)) | |
209 | 253 | then { | |
210 | 254 | let actualListPrices = { | |
211 | - | let $ | |
212 | - | let $ | |
213 | - | let $ | |
214 | - | if (($ | |
215 | - | then $ | |
255 | + | let $list92099259 = priceList | |
256 | + | let $size92099259 = size($list92099259) | |
257 | + | let $acc092099259 = token | |
258 | + | if (($size92099259 == 0)) | |
259 | + | then $acc092099259 | |
216 | 260 | else { | |
217 | - | let $ | |
218 | - | if (($ | |
219 | - | then $ | |
261 | + | let $acc192099259 = generateNewListOfPrices($acc092099259, $list92099259[0]) | |
262 | + | if (($size92099259 == 1)) | |
263 | + | then $acc192099259 | |
220 | 264 | else { | |
221 | - | let $ | |
222 | - | if (($ | |
223 | - | then $ | |
265 | + | let $acc292099259 = generateNewListOfPrices($acc192099259, $list92099259[1]) | |
266 | + | if (($size92099259 == 2)) | |
267 | + | then $acc292099259 | |
224 | 268 | else { | |
225 | - | let $ | |
226 | - | if (($ | |
227 | - | then $ | |
269 | + | let $acc392099259 = generateNewListOfPrices($acc292099259, $list92099259[2]) | |
270 | + | if (($size92099259 == 3)) | |
271 | + | then $acc392099259 | |
228 | 272 | else { | |
229 | - | let $ | |
230 | - | if (($ | |
231 | - | then $ | |
273 | + | let $acc492099259 = generateNewListOfPrices($acc392099259, $list92099259[3]) | |
274 | + | if (($size92099259 == 4)) | |
275 | + | then $acc492099259 | |
232 | 276 | else { | |
233 | - | let $ | |
234 | - | if (($ | |
235 | - | then $ | |
277 | + | let $acc592099259 = generateNewListOfPrices($acc492099259, $list92099259[4]) | |
278 | + | if (($size92099259 == 5)) | |
279 | + | then $acc592099259 | |
236 | 280 | else { | |
237 | - | let $ | |
281 | + | let $acc692099259 = generateNewListOfPrices($acc592099259, $list92099259[5]) | |
238 | 282 | throw("List size exceed 5") | |
239 | 283 | } | |
240 | 284 | } | |
241 | 285 | } | |
242 | 286 | } | |
243 | 287 | } | |
244 | 288 | } | |
245 | 289 | } | |
246 | 290 | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry((token + lotteryPrices), actualListPrices), DataEntry(lastHashRandomNumber, randNumber)]) | |
247 | 291 | if ((tokenAssetId == "")) | |
248 | 292 | then { | |
249 | 293 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
250 | 294 | ScriptResult(writeSets, winTransfer) | |
251 | 295 | } | |
252 | 296 | else { | |
253 | 297 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
254 | 298 | ScriptResult(writeSets, winTransfer) | |
255 | 299 | } | |
256 | 300 | } | |
257 | 301 | else { | |
258 | 302 | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
259 | 303 | if ((tokenAssetId == "")) | |
260 | 304 | then { | |
261 | 305 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
262 | 306 | ScriptResult(writeSets, winTransfer) | |
263 | 307 | } | |
264 | 308 | else { | |
265 | 309 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
266 | 310 | ScriptResult(writeSets, winTransfer) | |
267 | 311 | } | |
268 | 312 | } | |
269 | 313 | } | |
270 | 314 | } | |
271 | 315 | } | |
272 | 316 | ||
273 | 317 | ||
274 | 318 | @Verifier(tx) | |
275 | 319 | func verify () = match tx { | |
276 | 320 | case _: DataTransaction => | |
277 | 321 | true | |
278 | 322 | case _: SetScriptTransaction => | |
279 | 323 | true | |
280 | 324 | case _ => | |
281 | 325 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
282 | 326 | } | |
283 | 327 |
github/deemru/w8io/026f985 90.86 ms ◑