tx · 2Fy3EBWKijGFHWFoDvT994B2TS7NtL4hpcbsCzRwmQwq

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2022.04.13 17:39 [2006932] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "2Fy3EBWKijGFHWFoDvT994B2TS7NtL4hpcbsCzRwmQwq", "fee": 1400000, "feeAssetId": null, "timestamp": 1649860810710, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3jxyVvcupTjLxaJwfAHcEUVxQ3eZtw5TJeR66XzENLUGfm4M7UpJzedsbg5uUdqu9qwYs161EyVfpHpk6qEUGerP" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASBQoDCAgIEgcKBQgICAgIEgMKARgSAwoBCBIAEgAAAAAsAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAHdGhyb3dQRAAAAAAJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQBAAAAFHRocm93Q3JlYXRlTm90Q2FsbGVkAAAAAAkAAAIAAAABAgAAACRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBAAAAEXRocm93WW91Tm90SXNzdWVyAAAAAAkAAAIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhbW91bnRBc3NldCBpc3N1ZXIBAAAAD3Rocm93UG9vbEV4aXN0cwAAAAAJAAACAAAAAQIAAAAkUG9vbCB3aXRoIHN1Y2ggYXNzZXRzIGFscmVhZHkgZXhpc3RzAQAAABV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQAAAAACQAAAgAAAAECAAAAFUFzc2V0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HJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXnePam/", "chainId": 84, "height": 2006932, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: TrRaCCk58qfzWhc2axGrmkbYVCGByZHbPxjtjoEQaFZ Next: FD55p2Px3Mzaqc9pBFSfAdpxZYHweBcZWUyETht3CEnh Diff:
OldNewDifferences
6262
6363 let statusDeclined = "declined"
6464
65-let statusCreating = "creating"
66-
6765 let statusActive = "active"
6866
69-let statusBotDisabled = "bot_disabled"
70-
71-let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled]
67+let statuses = [statusPending, statusDeclined, statusActive]
7268
7369 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7470
185181 let amountAssetPayment = value(i.payments[0])
186182 let priceAssetPayment = value(i.payments[1])
187183 let feeAssetPayment = value(i.payments[2])
188- let $t058985969 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t058985969._1
190- let amountAssetInfo = $t058985969._2
191- let $t059726040 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t059726040._1
193- let priceAssetInfo = $t059726040._2
194- let $t060436105 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t060436105._1
196- let feeAssetInfo = $t060436105._2
184+ let $t057695840 = getIdAndInfo(amountAssetPayment)
185+ let amountAssetId = $t057695840._1
186+ let amountAssetInfo = $t057695840._2
187+ let $t058435911 = getIdAndInfo(priceAssetPayment)
188+ let priceAssetId = $t058435911._1
189+ let priceAssetInfo = $t058435911._2
190+ let $t059145976 = getIdAndInfo(feeAssetPayment)
191+ let feeAssetId = $t059145976._1
192+ let feeAssetInfo = $t059145976._2
197193 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198194 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199195 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
262258 if ((afterPut == afterPut))
263259 then {
264260 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
265-[StringEntry(keyStatus(amountAssetId, priceAssetId), statusCreating), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
261+[StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
266262 }
267263 else throw("Strict value is not equal to itself.")
268264 }
325321
326322
327323 @Callable(i)
328-func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP))
324+func priceAssetsREADONLY () = {
325+ let priceAssetsOrUnit = getString(keyPriceAssetIds())
326+ $Tuple2(nil, if ((priceAssetsOrUnit == unit))
327+ then nil
328+ else split(value(priceAssetsOrUnit), SEP))
329+ }
329330
330331
331332 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let invalidPriceAsset = "Invalid price asset"
99
1010 func throwPD () = throw("Permission denied")
1111
1212
1313 func throwCreateNotCalled () = throw("Create is not called for assets pair")
1414
1515
1616 func throwYouNotIssuer () = throw("You are not amountAsset issuer")
1717
1818
1919 func throwPoolExists () = throw("Pool with such assets already exists")
2020
2121
2222 func throwAssetNotVerified () = throw("Asset is not verified")
2323
2424
2525 func throwInvalidPriceAsset () = throw(invalidPriceAsset)
2626
2727
2828 func throwInvalidFeeAsset () = throw("Invalid fee asset")
2929
3030
3131 func throwInvalidAmountAsset () = throw("Invalid amount asset attached")
3232
3333
3434 func throwInvalidStatus () = throw("Invalid status")
3535
3636
3737 func throwCanActivateOnlyPendingPool () = throw("Can activate pool only in 'pending' status")
3838
3939
4040 func throwFactoryReturnedNotString () = throw("FactoryV2 returned not string")
4141
4242
4343 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
4444
4545
4646 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
4747
4848
4949 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
5050
5151
5252 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
5353
5454
5555 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
5656
5757
5858 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
5959
6060
6161 let statusPending = "pending"
6262
6363 let statusDeclined = "declined"
6464
65-let statusCreating = "creating"
66-
6765 let statusActive = "active"
6866
69-let statusBotDisabled = "bot_disabled"
70-
71-let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled]
67+let statuses = [statusPending, statusDeclined, statusActive]
7268
7369 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7470
7571
7672 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
7773
7874
7975 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
8076
8177
8278 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
8379
8480
8581 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
8682
8783
8884 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
8985
9086
9187 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
9288
9389
9490 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
9591
9692
9793 func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP)
9894
9995
10096 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
10197
10298
10399 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
104100
105101 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
106102
107103
108104 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
109105 then true
110106 else throwCreateNotCalled()
111107
112108
113109 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
114110 case s: String =>
115111 fromBase58String(s)
116112 case _: Unit =>
117113 unit
118114 case _ =>
119115 throw("Match error")
120116 }
121117
122118
123119 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
124120 case s: String =>
125121 fromBase58String(s)
126122 case _: Unit =>
127123 unit
128124 case _ =>
129125 throw("Match error")
130126 }
131127
132128
133129 func mustManager (i) = match managerPublicKeyOrUnit() {
134130 case pk: ByteVector =>
135131 if ((i.callerPublicKey == pk))
136132 then true
137133 else throwPD()
138134 case _: Unit =>
139135 if ((i.caller == this))
140136 then true
141137 else throwPD()
142138 case _ =>
143139 throw("Match error")
144140 }
145141
146142
147143 func mustAdmin (i) = {
148144 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
149145 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
150146 then true
151147 else {
152148 let isManager = mustManager(i)
153149 if ((isManager == isManager))
154150 then true
155151 else throw("Strict value is not equal to itself.")
156152 }
157153 }
158154
159155
160156 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
161157
162158
163159 func getIdAndInfo (payment) = {
164160 let id = value(payment.assetId)
165161 let info = value(assetInfo(id))
166162 $Tuple2(toBase58String(id), info)
167163 }
168164
169165
170166 func validStatus (status) = containsElement(statuses, status)
171167
172168
173169 @Callable(i)
174170 func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
175171 let checkCaller = mustManager(i)
176172 if ((checkCaller == checkCaller))
177173 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetIds(), makeString(priceAssetIds, SEP)), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
178174 else throw("Strict value is not equal to itself.")
179175 }
180176
181177
182178
183179 @Callable(i)
184180 func create () = {
185181 let amountAssetPayment = value(i.payments[0])
186182 let priceAssetPayment = value(i.payments[1])
187183 let feeAssetPayment = value(i.payments[2])
188- let $t058985969 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t058985969._1
190- let amountAssetInfo = $t058985969._2
191- let $t059726040 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t059726040._1
193- let priceAssetInfo = $t059726040._2
194- let $t060436105 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t060436105._1
196- let feeAssetInfo = $t060436105._2
184+ let $t057695840 = getIdAndInfo(amountAssetPayment)
185+ let amountAssetId = $t057695840._1
186+ let amountAssetInfo = $t057695840._2
187+ let $t058435911 = getIdAndInfo(priceAssetPayment)
188+ let priceAssetId = $t058435911._1
189+ let priceAssetInfo = $t058435911._2
190+ let $t059145976 = getIdAndInfo(feeAssetPayment)
191+ let feeAssetId = $t059145976._1
192+ let feeAssetInfo = $t059145976._2
197193 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198194 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199195 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
200196 then true
201197 else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller))
202198 then true
203199 else throwYouNotIssuer(), if (isVerified(amountAssetId))
204200 then true
205201 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
206202 then true
207203 else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
208204 then true
209205 else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
210206 then true
211207 else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
212208 then true
213209 else throw()]
214210 if ((checks == checks))
215211 then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
216212 else throw("Strict value is not equal to itself.")
217213 }
218214
219215
220216
221217 @Callable(i)
222218 func setStatus (amountAssetId,priceAssetId,newStatus) = {
223219 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
224220 then true
225221 else throwCreateNotCalled(), if (validStatus(newStatus))
226222 then true
227223 else throwInvalidStatus()]
228224 if ((checks == checks))
229225 then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)]
230226 else throw("Strict value is not equal to itself.")
231227 }
232228
233229
234230
235231 @Callable(i)
236232 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker) = {
237233 let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId))
238234 then true
239235 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
240236 then true
241237 else throwCanActivateOnlyPendingPool()]
242238 if ((checks == checks))
243239 then {
244240 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((("WX " + amountAssetTicker) + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL"], nil)
245241 if ((activateNewPoolInv == activateNewPoolInv))
246242 then {
247243 let lpAssetId = match activateNewPoolInv {
248244 case id: String =>
249245 id
250246 case _ =>
251247 throwFactoryReturnedNotString()
252248 }
253249 if ((lpAssetId == lpAssetId))
254250 then {
255251 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
256252 if ((beforePut == beforePut))
257253 then {
258254 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
259255 if ((put == put))
260256 then {
261257 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
262258 if ((afterPut == afterPut))
263259 then {
264260 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
265-[StringEntry(keyStatus(amountAssetId, priceAssetId), statusCreating), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
261+[StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
266262 }
267263 else throw("Strict value is not equal to itself.")
268264 }
269265 else throw("Strict value is not equal to itself.")
270266 }
271267 else throw("Strict value is not equal to itself.")
272268 }
273269 else throw("Strict value is not equal to itself.")
274270 }
275271 else throw("Strict value is not equal to itself.")
276272 }
277273 else throw("Strict value is not equal to itself.")
278274 }
279275
280276
281277
282278 @Callable(i)
283279 func setAdmins (adminPubKeys) = {
284280 let checkCaller = mustManager(i)
285281 if ((checkCaller == checkCaller))
286282 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
287283 else throw("Strict value is not equal to itself.")
288284 }
289285
290286
291287
292288 @Callable(i)
293289 func setManager (pendingManagerPublicKey) = {
294290 let checkCaller = mustManager(i)
295291 if ((checkCaller == checkCaller))
296292 then {
297293 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
298294 if ((checkManagerPublicKey == checkManagerPublicKey))
299295 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
300296 else throw("Strict value is not equal to itself.")
301297 }
302298 else throw("Strict value is not equal to itself.")
303299 }
304300
305301
306302
307303 @Callable(i)
308304 func confirmManager () = {
309305 let pm = pendingManagerPublicKeyOrUnit()
310306 let hasPM = if (isDefined(pm))
311307 then true
312308 else throw("No pending manager")
313309 if ((hasPM == hasPM))
314310 then {
315311 let checkPM = if ((i.callerPublicKey == value(pm)))
316312 then true
317313 else throw("You are not pending manager")
318314 if ((checkPM == checkPM))
319315 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
320316 else throw("Strict value is not equal to itself.")
321317 }
322318 else throw("Strict value is not equal to itself.")
323319 }
324320
325321
326322
327323 @Callable(i)
328-func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP))
324+func priceAssetsREADONLY () = {
325+ let priceAssetsOrUnit = getString(keyPriceAssetIds())
326+ $Tuple2(nil, if ((priceAssetsOrUnit == unit))
327+ then nil
328+ else split(value(priceAssetsOrUnit), SEP))
329+ }
329330
330331
331332 @Verifier(tx)
332333 func verify () = {
333334 let targetPublicKey = match managerPublicKeyOrUnit() {
334335 case pk: ByteVector =>
335336 pk
336337 case _: Unit =>
337338 tx.senderPublicKey
338339 case _ =>
339340 throw("Match error")
340341 }
341342 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
342343 }
343344

github/deemru/w8io/026f985 
60.75 ms