tx · TrRaCCk58qfzWhc2axGrmkbYVCGByZHbPxjtjoEQaFZ

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2022.04.13 14:07 [2006716] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "TrRaCCk58qfzWhc2axGrmkbYVCGByZHbPxjtjoEQaFZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1649848071088, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "4KiC5r3brupcsPCaNb93v77b8ANDTCvogSn3aSFypQPVEAbFoxjSFDDG9KwKeM14maVnNtCQMakCcYmSd2AQvyt2" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASBQoDCAgIEgcKBQgICAgIEgMKARgSAwoBCBIAEgAAAAAuAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAHdGhyb3dQRAAAAAAJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQBAAAAFHRocm93Q3JlYXRlTm90Q2FsbGVkAAAAAAkAAAIAAAABAgAAACRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBAAAAEXRocm93WW91Tm90SXNzdWVyAAAAAAkAAAIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhbW91bnRBc3NldCBpc3N1ZXIBAAAAD3Rocm93UG9vbEV4aXN0cwAAAAAJAAACAAAAAQIAAAAkUG9vbCB3aXRoIHN1Y2ggYXNzZXRzIGFscmVhZHkgZXhpc3RzAQAAABV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQAAAAACQAAAgAAAAECAAAAFUFzc2V0IGlzIG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ACCQAETAAAAAICAAAABiVzJXMlcwkABEwAAAACAgAAABFhbW91bnRBc3NldEFtb3VudAkABEwAAAACBQAAAA1hbW91bnRBc3NldElkCQAETAAAAAIFAAAADHByaWNlQXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAAE2tleVByaWNlQXNzZXRBbW91bnQAAAACAAAADWFtb3VudEFzc2V0SWQAAAAMcHJpY2VBc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAAGJXMlcyVzCQAETAAAAAICAAAAEHByaWNlQXNzZXRBbW91bnQJAARMAAAAAgUAAAANYW1vdW50QXNzZXRJZAkABEwAAAACBQAAAAxwcmljZUFzc2V0SWQFAAAAA25pbAUAAAADU0VQAQAAAAlrZXlIZWlnaHQAAAACAAAADWFtb3VudEFzc2V0SWQAAAAMcHJpY2VBc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAAGJXMlcyVzCQAETAAAAAICAAAABmhlaWdodAkABEwAAAACBQAAAA1hbW91bnRBc3NldElkCQAETAAAAAIFAAAADHByaWNlQXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAADWtleUZlZUFzc2V0SWQAAAAACQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAKZmVlQXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAADGtleUZlZUFtb3VudAAAAAAJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAlmZWVBbW91bnQFAAAAA25pbAUAAAADU0VQAQAAABdrZXlBbW91bnRBc3NldE1pbkFtb3VudAAAAAAJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAABRhbW91bnRBc3NldE1pbkFtb3VudAUAAAADbmlsBQAAAANTRVABAAAAF2tleVByaWNlQXNzZXRzTWluQW1vdW50AAAAAAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAFHByaWNlQXNzZXRzTWluQW1vdW50BQAAAANuaWwFAAAAA1NFUAEAAAAQa2V5UHJpY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AAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXl+h1DS", "chainId": 84, "height": 2006716, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 26oPx6bESHzC3t4nahpmcnDp1kZVmeCiT4geAvE8CmKU Next: 2Fy3EBWKijGFHWFoDvT994B2TS7NtL4hpcbsCzRwmQwq Diff:
OldNewDifferences
5858 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
5959
6060
61-let STATUS_PENDING = "pending"
61+let statusPending = "pending"
6262
63-let STATUS_DECLINED = "declined"
63+let statusDeclined = "declined"
6464
65-let STATUS_CREATING = "creating"
65+let statusCreating = "creating"
6666
67-let STATUS_ACTIVE = "active"
67+let statusActive = "active"
6868
69-let STATUS_BOT_DISABLED = "bot_disabled"
69+let statusBotDisabled = "bot_disabled"
7070
71-let STATUSES = [STATUS_PENDING, STATUS_DECLINED, STATUS_CREATING, STATUS_ACTIVE, STATUS_BOT_DISABLED]
71+let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled]
7272
7373 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7474
167167 }
168168
169169
170-func validStatus (status) = containsElement(STATUSES, status)
170+func validStatus (status) = containsElement(statuses, status)
171171
172172
173173 @Callable(i)
185185 let amountAssetPayment = value(i.payments[0])
186186 let priceAssetPayment = value(i.payments[1])
187187 let feeAssetPayment = value(i.payments[2])
188- let $t059105981 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t059105981._1
190- let amountAssetInfo = $t059105981._2
191- let $t059846052 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t059846052._1
193- let priceAssetInfo = $t059846052._2
194- let $t060556117 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t060556117._1
196- let feeAssetInfo = $t060556117._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
197197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198198 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199199 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
212212 then true
213213 else throw()]
214214 if ((checks == checks))
215- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_PENDING), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
215+ 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)]
216216 else throw("Strict value is not equal to itself.")
217217 }
218218
236236 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker) = {
237237 let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId))
238238 then true
239- else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == STATUS_PENDING))
239+ else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
240240 then true
241241 else throwCanActivateOnlyPendingPool()]
242242 if ((checks == checks))
262262 if ((afterPut == afterPut))
263263 then {
264264 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
265-[StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_CREATING), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
265+[StringEntry(keyStatus(amountAssetId, priceAssetId), statusCreating), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
266266 }
267267 else throw("Strict value is not equal to itself.")
268268 }
323323 }
324324
325325
326+
327+@Callable(i)
328+func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP))
329+
330+
326331 @Verifier(tx)
327332 func verify () = {
328333 let targetPublicKey = match managerPublicKeyOrUnit() {
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
61-let STATUS_PENDING = "pending"
61+let statusPending = "pending"
6262
63-let STATUS_DECLINED = "declined"
63+let statusDeclined = "declined"
6464
65-let STATUS_CREATING = "creating"
65+let statusCreating = "creating"
6666
67-let STATUS_ACTIVE = "active"
67+let statusActive = "active"
6868
69-let STATUS_BOT_DISABLED = "bot_disabled"
69+let statusBotDisabled = "bot_disabled"
7070
71-let STATUSES = [STATUS_PENDING, STATUS_DECLINED, STATUS_CREATING, STATUS_ACTIVE, STATUS_BOT_DISABLED]
71+let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled]
7272
7373 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7474
7575
7676 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
7777
7878
7979 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
8080
8181
8282 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
8383
8484
8585 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
8686
8787
8888 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
8989
9090
9191 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
9292
9393
9494 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
9595
9696
9797 func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP)
9898
9999
100100 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
101101
102102
103103 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
104104
105105 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
106106
107107
108108 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
109109 then true
110110 else throwCreateNotCalled()
111111
112112
113113 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
114114 case s: String =>
115115 fromBase58String(s)
116116 case _: Unit =>
117117 unit
118118 case _ =>
119119 throw("Match error")
120120 }
121121
122122
123123 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
124124 case s: String =>
125125 fromBase58String(s)
126126 case _: Unit =>
127127 unit
128128 case _ =>
129129 throw("Match error")
130130 }
131131
132132
133133 func mustManager (i) = match managerPublicKeyOrUnit() {
134134 case pk: ByteVector =>
135135 if ((i.callerPublicKey == pk))
136136 then true
137137 else throwPD()
138138 case _: Unit =>
139139 if ((i.caller == this))
140140 then true
141141 else throwPD()
142142 case _ =>
143143 throw("Match error")
144144 }
145145
146146
147147 func mustAdmin (i) = {
148148 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
149149 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
150150 then true
151151 else {
152152 let isManager = mustManager(i)
153153 if ((isManager == isManager))
154154 then true
155155 else throw("Strict value is not equal to itself.")
156156 }
157157 }
158158
159159
160160 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
161161
162162
163163 func getIdAndInfo (payment) = {
164164 let id = value(payment.assetId)
165165 let info = value(assetInfo(id))
166166 $Tuple2(toBase58String(id), info)
167167 }
168168
169169
170-func validStatus (status) = containsElement(STATUSES, status)
170+func validStatus (status) = containsElement(statuses, status)
171171
172172
173173 @Callable(i)
174174 func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
175175 let checkCaller = mustManager(i)
176176 if ((checkCaller == checkCaller))
177177 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)]
178178 else throw("Strict value is not equal to itself.")
179179 }
180180
181181
182182
183183 @Callable(i)
184184 func create () = {
185185 let amountAssetPayment = value(i.payments[0])
186186 let priceAssetPayment = value(i.payments[1])
187187 let feeAssetPayment = value(i.payments[2])
188- let $t059105981 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t059105981._1
190- let amountAssetInfo = $t059105981._2
191- let $t059846052 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t059846052._1
193- let priceAssetInfo = $t059846052._2
194- let $t060556117 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t060556117._1
196- let feeAssetInfo = $t060556117._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
197197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198198 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199199 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
200200 then true
201201 else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller))
202202 then true
203203 else throwYouNotIssuer(), if (isVerified(amountAssetId))
204204 then true
205205 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
206206 then true
207207 else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
208208 then true
209209 else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
210210 then true
211211 else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
212212 then true
213213 else throw()]
214214 if ((checks == checks))
215- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_PENDING), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
215+ 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)]
216216 else throw("Strict value is not equal to itself.")
217217 }
218218
219219
220220
221221 @Callable(i)
222222 func setStatus (amountAssetId,priceAssetId,newStatus) = {
223223 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
224224 then true
225225 else throwCreateNotCalled(), if (validStatus(newStatus))
226226 then true
227227 else throwInvalidStatus()]
228228 if ((checks == checks))
229229 then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)]
230230 else throw("Strict value is not equal to itself.")
231231 }
232232
233233
234234
235235 @Callable(i)
236236 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker) = {
237237 let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId))
238238 then true
239- else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == STATUS_PENDING))
239+ else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
240240 then true
241241 else throwCanActivateOnlyPendingPool()]
242242 if ((checks == checks))
243243 then {
244244 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((("WX " + amountAssetTicker) + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL"], nil)
245245 if ((activateNewPoolInv == activateNewPoolInv))
246246 then {
247247 let lpAssetId = match activateNewPoolInv {
248248 case id: String =>
249249 id
250250 case _ =>
251251 throwFactoryReturnedNotString()
252252 }
253253 if ((lpAssetId == lpAssetId))
254254 then {
255255 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
256256 if ((beforePut == beforePut))
257257 then {
258258 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
259259 if ((put == put))
260260 then {
261261 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
262262 if ((afterPut == afterPut))
263263 then {
264264 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
265-[StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_CREATING), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
265+[StringEntry(keyStatus(amountAssetId, priceAssetId), statusCreating), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
266266 }
267267 else throw("Strict value is not equal to itself.")
268268 }
269269 else throw("Strict value is not equal to itself.")
270270 }
271271 else throw("Strict value is not equal to itself.")
272272 }
273273 else throw("Strict value is not equal to itself.")
274274 }
275275 else throw("Strict value is not equal to itself.")
276276 }
277277 else throw("Strict value is not equal to itself.")
278278 }
279279
280280
281281
282282 @Callable(i)
283283 func setAdmins (adminPubKeys) = {
284284 let checkCaller = mustManager(i)
285285 if ((checkCaller == checkCaller))
286286 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
287287 else throw("Strict value is not equal to itself.")
288288 }
289289
290290
291291
292292 @Callable(i)
293293 func setManager (pendingManagerPublicKey) = {
294294 let checkCaller = mustManager(i)
295295 if ((checkCaller == checkCaller))
296296 then {
297297 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
298298 if ((checkManagerPublicKey == checkManagerPublicKey))
299299 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
300300 else throw("Strict value is not equal to itself.")
301301 }
302302 else throw("Strict value is not equal to itself.")
303303 }
304304
305305
306306
307307 @Callable(i)
308308 func confirmManager () = {
309309 let pm = pendingManagerPublicKeyOrUnit()
310310 let hasPM = if (isDefined(pm))
311311 then true
312312 else throw("No pending manager")
313313 if ((hasPM == hasPM))
314314 then {
315315 let checkPM = if ((i.callerPublicKey == value(pm)))
316316 then true
317317 else throw("You are not pending manager")
318318 if ((checkPM == checkPM))
319319 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
320320 else throw("Strict value is not equal to itself.")
321321 }
322322 else throw("Strict value is not equal to itself.")
323323 }
324324
325325
326+
327+@Callable(i)
328+func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP))
329+
330+
326331 @Verifier(tx)
327332 func verify () = {
328333 let targetPublicKey = match managerPublicKeyOrUnit() {
329334 case pk: ByteVector =>
330335 pk
331336 case _: Unit =>
332337 tx.senderPublicKey
333338 case _ =>
334339 throw("Match error")
335340 }
336341 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
337342 }
338343

github/deemru/w8io/026f985 
52.87 ms