tx · 4UVbEFEj1Eji37zVRuxKutfbCVxWQs5m8f2jZ4Xc87hc

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01600000 Waves

2023.01.19 12:48 [2411648] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "4UVbEFEj1Eji37zVRuxKutfbCVxWQs5m8f2jZ4Xc87hc", "fee": 1600000, "feeAssetId": null, "timestamp": 1674121745703, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3VYpYkYTzZPWrhzRosF1PNeSMciQ1aPW48sew783jp8D3TcQuwxLuDymFNdGyCStf2msoLU4BZjyZ5Ky92LV7KpC" ], "script": "base64:AAIFAAAAAAAABrcIAhIICgYICBgBCAESABIICgYICAgICAgSAwoBGBIDCgEIEgASABIECgIICCIDU0VQIgx3YXZlc0Fzc2V0SWQiEWludmFsaWRQcmljZUFzc2V0Igh0aHJvd0VyciIDbXNnIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSITa2V5TWFuYWdlclB1YmxpY0tleSIaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkiD2tleUFkb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AAApCeXRlVmVjdG9yBAAAAAJhZQUAAAABVgUAAAACYWUDCQAAAQAAAAIFAAAAAVYCAAAABFVuaXQIBQAAAAJiZAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmJkAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACYmQAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJiZq2zsJg=", "chainId": 84, "height": 2411648, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5VyiDTUwoBk1r5BhpGBRCuc8iPCsmoZg9rjkNLjkvdZ3 Next: Hf4YaRjYCMrET2TH9NNQd74rREezKQy14AvBogayrsr3 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let wavesAssetId = "WAVES"
77
88 let invalidPriceAsset = "Invalid price asset"
99
1010 func throwErr (msg) = throw(makeString(["user_pools.ride:", msg], " "))
1111
1212
1313 func throwPD () = throwErr("Permission denied")
1414
1515
1616 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
1717
1818
1919 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2020
2121
2222 func throwPoolExists () = throwErr("Pool with such assets already exists")
2323
2424
2525 func throwAssetNotVerified () = throwErr("Asset is not verified")
2626
2727
2828 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
2929
3030
3131 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3232
3333
3434 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
3535
3636
3737 func throwInvalidStatus () = throwErr("Invalid status")
3838
3939
4040 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4141
4242
4343 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4444
4545
4646 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
4747
4848
4949 func throwInvalidFee () = throwErr("invalid fee")
5050
5151
5252 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
5353
5454
5555 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
5656
5757
5858 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
5959
6060
6161 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
6262
6363
6464 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
6565
6666
6767 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
6868
6969
7070 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7171
7272
7373 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
7474
7575
7676 let indexSuffix = "u"
7777
7878 let statusPending = "pending"
7979
8080 let statusDeclined = "declined"
8181
8282 let statusActive = "active"
8383
8484 let statuses = [statusPending, statusDeclined, statusActive]
8585
8686 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
8787
8888
8989 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
9090
9191
9292 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
9393
9494
9595 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
9696
9797
9898 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
9999
100100
101101 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
102102
103103
104104 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
105105
106106
107107 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
108108
109109
110110 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
111111
112112
113113 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
114114
115115
116116 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
117117
118118
119119 func stringOptionToList (stringOrUnit) = match stringOrUnit {
120120 case s: String =>
121121 if ((size(s) == 0))
122122 then nil
123123 else split(s, SEP)
124124 case _: Unit =>
125125 nil
126126 case _ =>
127127 throw("Match error")
128128 }
129129
130130
131131 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
132132
133133 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
134134
135135
136136 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
137137 then true
138138 else throwCreateNotCalled()
139139
140140
141141 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
142142 case s: String =>
143143 fromBase58String(s)
144144 case _: Unit =>
145145 unit
146146 case _ =>
147147 throw("Match error")
148148 }
149149
150150
151151 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
152152 case s: String =>
153153 fromBase58String(s)
154154 case _: Unit =>
155155 unit
156156 case _ =>
157157 throw("Match error")
158158 }
159159
160160
161161 func isManager (i) = match managerPublicKeyOrUnit() {
162162 case pk: ByteVector =>
163163 (i.callerPublicKey == pk)
164164 case _: Unit =>
165165 (i.caller == this)
166166 case _ =>
167167 throw("Match error")
168168 }
169169
170170
171171 func mustManager (i) = if (isManager(i))
172172 then true
173173 else throwPD()
174174
175175
176176 func mustAdmin (i) = {
177177 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
178178 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
179179 then true
180180 else mustManager(i)
181181 }
182182
183183
184184 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
185185
186186
187187 func getIdAndInfo (payment) = match payment.assetId {
188188 case id: ByteVector =>
189189 let info = value(assetInfo(id))
190190 $Tuple2(toBase58String(id), info)
191191 case _: Unit =>
192192 $Tuple2(wavesAssetId, unit)
193193 case _ =>
194194 throw("Match error")
195195 }
196196
197197
198198 func validStatus (status) = containsElement(statuses, status)
199199
200200
201201 @Callable(i)
202202 func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
203203 let checkCaller = mustManager(i)
204204 if ((checkCaller == checkCaller))
205205 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
206206 else throw("Strict value is not equal to itself.")
207207 }
208208
209209
210210
211211 @Callable(i)
212212 func create () = {
213213 let amountAssetPayment = value(i.payments[0])
214214 let priceAssetPayment = value(i.payments[1])
215215 let feeAssetPayment = value(i.payments[2])
216216 let $t064926564 = getIdAndInfo(amountAssetPayment)
217217 let amountAssetId = $t064926564._1
218218 let amountAssetInfo = $t064926564._2
219219 let $t065676636 = getIdAndInfo(priceAssetPayment)
220220 let priceAssetId = $t065676636._1
221221 let priceAssetInfo = $t065676636._2
222222 let $t066396702 = getIdAndInfo(feeAssetPayment)
223223 let feeAssetId = $t066396702._1
224224 let feeAssetInfo = $t066396702._2
225225 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
226226 let managerPriceAssetMinAmount = 1
227227 let priceAssetMinAmount = if (isManager(i))
228228 then managerPriceAssetMinAmount
229229 else {
230230 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
231231 value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
232232 }
233233 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
234234 let curIndex = (lastIndex + 1)
235235 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
236236 then true
237237 else throwPoolExists(), if (if (isManager(i))
238238 then true
239239 else isVerified(amountAssetId))
240240 then true
241241 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
242242 then true
243243 else throwInvalidFeeAsset(), if (if (isManager(i))
244244 then true
245245 else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
246246 then true
247247 else throwInvalidAmountAsset(), if (if (isManager(i))
248248 then true
249249 else (priceAssetPayment.amount >= priceAssetMinAmount))
250250 then true
251251 else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
252252 then true
253253 else throwInvalidFee()]
254254 if ((checks == checks))
255255 then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
256256 else throw("Strict value is not equal to itself.")
257257 }
258258
259259
260260
261261 @Callable(i)
262262 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
263263 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
264264 then true
265265 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
266266 then true
267267 else throwCanActivateOnlyPendingPool()]
268268 if ((checks == checks))
269269 then {
270270 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
271271 if ((activateNewPoolInv == activateNewPoolInv))
272272 then {
273273 let lpAssetId = match activateNewPoolInv {
274274 case id: String =>
275275 id
276276 case _ =>
277277 throwFactoryReturnedNotString()
278278 }
279279 if ((lpAssetId == lpAssetId))
280280 then {
281281 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
282282 if ((beforePut == beforePut))
283283 then {
284284 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
285285 then unit
286286 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
287287 then unit
288288 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
289289 if ((put == put))
290290 then {
291291 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
292292 if ((afterPut == afterPut))
293293 then {
294294 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
295295 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
296296 }
297297 else throw("Strict value is not equal to itself.")
298298 }
299299 else throw("Strict value is not equal to itself.")
300300 }
301301 else throw("Strict value is not equal to itself.")
302302 }
303303 else throw("Strict value is not equal to itself.")
304304 }
305305 else throw("Strict value is not equal to itself.")
306306 }
307307 else throw("Strict value is not equal to itself.")
308308 }
309309
310310
311311
312312 @Callable(i)
313313 func setAdmins (adminPubKeys) = {
314314 let checkCaller = mustManager(i)
315315 if ((checkCaller == checkCaller))
316316 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
317317 else throw("Strict value is not equal to itself.")
318318 }
319319
320320
321321
322322 @Callable(i)
323323 func setManager (pendingManagerPublicKey) = {
324324 let checkCaller = mustManager(i)
325325 if ((checkCaller == checkCaller))
326326 then {
327327 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
328328 if ((checkManagerPublicKey == checkManagerPublicKey))
329329 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
330330 else throw("Strict value is not equal to itself.")
331331 }
332332 else throw("Strict value is not equal to itself.")
333333 }
334334
335335
336336
337337 @Callable(i)
338338 func confirmManager () = {
339339 let pm = pendingManagerPublicKeyOrUnit()
340340 let hasPM = if (isDefined(pm))
341341 then true
342342 else throw("No pending manager")
343343 if ((hasPM == hasPM))
344344 then {
345345 let checkPM = if ((i.callerPublicKey == value(pm)))
346346 then true
347347 else throw("You are not pending manager")
348348 if ((checkPM == checkPM))
349349 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
350350 else throw("Strict value is not equal to itself.")
351351 }
352352 else throw("Strict value is not equal to itself.")
353353 }
354354
355355
356356
357357 @Callable(i)
358358 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
359359
360360
361361
362362 @Callable(i)
363363 func statusREADONLY (amountAssetId,priceAssetId) = {
364364 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
365365 case s: String =>
366366 s
367367 case _ =>
368368 unit
369369 }
370370 $Tuple2(nil, status)
371371 }
372372
373373
374374 @Verifier(tx)
375375 func verify () = {
376376 let targetPublicKey = match managerPublicKeyOrUnit() {
377377 case pk: ByteVector =>
378378 pk
379379 case _: Unit =>
380380 tx.senderPublicKey
381381 case _ =>
382382 throw("Match error")
383383 }
384384 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
385385 }
386386

github/deemru/w8io/026f985 
43.65 ms