tx · 4Ec9jXGPbgeFMgLFotmguau9CGrYp8mnT4SdNdVk1jnF 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01300000 Waves 2023.05.10 13:17 [2571657] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "4Ec9jXGPbgeFMgLFotmguau9CGrYp8mnT4SdNdVk1jnF", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713846972, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "u935n3RUM4cZmRgThhL2WcfsuqENxFu596zCxTnjkpL2mdLTurkiur9Te1pwjpnrgBuPExz5inaRg3wQwVDyxFT" ], "script": "base64:BgLiDwgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIAEgQKAggIIhBjb250cmFjdEZpbGVuYW1lIgNTRVAiDHdhdmVzQXNzZXRJZCIRaW52YWxpZFByaWNlQXNzZXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiB3Rocm93UEQiFHRocm93Q3JlYXRlTm90Q2FsbGVkIhF0aHJvd1lvdU5vdElzc3VlciIPdGhyb3dQb29sRXhpc3RzIhV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQiFnRocm93SW52YWxpZFByaWNlQXNzZXQiFHRocm93SW52YWxpZEZlZUFzc2V0Ihd0aHJvd0ludmFsaWRBbW91bnRBc3NldCISdGhyb3dJbnZhbGlkU3RhdHVzIh90aHJvd0NhbkFjdGl2YXRlT25seVBlbmRpbmdQb29sIh10aHJvd0ZhY3RvcnlSZXR1cm5lZE5vdFN0cmluZyIcdGhyb3dJbnZhbGlkUHJpY2VBc3NldEFtb3VudCIPdGhyb3dJbnZhbGlkRmVlIhV0aHJvd0ludmFsaWRBc3NldFBhaXIiE2tleU1hbmFnZXJQdWJsaWN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lAoCBQNuaWwFAmF5AQJidQECYnYABAJidwQBVwkBAmFqAAMJAAECBQFXAgpCeXRlVmVjdG9yBAJhbgUBVwUCYW4DCQABAgUBVwIEVW5pdAgFAmJ1D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJidQlib2R5Qnl0ZXMJAJEDAggFAmJ1BnByb29mcwAABQJid0ZWy58=", "height": 2571657, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4pAh3mrJUeHMi8nxU6tiKTbUTDVovY6CR5E5STvVv8sc Next: Bcqq9bGEuN49RvHfog8bCyPom58HDDuTAGPCW6xYYaGT Diff:
Old | New | Differences | |
---|---|---|---|
60 | 60 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
61 | 61 | ||
62 | 62 | ||
63 | - | func | |
63 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
124 | 124 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
125 | 125 | ||
126 | 126 | ||
127 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
128 | + | case s: String => | |
129 | + | addressFromStringValue(s) | |
130 | + | case _ => | |
131 | + | this | |
132 | + | } | |
133 | + | ||
134 | + | ||
127 | 135 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
128 | 136 | ||
129 | 137 | ||
157 | 165 | else throwCreateNotCalled() | |
158 | 166 | ||
159 | 167 | ||
160 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
161 | - | case s: String => | |
162 | - | fromBase58String(s) | |
163 | - | case _: Unit => | |
164 | - | unit | |
165 | - | case _ => | |
166 | - | throw("Match error") | |
167 | - | } | |
168 | - | ||
169 | - | ||
170 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
171 | - | case s: String => | |
172 | - | fromBase58String(s) | |
173 | - | case _: Unit => | |
174 | - | unit | |
175 | - | case _ => | |
176 | - | throw("Match error") | |
177 | - | } | |
168 | + | func managerPublicKeyOrUnit () = { | |
169 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
170 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
171 | + | case s: String => | |
172 | + | fromBase58String(s) | |
173 | + | case _: Unit => | |
174 | + | unit | |
175 | + | case _ => | |
176 | + | throw("Match error") | |
177 | + | } | |
178 | + | } | |
178 | 179 | ||
179 | 180 | ||
180 | 181 | func isManager (i) = match managerPublicKeyOrUnit() { | |
229 | 230 | ||
230 | 231 | @Callable(i) | |
231 | 232 | func create () = { | |
232 | - | let | |
233 | - | let | |
233 | + | let asset1Payment = value(i.payments[0]) | |
234 | + | let asset2Payment = value(i.payments[1]) | |
234 | 235 | let feeAssetPayment = value(i.payments[2]) | |
235 | - | let $t074737545 = getIdAndInfo(amountAssetPayment) | |
236 | - | let amountAssetId = $t074737545._1 | |
237 | - | let amountAssetInfo = $t074737545._2 | |
238 | - | let $t075487617 = getIdAndInfo(priceAssetPayment) | |
239 | - | let priceAssetId = $t075487617._1 | |
240 | - | let priceAssetInfo = $t075487617._2 | |
241 | - | let $t076207683 = getIdAndInfo(feeAssetPayment) | |
242 | - | let feeAssetId = $t076207683._1 | |
243 | - | let feeAssetInfo = $t076207683._2 | |
244 | - | let amountAssetAmount = amountAssetPayment.amount | |
245 | - | let priceAssetAmount = priceAssetPayment.amount | |
246 | - | let feeAssetAmount = feeAssetPayment.amount | |
236 | + | let $t075317588 = getIdAndInfo(asset1Payment) | |
237 | + | let asset1Id = $t075317588._1 | |
238 | + | let asset1Info = $t075317588._2 | |
239 | + | let $t075917648 = getIdAndInfo(asset2Payment) | |
240 | + | let asset2Id = $t075917648._1 | |
241 | + | let asset2Info = $t075917648._2 | |
242 | + | let $t076517714 = getIdAndInfo(feeAssetPayment) | |
243 | + | let feeAssetId = $t076517714._1 | |
244 | + | let feeAssetInfo = $t076517714._2 | |
247 | 245 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
248 | - | let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount()) | |
249 | - | let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount())) | |
250 | - | let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId)) | |
246 | + | let checkAssetsNotEqual = if ((asset1Id != asset2Id)) | |
247 | + | then true | |
248 | + | else throwInvalidAssetPair() | |
249 | + | if ((checkAssetsNotEqual == checkAssetsNotEqual)) | |
251 | 250 | then { | |
252 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset) | |
253 | - | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
254 | - | } | |
255 | - | else assetMinAmountDefault | |
256 | - | let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId)) | |
257 | - | then { | |
258 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
259 | - | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
260 | - | } | |
261 | - | else assetMinAmountDefault | |
262 | - | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
263 | - | let curIndex = (lastIndex + 1) | |
264 | - | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
265 | - | let poolExists = { | |
266 | - | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
267 | - | if ($isInstanceOf(@, "Boolean")) | |
268 | - | then @ | |
269 | - | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
270 | - | } | |
271 | - | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
272 | - | then true | |
273 | - | else throwPoolExists(), if (!(poolExists)) | |
274 | - | then true | |
275 | - | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
276 | - | then true | |
277 | - | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
278 | - | then isVerified(priceAssetId) | |
279 | - | else false) | |
280 | - | then true | |
281 | - | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
282 | - | then true | |
283 | - | else containsElement(priceAssetsList, priceAssetId)) | |
284 | - | then true | |
285 | - | else throwInvalidAssetPair(), if (if (isManager(i)) | |
286 | - | then true | |
287 | - | else (getString(keyFeeAssetId()) == feeAssetId)) | |
288 | - | then true | |
289 | - | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
290 | - | then true | |
291 | - | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
292 | - | then true | |
293 | - | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
294 | - | then true | |
295 | - | else (priceAssetAmount >= priceAssetMinAmount)) | |
296 | - | then true | |
297 | - | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
298 | - | then true | |
299 | - | else (feeAssetAmount == getInteger(keyFeeAmount()))) | |
300 | - | then true | |
301 | - | else throwInvalidFee()] | |
302 | - | if ((checks == checks)) | |
303 | - | then { | |
304 | - | let paymentsWithFeeSize = 3 | |
305 | - | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
306 | - | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
307 | - | else unit | |
308 | - | if ((burnEmissionInv == burnEmissionInv)) | |
309 | - | 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)] | |
251 | + | let $t078888349 = if (if (isManager(i)) | |
252 | + | then true | |
253 | + | else if (containsElement(priceAssetsList, asset2Id)) | |
254 | + | then isVerified(asset1Id) | |
255 | + | else false) | |
256 | + | then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount) | |
257 | + | else if (if (containsElement(priceAssetsList, asset1Id)) | |
258 | + | then isVerified(asset2Id) | |
259 | + | else false) | |
260 | + | then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount) | |
261 | + | else throwInvalidAssetPair() | |
262 | + | let amountAssetId = $t078888349._1 | |
263 | + | let amountAssetAmount = $t078888349._2 | |
264 | + | let priceAssetId = $t078888349._3 | |
265 | + | let priceAssetAmount = $t078888349._4 | |
266 | + | let managerPriceAssetMinAmount = 1 | |
267 | + | let priceAssetMinAmount = if (isManager(i)) | |
268 | + | then managerPriceAssetMinAmount | |
269 | + | else { | |
270 | + | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
271 | + | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
272 | + | } | |
273 | + | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
274 | + | let curIndex = (lastIndex + 1) | |
275 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
276 | + | let poolExists = { | |
277 | + | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
278 | + | if ($isInstanceOf(@, "Boolean")) | |
279 | + | then @ | |
280 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
281 | + | } | |
282 | + | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
283 | + | then true | |
284 | + | else throwPoolExists(), if (!(poolExists)) | |
285 | + | then true | |
286 | + | else throwPoolExists(), if (if (isManager(i)) | |
287 | + | then true | |
288 | + | else (getString(keyFeeAssetId()) == feeAssetId)) | |
289 | + | then true | |
290 | + | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
291 | + | then true | |
292 | + | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
293 | + | then true | |
294 | + | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
295 | + | then true | |
296 | + | else (priceAssetAmount >= priceAssetMinAmount)) | |
297 | + | then true | |
298 | + | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
299 | + | then true | |
300 | + | else (feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
301 | + | then true | |
302 | + | else throwInvalidFee()] | |
303 | + | if ((checks == checks)) | |
304 | + | then { | |
305 | + | let paymentsWithFeeSize = 3 | |
306 | + | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
307 | + | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
308 | + | else unit | |
309 | + | if ((burnEmissionInv == burnEmissionInv)) | |
310 | + | 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)] | |
311 | + | else throw("Strict value is not equal to itself.") | |
312 | + | } | |
310 | 313 | else throw("Strict value is not equal to itself.") | |
311 | 314 | } | |
312 | 315 | else throw("Strict value is not equal to itself.") | |
379 | 382 | ||
380 | 383 | ||
381 | 384 | @Callable(i) | |
382 | - | func setManager (pendingManagerPublicKey) = { | |
383 | - | let checkCaller = mustManager(i) | |
384 | - | if ((checkCaller == checkCaller)) | |
385 | - | then { | |
386 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
387 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
388 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
389 | - | else throw("Strict value is not equal to itself.") | |
390 | - | } | |
391 | - | else throw("Strict value is not equal to itself.") | |
392 | - | } | |
393 | - | ||
394 | - | ||
395 | - | ||
396 | - | @Callable(i) | |
397 | - | func confirmManager () = { | |
398 | - | let pm = pendingManagerPublicKeyOrUnit() | |
399 | - | let hasPM = if (isDefined(pm)) | |
400 | - | then true | |
401 | - | else throw("No pending manager") | |
402 | - | if ((hasPM == hasPM)) | |
403 | - | then { | |
404 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
405 | - | then true | |
406 | - | else throw("You are not pending manager") | |
407 | - | if ((checkPM == checkPM)) | |
408 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
409 | - | else throw("Strict value is not equal to itself.") | |
410 | - | } | |
411 | - | else throw("Strict value is not equal to itself.") | |
412 | - | } | |
413 | - | ||
414 | - | ||
415 | - | ||
416 | - | @Callable(i) | |
417 | 385 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
418 | 386 | ||
419 | 387 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFilename = "user_pools.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let wavesAssetId = "WAVES" | |
9 | 9 | ||
10 | 10 | let invalidPriceAsset = "Invalid price asset" | |
11 | 11 | ||
12 | 12 | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func throwErr (msg) = throw(wrapErr(msg)) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func throwPD () = throwErr("Permission denied") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func throwCreateNotCalled () = throwErr("Create is not called for assets pair") | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func throwYouNotIssuer () = throwErr("You are not amountAsset issuer") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func throwPoolExists () = throwErr("Pool with such assets already exists") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func throwAssetNotVerified () = throwErr("Asset is not verified") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func throwInvalidPriceAsset () = throwErr(invalidPriceAsset) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func throwInvalidFeeAsset () = throwErr("Invalid fee asset") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached") | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func throwInvalidStatus () = throwErr("Invalid status") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func throwInvalidFee () = throwErr("invalid fee") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func throwInvalidAssetPair () = throwErr("invalid asset pair") | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
61 | 61 | ||
62 | 62 | ||
63 | - | func | |
63 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyLastIndex () = makeString(["%s", "lastIndex"], SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | let indexSuffix = "u" | |
88 | 88 | ||
89 | 89 | let statusPending = "pending" | |
90 | 90 | ||
91 | 91 | let statusDeclined = "declined" | |
92 | 92 | ||
93 | 93 | let statusActive = "active" | |
94 | 94 | ||
95 | 95 | let statuses = [statusPending, statusDeclined, statusActive] | |
96 | 96 | ||
97 | 97 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
125 | 125 | ||
126 | 126 | ||
127 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
128 | + | case s: String => | |
129 | + | addressFromStringValue(s) | |
130 | + | case _ => | |
131 | + | this | |
132 | + | } | |
133 | + | ||
134 | + | ||
127 | 135 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
128 | 136 | ||
129 | 137 | ||
130 | 138 | func stringOptionToList (stringOrUnit) = match stringOrUnit { | |
131 | 139 | case s: String => | |
132 | 140 | if ((size(s) == 0)) | |
133 | 141 | then nil | |
134 | 142 | else split(s, SEP) | |
135 | 143 | case _: Unit => | |
136 | 144 | nil | |
137 | 145 | case _ => | |
138 | 146 | throw("Match error") | |
139 | 147 | } | |
140 | 148 | ||
141 | 149 | ||
142 | 150 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
143 | 151 | ||
144 | 152 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
145 | 153 | ||
146 | 154 | let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required"))) | |
147 | 155 | ||
148 | 156 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP) | |
149 | 157 | ||
150 | 158 | let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required"))) | |
151 | 159 | ||
152 | 160 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
153 | 161 | ||
154 | 162 | ||
155 | 163 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
156 | 164 | then true | |
157 | 165 | else throwCreateNotCalled() | |
158 | 166 | ||
159 | 167 | ||
160 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
161 | - | case s: String => | |
162 | - | fromBase58String(s) | |
163 | - | case _: Unit => | |
164 | - | unit | |
165 | - | case _ => | |
166 | - | throw("Match error") | |
167 | - | } | |
168 | - | ||
169 | - | ||
170 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
171 | - | case s: String => | |
172 | - | fromBase58String(s) | |
173 | - | case _: Unit => | |
174 | - | unit | |
175 | - | case _ => | |
176 | - | throw("Match error") | |
177 | - | } | |
168 | + | func managerPublicKeyOrUnit () = { | |
169 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
170 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
171 | + | case s: String => | |
172 | + | fromBase58String(s) | |
173 | + | case _: Unit => | |
174 | + | unit | |
175 | + | case _ => | |
176 | + | throw("Match error") | |
177 | + | } | |
178 | + | } | |
178 | 179 | ||
179 | 180 | ||
180 | 181 | func isManager (i) = match managerPublicKeyOrUnit() { | |
181 | 182 | case pk: ByteVector => | |
182 | 183 | (i.callerPublicKey == pk) | |
183 | 184 | case _: Unit => | |
184 | 185 | (i.caller == this) | |
185 | 186 | case _ => | |
186 | 187 | throw("Match error") | |
187 | 188 | } | |
188 | 189 | ||
189 | 190 | ||
190 | 191 | func mustManager (i) = if (isManager(i)) | |
191 | 192 | then true | |
192 | 193 | else throwPD() | |
193 | 194 | ||
194 | 195 | ||
195 | 196 | func mustAdmin (i) = { | |
196 | 197 | let adminPKs = stringOptionToList(getString(keyAdminPubKeys())) | |
197 | 198 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
198 | 199 | then true | |
199 | 200 | else mustManager(i) | |
200 | 201 | } | |
201 | 202 | ||
202 | 203 | ||
203 | 204 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
204 | 205 | ||
205 | 206 | ||
206 | 207 | func getIdAndInfo (payment) = match payment.assetId { | |
207 | 208 | case id: ByteVector => | |
208 | 209 | let info = value(assetInfo(id)) | |
209 | 210 | $Tuple2(toBase58String(id), info) | |
210 | 211 | case _: Unit => | |
211 | 212 | $Tuple2(wavesAssetId, unit) | |
212 | 213 | case _ => | |
213 | 214 | throw("Match error") | |
214 | 215 | } | |
215 | 216 | ||
216 | 217 | ||
217 | 218 | func validStatus (status) = containsElement(statuses, status) | |
218 | 219 | ||
219 | 220 | ||
220 | 221 | @Callable(i) | |
221 | 222 | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
222 | 223 | let checkCaller = mustManager(i) | |
223 | 224 | if ((checkCaller == checkCaller)) | |
224 | 225 | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
225 | 226 | else throw("Strict value is not equal to itself.") | |
226 | 227 | } | |
227 | 228 | ||
228 | 229 | ||
229 | 230 | ||
230 | 231 | @Callable(i) | |
231 | 232 | func create () = { | |
232 | - | let | |
233 | - | let | |
233 | + | let asset1Payment = value(i.payments[0]) | |
234 | + | let asset2Payment = value(i.payments[1]) | |
234 | 235 | let feeAssetPayment = value(i.payments[2]) | |
235 | - | let $t074737545 = getIdAndInfo(amountAssetPayment) | |
236 | - | let amountAssetId = $t074737545._1 | |
237 | - | let amountAssetInfo = $t074737545._2 | |
238 | - | let $t075487617 = getIdAndInfo(priceAssetPayment) | |
239 | - | let priceAssetId = $t075487617._1 | |
240 | - | let priceAssetInfo = $t075487617._2 | |
241 | - | let $t076207683 = getIdAndInfo(feeAssetPayment) | |
242 | - | let feeAssetId = $t076207683._1 | |
243 | - | let feeAssetInfo = $t076207683._2 | |
244 | - | let amountAssetAmount = amountAssetPayment.amount | |
245 | - | let priceAssetAmount = priceAssetPayment.amount | |
246 | - | let feeAssetAmount = feeAssetPayment.amount | |
236 | + | let $t075317588 = getIdAndInfo(asset1Payment) | |
237 | + | let asset1Id = $t075317588._1 | |
238 | + | let asset1Info = $t075317588._2 | |
239 | + | let $t075917648 = getIdAndInfo(asset2Payment) | |
240 | + | let asset2Id = $t075917648._1 | |
241 | + | let asset2Info = $t075917648._2 | |
242 | + | let $t076517714 = getIdAndInfo(feeAssetPayment) | |
243 | + | let feeAssetId = $t076517714._1 | |
244 | + | let feeAssetInfo = $t076517714._2 | |
247 | 245 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
248 | - | let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount()) | |
249 | - | let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount())) | |
250 | - | let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId)) | |
246 | + | let checkAssetsNotEqual = if ((asset1Id != asset2Id)) | |
247 | + | then true | |
248 | + | else throwInvalidAssetPair() | |
249 | + | if ((checkAssetsNotEqual == checkAssetsNotEqual)) | |
251 | 250 | then { | |
252 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset) | |
253 | - | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
254 | - | } | |
255 | - | else assetMinAmountDefault | |
256 | - | let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId)) | |
257 | - | then { | |
258 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
259 | - | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
260 | - | } | |
261 | - | else assetMinAmountDefault | |
262 | - | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
263 | - | let curIndex = (lastIndex + 1) | |
264 | - | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
265 | - | let poolExists = { | |
266 | - | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
267 | - | if ($isInstanceOf(@, "Boolean")) | |
268 | - | then @ | |
269 | - | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
270 | - | } | |
271 | - | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
272 | - | then true | |
273 | - | else throwPoolExists(), if (!(poolExists)) | |
274 | - | then true | |
275 | - | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
276 | - | then true | |
277 | - | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
278 | - | then isVerified(priceAssetId) | |
279 | - | else false) | |
280 | - | then true | |
281 | - | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
282 | - | then true | |
283 | - | else containsElement(priceAssetsList, priceAssetId)) | |
284 | - | then true | |
285 | - | else throwInvalidAssetPair(), if (if (isManager(i)) | |
286 | - | then true | |
287 | - | else (getString(keyFeeAssetId()) == feeAssetId)) | |
288 | - | then true | |
289 | - | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
290 | - | then true | |
291 | - | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
292 | - | then true | |
293 | - | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
294 | - | then true | |
295 | - | else (priceAssetAmount >= priceAssetMinAmount)) | |
296 | - | then true | |
297 | - | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
298 | - | then true | |
299 | - | else (feeAssetAmount == getInteger(keyFeeAmount()))) | |
300 | - | then true | |
301 | - | else throwInvalidFee()] | |
302 | - | if ((checks == checks)) | |
303 | - | then { | |
304 | - | let paymentsWithFeeSize = 3 | |
305 | - | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
306 | - | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
307 | - | else unit | |
308 | - | if ((burnEmissionInv == burnEmissionInv)) | |
309 | - | 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)] | |
251 | + | let $t078888349 = if (if (isManager(i)) | |
252 | + | then true | |
253 | + | else if (containsElement(priceAssetsList, asset2Id)) | |
254 | + | then isVerified(asset1Id) | |
255 | + | else false) | |
256 | + | then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount) | |
257 | + | else if (if (containsElement(priceAssetsList, asset1Id)) | |
258 | + | then isVerified(asset2Id) | |
259 | + | else false) | |
260 | + | then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount) | |
261 | + | else throwInvalidAssetPair() | |
262 | + | let amountAssetId = $t078888349._1 | |
263 | + | let amountAssetAmount = $t078888349._2 | |
264 | + | let priceAssetId = $t078888349._3 | |
265 | + | let priceAssetAmount = $t078888349._4 | |
266 | + | let managerPriceAssetMinAmount = 1 | |
267 | + | let priceAssetMinAmount = if (isManager(i)) | |
268 | + | then managerPriceAssetMinAmount | |
269 | + | else { | |
270 | + | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
271 | + | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
272 | + | } | |
273 | + | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
274 | + | let curIndex = (lastIndex + 1) | |
275 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
276 | + | let poolExists = { | |
277 | + | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
278 | + | if ($isInstanceOf(@, "Boolean")) | |
279 | + | then @ | |
280 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
281 | + | } | |
282 | + | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
283 | + | then true | |
284 | + | else throwPoolExists(), if (!(poolExists)) | |
285 | + | then true | |
286 | + | else throwPoolExists(), if (if (isManager(i)) | |
287 | + | then true | |
288 | + | else (getString(keyFeeAssetId()) == feeAssetId)) | |
289 | + | then true | |
290 | + | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
291 | + | then true | |
292 | + | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
293 | + | then true | |
294 | + | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
295 | + | then true | |
296 | + | else (priceAssetAmount >= priceAssetMinAmount)) | |
297 | + | then true | |
298 | + | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
299 | + | then true | |
300 | + | else (feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
301 | + | then true | |
302 | + | else throwInvalidFee()] | |
303 | + | if ((checks == checks)) | |
304 | + | then { | |
305 | + | let paymentsWithFeeSize = 3 | |
306 | + | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
307 | + | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
308 | + | else unit | |
309 | + | if ((burnEmissionInv == burnEmissionInv)) | |
310 | + | 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)] | |
311 | + | else throw("Strict value is not equal to itself.") | |
312 | + | } | |
310 | 313 | else throw("Strict value is not equal to itself.") | |
311 | 314 | } | |
312 | 315 | else throw("Strict value is not equal to itself.") | |
313 | 316 | } | |
314 | 317 | ||
315 | 318 | ||
316 | 319 | ||
317 | 320 | @Callable(i) | |
318 | 321 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
319 | 322 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
320 | 323 | then true | |
321 | 324 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
322 | 325 | then true | |
323 | 326 | else throwCanActivateOnlyPendingPool()] | |
324 | 327 | if ((checks == checks)) | |
325 | 328 | then { | |
326 | 329 | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
327 | 330 | if ((activateNewPoolInv == activateNewPoolInv)) | |
328 | 331 | then { | |
329 | 332 | let lpAssetId = match activateNewPoolInv { | |
330 | 333 | case id: String => | |
331 | 334 | id | |
332 | 335 | case _ => | |
333 | 336 | throwFactoryReturnedNotString() | |
334 | 337 | } | |
335 | 338 | if ((lpAssetId == lpAssetId)) | |
336 | 339 | then { | |
337 | 340 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
338 | 341 | if ((beforePut == beforePut)) | |
339 | 342 | then { | |
340 | 343 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES")) | |
341 | 344 | then unit | |
342 | 345 | else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES")) | |
343 | 346 | then unit | |
344 | 347 | else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
345 | 348 | if ((put == put)) | |
346 | 349 | then { | |
347 | 350 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
348 | 351 | if ((afterPut == afterPut)) | |
349 | 352 | then { | |
350 | 353 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
351 | 354 | let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil) | |
352 | 355 | if ((res == res)) | |
353 | 356 | then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
354 | 357 | else throw("Strict value is not equal to itself.") | |
355 | 358 | } | |
356 | 359 | else throw("Strict value is not equal to itself.") | |
357 | 360 | } | |
358 | 361 | else throw("Strict value is not equal to itself.") | |
359 | 362 | } | |
360 | 363 | else throw("Strict value is not equal to itself.") | |
361 | 364 | } | |
362 | 365 | else throw("Strict value is not equal to itself.") | |
363 | 366 | } | |
364 | 367 | else throw("Strict value is not equal to itself.") | |
365 | 368 | } | |
366 | 369 | else throw("Strict value is not equal to itself.") | |
367 | 370 | } | |
368 | 371 | ||
369 | 372 | ||
370 | 373 | ||
371 | 374 | @Callable(i) | |
372 | 375 | func setAdmins (adminPubKeys) = { | |
373 | 376 | let checkCaller = mustManager(i) | |
374 | 377 | if ((checkCaller == checkCaller)) | |
375 | 378 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
376 | 379 | else throw("Strict value is not equal to itself.") | |
377 | 380 | } | |
378 | 381 | ||
379 | 382 | ||
380 | 383 | ||
381 | 384 | @Callable(i) | |
382 | - | func setManager (pendingManagerPublicKey) = { | |
383 | - | let checkCaller = mustManager(i) | |
384 | - | if ((checkCaller == checkCaller)) | |
385 | - | then { | |
386 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
387 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
388 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
389 | - | else throw("Strict value is not equal to itself.") | |
390 | - | } | |
391 | - | else throw("Strict value is not equal to itself.") | |
392 | - | } | |
393 | - | ||
394 | - | ||
395 | - | ||
396 | - | @Callable(i) | |
397 | - | func confirmManager () = { | |
398 | - | let pm = pendingManagerPublicKeyOrUnit() | |
399 | - | let hasPM = if (isDefined(pm)) | |
400 | - | then true | |
401 | - | else throw("No pending manager") | |
402 | - | if ((hasPM == hasPM)) | |
403 | - | then { | |
404 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
405 | - | then true | |
406 | - | else throw("You are not pending manager") | |
407 | - | if ((checkPM == checkPM)) | |
408 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
409 | - | else throw("Strict value is not equal to itself.") | |
410 | - | } | |
411 | - | else throw("Strict value is not equal to itself.") | |
412 | - | } | |
413 | - | ||
414 | - | ||
415 | - | ||
416 | - | @Callable(i) | |
417 | 385 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
418 | 386 | ||
419 | 387 | ||
420 | 388 | ||
421 | 389 | @Callable(i) | |
422 | 390 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
423 | 391 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
424 | 392 | case s: String => | |
425 | 393 | s | |
426 | 394 | case _ => | |
427 | 395 | unit | |
428 | 396 | } | |
429 | 397 | $Tuple2(nil, status) | |
430 | 398 | } | |
431 | 399 | ||
432 | 400 | ||
433 | 401 | @Verifier(tx) | |
434 | 402 | func verify () = { | |
435 | 403 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
436 | 404 | case pk: ByteVector => | |
437 | 405 | pk | |
438 | 406 | case _: Unit => | |
439 | 407 | tx.senderPublicKey | |
440 | 408 | case _ => | |
441 | 409 | throw("Match error") | |
442 | 410 | } | |
443 | 411 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
444 | 412 | } | |
445 | 413 |
github/deemru/w8io/026f985 48.87 ms ◑