tx · Cyajd2Rr8jF1ArwyNCetTfe1aSMdwsE69GbyTkdZt9YM

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01600000 Waves

2023.03.06 11:07 [2477969] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "Cyajd2Rr8jF1ArwyNCetTfe1aSMdwsE69GbyTkdZt9YM", "fee": 1600000, "feeAssetId": null, "timestamp": 1678090064985, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "41tG3nv9UomMZqmqoBWBAv2TKULrupUXXv4jxuxBNAWXdH7AXSYbq27zSKHvodqyVegSm3SPnFMweqXC4yri6xfq" ], "script": "base64:AAIFAAAAAAAABxAIAhIJCgcICAgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgiA1NFUCIMd2F2ZXNBc3NldElkIhFpbnZhbGlkUHJpY2VBc3NldCIIdGhyb3dFcnIiA21zZyIHdGhyb3dQRCIUdGhyb3dDcmVhdGVOb3RDYWxsZWQiEXRocm93WW91Tm90SXNzdWVyIg90aHJvd1Bvb2xFeGlzdHMiFXRocm93QXNzZXROb3RWZXJpZmllZCIWdGhyb3dJbnZhbGlkUHJpY2VBc3NldCIUdGhyb3dJbnZhbGlkRmVlQXNzZXQiF3Rocm93SW52YWxpZEFtb3VudEFzc2V0IhJ0aHJvd0ludmFsaWRTdGF0dXMiH3Rocm93Q2FuQWN0aXZhdGVPbmx5UGVuZGluZ1Bvb2wiHXRocm93RmFjdG9yeVJldHVybmVkTm90U3RyaW5nIhx0aHJvd0ludmFsaWRQcmljZUFzc2V0QW1vdW50Ig90aHJvd0ludmFsaWRGZWUiE2tleU1hbmFnZXJQdWJsaWNLZXkiGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2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969, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 54mVGVjkgtmy7aY2bzYSQ8vphmgLNahztSL8T64zPRHi Next: At5ie36JTGMoKjY9yft8zi7aBGFe55GmZy8NV4nTfMJ8 Diff:
OldNewDifferences
244244 }
245245 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
246246 then true
247- else throwPoolExists(), if (!(poolExists))
247+ else throwPoolExists(), if (poolExists)
248248 then true
249249 else throwPoolExists(), if (if (isManager(i))
250250 then true
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 keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
7171
7272
7373 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7474
7575
7676 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
7777
7878
7979 let indexSuffix = "u"
8080
8181 let statusPending = "pending"
8282
8383 let statusDeclined = "declined"
8484
8585 let statusActive = "active"
8686
8787 let statuses = [statusPending, statusDeclined, statusActive]
8888
8989 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
9090
9191
9292 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
9393
9494
9595 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
9696
9797
9898 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
9999
100100
101101 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
102102
103103
104104 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
105105
106106
107107 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
108108
109109
110110 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
111111
112112
113113 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
114114
115115
116116 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
117117
118118
119119 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
120120
121121
122122 func stringOptionToList (stringOrUnit) = match stringOrUnit {
123123 case s: String =>
124124 if ((size(s) == 0))
125125 then nil
126126 else split(s, SEP)
127127 case _: Unit =>
128128 nil
129129 case _ =>
130130 throw("Match error")
131131 }
132132
133133
134134 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
135135
136136 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
137137
138138
139139 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
140140 then true
141141 else throwCreateNotCalled()
142142
143143
144144 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
145145 case s: String =>
146146 fromBase58String(s)
147147 case _: Unit =>
148148 unit
149149 case _ =>
150150 throw("Match error")
151151 }
152152
153153
154154 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
155155 case s: String =>
156156 fromBase58String(s)
157157 case _: Unit =>
158158 unit
159159 case _ =>
160160 throw("Match error")
161161 }
162162
163163
164164 func isManager (i) = match managerPublicKeyOrUnit() {
165165 case pk: ByteVector =>
166166 (i.callerPublicKey == pk)
167167 case _: Unit =>
168168 (i.caller == this)
169169 case _ =>
170170 throw("Match error")
171171 }
172172
173173
174174 func mustManager (i) = if (isManager(i))
175175 then true
176176 else throwPD()
177177
178178
179179 func mustAdmin (i) = {
180180 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
181181 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
182182 then true
183183 else mustManager(i)
184184 }
185185
186186
187187 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
188188
189189
190190 func getIdAndInfo (payment) = match payment.assetId {
191191 case id: ByteVector =>
192192 let info = value(assetInfo(id))
193193 $Tuple2(toBase58String(id), info)
194194 case _: Unit =>
195195 $Tuple2(wavesAssetId, unit)
196196 case _ =>
197197 throw("Match error")
198198 }
199199
200200
201201 func validStatus (status) = containsElement(statuses, status)
202202
203203
204204 @Callable(i)
205205 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
206206 let checkCaller = mustManager(i)
207207 if ((checkCaller == checkCaller))
208208 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
209209 else throw("Strict value is not equal to itself.")
210210 }
211211
212212
213213
214214 @Callable(i)
215215 func create () = {
216216 let amountAssetPayment = value(i.payments[0])
217217 let priceAssetPayment = value(i.payments[1])
218218 let feeAssetPayment = value(i.payments[2])
219219 let $t066466718 = getIdAndInfo(amountAssetPayment)
220220 let amountAssetId = $t066466718._1
221221 let amountAssetInfo = $t066466718._2
222222 let $t067216790 = getIdAndInfo(priceAssetPayment)
223223 let priceAssetId = $t067216790._1
224224 let priceAssetInfo = $t067216790._2
225225 let $t067936856 = getIdAndInfo(feeAssetPayment)
226226 let feeAssetId = $t067936856._1
227227 let feeAssetInfo = $t067936856._2
228228 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
229229 let managerPriceAssetMinAmount = 1
230230 let priceAssetMinAmount = if (isManager(i))
231231 then managerPriceAssetMinAmount
232232 else {
233233 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
234234 value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
235235 }
236236 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
237237 let curIndex = (lastIndex + 1)
238238 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
239239 let poolExists = {
240240 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
241241 if ($isInstanceOf(@, "Boolean"))
242242 then @
243243 else throw("Couldn't cast Any to Boolean")
244244 }
245245 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
246246 then true
247- else throwPoolExists(), if (!(poolExists))
247+ else throwPoolExists(), if (poolExists)
248248 then true
249249 else throwPoolExists(), if (if (isManager(i))
250250 then true
251251 else isVerified(amountAssetId))
252252 then true
253253 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
254254 then true
255255 else throwInvalidFeeAsset(), if (if (isManager(i))
256256 then true
257257 else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
258258 then true
259259 else throwInvalidAmountAsset(), if (if (isManager(i))
260260 then true
261261 else (priceAssetPayment.amount >= priceAssetMinAmount))
262262 then true
263263 else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
264264 then true
265265 else throwInvalidFee()]
266266 if ((checks == checks))
267267 then {
268268 let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
269269 if ((burnEmissionInv == burnEmissionInv))
270270 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)]
271271 else throw("Strict value is not equal to itself.")
272272 }
273273 else throw("Strict value is not equal to itself.")
274274 }
275275
276276
277277
278278 @Callable(i)
279279 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
280280 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
281281 then true
282282 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
283283 then true
284284 else throwCanActivateOnlyPendingPool()]
285285 if ((checks == checks))
286286 then {
287287 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
288288 if ((activateNewPoolInv == activateNewPoolInv))
289289 then {
290290 let lpAssetId = match activateNewPoolInv {
291291 case id: String =>
292292 id
293293 case _ =>
294294 throwFactoryReturnedNotString()
295295 }
296296 if ((lpAssetId == lpAssetId))
297297 then {
298298 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
299299 if ((beforePut == beforePut))
300300 then {
301301 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
302302 then unit
303303 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
304304 then unit
305305 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
306306 if ((put == put))
307307 then {
308308 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
309309 if ((afterPut == afterPut))
310310 then {
311311 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
312312 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
313313 }
314314 else throw("Strict value is not equal to itself.")
315315 }
316316 else throw("Strict value is not equal to itself.")
317317 }
318318 else throw("Strict value is not equal to itself.")
319319 }
320320 else throw("Strict value is not equal to itself.")
321321 }
322322 else throw("Strict value is not equal to itself.")
323323 }
324324 else throw("Strict value is not equal to itself.")
325325 }
326326
327327
328328
329329 @Callable(i)
330330 func setAdmins (adminPubKeys) = {
331331 let checkCaller = mustManager(i)
332332 if ((checkCaller == checkCaller))
333333 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
334334 else throw("Strict value is not equal to itself.")
335335 }
336336
337337
338338
339339 @Callable(i)
340340 func setManager (pendingManagerPublicKey) = {
341341 let checkCaller = mustManager(i)
342342 if ((checkCaller == checkCaller))
343343 then {
344344 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
345345 if ((checkManagerPublicKey == checkManagerPublicKey))
346346 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
347347 else throw("Strict value is not equal to itself.")
348348 }
349349 else throw("Strict value is not equal to itself.")
350350 }
351351
352352
353353
354354 @Callable(i)
355355 func confirmManager () = {
356356 let pm = pendingManagerPublicKeyOrUnit()
357357 let hasPM = if (isDefined(pm))
358358 then true
359359 else throw("No pending manager")
360360 if ((hasPM == hasPM))
361361 then {
362362 let checkPM = if ((i.callerPublicKey == value(pm)))
363363 then true
364364 else throw("You are not pending manager")
365365 if ((checkPM == checkPM))
366366 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
367367 else throw("Strict value is not equal to itself.")
368368 }
369369 else throw("Strict value is not equal to itself.")
370370 }
371371
372372
373373
374374 @Callable(i)
375375 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
376376
377377
378378
379379 @Callable(i)
380380 func statusREADONLY (amountAssetId,priceAssetId) = {
381381 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
382382 case s: String =>
383383 s
384384 case _ =>
385385 unit
386386 }
387387 $Tuple2(nil, status)
388388 }
389389
390390
391391 @Verifier(tx)
392392 func verify () = {
393393 let targetPublicKey = match managerPublicKeyOrUnit() {
394394 case pk: ByteVector =>
395395 pk
396396 case _: Unit =>
397397 tx.senderPublicKey
398398 case _ =>
399399 throw("Match error")
400400 }
401401 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
402402 }
403403

github/deemru/w8io/026f985 
48.45 ms