tx · Hf4YaRjYCMrET2TH9NNQd74rREezKQy14AvBogayrsr3

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01600000 Waves

2023.01.19 15:22 [2411807] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "Hf4YaRjYCMrET2TH9NNQd74rREezKQy14AvBogayrsr3", "fee": 1600000, "feeAssetId": null, "timestamp": 1674130966785, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "Du6qQvcyvgbLh34yXnrXprMAdfLR2EUeENTQUAeAhUCCmh67kkv5epiKCo5Pc6dCQ2P7JwAW3Xrr9ocnFS68pVF" ], "script": "base64:AAIFAAAAAAAABwEIAhIJCgcICAgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgiA1NFUCIMd2F2ZXNBc3NldElkIhFpbnZhbGlkUHJpY2VBc3NldCIIdGhyb3dFcnIiA21zZyIHdGhyb3dQRCIUdGhyb3dDcmVhdGVOb3RDYWxsZWQiEXRocm93WW91Tm90SXNzdWVyIg90aHJvd1Bvb2xFeGlzdHMiFXRocm93QXNzZXROb3RWZXJpZmllZCIWdGhyb3dJbnZhbGlkUHJpY2VBc3NldCIUdGhyb3dJbnZhbGlkRmVlQXNzZXQiF3Rocm93SW52YWxpZEFtb3VudEFzc2V0IhJ0aHJvd0ludmFsaWRTdGF0dXMiH3Rocm93Q2FuQWN0aXZhdGVPbmx5UGVuZGluZ1Bvb2wiHXRocm93RmFjdG9yeVJldHVybmVkTm90U3RyaW5nIhx0aHJvd0ludmFsaWRQcmljZUFzc2V0QW1vdW50Ig90aHJvd0ludmFsaWRGZWUiE2tleU1hbmFnZXJQdWJsaWNLZXkiGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5Ig9rZXlBZG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AAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAJhZQEAAAATcHJpY2VBc3NldHNSRUFET05MWQAAAAAJAAUUAAAAAgUAAAADbmlsCQEAAAABVQAAAAEJAAQiAAAAAQkBAAAAAVIAAAAAAAAAAmFlAQAAAA5zdGF0dXNSRUFET05MWQAAAAIAAAABdwAAAAF4BAAAAAJhcQQAAAABVwkABCIAAAABCQEAAAABdgAAAAIFAAAAAXcFAAAAAXgDCQAAAQAAAAIFAAAAAVcCAAAABlN0cmluZwQAAAABWAUAAAABVwUAAAABWAUAAAAEdW5pdAkABRQAAAACBQAAAANuaWwFAAAAAmFxAAAAAQAAAAJiaAEAAAACYmkAAAAABAAAAAJiagQAAAABVwkBAAAAAmFiAAAAAAMJAAABAAAAAgUAAAABVwIAAAAKQnl0ZVZlY3RvcgQAAAACYWYFAAAAAVcFAAAAAmFmAwkAAAEAAAACBQAAAAFXAgAAAARVbml0CAUAAAACYmgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJiaAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmJoAAAABnByb29mcwAAAAAAAAAAAAUAAAACYmrck9+D", "chainId": 84, "height": 2411807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4UVbEFEj1Eji37zVRuxKutfbCVxWQs5m8f2jZ4Xc87hc Next: 6aYUsoKHSrQiKi3SKSsceYQMrTsYBBKxeo6BcntkytWN Diff:
OldNewDifferences
6565
6666
6767 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
68+
69+
70+func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
6871
6972
7073 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
199202
200203
201204 @Callable(i)
202-func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
205+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
203206 let checkCaller = mustManager(i)
204207 if ((checkCaller == checkCaller))
205- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
208+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
206209 else throw("Strict value is not equal to itself.")
207210 }
208211
213216 let amountAssetPayment = value(i.payments[0])
214217 let priceAssetPayment = value(i.payments[1])
215218 let feeAssetPayment = value(i.payments[2])
216- let $t064926564 = getIdAndInfo(amountAssetPayment)
217- let amountAssetId = $t064926564._1
218- let amountAssetInfo = $t064926564._2
219- let $t065676636 = getIdAndInfo(priceAssetPayment)
220- let priceAssetId = $t065676636._1
221- let priceAssetInfo = $t065676636._2
222- let $t066396702 = getIdAndInfo(feeAssetPayment)
223- let feeAssetId = $t066396702._1
224- let feeAssetInfo = $t066396702._2
219+ let $t066466718 = getIdAndInfo(amountAssetPayment)
220+ let amountAssetId = $t066466718._1
221+ let amountAssetInfo = $t066466718._2
222+ let $t067216790 = getIdAndInfo(priceAssetPayment)
223+ let priceAssetId = $t067216790._1
224+ let priceAssetInfo = $t067216790._2
225+ let $t067936856 = getIdAndInfo(feeAssetPayment)
226+ let feeAssetId = $t067936856._1
227+ let feeAssetInfo = $t067936856._2
225228 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
226229 let managerPriceAssetMinAmount = 1
227230 let priceAssetMinAmount = if (isManager(i))
232235 }
233236 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
234237 let curIndex = (lastIndex + 1)
238+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
235239 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
236240 then true
237241 else throwPoolExists(), if (if (isManager(i))
252256 then true
253257 else throwInvalidFee()]
254258 if ((checks == checks))
255- 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)]
259+ then {
260+ let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
261+ if ((burnEmissionInv == burnEmissionInv))
262+ 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)]
263+ else throw("Strict value is not equal to itself.")
264+ }
256265 else throw("Strict value is not equal to itself.")
257266 }
258267
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)
68+
69+
70+func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
6871
6972
7073 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7174
7275
7376 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
7477
7578
7679 let indexSuffix = "u"
7780
7881 let statusPending = "pending"
7982
8083 let statusDeclined = "declined"
8184
8285 let statusActive = "active"
8386
8487 let statuses = [statusPending, statusDeclined, statusActive]
8588
8689 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
8790
8891
8992 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
9093
9194
9295 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
9396
9497
9598 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
9699
97100
98101 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
99102
100103
101104 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
102105
103106
104107 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
105108
106109
107110 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
108111
109112
110113 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
111114
112115
113116 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
114117
115118
116119 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
117120
118121
119122 func stringOptionToList (stringOrUnit) = match stringOrUnit {
120123 case s: String =>
121124 if ((size(s) == 0))
122125 then nil
123126 else split(s, SEP)
124127 case _: Unit =>
125128 nil
126129 case _ =>
127130 throw("Match error")
128131 }
129132
130133
131134 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
132135
133136 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
134137
135138
136139 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
137140 then true
138141 else throwCreateNotCalled()
139142
140143
141144 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
142145 case s: String =>
143146 fromBase58String(s)
144147 case _: Unit =>
145148 unit
146149 case _ =>
147150 throw("Match error")
148151 }
149152
150153
151154 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
152155 case s: String =>
153156 fromBase58String(s)
154157 case _: Unit =>
155158 unit
156159 case _ =>
157160 throw("Match error")
158161 }
159162
160163
161164 func isManager (i) = match managerPublicKeyOrUnit() {
162165 case pk: ByteVector =>
163166 (i.callerPublicKey == pk)
164167 case _: Unit =>
165168 (i.caller == this)
166169 case _ =>
167170 throw("Match error")
168171 }
169172
170173
171174 func mustManager (i) = if (isManager(i))
172175 then true
173176 else throwPD()
174177
175178
176179 func mustAdmin (i) = {
177180 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
178181 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
179182 then true
180183 else mustManager(i)
181184 }
182185
183186
184187 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
185188
186189
187190 func getIdAndInfo (payment) = match payment.assetId {
188191 case id: ByteVector =>
189192 let info = value(assetInfo(id))
190193 $Tuple2(toBase58String(id), info)
191194 case _: Unit =>
192195 $Tuple2(wavesAssetId, unit)
193196 case _ =>
194197 throw("Match error")
195198 }
196199
197200
198201 func validStatus (status) = containsElement(statuses, status)
199202
200203
201204 @Callable(i)
202-func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
205+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
203206 let checkCaller = mustManager(i)
204207 if ((checkCaller == checkCaller))
205- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
208+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
206209 else throw("Strict value is not equal to itself.")
207210 }
208211
209212
210213
211214 @Callable(i)
212215 func create () = {
213216 let amountAssetPayment = value(i.payments[0])
214217 let priceAssetPayment = value(i.payments[1])
215218 let feeAssetPayment = value(i.payments[2])
216- let $t064926564 = getIdAndInfo(amountAssetPayment)
217- let amountAssetId = $t064926564._1
218- let amountAssetInfo = $t064926564._2
219- let $t065676636 = getIdAndInfo(priceAssetPayment)
220- let priceAssetId = $t065676636._1
221- let priceAssetInfo = $t065676636._2
222- let $t066396702 = getIdAndInfo(feeAssetPayment)
223- let feeAssetId = $t066396702._1
224- let feeAssetInfo = $t066396702._2
219+ let $t066466718 = getIdAndInfo(amountAssetPayment)
220+ let amountAssetId = $t066466718._1
221+ let amountAssetInfo = $t066466718._2
222+ let $t067216790 = getIdAndInfo(priceAssetPayment)
223+ let priceAssetId = $t067216790._1
224+ let priceAssetInfo = $t067216790._2
225+ let $t067936856 = getIdAndInfo(feeAssetPayment)
226+ let feeAssetId = $t067936856._1
227+ let feeAssetInfo = $t067936856._2
225228 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
226229 let managerPriceAssetMinAmount = 1
227230 let priceAssetMinAmount = if (isManager(i))
228231 then managerPriceAssetMinAmount
229232 else {
230233 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
231234 value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
232235 }
233236 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
234237 let curIndex = (lastIndex + 1)
238+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
235239 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
236240 then true
237241 else throwPoolExists(), if (if (isManager(i))
238242 then true
239243 else isVerified(amountAssetId))
240244 then true
241245 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
242246 then true
243247 else throwInvalidFeeAsset(), if (if (isManager(i))
244248 then true
245249 else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
246250 then true
247251 else throwInvalidAmountAsset(), if (if (isManager(i))
248252 then true
249253 else (priceAssetPayment.amount >= priceAssetMinAmount))
250254 then true
251255 else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
252256 then true
253257 else throwInvalidFee()]
254258 if ((checks == checks))
255- 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)]
259+ then {
260+ let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
261+ if ((burnEmissionInv == burnEmissionInv))
262+ 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)]
263+ else throw("Strict value is not equal to itself.")
264+ }
256265 else throw("Strict value is not equal to itself.")
257266 }
258267
259268
260269
261270 @Callable(i)
262271 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
263272 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
264273 then true
265274 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
266275 then true
267276 else throwCanActivateOnlyPendingPool()]
268277 if ((checks == checks))
269278 then {
270279 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
271280 if ((activateNewPoolInv == activateNewPoolInv))
272281 then {
273282 let lpAssetId = match activateNewPoolInv {
274283 case id: String =>
275284 id
276285 case _ =>
277286 throwFactoryReturnedNotString()
278287 }
279288 if ((lpAssetId == lpAssetId))
280289 then {
281290 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
282291 if ((beforePut == beforePut))
283292 then {
284293 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
285294 then unit
286295 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
287296 then unit
288297 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
289298 if ((put == put))
290299 then {
291300 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
292301 if ((afterPut == afterPut))
293302 then {
294303 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
295304 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
296305 }
297306 else throw("Strict value is not equal to itself.")
298307 }
299308 else throw("Strict value is not equal to itself.")
300309 }
301310 else throw("Strict value is not equal to itself.")
302311 }
303312 else throw("Strict value is not equal to itself.")
304313 }
305314 else throw("Strict value is not equal to itself.")
306315 }
307316 else throw("Strict value is not equal to itself.")
308317 }
309318
310319
311320
312321 @Callable(i)
313322 func setAdmins (adminPubKeys) = {
314323 let checkCaller = mustManager(i)
315324 if ((checkCaller == checkCaller))
316325 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
317326 else throw("Strict value is not equal to itself.")
318327 }
319328
320329
321330
322331 @Callable(i)
323332 func setManager (pendingManagerPublicKey) = {
324333 let checkCaller = mustManager(i)
325334 if ((checkCaller == checkCaller))
326335 then {
327336 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
328337 if ((checkManagerPublicKey == checkManagerPublicKey))
329338 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
330339 else throw("Strict value is not equal to itself.")
331340 }
332341 else throw("Strict value is not equal to itself.")
333342 }
334343
335344
336345
337346 @Callable(i)
338347 func confirmManager () = {
339348 let pm = pendingManagerPublicKeyOrUnit()
340349 let hasPM = if (isDefined(pm))
341350 then true
342351 else throw("No pending manager")
343352 if ((hasPM == hasPM))
344353 then {
345354 let checkPM = if ((i.callerPublicKey == value(pm)))
346355 then true
347356 else throw("You are not pending manager")
348357 if ((checkPM == checkPM))
349358 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
350359 else throw("Strict value is not equal to itself.")
351360 }
352361 else throw("Strict value is not equal to itself.")
353362 }
354363
355364
356365
357366 @Callable(i)
358367 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
359368
360369
361370
362371 @Callable(i)
363372 func statusREADONLY (amountAssetId,priceAssetId) = {
364373 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
365374 case s: String =>
366375 s
367376 case _ =>
368377 unit
369378 }
370379 $Tuple2(nil, status)
371380 }
372381
373382
374383 @Verifier(tx)
375384 func verify () = {
376385 let targetPublicKey = match managerPublicKeyOrUnit() {
377386 case pk: ByteVector =>
378387 pk
379388 case _: Unit =>
380389 tx.senderPublicKey
381390 case _ =>
382391 throw("Match error")
383392 }
384393 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
385394 }
386395

github/deemru/w8io/026f985 
74.11 ms