tx · GkjZUyBJNWL3LJGd6TD1hgVXrQVg28kkgqhX5TA2c9g

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2023.04.24 13:30 [2548511] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "GkjZUyBJNWL3LJGd6TD1hgVXrQVg28kkgqhX5TA2c9g", "fee": 1400000, "feeAssetId": null, "timestamp": 1682332239446, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3sDN2qpgdudjUtQMira7kxwRiJutM7HxT7YDk5rbyd9y54qAE9qQ7b232gPEwAS82bqGvM5dEmpLwHzmTDjC6Kfn" ], "script": "base64:BgKIEAgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIDCgEIEgASABIECgIICCIQY29udHJhY3RGaWxlbmFtZSIDU0VQIgx3YXZlc0Fzc2V0SWQiEWludmFsaWRQcmljZUFzc2V0Igd3cmFwRXJyIgNtc2ciCHRocm93RXJyIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSIVdGhyb3dJbnZhbGlkQXNzZXRQYWlyIhNrZXl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q6z88yrJ6Sj8AMF8mYZ Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let contractFilename = "user_pools.ride"
5+
46 let SEP = "__"
57
68 let wavesAssetId = "WAVES"
79
810 let invalidPriceAsset = "Invalid price asset"
911
10-func throwErr (msg) = throw(makeString(["user_pools.ride:", msg], " "))
12+func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
13+
14+
15+func throwErr (msg) = throw(wrapErr(msg))
1116
1217
1318 func throwPD () = throwErr("Permission denied")
136141
137142 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
138143
144+let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
145+
146+let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
147+
148+let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
149+
150+let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
151+
139152 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
140153
141154
219232 let asset1Payment = value(i.payments[0])
220233 let asset2Payment = value(i.payments[1])
221234 let feeAssetPayment = value(i.payments[2])
222- let $t067746831 = getIdAndInfo(asset1Payment)
223- let asset1Id = $t067746831._1
224- let asset1Info = $t067746831._2
225- let $t068346891 = getIdAndInfo(asset2Payment)
226- let asset2Id = $t068346891._1
227- let asset2Info = $t068346891._2
228- let $t068946957 = getIdAndInfo(feeAssetPayment)
229- let feeAssetId = $t068946957._1
230- let feeAssetInfo = $t068946957._2
235+ let $t074647521 = getIdAndInfo(asset1Payment)
236+ let asset1Id = $t074647521._1
237+ let asset1Info = $t074647521._2
238+ let $t075247581 = getIdAndInfo(asset2Payment)
239+ let asset2Id = $t075247581._1
240+ let asset2Info = $t075247581._2
241+ let $t075847647 = getIdAndInfo(feeAssetPayment)
242+ let feeAssetId = $t075847647._1
243+ let feeAssetInfo = $t075847647._2
231244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
232245 let checkAssetsNotEqual = if ((asset1Id != asset2Id))
233246 then true
234247 else throwInvalidAssetPair()
235248 if ((checkAssetsNotEqual == checkAssetsNotEqual))
236249 then {
237- let $t071317573 = if (if (containsElement(priceAssetsList, asset2Id))
250+ let $t078218263 = if (if (containsElement(priceAssetsList, asset2Id))
238251 then isVerified(asset1Id)
239252 else false)
240253 then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
243256 else false)
244257 then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
245258 else throwInvalidAssetPair()
246- let amountAssetId = $t071317573._1
247- let amountAssetAmount = $t071317573._2
248- let priceAssetId = $t071317573._3
249- let priceAssetAmount = $t071317573._4
259+ let amountAssetId = $t078218263._1
260+ let amountAssetAmount = $t078218263._2
261+ let priceAssetId = $t078218263._3
262+ let priceAssetAmount = $t078218263._4
250263 let managerPriceAssetMinAmount = 1
251264 let priceAssetMinAmount = if (isManager(i))
252265 then managerPriceAssetMinAmount
261274 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
262275 if ($isInstanceOf(@, "Boolean"))
263276 then @
264- else throw("Couldn't cast Any to Boolean")
277+ else throw(($getType(@) + " couldn't be cast to Boolean"))
265278 }
266279 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
267280 then true
328341 if ((afterPut == afterPut))
329342 then {
330343 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
331-[StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
344+ let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
345+ if ((res == res))
346+ then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
347+ else throw("Strict value is not equal to itself.")
332348 }
333349 else throw("Strict value is not equal to itself.")
334350 }
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let contractFilename = "user_pools.ride"
5+
46 let SEP = "__"
57
68 let wavesAssetId = "WAVES"
79
810 let invalidPriceAsset = "Invalid price asset"
911
10-func throwErr (msg) = throw(makeString(["user_pools.ride:", msg], " "))
12+func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
13+
14+
15+func throwErr (msg) = throw(wrapErr(msg))
1116
1217
1318 func throwPD () = throwErr("Permission denied")
1419
1520
1621 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
1722
1823
1924 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2025
2126
2227 func throwPoolExists () = throwErr("Pool with such assets already exists")
2328
2429
2530 func throwAssetNotVerified () = throwErr("Asset is not verified")
2631
2732
2833 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
2934
3035
3136 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3237
3338
3439 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
3540
3641
3742 func throwInvalidStatus () = throwErr("Invalid status")
3843
3944
4045 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4146
4247
4348 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4449
4550
4651 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
4752
4853
4954 func throwInvalidFee () = throwErr("invalid fee")
5055
5156
5257 func throwInvalidAssetPair () = throwErr("invalid asset pair")
5358
5459
5560 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
5661
5762
5863 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
5964
6065
6166 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
6267
6368
6469 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
6570
6671
6772 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
6873
6974
7075 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
7176
7277
7378 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
7479
7580
7681 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7782
7883
7984 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8085
8186
8287 let indexSuffix = "u"
8388
8489 let statusPending = "pending"
8590
8691 let statusDeclined = "declined"
8792
8893 let statusActive = "active"
8994
9095 let statuses = [statusPending, statusDeclined, statusActive]
9196
9297 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
9398
9499
95100 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
96101
97102
98103 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
99104
100105
101106 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
102107
103108
104109 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
105110
106111
107112 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
108113
109114
110115 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
111116
112117
113118 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
114119
115120
116121 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
117122
118123
119124 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
120125
121126
122127 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
123128
124129
125130 func stringOptionToList (stringOrUnit) = match stringOrUnit {
126131 case s: String =>
127132 if ((size(s) == 0))
128133 then nil
129134 else split(s, SEP)
130135 case _: Unit =>
131136 nil
132137 case _ =>
133138 throw("Match error")
134139 }
135140
136141
137142 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
138143
144+let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
145+
146+let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
147+
148+let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
149+
150+let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
151+
139152 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
140153
141154
142155 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
143156 then true
144157 else throwCreateNotCalled()
145158
146159
147160 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
148161 case s: String =>
149162 fromBase58String(s)
150163 case _: Unit =>
151164 unit
152165 case _ =>
153166 throw("Match error")
154167 }
155168
156169
157170 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
158171 case s: String =>
159172 fromBase58String(s)
160173 case _: Unit =>
161174 unit
162175 case _ =>
163176 throw("Match error")
164177 }
165178
166179
167180 func isManager (i) = match managerPublicKeyOrUnit() {
168181 case pk: ByteVector =>
169182 (i.callerPublicKey == pk)
170183 case _: Unit =>
171184 (i.caller == this)
172185 case _ =>
173186 throw("Match error")
174187 }
175188
176189
177190 func mustManager (i) = if (isManager(i))
178191 then true
179192 else throwPD()
180193
181194
182195 func mustAdmin (i) = {
183196 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
184197 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
185198 then true
186199 else mustManager(i)
187200 }
188201
189202
190203 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
191204
192205
193206 func getIdAndInfo (payment) = match payment.assetId {
194207 case id: ByteVector =>
195208 let info = value(assetInfo(id))
196209 $Tuple2(toBase58String(id), info)
197210 case _: Unit =>
198211 $Tuple2(wavesAssetId, unit)
199212 case _ =>
200213 throw("Match error")
201214 }
202215
203216
204217 func validStatus (status) = containsElement(statuses, status)
205218
206219
207220 @Callable(i)
208221 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
209222 let checkCaller = mustManager(i)
210223 if ((checkCaller == checkCaller))
211224 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
212225 else throw("Strict value is not equal to itself.")
213226 }
214227
215228
216229
217230 @Callable(i)
218231 func create () = {
219232 let asset1Payment = value(i.payments[0])
220233 let asset2Payment = value(i.payments[1])
221234 let feeAssetPayment = value(i.payments[2])
222- let $t067746831 = getIdAndInfo(asset1Payment)
223- let asset1Id = $t067746831._1
224- let asset1Info = $t067746831._2
225- let $t068346891 = getIdAndInfo(asset2Payment)
226- let asset2Id = $t068346891._1
227- let asset2Info = $t068346891._2
228- let $t068946957 = getIdAndInfo(feeAssetPayment)
229- let feeAssetId = $t068946957._1
230- let feeAssetInfo = $t068946957._2
235+ let $t074647521 = getIdAndInfo(asset1Payment)
236+ let asset1Id = $t074647521._1
237+ let asset1Info = $t074647521._2
238+ let $t075247581 = getIdAndInfo(asset2Payment)
239+ let asset2Id = $t075247581._1
240+ let asset2Info = $t075247581._2
241+ let $t075847647 = getIdAndInfo(feeAssetPayment)
242+ let feeAssetId = $t075847647._1
243+ let feeAssetInfo = $t075847647._2
231244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
232245 let checkAssetsNotEqual = if ((asset1Id != asset2Id))
233246 then true
234247 else throwInvalidAssetPair()
235248 if ((checkAssetsNotEqual == checkAssetsNotEqual))
236249 then {
237- let $t071317573 = if (if (containsElement(priceAssetsList, asset2Id))
250+ let $t078218263 = if (if (containsElement(priceAssetsList, asset2Id))
238251 then isVerified(asset1Id)
239252 else false)
240253 then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
241254 else if (if (containsElement(priceAssetsList, asset1Id))
242255 then isVerified(asset2Id)
243256 else false)
244257 then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
245258 else throwInvalidAssetPair()
246- let amountAssetId = $t071317573._1
247- let amountAssetAmount = $t071317573._2
248- let priceAssetId = $t071317573._3
249- let priceAssetAmount = $t071317573._4
259+ let amountAssetId = $t078218263._1
260+ let amountAssetAmount = $t078218263._2
261+ let priceAssetId = $t078218263._3
262+ let priceAssetAmount = $t078218263._4
250263 let managerPriceAssetMinAmount = 1
251264 let priceAssetMinAmount = if (isManager(i))
252265 then managerPriceAssetMinAmount
253266 else {
254267 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
255268 value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
256269 }
257270 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
258271 let curIndex = (lastIndex + 1)
259272 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
260273 let poolExists = {
261274 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
262275 if ($isInstanceOf(@, "Boolean"))
263276 then @
264- else throw("Couldn't cast Any to Boolean")
277+ else throw(($getType(@) + " couldn't be cast to Boolean"))
265278 }
266279 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
267280 then true
268281 else throwPoolExists(), if (!(poolExists))
269282 then true
270283 else throwPoolExists(), if ((getString(keyFeeAssetId()) == feeAssetId))
271284 then true
272285 else throwInvalidFeeAsset(), if (if (isManager(i))
273286 then true
274287 else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
275288 then true
276289 else throwInvalidAmountAsset(), if (if (isManager(i))
277290 then true
278291 else (priceAssetAmount >= priceAssetMinAmount))
279292 then true
280293 else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
281294 then true
282295 else throwInvalidFee()]
283296 if ((checks == checks))
284297 then {
285298 let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
286299 if ((burnEmissionInv == burnEmissionInv))
287300 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), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)]
288301 else throw("Strict value is not equal to itself.")
289302 }
290303 else throw("Strict value is not equal to itself.")
291304 }
292305 else throw("Strict value is not equal to itself.")
293306 }
294307
295308
296309
297310 @Callable(i)
298311 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
299312 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
300313 then true
301314 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
302315 then true
303316 else throwCanActivateOnlyPendingPool()]
304317 if ((checks == checks))
305318 then {
306319 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
307320 if ((activateNewPoolInv == activateNewPoolInv))
308321 then {
309322 let lpAssetId = match activateNewPoolInv {
310323 case id: String =>
311324 id
312325 case _ =>
313326 throwFactoryReturnedNotString()
314327 }
315328 if ((lpAssetId == lpAssetId))
316329 then {
317330 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
318331 if ((beforePut == beforePut))
319332 then {
320333 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
321334 then unit
322335 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
323336 then unit
324337 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
325338 if ((put == put))
326339 then {
327340 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
328341 if ((afterPut == afterPut))
329342 then {
330343 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
331-[StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
344+ let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
345+ if ((res == res))
346+ then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
347+ else throw("Strict value is not equal to itself.")
332348 }
333349 else throw("Strict value is not equal to itself.")
334350 }
335351 else throw("Strict value is not equal to itself.")
336352 }
337353 else throw("Strict value is not equal to itself.")
338354 }
339355 else throw("Strict value is not equal to itself.")
340356 }
341357 else throw("Strict value is not equal to itself.")
342358 }
343359 else throw("Strict value is not equal to itself.")
344360 }
345361
346362
347363
348364 @Callable(i)
349365 func setAdmins (adminPubKeys) = {
350366 let checkCaller = mustManager(i)
351367 if ((checkCaller == checkCaller))
352368 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
353369 else throw("Strict value is not equal to itself.")
354370 }
355371
356372
357373
358374 @Callable(i)
359375 func setManager (pendingManagerPublicKey) = {
360376 let checkCaller = mustManager(i)
361377 if ((checkCaller == checkCaller))
362378 then {
363379 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
364380 if ((checkManagerPublicKey == checkManagerPublicKey))
365381 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
366382 else throw("Strict value is not equal to itself.")
367383 }
368384 else throw("Strict value is not equal to itself.")
369385 }
370386
371387
372388
373389 @Callable(i)
374390 func confirmManager () = {
375391 let pm = pendingManagerPublicKeyOrUnit()
376392 let hasPM = if (isDefined(pm))
377393 then true
378394 else throw("No pending manager")
379395 if ((hasPM == hasPM))
380396 then {
381397 let checkPM = if ((i.callerPublicKey == value(pm)))
382398 then true
383399 else throw("You are not pending manager")
384400 if ((checkPM == checkPM))
385401 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
386402 else throw("Strict value is not equal to itself.")
387403 }
388404 else throw("Strict value is not equal to itself.")
389405 }
390406
391407
392408
393409 @Callable(i)
394410 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
395411
396412
397413
398414 @Callable(i)
399415 func statusREADONLY (amountAssetId,priceAssetId) = {
400416 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
401417 case s: String =>
402418 s
403419 case _ =>
404420 unit
405421 }
406422 $Tuple2(nil, status)
407423 }
408424
409425
410426 @Verifier(tx)
411427 func verify () = {
412428 let targetPublicKey = match managerPublicKeyOrUnit() {
413429 case pk: ByteVector =>
414430 pk
415431 case _: Unit =>
416432 tx.senderPublicKey
417433 case _ =>
418434 throw("Match error")
419435 }
420436 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
421437 }
422438

github/deemru/w8io/026f985 
62.97 ms